Bug 137172 - Remove remaining uses of NODE_TYPE_CASTS() from html/
Summary: Remove remaining uses of NODE_TYPE_CASTS() from html/
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on: 137056
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-26 22:17 PDT by Chris Dumez
Modified: 2014-09-29 10:16 PDT (History)
4 users (show)

See Also:


Attachments
Patch (18.35 KB, patch)
2014-09-26 22:26 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (19.14 KB, patch)
2014-09-26 22:29 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (19.21 KB, patch)
2014-09-26 22:50 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (19.16 KB, patch)
2014-09-29 09:33 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2014-09-26 22:17:47 PDT
Remove remaining uses of NODE_TYPE_CASTS() from html/ and use the new SPECIALIZE_TYPE_TRAITS_*() macro instead so that is<>() / downcast<>() works for those types.
Comment 1 Chris Dumez 2014-09-26 22:26:00 PDT
Created attachment 238759 [details]
Patch
Comment 2 WebKit Commit Bot 2014-09-26 22:28:33 PDT
Attachment 238759 [details] did not pass style-queue:


ERROR: Source/WebCore/html/LabelableElement.h:55:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/html/shadow/TextControlInnerElements.h:75:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 2 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Chris Dumez 2014-09-26 22:29:16 PDT
Created attachment 238760 [details]
Patch
Comment 4 WebKit Commit Bot 2014-09-26 22:31:22 PDT
Attachment 238760 [details] did not pass style-queue:


ERROR: Source/WebCore/html/LabelableElement.h:55:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/html/shadow/TextControlInnerElements.h:75:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 2 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Chris Dumez 2014-09-26 22:50:16 PDT
Created attachment 238761 [details]
Patch
Comment 6 WebKit Commit Bot 2014-09-26 22:52:38 PDT
Attachment 238761 [details] did not pass style-queue:


ERROR: Source/WebCore/html/LabelableElement.h:55:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/html/shadow/TextControlInnerElements.h:75:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 2 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Darin Adler 2014-09-28 17:13:16 PDT
Comment on attachment 238761 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=238761&action=review

> Source/WebCore/css/SelectorCheckerTestFunctions.h:137
> +    if (is<WebVTTElement>(element))

Should be *element unless we want to add a null check.

> Source/WebCore/css/SelectorCheckerTestFunctions.h:314
> +    return is<WebVTTElement>(element) && !downcast<WebVTTElement>(*element).isPastNode();

Should be *element unless we want to add a null check.

> Source/WebCore/css/SelectorCheckerTestFunctions.h:319
> +    return is<WebVTTElement>(element) && downcast<WebVTTElement>(*element).isPastNode();

Should be *element unless we want to add a null check.

> Source/WebCore/css/StyleResolver.cpp:653
> +    if (is<WebVTTElement>(state.element()))

Should be *state.element() unless we want to add a null check.

> Source/WebCore/dom/NodeRenderingTraversal.cpp:138
> +    if (is<InsertionPoint>(parent)) {

Should be *parent unless we want to add a null check.

> Source/WebCore/html/HTMLTextAreaElement.cpp:330
>      Node* node = userAgentShadowRoot()->firstChild();
> -    return toTextControlInnerTextElement(node);
> +    return downcast<TextControlInnerTextElement>(node);

I think this would read better without the local variable.

> Source/WebCore/html/shadow/InsertionPoint.h:84
> +    return node && is<InsertionPoint>(node) && downcast<InsertionPoint>(*node).isActive();

Should either remove the "node &&" part of use *node inside the call to is.

> Source/WebCore/html/shadow/InsertionPoint.h:92
> +        if (is<InsertionPoint>(parent) && downcast<InsertionPoint>(*parent).shouldUseFallbackElements())

Should pass *parent to is.

> Source/WebCore/html/track/VTTCue.cpp:500
> +        if (is<WebVTTElement>(node))

Should pass *node.

> Source/WebCore/html/track/VTTCue.cpp:769
> +        if (is<WebVTTElement>(child)) {

Should pass *child.
Comment 8 Chris Dumez 2014-09-29 09:33:47 PDT
Created attachment 238861 [details]
Patch
Comment 9 WebKit Commit Bot 2014-09-29 09:35:41 PDT
Attachment 238861 [details] did not pass style-queue:


ERROR: Source/WebCore/html/LabelableElement.h:55:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/html/shadow/TextControlInnerElements.h:75:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 2 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 WebKit Commit Bot 2014-09-29 10:16:35 PDT
Comment on attachment 238861 [details]
Patch

Clearing flags on attachment: 238861

Committed r174067: <http://trac.webkit.org/changeset/174067>
Comment 11 WebKit Commit Bot 2014-09-29 10:16:40 PDT
All reviewed patches have been landed.  Closing bug.