<!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>[170118] trunk/Source</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/170118">170118</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-06-18 14:43:30 -0700 (Wed, 18 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make ScrollingStateNodes refcounted, and other minor cleanup
https://bugs.webkit.org/show_bug.cgi?id=134040

Reviewed by Beth Dakin.

Source/WebCore:
Prepare for future scrolling frame gyrations by making
ScrollingStateNodes refcounted.

Rename ScrollingStateNode::removeChild() to removeDescendant()
since that's what it does. Also rename didRemoveNode() to willRemoveNode()
to better match the behavior.

Use 'auto' in more places.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::syncChildPositions):
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::create):
(WebCore::ScrollingStateFixedNode::clone):
* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::create):
(WebCore::ScrollingStateFrameScrollingNode::clone):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::cloneAndReset):
(WebCore::ScrollingStateNode::appendChild):
(WebCore::ScrollingStateNode::removeDescendant):
(WebCore::ScrollingStateNode::willBeRemovedFromStateTree):
(WebCore::ScrollingStateNode::removeChild): Deleted.
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::children):
* page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
(WebCore::ScrollingStateOverflowScrollingNode::create):
(WebCore::ScrollingStateOverflowScrollingNode::clone):
* page/scrolling/ScrollingStateOverflowScrollingNode.h:
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::create):
(WebCore::ScrollingStateStickyNode::clone):
* page/scrolling/ScrollingStateStickyNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::attachNode):
(WebCore::ScrollingStateTree::removeNode):
(WebCore::ScrollingStateTree::willRemoveNode):
(WebCore::ScrollingStateTree::didRemoveNode): Deleted.
* page/scrolling/ScrollingStateTree.h:
(WebCore::ScrollingStateTree::setRootStateNode):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::updateTreeFromStateNode):

