<!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>[201052] 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/201052">201052</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-05-17 15:39:00 -0700 (Tue, 17 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use RenderChildIterator more for traversing a renderer's children
https://bugs.webkit.org/show_bug.cgi?id=157811

Reviewed by Antti Koivisto.

Use RenderChildIterator more for traversing a renderer's children.

* inspector/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::layersForNode):
(WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy):
* inspector/InspectorLayerTreeAgent.h:
* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::recalcColumn):
* rendering/InlineIterator.h:
(WebCore::isEmptyInline):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addFocusRingRects):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::positionForPoint):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::updateOutlineAutoAncestor):
* rendering/RenderElement.h:
* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::findLegend):
* rendering/RenderFieldset.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::generateCulledLineBoxRects):
(WebCore::RenderInline::culledInlineFirstLineBox):
(WebCore::RenderInline::culledInlineVisualOverflowBoundingBox):
(WebCore::RenderInline::dirtyLineBoxes):
* rendering/RenderListItem.cpp:
(WebCore::getParentOfFirstLineBox):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::setFlowThreadStateIncludingDescendants):
(WebCore::RenderObject::addAbsoluteRectForLayer):
(WebCore::RenderObject::paintingRootRect):
(WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants):
(WebCore::RenderObject::invalidateFlowThreadContainingBlockIncludingDescendants):
(WebCore::RenderObject::updateDragState):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::firstColumn):
* rendering/RenderTableCol.cpp:
(WebCore::RenderTableCol::clearPreferredLogicalWidthsDirtyBits):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::layoutRows):
* rendering/RenderTreeAsText.cpp:
(WebCore::write):
* rendering/svg/RenderSVGText.cpp:
(WebCore::findPreviousAndNextAttributes):
(WebCore::RenderSVGText::subtreeChildWasAdded):
(WebCore::RenderSVGText::subtreeChildWillBeRemoved):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::updateObjectBoundingBox):
(WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
(WebCore::SVGRenderSupport::layoutChildren):
* rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
(WebCore::SVGTextLayoutAttributesBuilder::collectTextPositioningElements):
* rendering/svg/SVGTextMetricsBuilder.cpp:
(WebCore::SVGTextMetricsBuilder::walkTree):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorLayerTreeAgentcpp">trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorLayerTreeAgenth">trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h</a></li>
<li><a href="#trunkSourceWebCorerenderingAutoTableLayoutcpp">trunk/Source/WebCore/rendering/AutoTableLayout.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineIteratorh">trunk/Source/WebCore/rendering/InlineIterator.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockcpp">trunk/Source/WebCore/rendering/RenderBlock.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementcpp">trunk/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementh">trunk/Source/WebCore/rendering/RenderElement.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFieldsetcpp">trunk/Source/WebCore/rendering/RenderFieldset.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFieldseth">trunk/Source/WebCore/rendering/RenderFieldset.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderInlinecpp">trunk/Source/WebCore/rendering/RenderInline.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListItemcpp">trunk/Source/WebCore/rendering/RenderListItem.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderObjectcpp">trunk/Source/WebCore/rendering/RenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTablecpp">trunk/Source/WebCore/rendering/RenderTable.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableColcpp">trunk/Source/WebCore/rendering/RenderTableCol.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableSectioncpp">trunk/Source/WebCore/rendering/RenderTableSection.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTreeAsTextcpp">trunk/Source/WebCore/rendering/RenderTreeAsText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGTextcpp">trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRenderSupportcpp">trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextLayoutAttributesBuildercpp">trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextMetricsBuildercpp">trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/ChangeLog        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -1,3 +1,65 @@
</span><ins>+2016-05-17  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Use RenderChildIterator more for traversing a renderer's children
+        https://bugs.webkit.org/show_bug.cgi?id=157811
+
+        Reviewed by Antti Koivisto.
+
+        Use RenderChildIterator more for traversing a renderer's children.
+
+        * inspector/InspectorLayerTreeAgent.cpp:
+        (WebCore::InspectorLayerTreeAgent::layersForNode):
+        (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy):
+        * inspector/InspectorLayerTreeAgent.h:
+        * rendering/AutoTableLayout.cpp:
+        (WebCore::AutoTableLayout::recalcColumn):
+        * rendering/InlineIterator.h:
+        (WebCore::isEmptyInline):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::addFocusRingRects):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::positionForPoint):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::updateOutlineAutoAncestor):
+        * rendering/RenderElement.h:
+        * rendering/RenderFieldset.cpp:
+        (WebCore::RenderFieldset::findLegend):
+        * rendering/RenderFieldset.h:
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::generateCulledLineBoxRects):
+        (WebCore::RenderInline::culledInlineFirstLineBox):
+        (WebCore::RenderInline::culledInlineVisualOverflowBoundingBox):
+        (WebCore::RenderInline::dirtyLineBoxes):
+        * rendering/RenderListItem.cpp:
+        (WebCore::getParentOfFirstLineBox):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::setFlowThreadStateIncludingDescendants):
+        (WebCore::RenderObject::addAbsoluteRectForLayer):
+        (WebCore::RenderObject::paintingRootRect):
+        (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants):
+        (WebCore::RenderObject::invalidateFlowThreadContainingBlockIncludingDescendants):
+        (WebCore::RenderObject::updateDragState):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::firstColumn):
+        * rendering/RenderTableCol.cpp:
+        (WebCore::RenderTableCol::clearPreferredLogicalWidthsDirtyBits):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::layoutRows):
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::write):
+        * rendering/svg/RenderSVGText.cpp:
+        (WebCore::findPreviousAndNextAttributes):
+        (WebCore::RenderSVGText::subtreeChildWasAdded):
+        (WebCore::RenderSVGText::subtreeChildWillBeRemoved):
+        * rendering/svg/SVGRenderSupport.cpp:
+        (WebCore::updateObjectBoundingBox):
+        (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
+        (WebCore::SVGRenderSupport::layoutChildren):
+        * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
+        (WebCore::SVGTextLayoutAttributesBuilder::collectTextPositioningElements):
+        * rendering/svg/SVGTextMetricsBuilder.cpp:
+        (WebCore::SVGTextMetricsBuilder::walkTree):
+
</ins><span class="cx"> 2016-05-17  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove ES6_GENERATORS flag
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorLayerTreeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &quot;InstrumentingAgents.h&quot;
</span><span class="cx"> #include &quot;IntRect.h&quot;
</span><span class="cx"> #include &quot;PseudoElement.h&quot;
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderLayer.h&quot;
</span><span class="cx"> #include &quot;RenderLayerBacking.h&quot;
</span><span class="cx"> #include &quot;RenderLayerCompositor.h&quot;
</span><span class="lines">@@ -105,30 +106,31 @@
</span><span class="cx"> {
</span><span class="cx">     layers = Inspector::Protocol::Array&lt;Inspector::Protocol::LayerTree::Layer&gt;::create();
</span><span class="cx"> 
</span><del>-    Node* node = m_instrumentingAgents.inspectorDOMAgent()-&gt;nodeForId(nodeId);
</del><ins>+    auto* node = m_instrumentingAgents.inspectorDOMAgent()-&gt;nodeForId(nodeId);
</ins><span class="cx">     if (!node) {
</span><span class="cx">         errorString = ASCIILiteral(&quot;Provided node id doesn't match any known node&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RenderObject* renderer = node-&gt;renderer();
</del><ins>+    auto* renderer = node-&gt;renderer();
</ins><span class="cx">     if (!renderer) {
</span><span class="cx">         errorString = ASCIILiteral(&quot;Node for provided node id doesn't have a renderer&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    gatherLayersUsingRenderObjectHierarchy(errorString, renderer, layers);
</del><ins>+    if (is&lt;RenderElement&gt;(*renderer))
+        gatherLayersUsingRenderObjectHierarchy(errorString, downcast&lt;RenderElement&gt;(*renderer), layers);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy(ErrorString&amp; errorString, RenderObject* renderer, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::LayerTree::Layer&gt;&gt;&amp; layers)
</del><ins>+void InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy(ErrorString&amp; errorString, RenderElement&amp; renderer, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::LayerTree::Layer&gt;&gt;&amp; layers)
</ins><span class="cx"> {
</span><del>-    if (renderer-&gt;hasLayer()) {
-        gatherLayersUsingRenderLayerHierarchy(errorString, downcast&lt;RenderLayerModelObject&gt;(*renderer).layer(), layers);
</del><ins>+    if (renderer.hasLayer()) {
+        gatherLayersUsingRenderLayerHierarchy(errorString, downcast&lt;RenderLayerModelObject&gt;(renderer).layer(), layers);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    for (renderer = renderer-&gt;firstChildSlow(); renderer; renderer = renderer-&gt;nextSibling())
-        gatherLayersUsingRenderObjectHierarchy(errorString, renderer, layers);
</del><ins>+    for (auto&amp; child : childrenOfType&lt;RenderElement&gt;(renderer))
+        gatherLayersUsingRenderObjectHierarchy(errorString, child, layers);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorLayerTreeAgent::gatherLayersUsingRenderLayerHierarchy(ErrorString&amp; errorString, RenderLayer* renderLayer, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::LayerTree::Layer&gt;&gt;&amp; layers)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorLayerTreeAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">     String bind(const RenderLayer*);
</span><span class="cx">     void unbind(const RenderLayer*);
</span><span class="cx"> 
</span><del>-    void gatherLayersUsingRenderObjectHierarchy(ErrorString&amp;, RenderObject*, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::LayerTree::Layer&gt;&gt;&amp;);
</del><ins>+    void gatherLayersUsingRenderObjectHierarchy(ErrorString&amp;, RenderElement&amp;, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::LayerTree::Layer&gt;&gt;&amp;);
</ins><span class="cx">     void gatherLayersUsingRenderLayerHierarchy(ErrorString&amp;, RenderLayer*, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::LayerTree::Layer&gt;&gt;&amp;);
</span><span class="cx"> 
</span><span class="cx">     Ref&lt;Inspector::Protocol::LayerTree::Layer&gt; buildObjectForLayer(ErrorString&amp;, RenderLayer*);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingAutoTableLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/AutoTableLayout.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/AutoTableLayout.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/AutoTableLayout.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;AutoTableLayout.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderTable.h&quot;
</span><span class="cx"> #include &quot;RenderTableCell.h&quot;
</span><span class="cx"> #include &quot;RenderTableCol.h&quot;
</span><span class="lines">@@ -48,14 +49,14 @@
</span><span class="cx">     RenderTableCell* fixedContributor = nullptr;
</span><span class="cx">     RenderTableCell* maxContributor = nullptr;
</span><span class="cx"> 
</span><del>-    for (RenderObject* child = m_table-&gt;firstChild(); child; child = child-&gt;nextSibling()) {
-        if (is&lt;RenderTableCol&gt;(*child)) {
</del><ins>+    for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(*m_table)) {
+        if (is&lt;RenderTableCol&gt;(child)) {
</ins><span class="cx">             // RenderTableCols don't have the concept of preferred logical width, but we need to clear their dirty bits
</span><span class="cx">             // so that if we call setPreferredWidthsDirty(true) on a col or one of its descendants, we'll mark it's
</span><span class="cx">             // ancestors as dirty.
</span><del>-            downcast&lt;RenderTableCol&gt;(*child).clearPreferredLogicalWidthsDirtyBits();
-        } else if (is&lt;RenderTableSection&gt;(*child)) {
-            RenderTableSection&amp; section = downcast&lt;RenderTableSection&gt;(*child);
</del><ins>+            downcast&lt;RenderTableCol&gt;(child).clearPreferredLogicalWidthsDirtyBits();
+        } else if (is&lt;RenderTableSection&gt;(child)) {
+            auto&amp; section = downcast&lt;RenderTableSection&gt;(child);
</ins><span class="cx">             unsigned numRows = section.numRows();
</span><span class="cx">             for (unsigned i = 0; i &lt; numRows; ++i) {
</span><span class="cx">                 RenderTableSection::CellStruct current = section.cellAt(i, effCol);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineIterator.h (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineIterator.h        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/InlineIterator.h        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;BidiRun.h&quot;
</span><span class="cx"> #include &quot;RenderBlockFlow.h&quot;
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderInline.h&quot;
</span><span class="cx"> #include &quot;RenderText.h&quot;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="lines">@@ -209,15 +210,15 @@
</span><span class="cx"> 
</span><span class="cx"> static bool isEmptyInline(const RenderInline&amp; renderer)
</span><span class="cx"> {
</span><del>-    for (RenderObject* current = renderer.firstChild(); current; current = current-&gt;nextSibling()) {
-        if (current-&gt;isFloatingOrOutOfFlowPositioned())
</del><ins>+    for (auto&amp; current : childrenOfType&lt;RenderObject&gt;(renderer)) {
+        if (current.isFloatingOrOutOfFlowPositioned())
</ins><span class="cx">             continue;
</span><del>-        if (is&lt;RenderText&gt;(*current)) {
-            if (!downcast&lt;RenderText&gt;(*current).isAllCollapsibleWhitespace())
</del><ins>+        if (is&lt;RenderText&gt;(current)) {
+            if (!downcast&lt;RenderText&gt;(current).isAllCollapsibleWhitespace())
</ins><span class="cx">                 return false;
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><del>-        if (!is&lt;RenderInline&gt;(*current) || !isEmptyInline(downcast&lt;RenderInline&gt;(*current)))
</del><ins>+        if (!is&lt;RenderInline&gt;(current) || !isEmptyInline(downcast&lt;RenderInline&gt;(current)))
</ins><span class="cx">             return false;
</span><span class="cx">     }
</span><span class="cx">     return true;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> #include &quot;RenderBlockFlow.h&quot;
</span><span class="cx"> #include &quot;RenderBoxRegionInfo.h&quot;
</span><span class="cx"> #include &quot;RenderButton.h&quot;
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderCombineText.h&quot;
</span><span class="cx"> #include &quot;RenderDeprecatedFlexibleBox.h&quot;
</span><span class="cx"> #include &quot;RenderFlexibleBox.h&quot;
</span><span class="lines">@@ -3465,17 +3466,17 @@
</span><span class="cx">         if (childrenInline())
</span><span class="cx">             addFocusRingRectsForInlineChildren(rects, additionalOffset, paintContainer);
</span><span class="cx">     
</span><del>-        for (RenderObject* child = firstChild(); child; child = child-&gt;nextSibling()) {
-            if (!is&lt;RenderText&gt;(*child) &amp;&amp; !is&lt;RenderListMarker&gt;(*child) &amp;&amp; is&lt;RenderBox&gt;(*child)) {
-                auto&amp; box = downcast&lt;RenderBox&gt;(*child);
-                FloatPoint pos;
-                // FIXME: This doesn't work correctly with transforms.
-                if (box.layer())
-                    pos = child-&gt;localToContainerPoint(FloatPoint(), paintContainer);
-                else
-                    pos = FloatPoint(additionalOffset.x() + box.x(), additionalOffset.y() + box.y());
-                box.addFocusRingRects(rects, flooredLayoutPoint(pos), paintContainer);
-            }
</del><ins>+        for (auto&amp; box : childrenOfType&lt;RenderBox&gt;(*this)) {
+            if (is&lt;RenderListMarker&gt;(box))
+                continue;
+
+            FloatPoint pos;
+            // FIXME: This doesn't work correctly with transforms.
+            if (box.layer())
+                pos = box.localToContainerPoint(FloatPoint(), paintContainer);
+            else
+                pos = FloatPoint(additionalOffset.x() + box.x(), additionalOffset.y() + box.y());
+            box.addFocusRingRects(rects, flooredLayoutPoint(pos), paintContainer);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;PaintInfo.h&quot;
</span><span class="cx"> #include &quot;RenderBoxRegionInfo.h&quot;
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderDeprecatedFlexibleBox.h&quot;
</span><span class="cx"> #include &quot;RenderFlexibleBox.h&quot;
</span><span class="cx"> #include &quot;RenderGeometryMap.h&quot;
</span><span class="lines">@@ -4421,18 +4422,13 @@
</span><span class="cx">     if (isTableRow())
</span><span class="cx">         adjustedPoint.moveBy(location());
</span><span class="cx"> 
</span><del>-    for (RenderObject* renderObject = firstChild(); renderObject; renderObject = renderObject-&gt;nextSibling()) {
-        if (!is&lt;RenderBox&gt;(*renderObject))
-            continue;
-
</del><ins>+    for (auto&amp; renderer : childrenOfType&lt;RenderBox&gt;(*this)) {
</ins><span class="cx">         if (is&lt;RenderFlowThread&gt;(*this)) {
</span><span class="cx">             ASSERT(region);
</span><del>-            if (!downcast&lt;RenderFlowThread&gt;(*this).objectShouldFragmentInFlowRegion(renderObject, region))
</del><ins>+            if (!downcast&lt;RenderFlowThread&gt;(*this).objectShouldFragmentInFlowRegion(&amp;renderer, region))
</ins><span class="cx">                 continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        auto&amp; renderer = downcast&lt;RenderBox&gt;(*renderObject);
-
</del><span class="cx">         if ((!renderer.firstChild() &amp;&amp; !renderer.isInline() &amp;&amp; !is&lt;RenderBlockFlow&gt;(renderer))
</span><span class="cx">             || renderer.style().visibility() != VISIBLE)
</span><span class="cx">             continue;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;PathUtilities.h&quot;
</span><span class="cx"> #include &quot;RenderBlock.h&quot;
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderCounter.h&quot;
</span><span class="cx"> #include &quot;RenderDeprecatedFlexibleBox.h&quot;
</span><span class="cx"> #include &quot;RenderFlexibleBox.h&quot;
</span><span class="lines">@@ -2151,18 +2152,18 @@
</span><span class="cx">     repaintRectangle(repaintRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderElement::updateOutlineAutoAncestor(bool hasOutlineAuto) const
</del><ins>+void RenderElement::updateOutlineAutoAncestor(bool hasOutlineAuto)
</ins><span class="cx"> {
</span><del>-    for (auto* child = firstChild(); child; child = child-&gt;nextSibling()) {
-        if (hasOutlineAuto == child-&gt;hasOutlineAutoAncestor())
</del><ins>+    for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(*this)) {
+        if (hasOutlineAuto == child.hasOutlineAutoAncestor())
</ins><span class="cx">             continue;
</span><del>-        child-&gt;setHasOutlineAutoAncestor(hasOutlineAuto);
-        bool childHasOutlineAuto = child-&gt;outlineStyleForRepaint().outlineStyleIsAuto();
</del><ins>+        child.setHasOutlineAutoAncestor(hasOutlineAuto);
+        bool childHasOutlineAuto = child.outlineStyleForRepaint().outlineStyleIsAuto();
</ins><span class="cx">         if (childHasOutlineAuto)
</span><span class="cx">             continue;
</span><span class="cx">         if (!is&lt;RenderElement&gt;(child))
</span><span class="cx">             continue;
</span><del>-        downcast&lt;RenderElement&gt;(*child).updateOutlineAutoAncestor(hasOutlineAuto);
</del><ins>+        downcast&lt;RenderElement&gt;(child).updateOutlineAutoAncestor(hasOutlineAuto);
</ins><span class="cx">     }
</span><span class="cx">     if (hasContinuation())
</span><span class="cx">         downcast&lt;RenderBoxModelObject&gt;(*this).continuation()-&gt;updateOutlineAutoAncestor(hasOutlineAuto);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.h (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.h        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/RenderElement.h        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -278,7 +278,7 @@
</span><span class="cx"> 
</span><span class="cx">     void paintFocusRing(PaintInfo&amp;, const RenderStyle&amp;, const Vector&lt;LayoutRect&gt;&amp; focusRingRects);
</span><span class="cx">     void paintOutline(PaintInfo&amp;, const LayoutRect&amp;);
</span><del>-    void updateOutlineAutoAncestor(bool hasOutlineAuto) const;
</del><ins>+    void updateOutlineAutoAncestor(bool hasOutlineAuto);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     RenderElement(ContainerNode&amp;, RenderStyle&amp;&amp;, BaseTypeFlags);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFieldsetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFieldset.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFieldset.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/RenderFieldset.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;HTMLFieldSetElement.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;PaintInfo.h&quot;
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -124,14 +125,14 @@
</span><span class="cx">     return &amp;legend;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RenderBox* RenderFieldset::findLegend(FindLegendOption option) const
</del><ins>+RenderBox* RenderFieldset::findLegend(FindLegendOption option)
</ins><span class="cx"> {
</span><del>-    for (RenderObject* legend = firstChild(); legend; legend = legend-&gt;nextSibling()) {
-        if (option == IgnoreFloatingOrOutOfFlow &amp;&amp; legend-&gt;isFloatingOrOutOfFlowPositioned())
</del><ins>+    for (auto&amp; legend : childrenOfType&lt;RenderElement&gt;(*this)) {
+        if (option == IgnoreFloatingOrOutOfFlow &amp;&amp; legend.isFloatingOrOutOfFlowPositioned())
</ins><span class="cx">             continue;
</span><span class="cx">         
</span><del>-        if (is&lt;HTMLLegendElement&gt;(legend-&gt;node()))
-            return downcast&lt;RenderBox&gt;(legend);
</del><ins>+        if (is&lt;HTMLLegendElement&gt;(legend.element()))
+            return &amp;downcast&lt;RenderBox&gt;(legend);
</ins><span class="cx">     }
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFieldseth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFieldset.h (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFieldset.h        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/RenderFieldset.h        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx">     RenderFieldset(HTMLFieldSetElement&amp;, RenderStyle&amp;&amp;);
</span><span class="cx"> 
</span><span class="cx">     enum FindLegendOption { IgnoreFloatingOrOutOfFlow, IncludeFloatingOrOutOfFlow };
</span><del>-    RenderBox* findLegend(FindLegendOption = IgnoreFloatingOrOutOfFlow) const;
</del><ins>+    RenderBox* findLegend(FindLegendOption = IgnoreFloatingOrOutOfFlow);
</ins><span class="cx"> 
</span><span class="cx">     HTMLFieldSetElement&amp; fieldSetElement() const { return downcast&lt;HTMLFieldSetElement&gt;(nodeForNonAnonymous()); }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderInlinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderInline.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;InlineTextBox.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;RenderBlock.h&quot;
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderFullScreen.h&quot;
</span><span class="cx"> #include &quot;RenderGeometryMap.h&quot;
</span><span class="cx"> #include &quot;RenderIterator.h&quot;
</span><span class="lines">@@ -670,14 +671,14 @@
</span><span class="cx"> 
</span><span class="cx">     bool isHorizontal = style().isHorizontalWritingMode();
</span><span class="cx"> 
</span><del>-    for (RenderObject* current = firstChild(); current; current = current-&gt;nextSibling()) {
-        if (current-&gt;isFloatingOrOutOfFlowPositioned())
</del><ins>+    for (auto&amp; current : childrenOfType&lt;RenderObject&gt;(*this)) {
+        if (current.isFloatingOrOutOfFlowPositioned())
</ins><span class="cx">             continue;
</span><del>-            
</del><ins>+
</ins><span class="cx">         // We want to get the margin box in the inline direction, and then use our font ascent/descent in the block
</span><span class="cx">         // direction (aligned to the root box's baseline).
</span><del>-        if (is&lt;RenderBox&gt;(*current)) {
-            RenderBox&amp; renderBox = downcast&lt;RenderBox&gt;(*current);
</del><ins>+        if (is&lt;RenderBox&gt;(current)) {
+            auto&amp; renderBox = downcast&lt;RenderBox&gt;(current);
</ins><span class="cx">             if (renderBox.inlineBoxWrapper()) {
</span><span class="cx">                 const RootInlineBox&amp; rootBox = renderBox.inlineBoxWrapper()-&gt;root();
</span><span class="cx">                 const RenderStyle&amp; containerStyle = rootBox.isFirstLine() ? container-&gt;firstLineStyle() : container-&gt;style();
</span><span class="lines">@@ -688,9 +689,9 @@
</span><span class="cx">                 else
</span><span class="cx">                     context.addRect(FloatRect(logicalTop, renderBox.inlineBoxWrapper()-&gt;y() - renderBox.marginTop(), logicalHeight, renderBox.height() + renderBox.verticalMarginExtent()));
</span><span class="cx">             }
</span><del>-        } else if (is&lt;RenderInline&gt;(*current)) {
</del><ins>+        } else if (is&lt;RenderInline&gt;(current)) {
</ins><span class="cx">             // If the child doesn't need line boxes either, then we can recur.
</span><del>-            RenderInline&amp; renderInline = downcast&lt;RenderInline&gt;(*current);
</del><ins>+            auto&amp; renderInline = downcast&lt;RenderInline&gt;(current);
</ins><span class="cx">             if (!renderInline.alwaysCreateLineBoxes())
</span><span class="cx">                 renderInline.generateCulledLineBoxRects(context, container);
</span><span class="cx">             else {
</span><span class="lines">@@ -712,8 +713,8 @@
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx">             }
</span><del>-        } else if (is&lt;RenderText&gt;(*current)) {
-            RenderText&amp; currText = downcast&lt;RenderText&gt;(*current);
</del><ins>+        } else if (is&lt;RenderText&gt;(current)) {
+            auto&amp; currText = downcast&lt;RenderText&gt;(current);
</ins><span class="cx">             for (InlineTextBox* childText = currText.firstTextBox(); childText; childText = childText-&gt;nextTextBox()) {
</span><span class="cx">                 const RootInlineBox&amp; rootBox = childText-&gt;root();
</span><span class="cx">                 const RenderStyle&amp; containerStyle = rootBox.isFirstLine() ? container-&gt;firstLineStyle() : container-&gt;style();
</span><span class="lines">@@ -724,8 +725,8 @@
</span><span class="cx">                 else
</span><span class="cx">                     context.addRect(FloatRect(logicalTop, childText-&gt;y(), logicalHeight, childText-&gt;logicalWidth()));
</span><span class="cx">             }
</span><del>-        } else if (is&lt;RenderLineBreak&gt;(*current)) {
-            if (InlineBox* inlineBox = downcast&lt;RenderLineBreak&gt;(*current).inlineBoxWrapper()) {
</del><ins>+        } else if (is&lt;RenderLineBreak&gt;(current)) {
+            if (auto* inlineBox = downcast&lt;RenderLineBreak&gt;(current).inlineBoxWrapper()) {
</ins><span class="cx">                 // FIXME: This could use a helper to share these with text path.
</span><span class="cx">                 const RootInlineBox&amp; rootBox = inlineBox-&gt;root();
</span><span class="cx">                 const RenderStyle&amp; containerStyle = rootBox.isFirstLine() ? container-&gt;firstLineStyle() : container-&gt;style();
</span><span class="lines">@@ -1033,26 +1034,26 @@
</span><span class="cx"> 
</span><span class="cx"> InlineBox* RenderInline::culledInlineFirstLineBox() const
</span><span class="cx"> {
</span><del>-    for (RenderObject* current = firstChild(); current; current = current-&gt;nextSibling()) {
-        if (current-&gt;isFloatingOrOutOfFlowPositioned())
</del><ins>+    for (auto&amp; current : childrenOfType&lt;RenderObject&gt;(*this)) {
+        if (current.isFloatingOrOutOfFlowPositioned())
</ins><span class="cx">             continue;
</span><del>-            
</del><ins>+
</ins><span class="cx">         // We want to get the margin box in the inline direction, and then use our font ascent/descent in the block
</span><span class="cx">         // direction (aligned to the root box's baseline).
</span><del>-        if (is&lt;RenderBox&gt;(*current)) {
-            const auto&amp; renderBox = downcast&lt;RenderBox&gt;(*current);
</del><ins>+        if (is&lt;RenderBox&gt;(current)) {
+            auto&amp; renderBox = downcast&lt;RenderBox&gt;(current);
</ins><span class="cx">             if (renderBox.inlineBoxWrapper())
</span><span class="cx">                 return renderBox.inlineBoxWrapper();
</span><del>-        } else if (is&lt;RenderLineBreak&gt;(*current)) {
-            RenderLineBreak&amp; renderBR = downcast&lt;RenderLineBreak&gt;(*current);
</del><ins>+        } else if (is&lt;RenderLineBreak&gt;(current)) {
+            auto&amp; renderBR = downcast&lt;RenderLineBreak&gt;(current);
</ins><span class="cx">             if (renderBR.inlineBoxWrapper())
</span><span class="cx">                 return renderBR.inlineBoxWrapper();
</span><del>-        } else if (is&lt;RenderInline&gt;(*current)) {
-            RenderInline&amp; renderInline = downcast&lt;RenderInline&gt;(*current);
</del><ins>+        } else if (is&lt;RenderInline&gt;(current)) {
+            auto&amp; renderInline = downcast&lt;RenderInline&gt;(current);
</ins><span class="cx">             if (InlineBox* result = renderInline.firstLineBoxIncludingCulling())
</span><span class="cx">                 return result;
</span><del>-        } else if (is&lt;RenderText&gt;(*current)) {
-            RenderText&amp; renderText = downcast&lt;RenderText&gt;(*current);
</del><ins>+        } else if (is&lt;RenderText&gt;(current)) {
+            auto&amp; renderText = downcast&lt;RenderText&gt;(current);
</ins><span class="cx">             if (renderText.firstTextBox())
</span><span class="cx">                 return renderText.firstTextBox();
</span><span class="cx">         }
</span><span class="lines">@@ -1096,13 +1097,13 @@
</span><span class="cx">     generateCulledLineBoxRects(context, this);
</span><span class="cx">     LayoutRect result(enclosingLayoutRect(floatResult));
</span><span class="cx">     bool isHorizontal = style().isHorizontalWritingMode();
</span><del>-    for (RenderObject* current = firstChild(); current; current = current-&gt;nextSibling()) {
-        if (current-&gt;isFloatingOrOutOfFlowPositioned())
</del><ins>+    for (auto&amp; current : childrenOfType&lt;RenderObject&gt;(*this)) {
+        if (current.isFloatingOrOutOfFlowPositioned())
</ins><span class="cx">             continue;
</span><del>-            
</del><ins>+
</ins><span class="cx">         // For overflow we just have to propagate by hand and recompute it all.
</span><del>-        if (is&lt;RenderBox&gt;(*current)) {
-            RenderBox&amp; renderBox = downcast&lt;RenderBox&gt;(*current);
</del><ins>+        if (is&lt;RenderBox&gt;(current)) {
+            auto&amp; renderBox = downcast&lt;RenderBox&gt;(current);
</ins><span class="cx">             if (!renderBox.hasSelfPaintingLayer() &amp;&amp; renderBox.inlineBoxWrapper()) {
</span><span class="cx">                 LayoutRect logicalRect = renderBox.logicalVisualOverflowRectForPropagation(&amp;style());
</span><span class="cx">                 if (isHorizontal) {
</span><span class="lines">@@ -1113,17 +1114,17 @@
</span><span class="cx">                     result.uniteIfNonZero(logicalRect.transposedRect());
</span><span class="cx">                 }
</span><span class="cx">             }
</span><del>-        } else if (is&lt;RenderInline&gt;(*current)) {
</del><ins>+        } else if (is&lt;RenderInline&gt;(current)) {
</ins><span class="cx">             // If the child doesn't need line boxes either, then we can recur.
</span><del>-            RenderInline&amp; renderInline = downcast&lt;RenderInline&gt;(*current);
</del><ins>+            auto&amp; renderInline = downcast&lt;RenderInline&gt;(current);
</ins><span class="cx">             if (!renderInline.alwaysCreateLineBoxes())
</span><span class="cx">                 result.uniteIfNonZero(renderInline.culledInlineVisualOverflowBoundingBox());
</span><span class="cx">             else if (!renderInline.hasSelfPaintingLayer())
</span><span class="cx">                 result.uniteIfNonZero(renderInline.linesVisualOverflowBoundingBox());
</span><del>-        } else if (is&lt;RenderText&gt;(*current)) {
</del><ins>+        } else if (is&lt;RenderText&gt;(current)) {
</ins><span class="cx">             // FIXME; Overflow from text boxes is lost. We will need to cache this information in
</span><span class="cx">             // InlineTextBoxes.
</span><del>-            RenderText&amp; renderText = downcast&lt;RenderText&gt;(*current);
</del><ins>+            auto&amp; renderText = downcast&lt;RenderText&gt;(current);
</ins><span class="cx">             result.uniteIfNonZero(renderText.linesVisualOverflowBoundingBox());
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -1458,24 +1459,24 @@
</span><span class="cx"> 
</span><span class="cx">     if (!alwaysCreateLineBoxes()) {
</span><span class="cx">         // We have to grovel into our children in order to dirty the appropriate lines.
</span><del>-        for (RenderObject* current = firstChild(); current; current = current-&gt;nextSibling()) {
-            if (current-&gt;isFloatingOrOutOfFlowPositioned())
</del><ins>+        for (auto&amp; current : childrenOfType&lt;RenderObject&gt;(*this)) {
+            if (current.isFloatingOrOutOfFlowPositioned())
</ins><span class="cx">                 continue;
</span><del>-            if (is&lt;RenderBox&gt;(*current) &amp;&amp; !current-&gt;needsLayout()) {
-                RenderBox&amp; renderBox = downcast&lt;RenderBox&gt;(*current);
</del><ins>+            if (is&lt;RenderBox&gt;(current) &amp;&amp; !current.needsLayout()) {
+                auto&amp; renderBox = downcast&lt;RenderBox&gt;(current);
</ins><span class="cx">                 if (renderBox.inlineBoxWrapper())
</span><span class="cx">                     renderBox.inlineBoxWrapper()-&gt;root().markDirty();
</span><del>-            } else if (!current-&gt;selfNeedsLayout()) {
-                if (is&lt;RenderInline&gt;(*current)) {
-                    RenderInline&amp; renderInline = downcast&lt;RenderInline&gt;(*current);
</del><ins>+            } else if (!current.selfNeedsLayout()) {
+                if (is&lt;RenderInline&gt;(current)) {
+                    auto&amp; renderInline = downcast&lt;RenderInline&gt;(current);
</ins><span class="cx">                     for (InlineFlowBox* childLine = renderInline.firstLineBox(); childLine; childLine = childLine-&gt;nextLineBox())
</span><span class="cx">                         childLine-&gt;root().markDirty();
</span><del>-                } else if (is&lt;RenderText&gt;(*current)) {
-                    RenderText&amp; renderText = downcast&lt;RenderText&gt;(*current);
</del><ins>+                } else if (is&lt;RenderText&gt;(current)) {
+                    auto&amp; renderText = downcast&lt;RenderText&gt;(current);
</ins><span class="cx">                     for (InlineTextBox* childText = renderText.firstTextBox(); childText; childText = childText-&gt;nextTextBox())
</span><span class="cx">                         childText-&gt;root().markDirty();
</span><del>-                } else if (is&lt;RenderLineBreak&gt;(*current)) {
-                    RenderLineBreak&amp; renderBR = downcast&lt;RenderLineBreak&gt;(*current);
</del><ins>+                } else if (is&lt;RenderLineBreak&gt;(current)) {
+                    auto&amp; renderBR = downcast&lt;RenderLineBreak&gt;(current);
</ins><span class="cx">                     if (renderBR.inlineBoxWrapper())
</span><span class="cx">                         renderBR.inlineBoxWrapper()-&gt;root().markDirty();
</span><span class="cx">                 }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListItemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListItem.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListItem.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/RenderListItem.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;HTMLUListElement.h&quot;
</span><span class="cx"> #include &quot;InlineElementBox.h&quot;
</span><span class="cx"> #include &quot;PseudoElement.h&quot;
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderInline.h&quot;
</span><span class="cx"> #include &quot;RenderListMarker.h&quot;
</span><span class="cx"> #include &quot;RenderMultiColumnFlowThread.h&quot;
</span><span class="lines">@@ -227,23 +228,23 @@
</span><span class="cx"> static RenderBlock* getParentOfFirstLineBox(RenderBlock&amp; current, RenderObject&amp; marker)
</span><span class="cx"> {
</span><span class="cx">     bool inQuirksMode = current.document().inQuirksMode();
</span><del>-    for (RenderObject* child = current.firstChild(); child; child = child-&gt;nextSibling()) {
-        if (child == &amp;marker)
</del><ins>+    for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(current)) {
+        if (&amp;child == &amp;marker)
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        if (child-&gt;isInline() &amp;&amp; (!is&lt;RenderInline&gt;(*child) || current.generatesLineBoxesForInlineChild(child)))
</del><ins>+        if (child.isInline() &amp;&amp; (!is&lt;RenderInline&gt;(child) || current.generatesLineBoxesForInlineChild(&amp;child)))
</ins><span class="cx">             return &amp;current;
</span><span class="cx"> 
</span><del>-        if (child-&gt;isFloating() || child-&gt;isOutOfFlowPositioned())
</del><ins>+        if (child.isFloating() || child.isOutOfFlowPositioned())
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        if (is&lt;RenderTable&gt;(*child) || !is&lt;RenderBlock&gt;(*child) || (is&lt;RenderBox&gt;(*child) &amp;&amp; downcast&lt;RenderBox&gt;(*child).isWritingModeRoot()))
</del><ins>+        if (is&lt;RenderTable&gt;(child) || !is&lt;RenderBlock&gt;(child) || (is&lt;RenderBox&gt;(child) &amp;&amp; downcast&lt;RenderBox&gt;(child).isWritingModeRoot()))
</ins><span class="cx">             break;
</span><span class="cx"> 
</span><del>-        if (is&lt;RenderListItem&gt;(current) &amp;&amp; inQuirksMode &amp;&amp; child-&gt;node() &amp;&amp; isHTMLListElement(*child-&gt;node()))
</del><ins>+        if (is&lt;RenderListItem&gt;(current) &amp;&amp; inQuirksMode &amp;&amp; child.node() &amp;&amp; isHTMLListElement(*child.node()))
</ins><span class="cx">             break;
</span><span class="cx"> 
</span><del>-        if (RenderBlock* lineBox = getParentOfFirstLineBox(downcast&lt;RenderBlock&gt;(*child), marker))
</del><ins>+        if (RenderBlock* lineBox = getParentOfFirstLineBox(downcast&lt;RenderBlock&gt;(child), marker))
</ins><span class="cx">             return lineBox;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;PseudoElement.h&quot;
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderCounter.h&quot;
</span><span class="cx"> #include &quot;RenderFlowThread.h&quot;
</span><span class="cx"> #include &quot;RenderGeometryMap.h&quot;
</span><span class="lines">@@ -168,12 +169,15 @@
</span><span class="cx"> {
</span><span class="cx">     setFlowThreadState(state);
</span><span class="cx"> 
</span><del>-    for (RenderObject* child = firstChildSlow(); child; child = child-&gt;nextSibling()) {
</del><ins>+    if (!is&lt;RenderElement&gt;(*this))
+        return;
+
+    for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(downcast&lt;RenderElement&gt;(*this))) {
</ins><span class="cx">         // If the child is a fragmentation context it already updated the descendants flag accordingly.
</span><del>-        if (child-&gt;isRenderFlowThread())
</del><ins>+        if (child.isRenderFlowThread())
</ins><span class="cx">             continue;
</span><del>-        ASSERT(state != child-&gt;flowThreadState());
-        child-&gt;setFlowThreadStateIncludingDescendants(state);
</del><ins>+        ASSERT(state != child.flowThreadState());
+        child.setFlowThreadStateIncludingDescendants(state);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -800,8 +804,12 @@
</span><span class="cx"> {
</span><span class="cx">     if (hasLayer())
</span><span class="cx">         result.unite(absoluteBoundingBoxRectIgnoringTransforms());
</span><del>-    for (RenderObject* current = firstChildSlow(); current; current = current-&gt;nextSibling())
-        current-&gt;addAbsoluteRectForLayer(result);
</del><ins>+
+    if (!is&lt;RenderElement&gt;(*this))
+        return;
+
+    for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(downcast&lt;RenderElement&gt;(*this)))
+        child.addAbsoluteRectForLayer(result);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // FIXME: change this to use the subtreePaint terminology
</span><span class="lines">@@ -809,8 +817,10 @@
</span><span class="cx"> {
</span><span class="cx">     LayoutRect result = absoluteBoundingBoxRectIgnoringTransforms();
</span><span class="cx">     topLevelRect = result;
</span><del>-    for (RenderObject* current = firstChildSlow(); current; current = current-&gt;nextSibling())
-        current-&gt;addAbsoluteRectForLayer(result);
</del><ins>+    if (is&lt;RenderElement&gt;(*this)) {
+        for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(downcast&lt;RenderElement&gt;(*this)))
+            child.addAbsoluteRectForLayer(result);
+    }
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1588,8 +1598,10 @@
</span><span class="cx">     if (isRenderFlowThread())
</span><span class="cx">         shouldUpdateState = false;
</span><span class="cx"> 
</span><del>-    for (RenderObject* child = firstChildSlow(); child; child = child-&gt;nextSibling())
-        child-&gt;removeFromRenderFlowThreadIncludingDescendants(shouldUpdateState);
</del><ins>+    if (is&lt;RenderElement&gt;(*this)) {
+        for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(downcast&lt;RenderElement&gt;(*this)))
+            child.removeFromRenderFlowThreadIncludingDescendants(shouldUpdateState);
+    }
</ins><span class="cx"> 
</span><span class="cx">     // We have to ask for our containing flow thread as it may be above the removed sub-tree.
</span><span class="cx">     RenderFlowThread* flowThreadContainingBlock = this-&gt;flowThreadContainingBlock();
</span><span class="lines">@@ -1627,8 +1639,11 @@
</span><span class="cx">     if (flowThread)
</span><span class="cx">         flowThread-&gt;removeFlowChildInfo(this);
</span><span class="cx"> 
</span><del>-    for (RenderObject* child = firstChildSlow(); child; child = child-&gt;nextSibling())
-        child-&gt;invalidateFlowThreadContainingBlockIncludingDescendants(flowThread);
</del><ins>+    if (!is&lt;RenderElement&gt;(*this))
+        return;
+
+    for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(downcast&lt;RenderElement&gt;(*this)))
+        child.invalidateFlowThreadContainingBlockIncludingDescendants(flowThread);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void collapseAnonymousTableRowsIfNeeded(const RenderObject&amp; rendererToBeDestroyed)
</span><span class="lines">@@ -1723,8 +1738,12 @@
</span><span class="cx">     setIsDragging(dragOn);
</span><span class="cx">     if (valueChanged &amp;&amp; node() &amp;&amp; (style().affectedByDrag() || (is&lt;Element&gt;(*node()) &amp;&amp; downcast&lt;Element&gt;(*node()).childrenAffectedByDrag())))
</span><span class="cx">         node()-&gt;setNeedsStyleRecalc();
</span><del>-    for (RenderObject* curr = firstChildSlow(); curr; curr = curr-&gt;nextSibling())
-        curr-&gt;updateDragState(dragOn);
</del><ins>+
+    if (!is&lt;RenderElement&gt;(*this))
+        return;
+
+    for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(downcast&lt;RenderElement&gt;(*this)))
+        child.updateDragState(dragOn);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderObject::isComposited() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTable.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;HTMLTableElement.h&quot;
</span><span class="cx"> #include &quot;LayoutRepainter.h&quot;
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderIterator.h&quot;
</span><span class="cx"> #include &quot;RenderLayer.h&quot;
</span><span class="cx"> #include &quot;RenderNamedFlowFragment.h&quot;
</span><span class="lines">@@ -879,12 +880,12 @@
</span><span class="cx"> 
</span><span class="cx"> RenderTableCol* RenderTable::firstColumn() const
</span><span class="cx"> {
</span><del>-    for (RenderObject* child = firstChild(); child; child = child-&gt;nextSibling()) {
-        if (is&lt;RenderTableCol&gt;(*child))
-            return downcast&lt;RenderTableCol&gt;(child);
</del><ins>+    for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(*this)) {
+        if (is&lt;RenderTableCol&gt;(child))
+            return &amp;const_cast&lt;RenderTableCol&amp;&gt;(downcast&lt;RenderTableCol&gt;(child));
</ins><span class="cx"> 
</span><span class="cx">         // We allow only table-captions before columns or column-groups.
</span><del>-        if (!is&lt;RenderTableCaption&gt;(*child))
</del><ins>+        if (!is&lt;RenderTableCaption&gt;(child))
</ins><span class="cx">             return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableColcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableCol.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableCol.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/RenderTableCol.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;HTMLTableColElement.h&quot;
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderIterator.h&quot;
</span><span class="cx"> #include &quot;RenderTable.h&quot;
</span><span class="cx"> #include &quot;RenderTableCaption.h&quot;
</span><span class="lines">@@ -131,8 +132,8 @@
</span><span class="cx"> {
</span><span class="cx">     setPreferredLogicalWidthsDirty(false);
</span><span class="cx"> 
</span><del>-    for (RenderObject* child = firstChild(); child; child = child-&gt;nextSibling())
-        child-&gt;setPreferredLogicalWidthsDirty(false);
</del><ins>+    for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(*this))
+        child.setPreferredLogicalWidthsDirty(false);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderTable* RenderTableCol::table() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableSectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableSection.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;HitTestResult.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;PaintInfo.h&quot;
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderNamedFlowFragment.h&quot;
</span><span class="cx"> #include &quot;RenderTableCell.h&quot;
</span><span class="cx"> #include &quot;RenderTableCol.h&quot;
</span><span class="lines">@@ -570,11 +571,11 @@
</span><span class="cx">             bool flexAllChildren = cell-&gt;style().logicalHeight().isFixed()
</span><span class="cx">                 || (!table()-&gt;style().logicalHeight().isAuto() &amp;&amp; rHeight != cell-&gt;logicalHeight());
</span><span class="cx"> 
</span><del>-            for (RenderObject* renderer = cell-&gt;firstChild(); renderer; renderer = renderer-&gt;nextSibling()) {
-                if (!is&lt;RenderText&gt;(*renderer) &amp;&amp; renderer-&gt;style().logicalHeight().isPercentOrCalculated() &amp;&amp; (flexAllChildren || ((renderer-&gt;isReplaced() || (is&lt;RenderBox&gt;(*renderer) &amp;&amp; downcast&lt;RenderBox&gt;(*renderer).scrollsOverflow())) &amp;&amp; !is&lt;RenderTextControl&gt;(*renderer)))) {
</del><ins>+            for (auto&amp; renderer : childrenOfType&lt;RenderObject&gt;(*cell)) {
+                if (!is&lt;RenderText&gt;(renderer) &amp;&amp; renderer.style().logicalHeight().isPercentOrCalculated() &amp;&amp; (flexAllChildren || ((renderer.isReplaced() || (is&lt;RenderBox&gt;(renderer) &amp;&amp; downcast&lt;RenderBox&gt;(renderer).scrollsOverflow())) &amp;&amp; !is&lt;RenderTextControl&gt;(renderer)))) {
</ins><span class="cx">                     // Tables with no sections do not flex.
</span><del>-                    if (!is&lt;RenderTable&gt;(*renderer) || downcast&lt;RenderTable&gt;(*renderer).hasSections()) {
-                        renderer-&gt;setNeedsLayout(MarkOnlyThis);
</del><ins>+                    if (!is&lt;RenderTable&gt;(renderer) || downcast&lt;RenderTable&gt;(renderer).hasSections()) {
+                        renderer.setNeedsLayout(MarkOnlyThis);
</ins><span class="cx">                         cellChildrenFlex = true;
</span><span class="cx">                     }
</span><span class="cx">                 }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTreeAsTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -566,10 +566,10 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">     } else {
</span><del>-        for (RenderObject* child = downcast&lt;RenderElement&gt;(o).firstChild(); child; child = child-&gt;nextSibling()) {
-            if (child-&gt;hasLayer())
</del><ins>+        for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(downcast&lt;RenderElement&gt;(o))) {
+            if (child.hasLayer())
</ins><span class="cx">                 continue;
</span><del>-            write(ts, *child, indent + 1, behavior);
</del><ins>+            write(ts, child, indent + 1, behavior);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -118,14 +118,14 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool findPreviousAndNextAttributes(RenderElement* start, RenderSVGInlineText* locateElement, bool&amp; stopAfterNext, SVGTextLayoutAttributes*&amp; previous, SVGTextLayoutAttributes*&amp; next)
</del><ins>+static inline bool findPreviousAndNextAttributes(RenderElement&amp; start, RenderSVGInlineText* locateElement, bool&amp; stopAfterNext, SVGTextLayoutAttributes*&amp; previous, SVGTextLayoutAttributes*&amp; next)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(start);
</span><span class="cx">     ASSERT(locateElement);
</span><span class="cx">     // FIXME: Make this iterative.
</span><del>-    for (RenderObject* child = start-&gt;firstChild(); child; child = child-&gt;nextSibling()) {
-        if (is&lt;RenderSVGInlineText&gt;(*child)) {
-            RenderSVGInlineText&amp; text = downcast&lt;RenderSVGInlineText&gt;(*child);
</del><ins>+    for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(start)) {
+        if (is&lt;RenderSVGInlineText&gt;(child)) {
+            auto&amp; text = downcast&lt;RenderSVGInlineText&gt;(child);
</ins><span class="cx">             if (locateElement != &amp;text) {
</span><span class="cx">                 if (stopAfterNext) {
</span><span class="cx">                     next = text.layoutAttributes();
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!is&lt;RenderSVGInline&gt;(*child))
</del><ins>+        if (!is&lt;RenderSVGInline&gt;(child))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         if (findPreviousAndNextAttributes(downcast&lt;RenderElement&gt;(child), locateElement, stopAfterNext, previous, next))
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx">             SVGTextLayoutAttributes* previous = 0;
</span><span class="cx">             SVGTextLayoutAttributes* next = 0;
</span><span class="cx">             ASSERT_UNUSED(child, &amp;attributes-&gt;context() == child);
</span><del>-            findPreviousAndNextAttributes(this, &amp;attributes-&gt;context(), stopAfterNext, previous, next);
</del><ins>+            findPreviousAndNextAttributes(*this, &amp;attributes-&gt;context(), stopAfterNext, previous, next);
</ins><span class="cx"> 
</span><span class="cx">             if (previous)
</span><span class="cx">                 m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(previous-&gt;context());
</span><span class="lines">@@ -252,7 +252,7 @@
</span><span class="cx">     SVGTextLayoutAttributes* previous = nullptr;
</span><span class="cx">     SVGTextLayoutAttributes* next = nullptr;
</span><span class="cx">     if (!documentBeingDestroyed())
</span><del>-        findPreviousAndNextAttributes(this, &amp;text, stopAfterNext, previous, next);
</del><ins>+        findPreviousAndNextAttributes(*this, &amp;text, stopAfterNext, previous, next);
</ins><span class="cx"> 
</span><span class="cx">     if (previous)
</span><span class="cx">         affectedAttributes.append(previous);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRenderSupportcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;SVGRenderSupport.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;NodeRenderStyle.h&quot;
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderElement.h&quot;
</span><span class="cx"> #include &quot;RenderGeometryMap.h&quot;
</span><span class="cx"> #include &quot;RenderIterator.h&quot;
</span><span class="lines">@@ -131,7 +132,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Update a bounding box taking into account the validity of the other bounding box.
</span><del>-static inline void updateObjectBoundingBox(FloatRect&amp; objectBoundingBox, bool&amp; objectBoundingBoxValid, RenderObject* other, FloatRect otherBoundingBox)
</del><ins>+static inline void updateObjectBoundingBox(FloatRect&amp; objectBoundingBox, bool&amp; objectBoundingBoxValid, const RenderObject* other, FloatRect otherBoundingBox)
</ins><span class="cx"> {
</span><span class="cx">     bool otherValid = is&lt;RenderSVGContainer&gt;(*other) ? downcast&lt;RenderSVGContainer&gt;(*other).isObjectBoundingBoxValid() : true;
</span><span class="cx">     if (!otherValid)
</span><span class="lines">@@ -155,21 +156,21 @@
</span><span class="cx">     // When computing the strokeBoundingBox, we use the repaintRects of the container's children so that the container's stroke includes
</span><span class="cx">     // the resources applied to the children (such as clips and filters). This allows filters applied to containers to correctly bound
</span><span class="cx">     // the children, and also improves inlining of SVG content, as the stroke bound is used in that situation also.
</span><del>-    for (RenderObject* current = container.firstChild(); current; current = current-&gt;nextSibling()) {
-        if (current-&gt;isSVGHiddenContainer())
</del><ins>+    for (auto&amp; current : childrenOfType&lt;RenderObject&gt;(container)) {
+        if (current.isSVGHiddenContainer())
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         // Don't include elements in the union that do not render.
</span><del>-        if (is&lt;RenderSVGShape&gt;(*current) &amp;&amp; downcast&lt;RenderSVGShape&gt;(*current).isRenderingDisabled())
</del><ins>+        if (is&lt;RenderSVGShape&gt;(current) &amp;&amp; downcast&lt;RenderSVGShape&gt;(current).isRenderingDisabled())
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        const AffineTransform&amp; transform = current-&gt;localToParentTransform();
</del><ins>+        const AffineTransform&amp; transform = current.localToParentTransform();
</ins><span class="cx">         if (transform.isIdentity()) {
</span><del>-            updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, current, current-&gt;objectBoundingBox());
-            strokeBoundingBox.unite(current-&gt;repaintRectInLocalCoordinates());
</del><ins>+            updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, &amp;current, current.objectBoundingBox());
+            strokeBoundingBox.unite(current.repaintRectInLocalCoordinates());
</ins><span class="cx">         } else {
</span><del>-            updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, current, transform.mapRect(current-&gt;objectBoundingBox()));
-            strokeBoundingBox.unite(transform.mapRect(current-&gt;repaintRectInLocalCoordinates()));
</del><ins>+            updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, &amp;current, transform.mapRect(current.objectBoundingBox()));
+            strokeBoundingBox.unite(transform.mapRect(current.repaintRectInLocalCoordinates()));
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -247,58 +248,57 @@
</span><span class="cx">     bool needsBoundariesUpdate = start.needsBoundariesUpdate();
</span><span class="cx">     HashSet&lt;RenderElement*&gt; elementsThatDidNotReceiveLayout;
</span><span class="cx"> 
</span><del>-    for (RenderObject* child = start.firstChild(); child; child = child-&gt;nextSibling()) {
</del><ins>+    for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(start)) {
</ins><span class="cx">         bool needsLayout = selfNeedsLayout;
</span><del>-        bool childEverHadLayout = child-&gt;everHadLayout();
</del><ins>+        bool childEverHadLayout = child.everHadLayout();
</ins><span class="cx"> 
</span><span class="cx">         if (needsBoundariesUpdate &amp;&amp; hasSVGShadow) {
</span><span class="cx">             // If we have a shadow, our shadow is baked into our children's cached boundaries,
</span><span class="cx">             // so they need to update.
</span><del>-            child-&gt;setNeedsBoundariesUpdate();
</del><ins>+            child.setNeedsBoundariesUpdate();
</ins><span class="cx">             needsLayout = true;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (transformChanged) {
</span><span class="cx">             // If the transform changed we need to update the text metrics (note: this also happens for layoutSizeChanged=true).
</span><del>-            if (is&lt;RenderSVGText&gt;(*child))
-                downcast&lt;RenderSVGText&gt;(*child).setNeedsTextMetricsUpdate();
</del><ins>+            if (is&lt;RenderSVGText&gt;(child))
+                downcast&lt;RenderSVGText&gt;(child).setNeedsTextMetricsUpdate();
</ins><span class="cx">             needsLayout = true;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (layoutSizeChanged) {
</del><ins>+        if (layoutSizeChanged &amp;&amp; is&lt;SVGElement&gt;(child.node())) {
</ins><span class="cx">             // When selfNeedsLayout is false and the layout size changed, we have to check whether this child uses relative lengths
</span><del>-            if (SVGElement* element = is&lt;SVGElement&gt;(*child-&gt;node()) ? downcast&lt;SVGElement&gt;(child-&gt;node()) : nullptr) {
-                if (element-&gt;hasRelativeLengths()) {
-                    // When the layout size changed and when using relative values tell the RenderSVGShape to update its shape object
-                    if (is&lt;RenderSVGShape&gt;(*child))
-                        downcast&lt;RenderSVGShape&gt;(*child).setNeedsShapeUpdate();
-                    else if (is&lt;RenderSVGText&gt;(*child)) {
-                        RenderSVGText&amp; svgText = downcast&lt;RenderSVGText&gt;(*child);
-                        svgText.setNeedsTextMetricsUpdate();
-                        svgText.setNeedsPositioningValuesUpdate();
-                    }
</del><ins>+            auto&amp; element = downcast&lt;SVGElement&gt;(*child.node());
+            if (element.hasRelativeLengths()) {
+                // When the layout size changed and when using relative values tell the RenderSVGShape to update its shape object
+                if (is&lt;RenderSVGShape&gt;(child))
+                    downcast&lt;RenderSVGShape&gt;(child).setNeedsShapeUpdate();
+                else if (is&lt;RenderSVGText&gt;(child)) {
+                    auto&amp; svgText = downcast&lt;RenderSVGText&gt;(child);
+                    svgText.setNeedsTextMetricsUpdate();
+                    svgText.setNeedsPositioningValuesUpdate();
+                }
</ins><span class="cx"> 
</span><del>-                    needsLayout = true;
-                }
</del><ins>+                needsLayout = true;
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (needsLayout)
</span><del>-            child-&gt;setNeedsLayout(MarkOnlyThis);
</del><ins>+            child.setNeedsLayout(MarkOnlyThis);
</ins><span class="cx"> 
</span><del>-        if (child-&gt;needsLayout()) {
-            layoutDifferentRootIfNeeded(downcast&lt;RenderElement&gt;(*child));
-            downcast&lt;RenderElement&gt;(*child).layout();
</del><ins>+        if (child.needsLayout()) {
+            layoutDifferentRootIfNeeded(downcast&lt;RenderElement&gt;(child));
+            downcast&lt;RenderElement&gt;(child).layout();
</ins><span class="cx">             // Renderers are responsible for repainting themselves when changing, except
</span><span class="cx">             // for the initial paint to avoid potential double-painting caused by non-sensical &quot;old&quot; bounds.
</span><span class="cx">             // We could handle this in the individual objects, but for now it's easier to have
</span><span class="cx">             // parent containers call repaint().  (RenderBlock::layout* has similar logic.)
</span><span class="cx">             if (!childEverHadLayout)
</span><del>-                child-&gt;repaint();
-        } else if (layoutSizeChanged &amp;&amp; is&lt;RenderElement&gt;(*child))
-            elementsThatDidNotReceiveLayout.add(downcast&lt;RenderElement&gt;(child));
</del><ins>+                child.repaint();
+        } else if (layoutSizeChanged &amp;&amp; is&lt;RenderElement&gt;(child))
+            elementsThatDidNotReceiveLayout.add(&amp;downcast&lt;RenderElement&gt;(child));
</ins><span class="cx"> 
</span><del>-        ASSERT(!child-&gt;needsLayout());
</del><ins>+        ASSERT(!child.needsLayout());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!layoutSizeChanged) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextLayoutAttributesBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -20,6 +20,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;SVGTextLayoutAttributesBuilder.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderSVGInline.h&quot;
</span><span class="cx"> #include &quot;RenderSVGInlineText.h&quot;
</span><span class="cx"> #include &quot;RenderSVGText.h&quot;
</span><span class="lines">@@ -98,16 +99,16 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!is&lt;RenderSVGText&gt;(start) || m_textPositions.isEmpty());
</span><span class="cx"> 
</span><del>-    for (RenderObject* child = start.firstChild(); child; child = child-&gt;nextSibling()) {
-        if (is&lt;RenderSVGInlineText&gt;(*child)) {
-            processRenderSVGInlineText(downcast&lt;RenderSVGInlineText&gt;(*child), m_textLength, lastCharacterWasSpace);
</del><ins>+    for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(start)) {
+        if (is&lt;RenderSVGInlineText&gt;(child)) {
+            processRenderSVGInlineText(downcast&lt;RenderSVGInlineText&gt;(child), m_textLength, lastCharacterWasSpace);
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!is&lt;RenderSVGInline&gt;(*child))
</del><ins>+        if (!is&lt;RenderSVGInline&gt;(child))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        RenderSVGInline&amp; inlineChild = downcast&lt;RenderSVGInline&gt;(*child);
</del><ins>+        auto&amp; inlineChild = downcast&lt;RenderSVGInline&gt;(child);
</ins><span class="cx">         SVGTextPositioningElement* element = SVGTextPositioningElement::elementFromRenderer(inlineChild);
</span><span class="cx"> 
</span><span class="cx">         unsigned atPosition = m_textPositions.size();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextMetricsBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp (201051 => 201052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp        2016-05-17 22:34:45 UTC (rev 201051)
+++ trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp        2016-05-17 22:39:00 UTC (rev 201052)
</span><span class="lines">@@ -20,6 +20,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;SVGTextMetricsBuilder.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;RenderChildIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderSVGInline.h&quot;
</span><span class="cx"> #include &quot;RenderSVGInlineText.h&quot;
</span><span class="cx"> #include &quot;RenderSVGText.h&quot;
</span><span class="lines">@@ -171,9 +172,9 @@
</span><span class="cx"> 
</span><span class="cx"> void SVGTextMetricsBuilder::walkTree(RenderElement&amp; start, RenderSVGInlineText* stopAtLeaf, MeasureTextData* data)
</span><span class="cx"> {
</span><del>-    for (auto* child = start.firstChild(); child; child = child-&gt;nextSibling()) {
-        if (is&lt;RenderSVGInlineText&gt;(*child)) {
-            RenderSVGInlineText&amp; text = downcast&lt;RenderSVGInlineText&gt;(*child);
</del><ins>+    for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(start)) {
+        if (is&lt;RenderSVGInlineText&gt;(child)) {
+            auto&amp; text = downcast&lt;RenderSVGInlineText&gt;(child);
</ins><span class="cx">             if (stopAtLeaf &amp;&amp; stopAtLeaf != &amp;text) {
</span><span class="cx">                 data-&gt;processRenderer = false;
</span><span class="cx">                 measureTextRenderer(text, data);
</span><span class="lines">@@ -188,10 +189,10 @@
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!is&lt;RenderSVGInline&gt;(*child))
</del><ins>+        if (!is&lt;RenderSVGInline&gt;(child))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        walkTree(downcast&lt;RenderSVGInline&gt;(*child), stopAtLeaf, data);
</del><ins>+        walkTree(downcast&lt;RenderSVGInline&gt;(child), stopAtLeaf, data);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>