Bug 128934

Summary: Make TreeScope::rootNode return a reference
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch kling: review+

Description Antti Koivisto 2014-02-17 14:41:48 PST
It is never null
Comment 1 Antti Koivisto 2014-02-17 14:56:21 PST
Created attachment 224428 [details]
patch
Comment 2 Andreas Kling 2014-02-17 15:02:49 PST
Comment on attachment 224428 [details]
patch

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

r=me assuming it builds.

> Source/WebCore/dom/Document.cpp:716
> +    ContainerNode& rootNode = scope->rootNode();
> +    for (auto& element : descendantsOfType<Element>(rootNode)) {

I don't think you need the 'rootNode' local.

> Source/WebCore/dom/ShadowRoot.h:98
> +inline bool isShadowRoot(const Node& node) { return node.isElementNode() && toElement(node).isShadowRoot(); }

Why do you need the isElementNode() check? Node has isShadowRoot().

> Source/WebCore/dom/ShadowRoot.h:100
> +NODE_TYPE_CASTS(ShadowRoot);

You don't need the semicolon here.
Comment 3 Antti Koivisto 2014-02-17 15:24:36 PST
https://trac.webkit.org/r164251