Bug 128934 - Make TreeScope::rootNode return a reference
Summary: Make TreeScope::rootNode return a reference
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-17 14:41 PST by Antti Koivisto
Modified: 2014-02-17 15:24 PST (History)
0 users

See Also:


Attachments
patch (17.96 KB, patch)
2014-02-17 14:56 PST, Antti Koivisto
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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