<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[164251] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/164251">164251</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2014-02-17 15:29:31 -0800 (Mon, 17 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Make TreeScope::rootNode return a reference
https://bugs.webkit.org/show_bug.cgi?id=128934
Reviewed by Andreas Kling.
It is never null.
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRules):
* dom/ContainerNode.h:
(WebCore::Node::isTreeScope):
* dom/Document.cpp:
(WebCore::Document::buildAccessKeyMap):
* dom/DocumentOrderedMap.cpp:
(WebCore::DocumentOrderedMap::add):
(WebCore::DocumentOrderedMap::get):
(WebCore::DocumentOrderedMap::getAllElementsById):
* dom/EventDispatcher.cpp:
(WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
(WebCore::eventTargetRespectingTargetRules):
(WebCore::shouldEventCrossShadowBoundary):
* dom/Node.cpp:
(WebCore::Node::containingShadowRoot):
(WebCore::Node::removedFrom):
* dom/ShadowRoot.h:
(WebCore::isShadowRoot):
* dom/TreeScope.h:
(WebCore::TreeScope::rootNode):
* page/DOMSelection.cpp:
(WebCore::DOMSelection::DOMSelection):
* page/DragController.cpp:
(WebCore::asFileInput):
* page/FocusController.cpp:
(WebCore::FocusNavigationScope::rootNode):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssElementRuleCollectorcpp">trunk/Source/WebCore/css/ElementRuleCollector.cpp</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodeh">trunk/Source/WebCore/dom/ContainerNode.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentOrderedMapcpp">trunk/Source/WebCore/dom/DocumentOrderedMap.cpp</a></li>
<li><a href="#trunkSourceWebCoredomEventDispatchercpp">trunk/Source/WebCore/dom/EventDispatcher.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCoredomShadowRooth">trunk/Source/WebCore/dom/ShadowRoot.h</a></li>
<li><a href="#trunkSourceWebCoredomTreeScopecpp">trunk/Source/WebCore/dom/TreeScope.cpp</a></li>
<li><a href="#trunkSourceWebCoredomTreeScopeh">trunk/Source/WebCore/dom/TreeScope.h</a></li>
<li><a href="#trunkSourceWebCoreeditingVisibleSelectioncpp">trunk/Source/WebCore/editing/VisibleSelection.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMSelectioncpp">trunk/Source/WebCore/page/DOMSelection.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDragControllercpp">trunk/Source/WebCore/page/DragController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFocusControllercpp">trunk/Source/WebCore/page/FocusController.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGElementcpp">trunk/Source/WebCore/svg/SVGElement.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/ChangeLog        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2014-02-17 Antti Koivisto <antti@apple.com>
+
+ Make TreeScope::rootNode return a reference
+ https://bugs.webkit.org/show_bug.cgi?id=128934
+
+ Reviewed by Andreas Kling.
+
+ It is never null.
+
+ * css/ElementRuleCollector.cpp:
+ (WebCore::ElementRuleCollector::collectMatchingRules):
+ * dom/ContainerNode.h:
+ (WebCore::Node::isTreeScope):
+ * dom/Document.cpp:
+ (WebCore::Document::buildAccessKeyMap):
+ * dom/DocumentOrderedMap.cpp:
+ (WebCore::DocumentOrderedMap::add):
+ (WebCore::DocumentOrderedMap::get):
+ (WebCore::DocumentOrderedMap::getAllElementsById):
+ * dom/EventDispatcher.cpp:
+ (WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
+ (WebCore::eventTargetRespectingTargetRules):
+ (WebCore::shouldEventCrossShadowBoundary):
+ * dom/Node.cpp:
+ (WebCore::Node::containingShadowRoot):
+ (WebCore::Node::removedFrom):
+ * dom/ShadowRoot.h:
+ (WebCore::isShadowRoot):
+ * dom/TreeScope.h:
+ (WebCore::TreeScope::rootNode):
+ * page/DOMSelection.cpp:
+ (WebCore::DOMSelection::DOMSelection):
+ * page/DragController.cpp:
+ (WebCore::asFileInput):
+ * page/FocusController.cpp:
+ (WebCore::FocusNavigationScope::rootNode):
+
</ins><span class="cx"> 2014-02-17 Chris Fleizach <cfleizach@apple.com>
</span><span class="cx">
</span><span class="cx"> AX: Invalid cast in WebCore::AccessibilityTable::isDataTable (CRBug 280352)
</span></span></pre></div>
<a id="trunkSourceWebCorecssElementRuleCollectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/ElementRuleCollector.cpp (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/ElementRuleCollector.cpp        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/css/ElementRuleCollector.cpp        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx"> collectMatchingRulesForList(matchRequest.ruleSet->cuePseudoRules(), matchRequest, ruleRange);
</span><span class="cx"> #endif
</span><span class="cx"> // Only match UA rules in shadow tree.
</span><del>- if (!MatchingUARulesScope::isMatchingUARules() && m_element.treeScope().rootNode()->isShadowRoot())
</del><ins>+ if (!MatchingUARulesScope::isMatchingUARules() && m_element.treeScope().rootNode().isShadowRoot())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // We need to collect the rules for id, class, tag, and everything else into a buffer and
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.h (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.h        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/dom/ContainerNode.h        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -236,7 +236,7 @@
</span><span class="cx">
</span><span class="cx"> inline bool Node::isTreeScope() const
</span><span class="cx"> {
</span><del>- return treeScope().rootNode() == this;
</del><ins>+ return &treeScope().rootNode() == this;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // This constant controls how much buffer is initially allocated
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/dom/Document.cpp        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -712,8 +712,7 @@
</span><span class="cx"> void Document::buildAccessKeyMap(TreeScope* scope)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(scope);
</span><del>- ContainerNode* rootNode = scope->rootNode();
- for (auto& element : descendantsOfType<Element>(*rootNode)) {
</del><ins>+ for (auto& element : descendantsOfType<Element>(scope->rootNode())) {
</ins><span class="cx"> const AtomicString& accessKey = element.fastGetAttribute(accesskeyAttr);
</span><span class="cx"> if (!accessKey.isEmpty())
</span><span class="cx"> m_elementsByAccessKey.set(accessKey.impl(), &element);
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentOrderedMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentOrderedMap.cpp (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentOrderedMap.cpp        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/dom/DocumentOrderedMap.cpp        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx"> {
</span><span class="cx"> UNUSED_PARAM(treeScope);
</span><span class="cx"> ASSERT_WITH_SECURITY_IMPLICATION(element.isInTreeScope());
</span><del>- ASSERT_WITH_SECURITY_IMPLICATION(treeScope.rootNode()->containsIncludingShadowDOM(&element));
</del><ins>+ ASSERT_WITH_SECURITY_IMPLICATION(treeScope.rootNode().containsIncludingShadowDOM(&element));
</ins><span class="cx"> if (!element.isInTreeScope())
</span><span class="cx"> return;
</span><span class="cx"> Map::AddResult addResult = m_map.add(&key, MapEntry(&element));
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // We know there's at least one node that matches; iterate to find the first one.
</span><del>- for (auto& element : descendantsOfType<Element>(*scope.rootNode())) {
</del><ins>+ for (auto& element : descendantsOfType<Element>(scope.rootNode())) {
</ins><span class="cx"> if (!keyMatches(key, element))
</span><span class="cx"> continue;
</span><span class="cx"> entry.element = &element;
</span><span class="lines">@@ -211,7 +211,7 @@
</span><span class="cx">
</span><span class="cx"> if (entry.orderedList.isEmpty()) {
</span><span class="cx"> entry.orderedList.reserveCapacity(entry.count);
</span><del>- auto elementDescandents = descendantsOfType<Element>(*scope.rootNode());
</del><ins>+ auto elementDescandents = descendantsOfType<Element>(scope.rootNode());
</ins><span class="cx"> auto it = entry.element ? elementDescandents.beginAt(*entry.element) : elementDescandents.begin();
</span><span class="cx"> auto end = elementDescandents.end();
</span><span class="cx"> for (; it != end; ++it) {
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventDispatchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventDispatcher.cpp (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventDispatcher.cpp        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/dom/EventDispatcher.cpp        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -143,8 +143,8 @@
</span><span class="cx"> return m_relatedNodeInCurrentTreeScope;
</span><span class="cx">
</span><span class="cx"> if (m_currentTreeScope) {
</span><del>- ASSERT(m_currentTreeScope->rootNode()->isShadowRoot());
- ASSERT(&newTarget == toShadowRoot(m_currentTreeScope->rootNode())->hostElement());
</del><ins>+ ASSERT(m_currentTreeScope->rootNode().isShadowRoot());
+ ASSERT(&newTarget == toShadowRoot(m_currentTreeScope->rootNode()).hostElement());
</ins><span class="cx"> ASSERT(m_currentTreeScope->parentTreeScope() == &newTreeScope);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -184,8 +184,8 @@
</span><span class="cx">
</span><span class="cx"> // Spec: The event handling for the non-exposed tree works as if the referenced element had been textually included
</span><span class="cx"> // as a deeply cloned child of the 'use' element, except that events are dispatched to the SVGElementInstance objects
</span><del>- Node* rootNode = referenceNode.treeScope().rootNode();
- Element* shadowHostElement = rootNode->isShadowRoot() ? toShadowRoot(rootNode)->hostElement() : 0;
</del><ins>+ auto& rootNode = referenceNode.treeScope().rootNode();
+ Element* shadowHostElement = rootNode.isShadowRoot() ? toShadowRoot(rootNode).hostElement() : nullptr;
</ins><span class="cx"> // At this time, SVG nodes are not supported in non-<use> shadow trees.
</span><span class="cx"> if (!shadowHostElement || !shadowHostElement->hasTagName(SVGNames::useTag))
</span><span class="cx"> return referenceNode;
</span><span class="lines">@@ -366,7 +366,7 @@
</span><span class="cx"> // Changing this breaks existing sites.
</span><span class="cx"> // See https://bugs.webkit.org/show_bug.cgi?id=52195 for details.
</span><span class="cx"> const AtomicString& eventType = event.type();
</span><del>- bool targetIsInShadowRoot = targetNode && targetNode->treeScope().rootNode() == &shadowRoot;
</del><ins>+ bool targetIsInShadowRoot = targetNode && &targetNode->treeScope().rootNode() == &shadowRoot;
</ins><span class="cx"> return !targetIsInShadowRoot
</span><span class="cx"> || !(eventType == eventNames().abortEvent
</span><span class="cx"> || eventType == eventNames().changeEvent
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/dom/Node.cpp        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -951,8 +951,8 @@
</span><span class="cx">
</span><span class="cx"> ShadowRoot* Node::containingShadowRoot() const
</span><span class="cx"> {
</span><del>- ContainerNode* root = treeScope().rootNode();
- return root && root->isShadowRoot() ? toShadowRoot(root) : 0;
</del><ins>+ ContainerNode& root = treeScope().rootNode();
+ return root.isShadowRoot() ? toShadowRoot(&root) : nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Node* Node::nonBoundaryShadowTreeRootNode()
</span><span class="lines">@@ -1011,7 +1011,7 @@
</span><span class="cx"> ASSERT(insertionPoint.inDocument() || isContainerNode());
</span><span class="cx"> if (insertionPoint.inDocument())
</span><span class="cx"> clearFlag(InDocumentFlag);
</span><del>- if (isInShadowTree() && !treeScope().rootNode()->isShadowRoot())
</del><ins>+ if (isInShadowTree() && !treeScope().rootNode().isShadowRoot())
</ins><span class="cx"> clearFlag(IsInShadowTreeFlag);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomShadowRooth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ShadowRoot.h (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ShadowRoot.h        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/dom/ShadowRoot.h        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -95,16 +95,9 @@
</span><span class="cx"> return treeScope().focusedElement();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline const ShadowRoot* toShadowRoot(const Node* node)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isShadowRoot());
- return static_cast<const ShadowRoot*>(node);
-}
</del><ins>+inline bool isShadowRoot(const Node& node) { return node.isShadowRoot(); }
</ins><span class="cx">
</span><del>-inline ShadowRoot* toShadowRoot(Node* node)
-{
- return const_cast<ShadowRoot*>(toShadowRoot(static_cast<const Node*>(node)));
-}
</del><ins>+NODE_TYPE_CASTS(ShadowRoot)
</ins><span class="cx">
</span><span class="cx"> inline ShadowRoot* Node::shadowRoot() const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoredomTreeScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/TreeScope.cpp (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/TreeScope.cpp        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/dom/TreeScope.cpp        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> void TreeScope::setParentTreeScope(TreeScope* newParentScope)
</span><span class="cx"> {
</span><span class="cx"> // A document node cannot be re-parented.
</span><del>- ASSERT(!rootNode()->isDocumentNode());
</del><ins>+ ASSERT(!m_rootNode.isDocumentNode());
</ins><span class="cx"> // Every scope other than document needs a parent scope.
</span><span class="cx"> ASSERT(newParentScope);
</span><span class="cx">
</span><span class="lines">@@ -198,7 +198,7 @@
</span><span class="cx"> String name = (hashPos == notFound ? url : url.substring(hashPos + 1)).impl();
</span><span class="cx"> if (name.isEmpty())
</span><span class="cx"> return nullptr;
</span><del>- if (rootNode()->document().isHTMLDocument()) {
</del><ins>+ if (m_rootNode.document().isHTMLDocument()) {
</ins><span class="cx"> AtomicString lowercasedName = name.lower();
</span><span class="cx"> return m_imageMapsByName->getElementByLowercasedMapName(*lowercasedName.impl(), *this);
</span><span class="cx"> }
</span><span class="lines">@@ -239,7 +239,7 @@
</span><span class="cx">
</span><span class="cx"> Element* TreeScope::elementFromPoint(int x, int y) const
</span><span class="cx"> {
</span><del>- Node* node = nodeFromPoint(&rootNode()->document(), x, y);
</del><ins>+ Node* node = nodeFromPoint(&m_rootNode.document(), x, y);
</ins><span class="cx"> while (node && !node->isElementNode())
</span><span class="cx"> node = node->parentNode();
</span><span class="cx"> if (node)
</span><span class="lines">@@ -268,7 +268,7 @@
</span><span class="cx"> // Populate the map on first access.
</span><span class="cx"> m_labelsByForAttribute = std::make_unique<DocumentOrderedMap>();
</span><span class="cx">
</span><del>- for (auto& label : descendantsOfType<HTMLLabelElement>(*rootNode())) {
</del><ins>+ for (auto& label : descendantsOfType<HTMLLabelElement>(m_rootNode)) {
</ins><span class="cx"> const AtomicString& forValue = label.fastGetAttribute(forAttr);
</span><span class="cx"> if (!forValue.isEmpty())
</span><span class="cx"> addLabel(*forValue.impl(), label);
</span><span class="lines">@@ -280,16 +280,16 @@
</span><span class="cx">
</span><span class="cx"> DOMSelection* TreeScope::getSelection() const
</span><span class="cx"> {
</span><del>- if (!rootNode()->document().frame())
</del><ins>+ if (!m_rootNode.document().frame())
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> if (m_selection)
</span><span class="cx"> return m_selection.get();
</span><span class="cx">
</span><del>- if (this != &rootNode()->document())
- return rootNode()->document().getSelection();
</del><ins>+ if (this != &m_rootNode.document())
+ return m_rootNode.document().getSelection();
</ins><span class="cx">
</span><del>- m_selection = DOMSelection::create(&rootNode()->document());
</del><ins>+ m_selection = DOMSelection::create(&m_rootNode.document());
</ins><span class="cx"> return m_selection.get();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -299,8 +299,8 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> if (Element* element = getElementById(name))
</span><span class="cx"> return element;
</span><del>- for (auto& anchor : descendantsOfType<HTMLAnchorElement>(*rootNode())) {
- if (rootNode()->document().inQuirksMode()) {
</del><ins>+ for (auto& anchor : descendantsOfType<HTMLAnchorElement>(m_rootNode)) {
+ if (m_rootNode.document().inQuirksMode()) {
</ins><span class="cx"> // Quirks mode, case insensitive comparison of names.
</span><span class="cx"> if (equalIgnoringCase(anchor.name(), name))
</span><span class="cx"> return &anchor;
</span><span class="lines">@@ -335,7 +335,7 @@
</span><span class="cx">
</span><span class="cx"> Element* TreeScope::focusedElement()
</span><span class="cx"> {
</span><del>- Document& document = rootNode()->document();
</del><ins>+ Document& document = m_rootNode.document();
</ins><span class="cx"> Element* element = document.focusedElement();
</span><span class="cx">
</span><span class="cx"> if (!element && document.page())
</span><span class="lines">@@ -344,7 +344,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> TreeScope* treeScope = &element->treeScope();
</span><span class="cx"> while (treeScope != this && treeScope != &document) {
</span><del>- element = toShadowRoot(treeScope->rootNode())->hostElement();
</del><ins>+ element = toShadowRoot(treeScope->rootNode()).hostElement();
</ins><span class="cx"> treeScope = &element->treeScope();
</span><span class="cx"> }
</span><span class="cx"> if (this != treeScope)
</span></span></pre></div>
<a id="trunkSourceWebCoredomTreeScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/TreeScope.h (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/TreeScope.h        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/dom/TreeScope.h        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx"> // Used by the basic DOM mutation methods (e.g., appendChild()).
</span><span class="cx"> void adoptIfNeeded(Node*);
</span><span class="cx">
</span><del>- ContainerNode* rootNode() const { return &m_rootNode; }
</del><ins>+ ContainerNode& rootNode() const { return m_rootNode; }
</ins><span class="cx">
</span><span class="cx"> IdTargetObserverRegistry& idTargetObserverRegistry() const { return *m_idTargetObserverRegistry.get(); }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingVisibleSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisibleSelection.cpp (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisibleSelection.cpp        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/editing/VisibleSelection.cpp        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -485,7 +485,7 @@
</span><span class="cx"> return positionBeforeNode(ancestor);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (Node* lastChild = treeScope.rootNode()->lastChild())
</del><ins>+ if (Node* lastChild = treeScope.rootNode().lastChild())
</ins><span class="cx"> return positionAfterNode(lastChild);
</span><span class="cx">
</span><span class="cx"> return Position();
</span><span class="lines">@@ -503,7 +503,7 @@
</span><span class="cx"> return positionAfterNode(ancestor);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (Node* firstChild = treeScope.rootNode()->firstChild())
</del><ins>+ if (Node* firstChild = treeScope.rootNode().firstChild())
</ins><span class="cx"> return positionBeforeNode(firstChild);
</span><span class="cx">
</span><span class="cx"> return Position();
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMSelection.cpp (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMSelection.cpp        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/page/DOMSelection.cpp        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> DOMSelection::DOMSelection(const TreeScope* treeScope)
</span><del>- : DOMWindowProperty(treeScope->rootNode()->document().frame())
</del><ins>+ : DOMWindowProperty(treeScope->rootNode().document().frame())
</ins><span class="cx"> , m_treeScope(treeScope)
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.cpp (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.cpp        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/page/DragController.cpp        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -272,8 +272,8 @@
</span><span class="cx"> HTMLInputElement* inputElement = node->toInputElement();
</span><span class="cx">
</span><span class="cx"> // If this is a button inside of the a file input, move up to the file input.
</span><del>- if (inputElement && inputElement->isTextButton() && inputElement->treeScope().rootNode()->isShadowRoot())
- inputElement = toShadowRoot(inputElement->treeScope().rootNode())->hostElement()->toInputElement();
</del><ins>+ if (inputElement && inputElement->isTextButton() && inputElement->treeScope().rootNode().isShadowRoot())
+ inputElement = toShadowRoot(inputElement->treeScope().rootNode()).hostElement()->toInputElement();
</ins><span class="cx">
</span><span class="cx"> return inputElement && inputElement->isFileUpload() ? inputElement : 0;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepageFocusControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FocusController.cpp (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FocusController.cpp        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/page/FocusController.cpp        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">
</span><span class="cx"> ContainerNode* FocusNavigationScope::rootNode() const
</span><span class="cx"> {
</span><del>- return m_rootTreeScope->rootNode();
</del><ins>+ return &m_rootTreeScope->rootNode();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Element* FocusNavigationScope::owner() const
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGElement.cpp (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGElement.cpp        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/svg/SVGElement.cpp        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -947,7 +947,7 @@
</span><span class="cx">
</span><span class="cx"> // Walk up the tree, to find out whether we're inside a <use> shadow tree, to find the right title.
</span><span class="cx"> if (isInShadowTree()) {
</span><del>- Element* shadowHostElement = toShadowRoot(treeScope().rootNode())->hostElement();
</del><ins>+ Element* shadowHostElement = toShadowRoot(treeScope().rootNode()).hostElement();
</ins><span class="cx"> // At this time, SVG nodes are not allowed in non-<use> shadow trees, so any shadow root we do
</span><span class="cx"> // have should be a use. The assert and following test is here to catch future shadow DOM changes
</span><span class="cx"> // that do enable SVG in a shadow tree.
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (164250 => 164251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2014-02-17 22:44:24 UTC (rev 164250)
+++ trunk/Source/WebCore/testing/Internals.cpp        2014-02-17 23:29:31 UTC (rev 164251)
</span><span class="lines">@@ -365,20 +365,20 @@
</span><span class="cx"> {
</span><span class="cx"> if (!node) {
</span><span class="cx"> ec = INVALID_ACCESS_ERR;
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- return node->treeScope().rootNode();
</del><ins>+ return &node->treeScope().rootNode();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Node* Internals::parentTreeScope(Node* node, ExceptionCode& ec)
</span><span class="cx"> {
</span><span class="cx"> if (!node) {
</span><span class="cx"> ec = INVALID_ACCESS_ERR;
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> const TreeScope* parentTreeScope = node->treeScope().parentTreeScope();
</span><del>- return parentTreeScope ? parentTreeScope->rootNode() : 0;
</del><ins>+ return parentTreeScope ? &parentTreeScope->rootNode() : nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> unsigned Internals::lastSpatialNavigationCandidateCount(ExceptionCode& ec) const
</span></span></pre>
</div>
</div>
</body>
</html>