Source/WebKit2:
* Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::encodeNodeAndDescendants):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp">trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateFixedNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateFixedNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateOverflowScrollingNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateOverflowScrollingNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateStickyNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateStickyNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateTreecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateTreeh">trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreecpp">trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedScrollingRemoteScrollingCoordinatorTransactioncpp">trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/ChangeLog        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2014-06-18  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Make ScrollingStateNodes refcounted, and other minor cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=134040
+
+        Reviewed by Beth Dakin.
+
+        Prepare for future scrolling frame gyrations by making
+        ScrollingStateNodes refcounted.
+        
+        Rename ScrollingStateNode::removeChild() to removeDescendant()
+        since that's what it does. Also rename didRemoveNode() to willRemoveNode()
+        to better match the behavior.
+        
+        Use 'auto' in more places.
+
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::syncChildPositions):
+        * page/scrolling/ScrollingStateFixedNode.cpp:
+        (WebCore::ScrollingStateFixedNode::create):
+        (WebCore::ScrollingStateFixedNode::clone):
+        * page/scrolling/ScrollingStateFixedNode.h:
+        * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
+        (WebCore::ScrollingStateFrameScrollingNode::create):
+        (WebCore::ScrollingStateFrameScrollingNode::clone):
+        * page/scrolling/ScrollingStateFrameScrollingNode.h:
+        * page/scrolling/ScrollingStateNode.cpp:
+        (WebCore::ScrollingStateNode::cloneAndReset):
+        (WebCore::ScrollingStateNode::appendChild):
+        (WebCore::ScrollingStateNode::removeDescendant):
+        (WebCore::ScrollingStateNode::willBeRemovedFromStateTree):
+        (WebCore::ScrollingStateNode::removeChild): Deleted.
+        * page/scrolling/ScrollingStateNode.h:
+        (WebCore::ScrollingStateNode::children):
+        * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
+        (WebCore::ScrollingStateOverflowScrollingNode::create):
+        (WebCore::ScrollingStateOverflowScrollingNode::clone):
+        * page/scrolling/ScrollingStateOverflowScrollingNode.h:
+        * page/scrolling/ScrollingStateStickyNode.cpp:
+        (WebCore::ScrollingStateStickyNode::create):
+        (WebCore::ScrollingStateStickyNode::clone):
+        * page/scrolling/ScrollingStateStickyNode.h:
+        * page/scrolling/ScrollingStateTree.cpp:
+        (WebCore::ScrollingStateTree::attachNode):
+        (WebCore::ScrollingStateTree::removeNode):
+        (WebCore::ScrollingStateTree::willRemoveNode):
+        (WebCore::ScrollingStateTree::didRemoveNode): Deleted.
+        * page/scrolling/ScrollingStateTree.h:
+        (WebCore::ScrollingStateTree::setRootStateNode):
+        * page/scrolling/ScrollingTree.cpp:
+        (WebCore::ScrollingTree::updateTreeFromStateNode):
+
</ins><span class="cx"> 2014-06-18  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Adopt modern C++11 loops and fix WebArchive creation functions
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -344,7 +344,7 @@
</span><span class="cx">     if (!m_scrollingStateTree-&gt;rootStateNode())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    Vector&lt;OwnPtr&lt;ScrollingStateNode&gt;&gt;* children = m_scrollingStateTree-&gt;rootStateNode()-&gt;children();
</del><ins>+    auto children = m_scrollingStateTree-&gt;rootStateNode()-&gt;children();
</ins><span class="cx">     if (!children)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateFixedNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -35,9 +35,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-PassOwnPtr&lt;ScrollingStateFixedNode&gt; ScrollingStateFixedNode::create(ScrollingStateTree&amp; stateTree, ScrollingNodeID nodeID)
</del><ins>+PassRefPtr&lt;ScrollingStateFixedNode&gt; ScrollingStateFixedNode::create(ScrollingStateTree&amp; stateTree, ScrollingNodeID nodeID)
</ins><span class="cx"> {
</span><del>-    return adoptPtr(new ScrollingStateFixedNode(stateTree, nodeID));
</del><ins>+    return adoptRef(new ScrollingStateFixedNode(stateTree, nodeID));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ScrollingStateFixedNode::ScrollingStateFixedNode(ScrollingStateTree&amp; tree, ScrollingNodeID nodeID)
</span><span class="lines">@@ -55,9 +55,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassOwnPtr&lt;ScrollingStateNode&gt; ScrollingStateFixedNode::clone(ScrollingStateTree&amp; adoptiveTree)
</del><ins>+PassRefPtr&lt;ScrollingStateNode&gt; ScrollingStateFixedNode::clone(ScrollingStateTree&amp; adoptiveTree)
</ins><span class="cx"> {
</span><del>-    return adoptPtr(new ScrollingStateFixedNode(*this, adoptiveTree));
</del><ins>+    return adoptRef(new ScrollingStateFixedNode(*this, adoptiveTree));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingStateFixedNode::updateConstraints(const FixedPositionViewportConstraints&amp; constraints)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateFixedNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.h (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.h        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.h        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -39,9 +39,9 @@
</span><span class="cx"> 
</span><span class="cx"> class ScrollingStateFixedNode final : public ScrollingStateNode {
</span><span class="cx"> public:
</span><del>-    static PassOwnPtr&lt;ScrollingStateFixedNode&gt; create(ScrollingStateTree&amp;, ScrollingNodeID);
</del><ins>+    static PassRefPtr&lt;ScrollingStateFixedNode&gt; create(ScrollingStateTree&amp;, ScrollingNodeID);
</ins><span class="cx"> 
</span><del>-    virtual PassOwnPtr&lt;ScrollingStateNode&gt; clone(ScrollingStateTree&amp;);
</del><ins>+    virtual PassRefPtr&lt;ScrollingStateNode&gt; clone(ScrollingStateTree&amp;);
</ins><span class="cx"> 
</span><span class="cx">     virtual ~ScrollingStateFixedNode();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -34,9 +34,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-PassOwnPtr&lt;ScrollingStateFrameScrollingNode&gt; ScrollingStateFrameScrollingNode::create(ScrollingStateTree&amp; stateTree, ScrollingNodeID nodeID)
</del><ins>+PassRefPtr&lt;ScrollingStateFrameScrollingNode&gt; ScrollingStateFrameScrollingNode::create(ScrollingStateTree&amp; stateTree, ScrollingNodeID nodeID)
</ins><span class="cx"> {
</span><del>-    return adoptPtr(new ScrollingStateFrameScrollingNode(stateTree, nodeID));
</del><ins>+    return adoptRef(new ScrollingStateFrameScrollingNode(stateTree, nodeID));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode(ScrollingStateTree&amp; stateTree, ScrollingNodeID nodeID)
</span><span class="lines">@@ -96,9 +96,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassOwnPtr&lt;ScrollingStateNode&gt; ScrollingStateFrameScrollingNode::clone(ScrollingStateTree&amp; adoptiveTree)
</del><ins>+PassRefPtr&lt;ScrollingStateNode&gt; ScrollingStateFrameScrollingNode::clone(ScrollingStateTree&amp; adoptiveTree)
</ins><span class="cx"> {
</span><del>-    return adoptPtr(new ScrollingStateFrameScrollingNode(*this, adoptiveTree));
</del><ins>+    return adoptRef(new ScrollingStateFrameScrollingNode(*this, adoptiveTree));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingStateFrameScrollingNode::setFrameScaleFactor(float scaleFactor)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> #include &quot;ScrollbarThemeComposite.h&quot;
</span><span class="cx"> #include &quot;ScrollingCoordinator.h&quot;
</span><span class="cx"> #include &quot;ScrollingStateScrollingNode.h&quot;
</span><del>-#include &lt;wtf/PassOwnPtr.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -41,9 +40,9 @@
</span><span class="cx"> 
</span><span class="cx"> class ScrollingStateFrameScrollingNode final : public ScrollingStateScrollingNode {
</span><span class="cx"> public:
</span><del>-    static PassOwnPtr&lt;ScrollingStateFrameScrollingNode&gt; create(ScrollingStateTree&amp;, ScrollingNodeID);
</del><ins>+    static PassRefPtr&lt;ScrollingStateFrameScrollingNode&gt; create(ScrollingStateTree&amp;, ScrollingNodeID);
</ins><span class="cx"> 
</span><del>-    virtual PassOwnPtr&lt;ScrollingStateNode&gt; clone(ScrollingStateTree&amp;);
</del><ins>+    virtual PassRefPtr&lt;ScrollingStateNode&gt; clone(ScrollingStateTree&amp;);
</ins><span class="cx"> 
</span><span class="cx">     virtual ~ScrollingStateFrameScrollingNode();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -72,9 +72,9 @@
</span><span class="cx">     m_scrollingStateTree.setHasChangedProperties();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassOwnPtr&lt;ScrollingStateNode&gt; ScrollingStateNode::cloneAndReset(ScrollingStateTree&amp; adoptiveTree)
</del><ins>+PassRefPtr&lt;ScrollingStateNode&gt; ScrollingStateNode::cloneAndReset(ScrollingStateTree&amp; adoptiveTree)
</ins><span class="cx"> {
</span><del>-    OwnPtr&lt;ScrollingStateNode&gt; clone = this-&gt;clone(adoptiveTree);
</del><ins>+    RefPtr&lt;ScrollingStateNode&gt; clone = this-&gt;clone(adoptiveTree);
</ins><span class="cx"> 
</span><span class="cx">     // Now that this node is cloned, reset our change properties.
</span><span class="cx">     resetChangedProperties();
</span><span class="lines">@@ -92,25 +92,22 @@
</span><span class="cx">         clone.appendChild(child-&gt;cloneAndReset(adoptiveTree));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingStateNode::appendChild(PassOwnPtr&lt;ScrollingStateNode&gt; childNode)
</del><ins>+void ScrollingStateNode::appendChild(PassRefPtr&lt;ScrollingStateNode&gt; childNode)
</ins><span class="cx"> {
</span><span class="cx">     childNode-&gt;setParent(this);
</span><span class="cx"> 
</span><span class="cx">     if (!m_children)
</span><del>-        m_children = adoptPtr(new Vector&lt;OwnPtr&lt;ScrollingStateNode&gt;&gt;);
</del><ins>+        m_children = adoptPtr(new Vector&lt;RefPtr&lt;ScrollingStateNode&gt;&gt;);
</ins><span class="cx"> 
</span><span class="cx">     m_children-&gt;append(childNode);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingStateNode::removeChild(ScrollingStateNode* node)
</del><ins>+void ScrollingStateNode::removeDescendant(ScrollingStateNode* node)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_children)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     size_t index = m_children-&gt;find(node);
</span><del>-
-    // The index will be notFound if the node to remove is a deeper-than-1-level descendant or
-    // if node is the root state node.
</del><span class="cx">     if (index != notFound) {
</span><span class="cx">         node-&gt;willBeRemovedFromStateTree();
</span><span class="cx">         m_children-&gt;remove(index);
</span><span class="lines">@@ -118,13 +115,12 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; child : *m_children)
</span><del>-        child-&gt;removeChild(node);
</del><ins>+        child-&gt;removeDescendant(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingStateNode::willBeRemovedFromStateTree()
</span><span class="cx"> {
</span><del>-    scrollingStateTree().didRemoveNode(scrollingNodeID());
-
</del><ins>+    scrollingStateTree().willRemoveNode(this);
</ins><span class="cx">     if (!m_children)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> #include &quot;GraphicsLayer.h&quot;
</span><span class="cx"> #include &quot;ScrollingCoordinator.h&quot;
</span><span class="cx"> #include &lt;wtf/OwnPtr.h&gt;
</span><del>-#include &lt;wtf/PassOwnPtr.h&gt;
</del><ins>+#include &lt;wtf/RefCounted.h&gt;
</ins><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx">     Type m_representation;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-class ScrollingStateNode {
</del><ins>+class ScrollingStateNode : public RefCounted&lt;ScrollingStateNode&gt; {
</ins><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx">     ScrollingStateNode(ScrollingNodeType, ScrollingStateTree&amp;, ScrollingNodeID);
</span><span class="lines">@@ -164,8 +164,8 @@
</span><span class="cx">     bool isFrameScrollingNode() const { return m_nodeType == FrameScrollingNode; }
</span><span class="cx">     bool isOverflowScrollingNode() const { return m_nodeType == OverflowScrollingNode; }
</span><span class="cx"> 
</span><del>-    virtual PassOwnPtr&lt;ScrollingStateNode&gt; clone(ScrollingStateTree&amp; adoptiveTree) = 0;
-    PassOwnPtr&lt;ScrollingStateNode&gt; cloneAndReset(ScrollingStateTree&amp; adoptiveTree);
</del><ins>+    virtual PassRefPtr&lt;ScrollingStateNode&gt; clone(ScrollingStateTree&amp; adoptiveTree) = 0;
+    PassRefPtr&lt;ScrollingStateNode&gt; cloneAndReset(ScrollingStateTree&amp; adoptiveTree);
</ins><span class="cx">     void cloneAndResetChildren(ScrollingStateNode&amp;, ScrollingStateTree&amp; adoptiveTree);
</span><span class="cx"> 
</span><span class="cx">     enum {
</span><span class="lines">@@ -195,10 +195,10 @@
</span><span class="cx">     void setParent(ScrollingStateNode* parent) { m_parent = parent; }
</span><span class="cx">     ScrollingNodeID parentNodeID() const { return m_parent ? m_parent-&gt;scrollingNodeID() : 0; }
</span><span class="cx"> 
</span><del>-    Vector&lt;OwnPtr&lt;ScrollingStateNode&gt;&gt;* children() const { return m_children.get(); }
</del><ins>+    Vector&lt;RefPtr&lt;ScrollingStateNode&gt;&gt;* children() const { return m_children.get(); }
</ins><span class="cx"> 
</span><del>-    void appendChild(PassOwnPtr&lt;ScrollingStateNode&gt;);
-    void removeChild(ScrollingStateNode*);
</del><ins>+    void appendChild(PassRefPtr&lt;ScrollingStateNode&gt;);
+    void removeDescendant(ScrollingStateNode*);
</ins><span class="cx"> 
</span><span class="cx">     String scrollingStateTreeAsText() const;
</span><span class="cx"> 
</span><span class="lines">@@ -218,7 +218,7 @@
</span><span class="cx">     ScrollingStateTree&amp; m_scrollingStateTree;
</span><span class="cx"> 
</span><span class="cx">     ScrollingStateNode* m_parent;
</span><del>-    OwnPtr&lt;Vector&lt;OwnPtr&lt;ScrollingStateNode&gt;&gt;&gt; m_children;
</del><ins>+    OwnPtr&lt;Vector&lt;RefPtr&lt;ScrollingStateNode&gt;&gt;&gt; m_children;
</ins><span class="cx"> 
</span><span class="cx">     LayerRepresentation m_layer;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateOverflowScrollingNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -34,9 +34,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-PassOwnPtr&lt;ScrollingStateOverflowScrollingNode&gt; ScrollingStateOverflowScrollingNode::create(ScrollingStateTree&amp; stateTree, ScrollingNodeID nodeID)
</del><ins>+PassRefPtr&lt;ScrollingStateOverflowScrollingNode&gt; ScrollingStateOverflowScrollingNode::create(ScrollingStateTree&amp; stateTree, ScrollingNodeID nodeID)
</ins><span class="cx"> {
</span><del>-    return adoptPtr(new ScrollingStateOverflowScrollingNode(stateTree, nodeID));
</del><ins>+    return adoptRef(new ScrollingStateOverflowScrollingNode(stateTree, nodeID));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode(ScrollingStateTree&amp; stateTree, ScrollingNodeID nodeID)
</span><span class="lines">@@ -55,9 +55,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassOwnPtr&lt;ScrollingStateNode&gt; ScrollingStateOverflowScrollingNode::clone(ScrollingStateTree&amp; adoptiveTree)
</del><ins>+PassRefPtr&lt;ScrollingStateNode&gt; ScrollingStateOverflowScrollingNode::clone(ScrollingStateTree&amp; adoptiveTree)
</ins><span class="cx"> {
</span><del>-    return adoptPtr(new ScrollingStateOverflowScrollingNode(*this, adoptiveTree));
</del><ins>+    return adoptRef(new ScrollingStateOverflowScrollingNode(*this, adoptiveTree));
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void ScrollingStateOverflowScrollingNode::setScrolledContentsLayer(const LayerRepresentation&amp; layerRepresentation)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateOverflowScrollingNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.h (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.h        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.h        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -34,9 +34,9 @@
</span><span class="cx"> 
</span><span class="cx"> class ScrollingStateOverflowScrollingNode : public ScrollingStateScrollingNode {
</span><span class="cx"> public:
</span><del>-    static PassOwnPtr&lt;ScrollingStateOverflowScrollingNode&gt; create(ScrollingStateTree&amp;, ScrollingNodeID);
</del><ins>+    static PassRefPtr&lt;ScrollingStateOverflowScrollingNode&gt; create(ScrollingStateTree&amp;, ScrollingNodeID);
</ins><span class="cx"> 
</span><del>-    virtual PassOwnPtr&lt;ScrollingStateNode&gt; clone(ScrollingStateTree&amp;);
</del><ins>+    virtual PassRefPtr&lt;ScrollingStateNode&gt; clone(ScrollingStateTree&amp;);
</ins><span class="cx"> 
</span><span class="cx">     virtual ~ScrollingStateOverflowScrollingNode();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateStickyNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -35,9 +35,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-PassOwnPtr&lt;ScrollingStateStickyNode&gt; ScrollingStateStickyNode::create(ScrollingStateTree&amp; stateTree, ScrollingNodeID nodeID)
</del><ins>+PassRefPtr&lt;ScrollingStateStickyNode&gt; ScrollingStateStickyNode::create(ScrollingStateTree&amp; stateTree, ScrollingNodeID nodeID)
</ins><span class="cx"> {
</span><del>-    return adoptPtr(new ScrollingStateStickyNode(stateTree, nodeID));
</del><ins>+    return adoptRef(new ScrollingStateStickyNode(stateTree, nodeID));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ScrollingStateStickyNode::ScrollingStateStickyNode(ScrollingStateTree&amp; tree, ScrollingNodeID nodeID)
</span><span class="lines">@@ -55,9 +55,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassOwnPtr&lt;ScrollingStateNode&gt; ScrollingStateStickyNode::clone(ScrollingStateTree&amp; adoptiveTree)
</del><ins>+PassRefPtr&lt;ScrollingStateNode&gt; ScrollingStateStickyNode::clone(ScrollingStateTree&amp; adoptiveTree)
</ins><span class="cx"> {
</span><del>-    return adoptPtr(new ScrollingStateStickyNode(*this, adoptiveTree));
</del><ins>+    return adoptRef(new ScrollingStateStickyNode(*this, adoptiveTree));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingStateStickyNode::updateConstraints(const StickyPositionViewportConstraints&amp; constraints)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateStickyNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.h (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.h        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.h        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -39,9 +39,9 @@
</span><span class="cx"> 
</span><span class="cx"> class ScrollingStateStickyNode final : public ScrollingStateNode {
</span><span class="cx"> public:
</span><del>-    static PassOwnPtr&lt;ScrollingStateStickyNode&gt; create(ScrollingStateTree&amp;, ScrollingNodeID);
</del><ins>+    static PassRefPtr&lt;ScrollingStateStickyNode&gt; create(ScrollingStateTree&amp;, ScrollingNodeID);
</ins><span class="cx"> 
</span><del>-    virtual PassOwnPtr&lt;ScrollingStateNode&gt; clone(ScrollingStateTree&amp;);
</del><ins>+    virtual PassRefPtr&lt;ScrollingStateNode&gt; clone(ScrollingStateTree&amp;);
</ins><span class="cx"> 
</span><span class="cx">     virtual ~ScrollingStateStickyNode();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -72,9 +72,13 @@
</span><span class="cx">     ASSERT(newNodeID);
</span><span class="cx"> 
</span><span class="cx">     if (ScrollingStateNode* node = stateNodeForID(newNodeID)) {
</span><ins>+        if (!parentID)
+            return newNodeID;
+
</ins><span class="cx">         ScrollingStateNode* parent = stateNodeForID(parentID);
</span><span class="cx">         if (!parent)
</span><span class="cx">             return newNodeID;
</span><ins>+
</ins><span class="cx">         if (node-&gt;parent() == parent)
</span><span class="cx">             return newNodeID;
</span><span class="cx"> 
</span><span class="lines">@@ -82,7 +86,7 @@
</span><span class="cx">         removeNode(node);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ScrollingStateNode* newNode = 0;
</del><ins>+    ScrollingStateNode* newNode = nullptr;
</ins><span class="cx">     if (!parentID) {
</span><span class="cx">         // If we're resetting the root node, we should clear the HashMap and destroy the current children.
</span><span class="cx">         clear();
</span><span class="lines">@@ -97,25 +101,25 @@
</span><span class="cx"> 
</span><span class="cx">         switch (nodeType) {
</span><span class="cx">         case FixedNode: {
</span><del>-            OwnPtr&lt;ScrollingStateFixedNode&gt; fixedNode = ScrollingStateFixedNode::create(*this, newNodeID);
</del><ins>+            RefPtr&lt;ScrollingStateFixedNode&gt; fixedNode = ScrollingStateFixedNode::create(*this, newNodeID);
</ins><span class="cx">             newNode = fixedNode.get();
</span><span class="cx">             parent-&gt;appendChild(fixedNode.release());
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case StickyNode: {
</span><del>-            OwnPtr&lt;ScrollingStateStickyNode&gt; stickyNode = ScrollingStateStickyNode::create(*this, newNodeID);
</del><ins>+            RefPtr&lt;ScrollingStateStickyNode&gt; stickyNode = ScrollingStateStickyNode::create(*this, newNodeID);
</ins><span class="cx">             newNode = stickyNode.get();
</span><span class="cx">             parent-&gt;appendChild(stickyNode.release());
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FrameScrollingNode: {
</span><del>-            OwnPtr&lt;ScrollingStateFrameScrollingNode&gt; scrollingNode = ScrollingStateFrameScrollingNode::create(*this, newNodeID);
</del><ins>+            RefPtr&lt;ScrollingStateFrameScrollingNode&gt; scrollingNode = ScrollingStateFrameScrollingNode::create(*this, newNodeID);
</ins><span class="cx">             newNode = scrollingNode.get();
</span><span class="cx">             parent-&gt;appendChild(scrollingNode.release());
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case OverflowScrollingNode: {
</span><del>-            OwnPtr&lt;ScrollingStateOverflowScrollingNode&gt; scrollingNode = ScrollingStateOverflowScrollingNode::create(*this, newNodeID);
</del><ins>+            RefPtr&lt;ScrollingStateOverflowScrollingNode&gt; scrollingNode = ScrollingStateOverflowScrollingNode::create(*this, newNodeID);
</ins><span class="cx">             newNode = scrollingNode.get();
</span><span class="cx">             parent-&gt;appendChild(scrollingNode.release());
</span><span class="cx">             break;
</span><span class="lines">@@ -179,24 +183,23 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (node == m_rootStateNode) {
</span><del>-        didRemoveNode(node-&gt;scrollingNodeID());
</del><ins>+        willRemoveNode(node);
</ins><span class="cx">         m_rootStateNode = nullptr;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_rootStateNode);
</span><del>-    m_rootStateNode-&gt;removeChild(node);
</del><ins>+    m_rootStateNode-&gt;removeDescendant(node);
</ins><span class="cx"> 
</span><del>-    // ScrollingStateTree::removeNode() will destroy children, so we have to make sure we remove those children
</del><ins>+    // ScrollingStateTree::removeDescendant() will destroy children, so we have to make sure we remove those children
</ins><span class="cx">     // from the HashMap.
</span><del>-    size_t size = m_nodesRemovedSinceLastCommit.size();
-    for (size_t i = 0; i &lt; size; ++i)
-        m_stateNodeMap.remove(m_nodesRemovedSinceLastCommit[i]);
</del><ins>+    for (auto removedNodeID : m_nodesRemovedSinceLastCommit)
+        m_stateNodeMap.remove(removedNodeID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingStateTree::didRemoveNode(ScrollingNodeID nodeID)
</del><ins>+void ScrollingStateTree::willRemoveNode(ScrollingStateNode* node)
</ins><span class="cx"> {
</span><del>-    m_nodesRemovedSinceLastCommit.append(nodeID);
</del><ins>+    m_nodesRemovedSinceLastCommit.append(node-&gt;scrollingNodeID());
</ins><span class="cx">     setHasChangedProperties();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateTreeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -79,14 +79,14 @@
</span><span class="cx"> private:
</span><span class="cx">     ScrollingStateTree(AsyncScrollingCoordinator*);
</span><span class="cx"> 
</span><del>-    void setRootStateNode(PassOwnPtr&lt;ScrollingStateFrameScrollingNode&gt; rootStateNode) { m_rootStateNode = rootStateNode; }
</del><ins>+    void setRootStateNode(PassRefPtr&lt;ScrollingStateFrameScrollingNode&gt; rootStateNode) { m_rootStateNode = rootStateNode; }
</ins><span class="cx">     void addNode(ScrollingStateNode*);
</span><span class="cx">     void removeNode(ScrollingStateNode*);
</span><del>-    void didRemoveNode(ScrollingNodeID);
</del><ins>+    void willRemoveNode(ScrollingStateNode*);
</ins><span class="cx"> 
</span><span class="cx">     AsyncScrollingCoordinator* m_scrollingCoordinator;
</span><span class="cx">     StateNodeMap m_stateNodeMap;
</span><del>-    OwnPtr&lt;ScrollingStateFrameScrollingNode&gt; m_rootStateNode;
</del><ins>+    RefPtr&lt;ScrollingStateFrameScrollingNode&gt; m_rootStateNode;
</ins><span class="cx">     Vector&lt;ScrollingNodeID&gt; m_nodesRemovedSinceLastCommit;
</span><span class="cx">     bool m_hasChangedProperties;
</span><span class="cx">     bool m_hasNewRootStateNode;
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -197,11 +197,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Now update the children if we have any.
</span><del>-    Vector&lt;OwnPtr&lt;ScrollingStateNode&gt;&gt;* stateNodeChildren = stateNode-&gt;children();
-    if (stateNodeChildren) {
-        size_t size = stateNodeChildren-&gt;size();
-        for (size_t i = 0; i &lt; size; ++i)
-            updateTreeFromStateNode(stateNodeChildren-&gt;at(i).get());
</del><ins>+    if (auto children = stateNode-&gt;children()) {
+        for (auto&amp; child : *children)
+            updateTreeFromStateNode(child.get());
</ins><span class="cx">     }
</span><span class="cx">     node-&gt;updateAfterChildren(*stateNode);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebKit2/ChangeLog        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-06-18  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Make ScrollingStateNodes refcounted, and other minor cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=134040
+
+        Reviewed by Beth Dakin.
+
+        * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
+        (WebKit::encodeNodeAndDescendants):
+
</ins><span class="cx"> 2014-06-18  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS][WK2] Do not add padding when magnifying replaced elements
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedScrollingRemoteScrollingCoordinatorTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp (170117 => 170118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp        2014-06-18 21:41:44 UTC (rev 170117)
+++ trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp        2014-06-18 21:43:30 UTC (rev 170118)
</span><span class="lines">@@ -337,10 +337,8 @@
</span><span class="cx">     if (!stateNode.children())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    for (size_t i = 0; i &lt; stateNode.children()-&gt;size(); ++i) {
-        const OwnPtr&lt;ScrollingStateNode&gt;&amp; child = stateNode.children()-&gt;at(i);
</del><ins>+    for (const auto&amp; child : *stateNode.children())
</ins><span class="cx">         encodeNodeAndDescendants(encoder, *child.get());
</span><del>-    }
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RemoteScrollingCoordinatorTransaction::encode(IPC::ArgumentEncoder&amp; encoder) const
</span></span></pre>
</div>
</div>

</body>
</html>