[webkit-reviews] review granted: [Bug 137172] Remove remaining uses of NODE_TYPE_CASTS() from html/ : [Attachment 238761] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Sep 28 17:13:16 PDT 2014


Darin Adler <darin at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 137172: Remove remaining uses of NODE_TYPE_CASTS() from html/
https://bugs.webkit.org/show_bug.cgi?id=137172

Attachment 238761: Patch
https://bugs.webkit.org/attachment.cgi?id=238761&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
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.


More information about the webkit-reviews mailing list