<!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 <cdumez@apple.com>
+
+ 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 <dino@apple.com>
</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 "InstrumentingAgents.h"
</span><span class="cx"> #include "IntRect.h"
</span><span class="cx"> #include "PseudoElement.h"
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderLayer.h"
</span><span class="cx"> #include "RenderLayerBacking.h"
</span><span class="cx"> #include "RenderLayerCompositor.h"
</span><span class="lines">@@ -105,30 +106,31 @@
</span><span class="cx"> {
</span><span class="cx"> layers = Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>::create();
</span><span class="cx">
</span><del>- Node* node = m_instrumentingAgents.inspectorDOMAgent()->nodeForId(nodeId);
</del><ins>+ auto* node = m_instrumentingAgents.inspectorDOMAgent()->nodeForId(nodeId);
</ins><span class="cx"> if (!node) {
</span><span class="cx"> errorString = ASCIILiteral("Provided node id doesn't match any known node");
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RenderObject* renderer = node->renderer();
</del><ins>+ auto* renderer = node->renderer();
</ins><span class="cx"> if (!renderer) {
</span><span class="cx"> errorString = ASCIILiteral("Node for provided node id doesn't have a renderer");
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- gatherLayersUsingRenderObjectHierarchy(errorString, renderer, layers);
</del><ins>+ if (is<RenderElement>(*renderer))
+ gatherLayersUsingRenderObjectHierarchy(errorString, downcast<RenderElement>(*renderer), layers);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy(ErrorString& errorString, RenderObject* renderer, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>& layers)
</del><ins>+void InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy(ErrorString& errorString, RenderElement& renderer, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>& layers)
</ins><span class="cx"> {
</span><del>- if (renderer->hasLayer()) {
- gatherLayersUsingRenderLayerHierarchy(errorString, downcast<RenderLayerModelObject>(*renderer).layer(), layers);
</del><ins>+ if (renderer.hasLayer()) {
+ gatherLayersUsingRenderLayerHierarchy(errorString, downcast<RenderLayerModelObject>(renderer).layer(), layers);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- for (renderer = renderer->firstChildSlow(); renderer; renderer = renderer->nextSibling())
- gatherLayersUsingRenderObjectHierarchy(errorString, renderer, layers);
</del><ins>+ for (auto& child : childrenOfType<RenderElement>(renderer))
+ gatherLayersUsingRenderObjectHierarchy(errorString, child, layers);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorLayerTreeAgent::gatherLayersUsingRenderLayerHierarchy(ErrorString& errorString, RenderLayer* renderLayer, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>& 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&, RenderObject*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>&);
</del><ins>+ void gatherLayersUsingRenderObjectHierarchy(ErrorString&, RenderElement&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>&);
</ins><span class="cx"> void gatherLayersUsingRenderLayerHierarchy(ErrorString&, RenderLayer*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>&);
</span><span class="cx">
</span><span class="cx"> Ref<Inspector::Protocol::LayerTree::Layer> buildObjectForLayer(ErrorString&, 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 "config.h"
</span><span class="cx"> #include "AutoTableLayout.h"
</span><span class="cx">
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderTable.h"
</span><span class="cx"> #include "RenderTableCell.h"
</span><span class="cx"> #include "RenderTableCol.h"
</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->firstChild(); child; child = child->nextSibling()) {
- if (is<RenderTableCol>(*child)) {
</del><ins>+ for (auto& child : childrenOfType<RenderObject>(*m_table)) {
+ if (is<RenderTableCol>(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<RenderTableCol>(*child).clearPreferredLogicalWidthsDirtyBits();
- } else if (is<RenderTableSection>(*child)) {
- RenderTableSection& section = downcast<RenderTableSection>(*child);
</del><ins>+ downcast<RenderTableCol>(child).clearPreferredLogicalWidthsDirtyBits();
+ } else if (is<RenderTableSection>(child)) {
+ auto& section = downcast<RenderTableSection>(child);
</ins><span class="cx"> unsigned numRows = section.numRows();
</span><span class="cx"> for (unsigned i = 0; i < 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 "BidiRun.h"
</span><span class="cx"> #include "RenderBlockFlow.h"
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderInline.h"
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="lines">@@ -209,15 +210,15 @@
</span><span class="cx">
</span><span class="cx"> static bool isEmptyInline(const RenderInline& renderer)
</span><span class="cx"> {
</span><del>- for (RenderObject* current = renderer.firstChild(); current; current = current->nextSibling()) {
- if (current->isFloatingOrOutOfFlowPositioned())
</del><ins>+ for (auto& current : childrenOfType<RenderObject>(renderer)) {
+ if (current.isFloatingOrOutOfFlowPositioned())
</ins><span class="cx"> continue;
</span><del>- if (is<RenderText>(*current)) {
- if (!downcast<RenderText>(*current).isAllCollapsibleWhitespace())
</del><ins>+ if (is<RenderText>(current)) {
+ if (!downcast<RenderText>(current).isAllCollapsibleWhitespace())
</ins><span class="cx"> return false;
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (!is<RenderInline>(*current) || !isEmptyInline(downcast<RenderInline>(*current)))
</del><ins>+ if (!is<RenderInline>(current) || !isEmptyInline(downcast<RenderInline>(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 "RenderBlockFlow.h"
</span><span class="cx"> #include "RenderBoxRegionInfo.h"
</span><span class="cx"> #include "RenderButton.h"
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderCombineText.h"
</span><span class="cx"> #include "RenderDeprecatedFlexibleBox.h"
</span><span class="cx"> #include "RenderFlexibleBox.h"
</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->nextSibling()) {
- if (!is<RenderText>(*child) && !is<RenderListMarker>(*child) && is<RenderBox>(*child)) {
- auto& box = downcast<RenderBox>(*child);
- FloatPoint pos;
- // FIXME: This doesn't work correctly with transforms.
- if (box.layer())
- pos = child->localToContainerPoint(FloatPoint(), paintContainer);
- else
- pos = FloatPoint(additionalOffset.x() + box.x(), additionalOffset.y() + box.y());
- box.addFocusRingRects(rects, flooredLayoutPoint(pos), paintContainer);
- }
</del><ins>+ for (auto& box : childrenOfType<RenderBox>(*this)) {
+ if (is<RenderListMarker>(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 "Page.h"
</span><span class="cx"> #include "PaintInfo.h"
</span><span class="cx"> #include "RenderBoxRegionInfo.h"
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderDeprecatedFlexibleBox.h"
</span><span class="cx"> #include "RenderFlexibleBox.h"
</span><span class="cx"> #include "RenderGeometryMap.h"
</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->nextSibling()) {
- if (!is<RenderBox>(*renderObject))
- continue;
-
</del><ins>+ for (auto& renderer : childrenOfType<RenderBox>(*this)) {
</ins><span class="cx"> if (is<RenderFlowThread>(*this)) {
</span><span class="cx"> ASSERT(region);
</span><del>- if (!downcast<RenderFlowThread>(*this).objectShouldFragmentInFlowRegion(renderObject, region))
</del><ins>+ if (!downcast<RenderFlowThread>(*this).objectShouldFragmentInFlowRegion(&renderer, region))
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- auto& renderer = downcast<RenderBox>(*renderObject);
-
</del><span class="cx"> if ((!renderer.firstChild() && !renderer.isInline() && !is<RenderBlockFlow>(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 "Logging.h"
</span><span class="cx"> #include "PathUtilities.h"
</span><span class="cx"> #include "RenderBlock.h"
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderCounter.h"
</span><span class="cx"> #include "RenderDeprecatedFlexibleBox.h"
</span><span class="cx"> #include "RenderFlexibleBox.h"
</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->nextSibling()) {
- if (hasOutlineAuto == child->hasOutlineAutoAncestor())
</del><ins>+ for (auto& child : childrenOfType<RenderObject>(*this)) {
+ if (hasOutlineAuto == child.hasOutlineAutoAncestor())
</ins><span class="cx"> continue;
</span><del>- child->setHasOutlineAutoAncestor(hasOutlineAuto);
- bool childHasOutlineAuto = child->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<RenderElement>(child))
</span><span class="cx"> continue;
</span><del>- downcast<RenderElement>(*child).updateOutlineAutoAncestor(hasOutlineAuto);
</del><ins>+ downcast<RenderElement>(child).updateOutlineAutoAncestor(hasOutlineAuto);
</ins><span class="cx"> }
</span><span class="cx"> if (hasContinuation())
</span><span class="cx"> downcast<RenderBoxModelObject>(*this).continuation()->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&, const RenderStyle&, const Vector<LayoutRect>& focusRingRects);
</span><span class="cx"> void paintOutline(PaintInfo&, const LayoutRect&);
</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&, RenderStyle&&, 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 "HTMLFieldSetElement.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "PaintInfo.h"
</span><ins>+#include "RenderChildIterator.h"
</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 &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->nextSibling()) {
- if (option == IgnoreFloatingOrOutOfFlow && legend->isFloatingOrOutOfFlowPositioned())
</del><ins>+ for (auto& legend : childrenOfType<RenderElement>(*this)) {
+ if (option == IgnoreFloatingOrOutOfFlow && legend.isFloatingOrOutOfFlowPositioned())
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- if (is<HTMLLegendElement>(legend->node()))
- return downcast<RenderBox>(legend);
</del><ins>+ if (is<HTMLLegendElement>(legend.element()))
+ return &downcast<RenderBox>(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&, RenderStyle&&);
</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& fieldSetElement() const { return downcast<HTMLFieldSetElement>(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 "InlineTextBox.h"
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "RenderBlock.h"
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderFullScreen.h"
</span><span class="cx"> #include "RenderGeometryMap.h"
</span><span class="cx"> #include "RenderIterator.h"
</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->nextSibling()) {
- if (current->isFloatingOrOutOfFlowPositioned())
</del><ins>+ for (auto& current : childrenOfType<RenderObject>(*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<RenderBox>(*current)) {
- RenderBox& renderBox = downcast<RenderBox>(*current);
</del><ins>+ if (is<RenderBox>(current)) {
+ auto& renderBox = downcast<RenderBox>(current);
</ins><span class="cx"> if (renderBox.inlineBoxWrapper()) {
</span><span class="cx"> const RootInlineBox& rootBox = renderBox.inlineBoxWrapper()->root();
</span><span class="cx"> const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
</span><span class="lines">@@ -688,9 +689,9 @@
</span><span class="cx"> else
</span><span class="cx"> context.addRect(FloatRect(logicalTop, renderBox.inlineBoxWrapper()->y() - renderBox.marginTop(), logicalHeight, renderBox.height() + renderBox.verticalMarginExtent()));
</span><span class="cx"> }
</span><del>- } else if (is<RenderInline>(*current)) {
</del><ins>+ } else if (is<RenderInline>(current)) {
</ins><span class="cx"> // If the child doesn't need line boxes either, then we can recur.
</span><del>- RenderInline& renderInline = downcast<RenderInline>(*current);
</del><ins>+ auto& renderInline = downcast<RenderInline>(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<RenderText>(*current)) {
- RenderText& currText = downcast<RenderText>(*current);
</del><ins>+ } else if (is<RenderText>(current)) {
+ auto& currText = downcast<RenderText>(current);
</ins><span class="cx"> for (InlineTextBox* childText = currText.firstTextBox(); childText; childText = childText->nextTextBox()) {
</span><span class="cx"> const RootInlineBox& rootBox = childText->root();
</span><span class="cx"> const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
</span><span class="lines">@@ -724,8 +725,8 @@
</span><span class="cx"> else
</span><span class="cx"> context.addRect(FloatRect(logicalTop, childText->y(), logicalHeight, childText->logicalWidth()));
</span><span class="cx"> }
</span><del>- } else if (is<RenderLineBreak>(*current)) {
- if (InlineBox* inlineBox = downcast<RenderLineBreak>(*current).inlineBoxWrapper()) {
</del><ins>+ } else if (is<RenderLineBreak>(current)) {
+ if (auto* inlineBox = downcast<RenderLineBreak>(current).inlineBoxWrapper()) {
</ins><span class="cx"> // FIXME: This could use a helper to share these with text path.
</span><span class="cx"> const RootInlineBox& rootBox = inlineBox->root();
</span><span class="cx"> const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->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->nextSibling()) {
- if (current->isFloatingOrOutOfFlowPositioned())
</del><ins>+ for (auto& current : childrenOfType<RenderObject>(*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<RenderBox>(*current)) {
- const auto& renderBox = downcast<RenderBox>(*current);
</del><ins>+ if (is<RenderBox>(current)) {
+ auto& renderBox = downcast<RenderBox>(current);
</ins><span class="cx"> if (renderBox.inlineBoxWrapper())
</span><span class="cx"> return renderBox.inlineBoxWrapper();
</span><del>- } else if (is<RenderLineBreak>(*current)) {
- RenderLineBreak& renderBR = downcast<RenderLineBreak>(*current);
</del><ins>+ } else if (is<RenderLineBreak>(current)) {
+ auto& renderBR = downcast<RenderLineBreak>(current);
</ins><span class="cx"> if (renderBR.inlineBoxWrapper())
</span><span class="cx"> return renderBR.inlineBoxWrapper();
</span><del>- } else if (is<RenderInline>(*current)) {
- RenderInline& renderInline = downcast<RenderInline>(*current);
</del><ins>+ } else if (is<RenderInline>(current)) {
+ auto& renderInline = downcast<RenderInline>(current);
</ins><span class="cx"> if (InlineBox* result = renderInline.firstLineBoxIncludingCulling())
</span><span class="cx"> return result;
</span><del>- } else if (is<RenderText>(*current)) {
- RenderText& renderText = downcast<RenderText>(*current);
</del><ins>+ } else if (is<RenderText>(current)) {
+ auto& renderText = downcast<RenderText>(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->nextSibling()) {
- if (current->isFloatingOrOutOfFlowPositioned())
</del><ins>+ for (auto& current : childrenOfType<RenderObject>(*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<RenderBox>(*current)) {
- RenderBox& renderBox = downcast<RenderBox>(*current);
</del><ins>+ if (is<RenderBox>(current)) {
+ auto& renderBox = downcast<RenderBox>(current);
</ins><span class="cx"> if (!renderBox.hasSelfPaintingLayer() && renderBox.inlineBoxWrapper()) {
</span><span class="cx"> LayoutRect logicalRect = renderBox.logicalVisualOverflowRectForPropagation(&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<RenderInline>(*current)) {
</del><ins>+ } else if (is<RenderInline>(current)) {
</ins><span class="cx"> // If the child doesn't need line boxes either, then we can recur.
</span><del>- RenderInline& renderInline = downcast<RenderInline>(*current);
</del><ins>+ auto& renderInline = downcast<RenderInline>(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<RenderText>(*current)) {
</del><ins>+ } else if (is<RenderText>(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& renderText = downcast<RenderText>(*current);
</del><ins>+ auto& renderText = downcast<RenderText>(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->nextSibling()) {
- if (current->isFloatingOrOutOfFlowPositioned())
</del><ins>+ for (auto& current : childrenOfType<RenderObject>(*this)) {
+ if (current.isFloatingOrOutOfFlowPositioned())
</ins><span class="cx"> continue;
</span><del>- if (is<RenderBox>(*current) && !current->needsLayout()) {
- RenderBox& renderBox = downcast<RenderBox>(*current);
</del><ins>+ if (is<RenderBox>(current) && !current.needsLayout()) {
+ auto& renderBox = downcast<RenderBox>(current);
</ins><span class="cx"> if (renderBox.inlineBoxWrapper())
</span><span class="cx"> renderBox.inlineBoxWrapper()->root().markDirty();
</span><del>- } else if (!current->selfNeedsLayout()) {
- if (is<RenderInline>(*current)) {
- RenderInline& renderInline = downcast<RenderInline>(*current);
</del><ins>+ } else if (!current.selfNeedsLayout()) {
+ if (is<RenderInline>(current)) {
+ auto& renderInline = downcast<RenderInline>(current);
</ins><span class="cx"> for (InlineFlowBox* childLine = renderInline.firstLineBox(); childLine; childLine = childLine->nextLineBox())
</span><span class="cx"> childLine->root().markDirty();
</span><del>- } else if (is<RenderText>(*current)) {
- RenderText& renderText = downcast<RenderText>(*current);
</del><ins>+ } else if (is<RenderText>(current)) {
+ auto& renderText = downcast<RenderText>(current);
</ins><span class="cx"> for (InlineTextBox* childText = renderText.firstTextBox(); childText; childText = childText->nextTextBox())
</span><span class="cx"> childText->root().markDirty();
</span><del>- } else if (is<RenderLineBreak>(*current)) {
- RenderLineBreak& renderBR = downcast<RenderLineBreak>(*current);
</del><ins>+ } else if (is<RenderLineBreak>(current)) {
+ auto& renderBR = downcast<RenderLineBreak>(current);
</ins><span class="cx"> if (renderBR.inlineBoxWrapper())
</span><span class="cx"> renderBR.inlineBoxWrapper()->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 "HTMLUListElement.h"
</span><span class="cx"> #include "InlineElementBox.h"
</span><span class="cx"> #include "PseudoElement.h"
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderInline.h"
</span><span class="cx"> #include "RenderListMarker.h"
</span><span class="cx"> #include "RenderMultiColumnFlowThread.h"
</span><span class="lines">@@ -227,23 +228,23 @@
</span><span class="cx"> static RenderBlock* getParentOfFirstLineBox(RenderBlock& current, RenderObject& marker)
</span><span class="cx"> {
</span><span class="cx"> bool inQuirksMode = current.document().inQuirksMode();
</span><del>- for (RenderObject* child = current.firstChild(); child; child = child->nextSibling()) {
- if (child == &marker)
</del><ins>+ for (auto& child : childrenOfType<RenderObject>(current)) {
+ if (&child == &marker)
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- if (child->isInline() && (!is<RenderInline>(*child) || current.generatesLineBoxesForInlineChild(child)))
</del><ins>+ if (child.isInline() && (!is<RenderInline>(child) || current.generatesLineBoxesForInlineChild(&child)))
</ins><span class="cx"> return &current;
</span><span class="cx">
</span><del>- if (child->isFloating() || child->isOutOfFlowPositioned())
</del><ins>+ if (child.isFloating() || child.isOutOfFlowPositioned())
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- if (is<RenderTable>(*child) || !is<RenderBlock>(*child) || (is<RenderBox>(*child) && downcast<RenderBox>(*child).isWritingModeRoot()))
</del><ins>+ if (is<RenderTable>(child) || !is<RenderBlock>(child) || (is<RenderBox>(child) && downcast<RenderBox>(child).isWritingModeRoot()))
</ins><span class="cx"> break;
</span><span class="cx">
</span><del>- if (is<RenderListItem>(current) && inQuirksMode && child->node() && isHTMLListElement(*child->node()))
</del><ins>+ if (is<RenderListItem>(current) && inQuirksMode && child.node() && isHTMLListElement(*child.node()))
</ins><span class="cx"> break;
</span><span class="cx">
</span><del>- if (RenderBlock* lineBox = getParentOfFirstLineBox(downcast<RenderBlock>(*child), marker))
</del><ins>+ if (RenderBlock* lineBox = getParentOfFirstLineBox(downcast<RenderBlock>(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 "MainFrame.h"
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "PseudoElement.h"
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderCounter.h"
</span><span class="cx"> #include "RenderFlowThread.h"
</span><span class="cx"> #include "RenderGeometryMap.h"
</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->nextSibling()) {
</del><ins>+ if (!is<RenderElement>(*this))
+ return;
+
+ for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*this))) {
</ins><span class="cx"> // If the child is a fragmentation context it already updated the descendants flag accordingly.
</span><del>- if (child->isRenderFlowThread())
</del><ins>+ if (child.isRenderFlowThread())
</ins><span class="cx"> continue;
</span><del>- ASSERT(state != child->flowThreadState());
- child->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->nextSibling())
- current->addAbsoluteRectForLayer(result);
</del><ins>+
+ if (!is<RenderElement>(*this))
+ return;
+
+ for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*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->nextSibling())
- current->addAbsoluteRectForLayer(result);
</del><ins>+ if (is<RenderElement>(*this)) {
+ for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*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->nextSibling())
- child->removeFromRenderFlowThreadIncludingDescendants(shouldUpdateState);
</del><ins>+ if (is<RenderElement>(*this)) {
+ for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*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->flowThreadContainingBlock();
</span><span class="lines">@@ -1627,8 +1639,11 @@
</span><span class="cx"> if (flowThread)
</span><span class="cx"> flowThread->removeFlowChildInfo(this);
</span><span class="cx">
</span><del>- for (RenderObject* child = firstChildSlow(); child; child = child->nextSibling())
- child->invalidateFlowThreadContainingBlockIncludingDescendants(flowThread);
</del><ins>+ if (!is<RenderElement>(*this))
+ return;
+
+ for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*this)))
+ child.invalidateFlowThreadContainingBlockIncludingDescendants(flowThread);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static void collapseAnonymousTableRowsIfNeeded(const RenderObject& rendererToBeDestroyed)
</span><span class="lines">@@ -1723,8 +1738,12 @@
</span><span class="cx"> setIsDragging(dragOn);
</span><span class="cx"> if (valueChanged && node() && (style().affectedByDrag() || (is<Element>(*node()) && downcast<Element>(*node()).childrenAffectedByDrag())))
</span><span class="cx"> node()->setNeedsStyleRecalc();
</span><del>- for (RenderObject* curr = firstChildSlow(); curr; curr = curr->nextSibling())
- curr->updateDragState(dragOn);
</del><ins>+
+ if (!is<RenderElement>(*this))
+ return;
+
+ for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*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 "HTMLNames.h"
</span><span class="cx"> #include "HTMLTableElement.h"
</span><span class="cx"> #include "LayoutRepainter.h"
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderIterator.h"
</span><span class="cx"> #include "RenderLayer.h"
</span><span class="cx"> #include "RenderNamedFlowFragment.h"
</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->nextSibling()) {
- if (is<RenderTableCol>(*child))
- return downcast<RenderTableCol>(child);
</del><ins>+ for (auto& child : childrenOfType<RenderObject>(*this)) {
+ if (is<RenderTableCol>(child))
+ return &const_cast<RenderTableCol&>(downcast<RenderTableCol>(child));
</ins><span class="cx">
</span><span class="cx"> // We allow only table-captions before columns or column-groups.
</span><del>- if (!is<RenderTableCaption>(*child))
</del><ins>+ if (!is<RenderTableCaption>(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 "HTMLNames.h"
</span><span class="cx"> #include "HTMLTableColElement.h"
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderIterator.h"
</span><span class="cx"> #include "RenderTable.h"
</span><span class="cx"> #include "RenderTableCaption.h"
</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->nextSibling())
- child->setPreferredLogicalWidthsDirty(false);
</del><ins>+ for (auto& child : childrenOfType<RenderObject>(*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 "HitTestResult.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "PaintInfo.h"
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderNamedFlowFragment.h"
</span><span class="cx"> #include "RenderTableCell.h"
</span><span class="cx"> #include "RenderTableCol.h"
</span><span class="lines">@@ -570,11 +571,11 @@
</span><span class="cx"> bool flexAllChildren = cell->style().logicalHeight().isFixed()
</span><span class="cx"> || (!table()->style().logicalHeight().isAuto() && rHeight != cell->logicalHeight());
</span><span class="cx">
</span><del>- for (RenderObject* renderer = cell->firstChild(); renderer; renderer = renderer->nextSibling()) {
- if (!is<RenderText>(*renderer) && renderer->style().logicalHeight().isPercentOrCalculated() && (flexAllChildren || ((renderer->isReplaced() || (is<RenderBox>(*renderer) && downcast<RenderBox>(*renderer).scrollsOverflow())) && !is<RenderTextControl>(*renderer)))) {
</del><ins>+ for (auto& renderer : childrenOfType<RenderObject>(*cell)) {
+ if (!is<RenderText>(renderer) && renderer.style().logicalHeight().isPercentOrCalculated() && (flexAllChildren || ((renderer.isReplaced() || (is<RenderBox>(renderer) && downcast<RenderBox>(renderer).scrollsOverflow())) && !is<RenderTextControl>(renderer)))) {
</ins><span class="cx"> // Tables with no sections do not flex.
</span><del>- if (!is<RenderTable>(*renderer) || downcast<RenderTable>(*renderer).hasSections()) {
- renderer->setNeedsLayout(MarkOnlyThis);
</del><ins>+ if (!is<RenderTable>(renderer) || downcast<RenderTable>(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<RenderElement>(o).firstChild(); child; child = child->nextSibling()) {
- if (child->hasLayer())
</del><ins>+ for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(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& stopAfterNext, SVGTextLayoutAttributes*& previous, SVGTextLayoutAttributes*& next)
</del><ins>+static inline bool findPreviousAndNextAttributes(RenderElement& start, RenderSVGInlineText* locateElement, bool& stopAfterNext, SVGTextLayoutAttributes*& previous, SVGTextLayoutAttributes*& 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->firstChild(); child; child = child->nextSibling()) {
- if (is<RenderSVGInlineText>(*child)) {
- RenderSVGInlineText& text = downcast<RenderSVGInlineText>(*child);
</del><ins>+ for (auto& child : childrenOfType<RenderObject>(start)) {
+ if (is<RenderSVGInlineText>(child)) {
+ auto& text = downcast<RenderSVGInlineText>(child);
</ins><span class="cx"> if (locateElement != &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<RenderSVGInline>(*child))
</del><ins>+ if (!is<RenderSVGInline>(child))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> if (findPreviousAndNextAttributes(downcast<RenderElement>(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, &attributes->context() == child);
</span><del>- findPreviousAndNextAttributes(this, &attributes->context(), stopAfterNext, previous, next);
</del><ins>+ findPreviousAndNextAttributes(*this, &attributes->context(), stopAfterNext, previous, next);
</ins><span class="cx">
</span><span class="cx"> if (previous)
</span><span class="cx"> m_layoutAttributesBuilder.buildLayoutAttributesForTextRenderer(previous->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, &text, stopAfterNext, previous, next);
</del><ins>+ findPreviousAndNextAttributes(*this, &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 "SVGRenderSupport.h"
</span><span class="cx">
</span><span class="cx"> #include "NodeRenderStyle.h"
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderElement.h"
</span><span class="cx"> #include "RenderGeometryMap.h"
</span><span class="cx"> #include "RenderIterator.h"
</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& objectBoundingBox, bool& objectBoundingBoxValid, RenderObject* other, FloatRect otherBoundingBox)
</del><ins>+static inline void updateObjectBoundingBox(FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, const RenderObject* other, FloatRect otherBoundingBox)
</ins><span class="cx"> {
</span><span class="cx"> bool otherValid = is<RenderSVGContainer>(*other) ? downcast<RenderSVGContainer>(*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->nextSibling()) {
- if (current->isSVGHiddenContainer())
</del><ins>+ for (auto& current : childrenOfType<RenderObject>(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<RenderSVGShape>(*current) && downcast<RenderSVGShape>(*current).isRenderingDisabled())
</del><ins>+ if (is<RenderSVGShape>(current) && downcast<RenderSVGShape>(current).isRenderingDisabled())
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- const AffineTransform& transform = current->localToParentTransform();
</del><ins>+ const AffineTransform& transform = current.localToParentTransform();
</ins><span class="cx"> if (transform.isIdentity()) {
</span><del>- updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, current, current->objectBoundingBox());
- strokeBoundingBox.unite(current->repaintRectInLocalCoordinates());
</del><ins>+ updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, &current, current.objectBoundingBox());
+ strokeBoundingBox.unite(current.repaintRectInLocalCoordinates());
</ins><span class="cx"> } else {
</span><del>- updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, current, transform.mapRect(current->objectBoundingBox()));
- strokeBoundingBox.unite(transform.mapRect(current->repaintRectInLocalCoordinates()));
</del><ins>+ updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, &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<RenderElement*> elementsThatDidNotReceiveLayout;
</span><span class="cx">
</span><del>- for (RenderObject* child = start.firstChild(); child; child = child->nextSibling()) {
</del><ins>+ for (auto& child : childrenOfType<RenderObject>(start)) {
</ins><span class="cx"> bool needsLayout = selfNeedsLayout;
</span><del>- bool childEverHadLayout = child->everHadLayout();
</del><ins>+ bool childEverHadLayout = child.everHadLayout();
</ins><span class="cx">
</span><span class="cx"> if (needsBoundariesUpdate && 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->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<RenderSVGText>(*child))
- downcast<RenderSVGText>(*child).setNeedsTextMetricsUpdate();
</del><ins>+ if (is<RenderSVGText>(child))
+ downcast<RenderSVGText>(child).setNeedsTextMetricsUpdate();
</ins><span class="cx"> needsLayout = true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (layoutSizeChanged) {
</del><ins>+ if (layoutSizeChanged && is<SVGElement>(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<SVGElement>(*child->node()) ? downcast<SVGElement>(child->node()) : nullptr) {
- if (element->hasRelativeLengths()) {
- // When the layout size changed and when using relative values tell the RenderSVGShape to update its shape object
- if (is<RenderSVGShape>(*child))
- downcast<RenderSVGShape>(*child).setNeedsShapeUpdate();
- else if (is<RenderSVGText>(*child)) {
- RenderSVGText& svgText = downcast<RenderSVGText>(*child);
- svgText.setNeedsTextMetricsUpdate();
- svgText.setNeedsPositioningValuesUpdate();
- }
</del><ins>+ auto& element = downcast<SVGElement>(*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<RenderSVGShape>(child))
+ downcast<RenderSVGShape>(child).setNeedsShapeUpdate();
+ else if (is<RenderSVGText>(child)) {
+ auto& svgText = downcast<RenderSVGText>(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->setNeedsLayout(MarkOnlyThis);
</del><ins>+ child.setNeedsLayout(MarkOnlyThis);
</ins><span class="cx">
</span><del>- if (child->needsLayout()) {
- layoutDifferentRootIfNeeded(downcast<RenderElement>(*child));
- downcast<RenderElement>(*child).layout();
</del><ins>+ if (child.needsLayout()) {
+ layoutDifferentRootIfNeeded(downcast<RenderElement>(child));
+ downcast<RenderElement>(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 "old" 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->repaint();
- } else if (layoutSizeChanged && is<RenderElement>(*child))
- elementsThatDidNotReceiveLayout.add(downcast<RenderElement>(child));
</del><ins>+ child.repaint();
+ } else if (layoutSizeChanged && is<RenderElement>(child))
+ elementsThatDidNotReceiveLayout.add(&downcast<RenderElement>(child));
</ins><span class="cx">
</span><del>- ASSERT(!child->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 "config.h"
</span><span class="cx"> #include "SVGTextLayoutAttributesBuilder.h"
</span><span class="cx">
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderSVGInline.h"
</span><span class="cx"> #include "RenderSVGInlineText.h"
</span><span class="cx"> #include "RenderSVGText.h"
</span><span class="lines">@@ -98,16 +99,16 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!is<RenderSVGText>(start) || m_textPositions.isEmpty());
</span><span class="cx">
</span><del>- for (RenderObject* child = start.firstChild(); child; child = child->nextSibling()) {
- if (is<RenderSVGInlineText>(*child)) {
- processRenderSVGInlineText(downcast<RenderSVGInlineText>(*child), m_textLength, lastCharacterWasSpace);
</del><ins>+ for (auto& child : childrenOfType<RenderObject>(start)) {
+ if (is<RenderSVGInlineText>(child)) {
+ processRenderSVGInlineText(downcast<RenderSVGInlineText>(child), m_textLength, lastCharacterWasSpace);
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (!is<RenderSVGInline>(*child))
</del><ins>+ if (!is<RenderSVGInline>(child))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- RenderSVGInline& inlineChild = downcast<RenderSVGInline>(*child);
</del><ins>+ auto& inlineChild = downcast<RenderSVGInline>(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 "config.h"
</span><span class="cx"> #include "SVGTextMetricsBuilder.h"
</span><span class="cx">
</span><ins>+#include "RenderChildIterator.h"
</ins><span class="cx"> #include "RenderSVGInline.h"
</span><span class="cx"> #include "RenderSVGInlineText.h"
</span><span class="cx"> #include "RenderSVGText.h"
</span><span class="lines">@@ -171,9 +172,9 @@
</span><span class="cx">
</span><span class="cx"> void SVGTextMetricsBuilder::walkTree(RenderElement& start, RenderSVGInlineText* stopAtLeaf, MeasureTextData* data)
</span><span class="cx"> {
</span><del>- for (auto* child = start.firstChild(); child; child = child->nextSibling()) {
- if (is<RenderSVGInlineText>(*child)) {
- RenderSVGInlineText& text = downcast<RenderSVGInlineText>(*child);
</del><ins>+ for (auto& child : childrenOfType<RenderObject>(start)) {
+ if (is<RenderSVGInlineText>(child)) {
+ auto& text = downcast<RenderSVGInlineText>(child);
</ins><span class="cx"> if (stopAtLeaf && stopAtLeaf != &text) {
</span><span class="cx"> data->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<RenderSVGInline>(*child))
</del><ins>+ if (!is<RenderSVGInline>(child))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- walkTree(downcast<RenderSVGInline>(*child), stopAtLeaf, data);
</del><ins>+ walkTree(downcast<RenderSVGInline>(child), stopAtLeaf, data);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>