<!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>[191246] 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/191246">191246</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2015-10-17 12:14:53 -0700 (Sat, 17 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>RenderBlockFlow::xPositionForFloatIncludingMargin/yPositionForFloatIncludingMargin/flipFloatForWritingModeForChild
should all take FloatingObject reference.
https://bugs.webkit.org/show_bug.cgi?id=150267

Reviewed by Simon Fraser.

No change in behaviour.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::addOverflowFromFloats):
(WebCore::RenderBlockFlow::paintFloats):
(WebCore::RenderBlockFlow::clipOutFloatingObjects):
(WebCore::RenderBlockFlow::addOverhangingFloats):
(WebCore::RenderBlockFlow::flipFloatForWritingModeForChild):
(WebCore::RenderBlockFlow::hitTestFloats):
(WebCore::RenderBlockFlow::adjustForBorderFit):
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::xPositionForFloatIncludingMargin):
(WebCore::RenderBlockFlow::yPositionForFloatIncludingMargin):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowcpp">trunk/Source/WebCore/rendering/RenderBlockFlow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowh">trunk/Source/WebCore/rendering/RenderBlockFlow.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191245 => 191246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-17 18:49:02 UTC (rev 191245)
+++ trunk/Source/WebCore/ChangeLog        2015-10-17 19:14:53 UTC (rev 191246)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2015-10-17  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        RenderBlockFlow::xPositionForFloatIncludingMargin/yPositionForFloatIncludingMargin/flipFloatForWritingModeForChild
+        should all take FloatingObject reference.
+        https://bugs.webkit.org/show_bug.cgi?id=150267
+
+        Reviewed by Simon Fraser.
+
+        No change in behaviour.
+
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::addOverflowFromFloats):
+        (WebCore::RenderBlockFlow::paintFloats):
+        (WebCore::RenderBlockFlow::clipOutFloatingObjects):
+        (WebCore::RenderBlockFlow::addOverhangingFloats):
+        (WebCore::RenderBlockFlow::flipFloatForWritingModeForChild):
+        (WebCore::RenderBlockFlow::hitTestFloats):
+        (WebCore::RenderBlockFlow::adjustForBorderFit):
+        * rendering/RenderBlockFlow.h:
+        (WebCore::RenderBlockFlow::xPositionForFloatIncludingMargin):
+        (WebCore::RenderBlockFlow::yPositionForFloatIncludingMargin):
+
</ins><span class="cx"> 2015-10-17  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Sort the project file.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (191245 => 191246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2015-10-17 18:49:02 UTC (rev 191245)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2015-10-17 19:14:53 UTC (rev 191246)
</span><span class="lines">@@ -2127,9 +2127,9 @@
</span><span class="cx">     const FloatingObjectSet&amp; floatingObjectSet = m_floatingObjects-&gt;set();
</span><span class="cx">     auto end = floatingObjectSet.end();
</span><span class="cx">     for (auto it = floatingObjectSet.begin(); it != end; ++it) {
</span><del>-        FloatingObject* r = it-&gt;get();
-        if (r-&gt;isDescendant())
-            addOverflowFromChild(&amp;r-&gt;renderer(), IntSize(xPositionForFloatIncludingMargin(r), yPositionForFloatIncludingMargin(r)));
</del><ins>+        const auto&amp; floatingObject = *it-&gt;get();
+        if (floatingObject.isDescendant())
+            addOverflowFromChild(&amp;floatingObject.renderer(), IntSize(xPositionForFloatIncludingMargin(floatingObject), yPositionForFloatIncludingMargin(floatingObject)));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2190,23 +2190,26 @@
</span><span class="cx">     const FloatingObjectSet&amp; floatingObjectSet = m_floatingObjects-&gt;set();
</span><span class="cx">     auto end = floatingObjectSet.end();
</span><span class="cx">     for (auto it = floatingObjectSet.begin(); it != end; ++it) {
</span><del>-        FloatingObject* r = it-&gt;get();
</del><ins>+        const auto&amp; floatingObject = *it-&gt;get();
+        auto&amp; renderer = floatingObject.renderer();
</ins><span class="cx">         // Only paint the object if our m_shouldPaint flag is set.
</span><del>-        if (r-&gt;shouldPaint() &amp;&amp; !r-&gt;renderer().hasSelfPaintingLayer()) {
</del><ins>+        if (floatingObject.shouldPaint() &amp;&amp; !renderer.hasSelfPaintingLayer()) {
</ins><span class="cx">             PaintInfo currentPaintInfo(paintInfo);
</span><span class="cx">             currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
</span><span class="cx">             // FIXME: LayoutPoint version of xPositionForFloatIncludingMargin would make this much cleaner.
</span><del>-            LayoutPoint childPoint = flipFloatForWritingModeForChild(r, LayoutPoint(paintOffset.x() + xPositionForFloatIncludingMargin(r) - r-&gt;renderer().x(), paintOffset.y() + yPositionForFloatIncludingMargin(r) - r-&gt;renderer().y()));
-            r-&gt;renderer().paint(currentPaintInfo, childPoint);
</del><ins>+            LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject,
+                LayoutPoint(paintOffset.x() + xPositionForFloatIncludingMargin(floatingObject) - renderer.x(),
+                paintOffset.y() + yPositionForFloatIncludingMargin(floatingObject) - renderer.y()));
+            renderer.paint(currentPaintInfo, childPoint);
</ins><span class="cx">             if (!preservePhase) {
</span><span class="cx">                 currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds;
</span><del>-                r-&gt;renderer().paint(currentPaintInfo, childPoint);
</del><ins>+                renderer.paint(currentPaintInfo, childPoint);
</ins><span class="cx">                 currentPaintInfo.phase = PaintPhaseFloat;
</span><del>-                r-&gt;renderer().paint(currentPaintInfo, childPoint);
</del><ins>+                renderer.paint(currentPaintInfo, childPoint);
</ins><span class="cx">                 currentPaintInfo.phase = PaintPhaseForeground;
</span><del>-                r-&gt;renderer().paint(currentPaintInfo, childPoint);
</del><ins>+                renderer.paint(currentPaintInfo, childPoint);
</ins><span class="cx">                 currentPaintInfo.phase = PaintPhaseOutline;
</span><del>-                r-&gt;renderer().paint(currentPaintInfo, childPoint);
</del><ins>+                renderer.paint(currentPaintInfo, childPoint);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2218,10 +2221,10 @@
</span><span class="cx">         const FloatingObjectSet&amp; floatingObjectSet = m_floatingObjects-&gt;set();
</span><span class="cx">         auto end = floatingObjectSet.end();
</span><span class="cx">         for (auto it = floatingObjectSet.begin(); it != end; ++it) {
</span><del>-            FloatingObject* floatingObject = it-&gt;get();
</del><ins>+            const auto&amp; floatingObject = *it-&gt;get();
</ins><span class="cx">             LayoutRect floatBox(offsetFromRootBlock.width() + xPositionForFloatIncludingMargin(floatingObject),
</span><span class="cx">                 offsetFromRootBlock.height() + yPositionForFloatIncludingMargin(floatingObject),
</span><del>-                floatingObject-&gt;renderer().width(), floatingObject-&gt;renderer().height());
</del><ins>+                floatingObject.renderer().width(), floatingObject.renderer().height());
</ins><span class="cx">             rootBlock.flipForWritingMode(floatBox);
</span><span class="cx">             floatBox.move(rootBlockPhysicalPosition.x(), rootBlockPhysicalPosition.y());
</span><span class="cx">             paintInfo-&gt;context().clipOut(snappedIntRect(floatBox));
</span><span class="lines">@@ -2695,7 +2698,7 @@
</span><span class="cx">             
</span><span class="cx">             // Since the float doesn't overhang, it didn't get put into our list. We need to add its overflow in to the child now.
</span><span class="cx">             if (floatingObject.isDescendant())
</span><del>-                child.addOverflowFromChild(&amp;renderer, LayoutSize(xPositionForFloatIncludingMargin(&amp;floatingObject), yPositionForFloatIncludingMargin(&amp;floatingObject)));
</del><ins>+                child.addOverflowFromChild(&amp;renderer, LayoutSize(xPositionForFloatIncludingMargin(floatingObject), yPositionForFloatIncludingMargin(floatingObject)));
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     return lowestFloatLogicalBottom;
</span><span class="lines">@@ -2802,7 +2805,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-LayoutPoint RenderBlockFlow::flipFloatForWritingModeForChild(const FloatingObject* child, const LayoutPoint&amp; point) const
</del><ins>+LayoutPoint RenderBlockFlow::flipFloatForWritingModeForChild(const FloatingObject&amp; child, const LayoutPoint&amp; point) const
</ins><span class="cx"> {
</span><span class="cx">     if (!style().isFlippedBlocksWritingMode())
</span><span class="cx">         return point;
</span><span class="lines">@@ -2811,8 +2814,8 @@
</span><span class="cx">     // it's going to get added back in. We hide this complication here so that the calling code looks normal for the unflipped
</span><span class="cx">     // case.
</span><span class="cx">     if (isHorizontalWritingMode())
</span><del>-        return LayoutPoint(point.x(), point.y() + height() - child-&gt;renderer().height() - 2 * yPositionForFloatIncludingMargin(child));
-    return LayoutPoint(point.x() + width() - child-&gt;renderer().width() - 2 * xPositionForFloatIncludingMargin(child), point.y());
</del><ins>+        return LayoutPoint(point.x(), point.y() + height() - child.renderer().height() - 2 * yPositionForFloatIncludingMargin(child));
+    return LayoutPoint(point.x() + width() - child.renderer().width() - 2 * xPositionForFloatIncludingMargin(child), point.y());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LayoutUnit RenderBlockFlow::getClearDelta(RenderBox&amp; child, LayoutUnit logicalTop)
</span><span class="lines">@@ -2900,12 +2903,13 @@
</span><span class="cx">     auto begin = floatingObjectSet.begin();
</span><span class="cx">     for (auto it = floatingObjectSet.end(); it != begin;) {
</span><span class="cx">         --it;
</span><del>-        FloatingObject* floatingObject = it-&gt;get();
-        if (floatingObject-&gt;shouldPaint() &amp;&amp; !floatingObject-&gt;renderer().hasSelfPaintingLayer()) {
-            LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject) - floatingObject-&gt;renderer().x();
-            LayoutUnit yOffset = yPositionForFloatIncludingMargin(floatingObject) - floatingObject-&gt;renderer().y();
</del><ins>+        const auto&amp; floatingObject = *it-&gt;get();
+        auto&amp; renderer = floatingObject.renderer();
+        if (floatingObject.shouldPaint() &amp;&amp; !renderer.hasSelfPaintingLayer()) {
+            LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject) - renderer.x();
+            LayoutUnit yOffset = yPositionForFloatIncludingMargin(floatingObject) - renderer.y();
</ins><span class="cx">             LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject, adjustedLocation + LayoutSize(xOffset, yOffset));
</span><del>-            if (floatingObject-&gt;renderer().hitTest(request, result, locationInContainer, childPoint)) {
</del><ins>+            if (renderer.hitTest(request, result, locationInContainer, childPoint)) {
</ins><span class="cx">                 updateHitTestResult(result, locationInContainer.point() - toLayoutSize(childPoint));
</span><span class="cx">                 return true;
</span><span class="cx">             }
</span><span class="lines">@@ -2959,11 +2963,11 @@
</span><span class="cx">         const FloatingObjectSet&amp; floatingObjectSet = m_floatingObjects-&gt;set();
</span><span class="cx">         auto end = floatingObjectSet.end();
</span><span class="cx">         for (auto it = floatingObjectSet.begin(); it != end; ++it) {
</span><del>-            FloatingObject* r = it-&gt;get();
</del><ins>+            const auto&amp; floatingObject = *it-&gt;get();
</ins><span class="cx">             // Only examine the object if our m_shouldPaint flag is set.
</span><del>-            if (r-&gt;shouldPaint()) {
-                LayoutUnit floatLeft = xPositionForFloatIncludingMargin(r) - r-&gt;renderer().x();
-                LayoutUnit floatRight = floatLeft + r-&gt;renderer().width();
</del><ins>+            if (floatingObject.shouldPaint()) {
+                LayoutUnit floatLeft = xPositionForFloatIncludingMargin(floatingObject) - floatingObject.renderer().x();
+                LayoutUnit floatRight = floatLeft + floatingObject.renderer().width();
</ins><span class="cx">                 left = std::min(left, floatLeft);
</span><span class="cx">                 right = std::max(right, floatRight);
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (191245 => 191246)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.h        2015-10-17 18:49:02 UTC (rev 191245)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h        2015-10-17 19:14:53 UTC (rev 191246)
</span><span class="lines">@@ -333,10 +333,10 @@
</span><span class="cx">             floatingObject.setHeight(logicalWidth);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    LayoutUnit xPositionForFloatIncludingMargin(const FloatingObject* child) const { return isHorizontalWritingMode() ? child-&gt;x() + child-&gt;renderer().marginLeft() : child-&gt;x() + marginBeforeForChild(child-&gt;renderer()); }
-    LayoutUnit yPositionForFloatIncludingMargin(const FloatingObject* child) const { return isHorizontalWritingMode() ? child-&gt;y() + marginBeforeForChild(child-&gt;renderer()) : child-&gt;y() + child-&gt;renderer().marginTop(); }
</del><ins>+    LayoutUnit xPositionForFloatIncludingMargin(const FloatingObject&amp; floatingObject) const { return isHorizontalWritingMode() ? floatingObject.x() + floatingObject.renderer().marginLeft() : floatingObject.x() + marginBeforeForChild(floatingObject.renderer()); }
+    LayoutUnit yPositionForFloatIncludingMargin(const FloatingObject&amp; floatingObject) const { return isHorizontalWritingMode() ? floatingObject.y() + marginBeforeForChild(floatingObject.renderer()) : floatingObject.y() + floatingObject.renderer().marginTop(); }
</ins><span class="cx"> 
</span><del>-    LayoutPoint flipFloatForWritingModeForChild(const FloatingObject*, const LayoutPoint&amp;) const;
</del><ins>+    LayoutPoint flipFloatForWritingModeForChild(const FloatingObject&amp;, const LayoutPoint&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     RenderLineBoxList&amp; lineBoxes() { return m_lineBoxes; }
</span><span class="cx">     const RenderLineBoxList&amp; lineBoxes() const { return m_lineBoxes; }
</span></span></pre>
</div>
</div>

</body>
</html>