Bug 117104

Summary: Move Node::hasID() and hasClass() to Element.
Product: WebKit Reporter: Andreas Kling <kling>
Component: DOMAssignee: Andreas Kling <kling>
Severity: Normal CC: cmarcelo, commit-queue, esprehn+autocc, glenn, kling, simon.fraser, WebkitBugTracker
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
Patch rniwa: review+

Description Andreas Kling 2013-06-01 00:35:53 PDT
Move Node::hasID() and hasClass() to Element.
Comment 1 Andreas Kling 2013-06-01 00:43:29 PDT
Created attachment 203481 [details]
Comment 2 Ryosuke Niwa 2013-06-01 02:12:13 PDT
Comment on attachment 203481 [details]

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

> Source/WebCore/dom/LiveNodeList.cpp:114
> +        if (!node->isElementNode())
> +            continue;

Only ChildNodeList contains non-element item so maybe we want to check that condition outside the loop instead.
We don't need to do this in this patch though.

> Source/WebCore/rendering/RenderLayer.cpp:283
> +    if (Element* element = renderer()->node() && renderer()->node()->isElementNode() ? toElement(renderer()->node()) : 0) {

Looks like we almost want renderer()->element().
Comment 3 Andreas Kling 2013-06-01 02:40:07 PDT
Committed r151069: <http://trac.webkit.org/changeset/151069>