<!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>[158855] 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/158855">158855</a></dd>
<dt>Author</dt> <dd>bjonesbe@adobe.com</dd>
<dt>Date</dt> <dd>2013-11-07 10:11:43 -0800 (Thu, 07 Nov 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Refactor logical left/right offset for line methods
https://bugs.webkit.org/show_bug.cgi?id=123898

Reviewed by David Hyatt.

Simplify the logical left/right offset for line methods and their
implementation, including the ComputeFloatOffsetAdapter. This also
reduces the number of line offset methods in RenderBlock.

No new tests, no behavior change.

* rendering/FloatingObjects.cpp:
(WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
(WebCore::ComputeFloatOffsetAdapter::offset): Add a method to return
    the offset instead of using a confusing out parameter.
(WebCore::::shapeOffset): Method to return the offset modified by the
    shape delta. Moving the computation to this method allowed for
    simplification of the users of ComputeFloatOffsetAdapter.
(WebCore::FloatingObjects::logicalLeftOffsetForPositioningFloat): Added this
    method so that ShapeOutsideFloatOffsetMode isn't needed. Returns the
    offset based on the float margin box.
(WebCore::FloatingObjects::logicalRightOffsetForPositioningFloat): Ditto.
(WebCore::FloatingObjects::logicalLeftOffset): This now only returns
    the offset based on the shape's contour.
(WebCore::FloatingObjects::logicalRightOffset): Ditto.
(WebCore::::heightRemaining): Rename to properly follow the getter
    naming convention.
* rendering/FloatingObjects.h:
* rendering/RenderBlock.h:
(WebCore::RenderBlock::logicalRightOffsetForLine): Update to remove
    use of ShapeOutsideFloatOffsetMode and heightRemaining.
(WebCore::RenderBlock::logicalLeftOffsetForLine): Ditto.
(WebCore::RenderBlock::logicalRightFloatOffsetForLine): Ditto.
(WebCore::RenderBlock::logicalLeftFloatOffsetForLine): Ditto.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::logicalLeftOffsetForPositioningFloat):
    Positioning a float is the only case where the float margin box
    should be used, and also the only case where heightRemaining is
    needed. This handles that case.
(WebCore::RenderBlockFlow::logicalRightOffsetForPositioningFloat):
    Ditto.
(WebCore::RenderBlockFlow::computeLogicalLocationForFloat): Update to
    use logical(Left|Right)OffsetForPositioningFloatOnLine.
(WebCore::RenderBlockFlow::logicalLeftFloatOffsetForLine): Update to
    remove use for ShapeOutsideFloatOffsetMode and heightRemaining.
(WebCore::RenderBlockFlow::logicalRightFloatOffsetForLine): Ditto.
* rendering/RenderBlockFlow.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingFloatingObjectscpp">trunk/Source/WebCore/rendering/FloatingObjects.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingFloatingObjectsh">trunk/Source/WebCore/rendering/FloatingObjects.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockh">trunk/Source/WebCore/rendering/RenderBlock.h</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 (158854 => 158855)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-11-07 18:05:55 UTC (rev 158854)
+++ trunk/Source/WebCore/ChangeLog        2013-11-07 18:11:43 UTC (rev 158855)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2013-11-07  Bem Jones-Bey  &lt;bjonesbe@adobe.com&gt;
+
+        Refactor logical left/right offset for line methods
+        https://bugs.webkit.org/show_bug.cgi?id=123898
+
+        Reviewed by David Hyatt.
+
+        Simplify the logical left/right offset for line methods and their
+        implementation, including the ComputeFloatOffsetAdapter. This also
+        reduces the number of line offset methods in RenderBlock.
+
+        No new tests, no behavior change.
+
+        * rendering/FloatingObjects.cpp:
+        (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
+        (WebCore::ComputeFloatOffsetAdapter::offset): Add a method to return
+            the offset instead of using a confusing out parameter.
+        (WebCore::::shapeOffset): Method to return the offset modified by the
+            shape delta. Moving the computation to this method allowed for
+            simplification of the users of ComputeFloatOffsetAdapter.
+        (WebCore::FloatingObjects::logicalLeftOffsetForPositioningFloat): Added this
+            method so that ShapeOutsideFloatOffsetMode isn't needed. Returns the
+            offset based on the float margin box.
+        (WebCore::FloatingObjects::logicalRightOffsetForPositioningFloat): Ditto.
+        (WebCore::FloatingObjects::logicalLeftOffset): This now only returns
+            the offset based on the shape's contour.
+        (WebCore::FloatingObjects::logicalRightOffset): Ditto.
+        (WebCore::::heightRemaining): Rename to properly follow the getter
+            naming convention.
+        * rendering/FloatingObjects.h:
+        * rendering/RenderBlock.h:
+        (WebCore::RenderBlock::logicalRightOffsetForLine): Update to remove
+            use of ShapeOutsideFloatOffsetMode and heightRemaining.
+        (WebCore::RenderBlock::logicalLeftOffsetForLine): Ditto.
+        (WebCore::RenderBlock::logicalRightFloatOffsetForLine): Ditto.
+        (WebCore::RenderBlock::logicalLeftFloatOffsetForLine): Ditto.
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::logicalLeftOffsetForPositioningFloat):
+            Positioning a float is the only case where the float margin box
+            should be used, and also the only case where heightRemaining is
+            needed. This handles that case.
+        (WebCore::RenderBlockFlow::logicalRightOffsetForPositioningFloat):
+            Ditto.
+        (WebCore::RenderBlockFlow::computeLogicalLocationForFloat): Update to
+            use logical(Left|Right)OffsetForPositioningFloatOnLine.
+        (WebCore::RenderBlockFlow::logicalLeftFloatOffsetForLine): Update to
+            remove use for ShapeOutsideFloatOffsetMode and heightRemaining.
+        (WebCore::RenderBlockFlow::logicalRightFloatOffsetForLine): Ditto.
+        * rendering/RenderBlockFlow.h:
+
</ins><span class="cx"> 2013-11-07  Alexandru Chiculita  &lt;achicu@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: CSS Regions: Removing a content node of a ContentFlow from the DOM will send a 0 nodeId
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingFloatingObjectscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/FloatingObjects.cpp (158854 => 158855)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/FloatingObjects.cpp        2013-11-07 18:05:55 UTC (rev 158854)
+++ trunk/Source/WebCore/rendering/FloatingObjects.cpp        2013-11-07 18:11:43 UTC (rev 158855)
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx"> public:
</span><span class="cx">     typedef FloatingObjectInterval IntervalType;
</span><span class="cx"> 
</span><del>-    ComputeFloatOffsetAdapter(const RenderBlockFlow* renderer, int lineTop, int lineBottom, LayoutUnit&amp; offset)
</del><ins>+    ComputeFloatOffsetAdapter(const RenderBlockFlow* renderer, int lineTop, int lineBottom, LayoutUnit offset)
</ins><span class="cx">         : m_renderer(renderer)
</span><span class="cx">         , m_lineTop(lineTop)
</span><span class="cx">         , m_lineBottom(lineBottom)
</span><span class="lines">@@ -118,23 +118,17 @@
</span><span class="cx">     int highValue() const { return m_lineBottom; }
</span><span class="cx">     void collectIfNeeded(const IntervalType&amp;);
</span><span class="cx"> 
</span><del>-#if ENABLE(CSS_SHAPES)
-    // When computing the offset caused by the floats on a given line, if
-    // the outermost float on that line has a shape-outside, the inline
-    // content that butts up against that float must be positioned using
-    // the contours of the shape, not the margin box of the float.
-    const FloatingObject* outermostFloat() const { return m_outermostFloat; }
-#endif
</del><ins>+    LayoutUnit offset() const { return m_offset; }
+    LayoutUnit shapeOffset() const;
+    LayoutUnit heightRemaining() const;
</ins><span class="cx"> 
</span><del>-    LayoutUnit getHeightRemaining() const;
-
</del><span class="cx"> private:
</span><span class="cx">     bool updateOffsetIfNeeded(const FloatingObject*);
</span><span class="cx"> 
</span><span class="cx">     const RenderBlockFlow* m_renderer;
</span><span class="cx">     int m_lineTop;
</span><span class="cx">     int m_lineBottom;
</span><del>-    LayoutUnit&amp; m_offset;
</del><ins>+    LayoutUnit m_offset;
</ins><span class="cx">     const FloatingObject* m_outermostFloat;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -273,58 +267,80 @@
</span><span class="cx">     return m_placedFloatsTree;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-LayoutUnit FloatingObjects::logicalLeftOffset(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit logicalHeight, ShapeOutsideFloatOffsetMode offsetMode, LayoutUnit *heightRemaining)
</del><ins>+static inline ShapeOutsideInfo* shapeInfoForFloat(const FloatingObject* floatingObject, const RenderBlockFlow* containingBlock, LayoutUnit lineTop, LayoutUnit lineBottom)
</ins><span class="cx"> {
</span><del>-#if !ENABLE(CSS_SHAPES)
-    UNUSED_PARAM(offsetMode);
-#endif
</del><ins>+    if (floatingObject) {
+        if (ShapeOutsideInfo* shapeOutside = floatingObject-&gt;renderer().shapeOutsideInfo()) {
+            shapeOutside-&gt;updateDeltasForContainingBlockLine(containingBlock, floatingObject, lineTop, lineBottom - lineTop);
+            return shapeOutside;
+        }
+    }
</ins><span class="cx"> 
</span><del>-    LayoutUnit offset = fixedOffset;
-    ComputeFloatOffsetAdapter&lt;FloatingObject::FloatLeft&gt; adapter(m_renderer, roundToInt(logicalTop), roundToInt(logicalTop + logicalHeight), offset);
-    placedFloatsTree().allOverlapsWithAdapter(adapter);
</del><ins>+    return 0;
+}
</ins><span class="cx"> 
</span><del>-    if (heightRemaining)
-        *heightRemaining = adapter.getHeightRemaining();
-
</del><ins>+template&lt;&gt;
+inline LayoutUnit ComputeFloatOffsetAdapter&lt;FloatingObject::FloatLeft&gt;::shapeOffset() const
+{
</ins><span class="cx"> #if ENABLE(CSS_SHAPES)
</span><del>-    const FloatingObject* outermostFloat = adapter.outermostFloat();
-    if (offsetMode == ShapeOutsideFloatShapeOffset &amp;&amp; outermostFloat) {
-        if (ShapeOutsideInfo* shapeOutside = outermostFloat-&gt;renderer().shapeOutsideInfo()) {
-            shapeOutside-&gt;updateDeltasForContainingBlockLine(m_renderer, outermostFloat, logicalTop, logicalHeight);
-            offset += shapeOutside-&gt;rightMarginBoxDelta();
-        }
-    }
</del><ins>+    if (ShapeOutsideInfo* shapeOutside = shapeInfoForFloat(m_outermostFloat, m_renderer, m_lineTop, m_lineBottom))
+        return m_offset + shapeOutside-&gt;rightMarginBoxDelta();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    return offset;
</del><ins>+    return m_offset;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-LayoutUnit FloatingObjects::logicalRightOffset(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit logicalHeight, ShapeOutsideFloatOffsetMode offsetMode, LayoutUnit *heightRemaining)
</del><ins>+template&lt;&gt;
+inline LayoutUnit ComputeFloatOffsetAdapter&lt;FloatingObject::FloatRight&gt;::shapeOffset() const
</ins><span class="cx"> {
</span><del>-#if !ENABLE(CSS_SHAPES)
-    UNUSED_PARAM(offsetMode);
</del><ins>+#if ENABLE(CSS_SHAPES)
+    if (ShapeOutsideInfo* shapeOutside = shapeInfoForFloat(m_outermostFloat, m_renderer, m_lineTop, m_lineBottom))
+        return m_offset + shapeOutside-&gt;leftMarginBoxDelta();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    LayoutUnit offset = fixedOffset;
-    ComputeFloatOffsetAdapter&lt;FloatingObject::FloatRight&gt; adapter(m_renderer, roundToInt(logicalTop), roundToInt(logicalTop + logicalHeight), offset);
</del><ins>+    return m_offset;
+}
+
+LayoutUnit FloatingObjects::logicalLeftOffsetForPositioningFloat(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit *heightRemaining)
+{
+    int logicalTopAsInt = roundToInt(logicalTop);
+    ComputeFloatOffsetAdapter&lt;FloatingObject::FloatLeft&gt; adapter(m_renderer, logicalTopAsInt, logicalTopAsInt, fixedOffset);
</ins><span class="cx">     placedFloatsTree().allOverlapsWithAdapter(adapter);
</span><span class="cx"> 
</span><span class="cx">     if (heightRemaining)
</span><del>-        *heightRemaining = adapter.getHeightRemaining();
</del><ins>+        *heightRemaining = adapter.heightRemaining();
</ins><span class="cx"> 
</span><del>-#if ENABLE(CSS_SHAPES)
-    const FloatingObject* outermostFloat = adapter.outermostFloat();
-    if (offsetMode == ShapeOutsideFloatShapeOffset &amp;&amp; outermostFloat) {
-        if (ShapeOutsideInfo* shapeOutside = outermostFloat-&gt;renderer().shapeOutsideInfo()) {
-            shapeOutside-&gt;updateDeltasForContainingBlockLine(m_renderer, outermostFloat, logicalTop, logicalHeight);
-            offset += shapeOutside-&gt;leftMarginBoxDelta();
-        }
-    }
-#endif
</del><ins>+    return adapter.offset();
+}
</ins><span class="cx"> 
</span><del>-    return min(fixedOffset, offset);
</del><ins>+LayoutUnit FloatingObjects::logicalRightOffsetForPositioningFloat(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit *heightRemaining)
+{
+    int logicalTopAsInt = roundToInt(logicalTop);
+    ComputeFloatOffsetAdapter&lt;FloatingObject::FloatRight&gt; adapter(m_renderer, logicalTopAsInt, logicalTopAsInt, fixedOffset);
+    placedFloatsTree().allOverlapsWithAdapter(adapter);
+
+    if (heightRemaining)
+        *heightRemaining = adapter.heightRemaining();
+
+    return min(fixedOffset, adapter.offset());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LayoutUnit FloatingObjects::logicalLeftOffset(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit logicalHeight)
+{
+    ComputeFloatOffsetAdapter&lt;FloatingObject::FloatLeft&gt; adapter(m_renderer, roundToInt(logicalTop), roundToInt(logicalTop + logicalHeight), fixedOffset);
+    placedFloatsTree().allOverlapsWithAdapter(adapter);
+
+    return adapter.shapeOffset();
+}
+
+LayoutUnit FloatingObjects::logicalRightOffset(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit logicalHeight)
+{
+    ComputeFloatOffsetAdapter&lt;FloatingObject::FloatRight&gt; adapter(m_renderer, roundToInt(logicalTop), roundToInt(logicalTop + logicalHeight), fixedOffset);
+    placedFloatsTree().allOverlapsWithAdapter(adapter);
+
+    return min(fixedOffset, adapter.shapeOffset());
+}
+
</ins><span class="cx"> inline static bool rangesIntersect(int floatTop, int floatBottom, int objectTop, int objectBottom)
</span><span class="cx"> {
</span><span class="cx">     if (objectTop &gt;= floatBottom || objectBottom &lt; floatTop)
</span><span class="lines">@@ -384,7 +400,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template &lt;FloatingObject::Type FloatTypeValue&gt;
</span><del>-LayoutUnit ComputeFloatOffsetAdapter&lt;FloatTypeValue&gt;::getHeightRemaining() const
</del><ins>+LayoutUnit ComputeFloatOffsetAdapter&lt;FloatTypeValue&gt;::heightRemaining() const
</ins><span class="cx"> {
</span><span class="cx">     return m_outermostFloat ? m_renderer-&gt;logicalBottomForFloat(m_outermostFloat) - m_lineTop : LayoutUnit(1);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingFloatingObjectsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/FloatingObjects.h (158854 => 158855)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/FloatingObjects.h        2013-11-07 18:05:55 UTC (rev 158854)
+++ trunk/Source/WebCore/rendering/FloatingObjects.h        2013-11-07 18:11:43 UTC (rev 158855)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> class RenderBlockFlow;
</span><span class="cx"> class RenderBox;
</span><span class="cx"> 
</span><ins>+// FIXME this should be removed once RenderBlockFlow::nextFloatLogicalBottomBelow doesn't need it anymore. (Bug 123931)
</ins><span class="cx"> enum ShapeOutsideFloatOffsetMode { ShapeOutsideFloatShapeOffset, ShapeOutsideFloatMarginBoxOffset };
</span><span class="cx"> 
</span><span class="cx"> class FloatingObject {
</span><span class="lines">@@ -141,9 +142,13 @@
</span><span class="cx">     bool hasRightObjects() const { return m_rightObjectsCount &gt; 0; }
</span><span class="cx">     const FloatingObjectSet&amp; set() const { return m_set; }
</span><span class="cx">     void clearLineBoxTreePointers();
</span><del>-    LayoutUnit logicalLeftOffset(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit logicalHeight, ShapeOutsideFloatOffsetMode = ShapeOutsideFloatShapeOffset, LayoutUnit* heightRemaining = 0);
-    LayoutUnit logicalRightOffset(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit logicalHeight, ShapeOutsideFloatOffsetMode = ShapeOutsideFloatShapeOffset, LayoutUnit* heightRemaining = 0);
</del><span class="cx"> 
</span><ins>+    LayoutUnit logicalLeftOffset(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit logicalHeight);
+    LayoutUnit logicalRightOffset(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit logicalHeight);
+
+    LayoutUnit logicalLeftOffsetForPositioningFloat(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit* heightRemaining);
+    LayoutUnit logicalRightOffsetForPositioningFloat(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit* heightRemaining);
+
</ins><span class="cx"> private:
</span><span class="cx">     void computePlacedFloatsTree();
</span><span class="cx">     const FloatingObjectTree&amp; placedFloatsTree();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.h (158854 => 158855)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.h        2013-11-07 18:05:55 UTC (rev 158854)
+++ trunk/Source/WebCore/rendering/RenderBlock.h        2013-11-07 18:11:43 UTC (rev 158855)
</span><span class="lines">@@ -164,11 +164,11 @@
</span><span class="cx">     }
</span><span class="cx">     LayoutUnit logicalRightOffsetForLineInRegion(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const 
</span><span class="cx">     {
</span><del>-        return logicalRightOffsetForLine(position, logicalRightOffsetForContent(region), shouldIndentText, 0, logicalHeight);
</del><ins>+        return logicalRightOffsetForLine(position, logicalRightOffsetForContent(region), shouldIndentText, logicalHeight);
</ins><span class="cx">     }
</span><span class="cx">     LayoutUnit logicalLeftOffsetForLineInRegion(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const 
</span><span class="cx">     {
</span><del>-        return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(region), shouldIndentText, 0, logicalHeight);
</del><ins>+        return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(region), shouldIndentText, logicalHeight);
</ins><span class="cx">     }
</span><span class="cx">     LayoutUnit startOffsetForLineInRegion(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const
</span><span class="cx">     {
</span><span class="lines">@@ -187,11 +187,11 @@
</span><span class="cx">     }
</span><span class="cx">     LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const 
</span><span class="cx">     {
</span><del>-        return logicalRightOffsetForLine(position, logicalRightOffsetForContent(position), shouldIndentText, 0, logicalHeight);
</del><ins>+        return logicalRightOffsetForLine(position, logicalRightOffsetForContent(position), shouldIndentText, logicalHeight);
</ins><span class="cx">     }
</span><span class="cx">     LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const 
</span><span class="cx">     {
</span><del>-        return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(position), shouldIndentText, 0, logicalHeight);
</del><ins>+        return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(position), shouldIndentText, logicalHeight);
</ins><span class="cx">     }
</span><span class="cx">     LayoutUnit pixelSnappedLogicalLeftOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const 
</span><span class="cx">     {
</span><span class="lines">@@ -434,22 +434,14 @@
</span><span class="cx">     virtual void paintChildren(PaintInfo&amp; forSelf, const LayoutPoint&amp;, PaintInfo&amp; forChild, bool usePrintRect);
</span><span class="cx">     bool paintChild(RenderBox&amp;, PaintInfo&amp; forSelf, const LayoutPoint&amp;, PaintInfo&amp; forChild, bool usePrintRect);
</span><span class="cx">    
</span><del>-    LayoutUnit logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining = 0, LayoutUnit logicalHeight = 0) const
</del><ins>+    LayoutUnit logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const
</ins><span class="cx">     {
</span><del>-        return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(logicalTop, fixedOffset, heightRemaining, logicalHeight, ShapeOutsideFloatShapeOffset), applyTextIndent);
</del><ins>+        return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(logicalTop, fixedOffset, logicalHeight), applyTextIndent);
</ins><span class="cx">     }
</span><del>-    LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining = 0, LayoutUnit logicalHeight = 0) const
</del><ins>+    LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const
</ins><span class="cx">     {
</span><del>-        return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logicalTop, fixedOffset, heightRemaining, logicalHeight, ShapeOutsideFloatShapeOffset), applyTextIndent);
</del><ins>+        return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logicalTop, fixedOffset, logicalHeight), applyTextIndent);
</ins><span class="cx">     }
</span><del>-    LayoutUnit logicalRightOffsetForLineIgnoringShapeOutside(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining = 0, LayoutUnit logicalHeight = 0) const
-    {
-        return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(logicalTop, fixedOffset, heightRemaining, logicalHeight, ShapeOutsideFloatMarginBoxOffset), applyTextIndent);
-    }
-    LayoutUnit logicalLeftOffsetForLineIgnoringShapeOutside(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining = 0, LayoutUnit logicalHeight = 0) const
-    {
-        return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logicalTop, fixedOffset, heightRemaining, logicalHeight, ShapeOutsideFloatMarginBoxOffset), applyTextIndent);
-    }
</del><span class="cx"> 
</span><span class="cx">     virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const;
</span><span class="cx">     virtual void adjustInlineDirectionLineBounds(int /* expansionOpportunityCount */, float&amp; /* logicalLeft */, float&amp; /* logicalWidth */) const { }
</span><span class="lines">@@ -512,9 +504,9 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
</span><del>-    virtual LayoutUnit logicalRightFloatOffsetForLine(LayoutUnit, LayoutUnit fixedOffset, LayoutUnit*, LayoutUnit, ShapeOutsideFloatOffsetMode) const { return fixedOffset; };
</del><ins>+    virtual LayoutUnit logicalRightFloatOffsetForLine(LayoutUnit, LayoutUnit fixedOffset, LayoutUnit) const { return fixedOffset; };
</ins><span class="cx">     // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
</span><del>-    virtual LayoutUnit logicalLeftFloatOffsetForLine(LayoutUnit, LayoutUnit fixedOffset, LayoutUnit*, LayoutUnit, ShapeOutsideFloatOffsetMode) const { return fixedOffset; }
</del><ins>+    virtual LayoutUnit logicalLeftFloatOffsetForLine(LayoutUnit, LayoutUnit fixedOffset, LayoutUnit) const { return fixedOffset; }
</ins><span class="cx">     LayoutUnit adjustLogicalRightOffsetForLine(LayoutUnit offsetFromFloats, bool applyTextIndent) const;
</span><span class="cx">     LayoutUnit adjustLogicalLeftOffsetForLine(LayoutUnit offsetFromFloats, bool applyTextIndent) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (158854 => 158855)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2013-11-07 18:05:55 UTC (rev 158854)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2013-11-07 18:11:43 UTC (rev 158855)
</span><span class="lines">@@ -2027,6 +2027,22 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LayoutUnit RenderBlockFlow::logicalLeftOffsetForPositioningFloat(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const
+{
+    LayoutUnit offset = fixedOffset;
+    if (m_floatingObjects &amp;&amp; m_floatingObjects-&gt;hasLeftObjects())
+        offset = m_floatingObjects-&gt;logicalLeftOffsetForPositioningFloat(fixedOffset, logicalTop, heightRemaining);
+    return adjustLogicalLeftOffsetForLine(offset, applyTextIndent);
+}
+
+LayoutUnit RenderBlockFlow::logicalRightOffsetForPositioningFloat(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const
+{
+    LayoutUnit offset = fixedOffset;
+    if (m_floatingObjects &amp;&amp; m_floatingObjects-&gt;hasRightObjects())
+        offset = m_floatingObjects-&gt;logicalRightOffsetForPositioningFloat(fixedOffset, logicalTop, heightRemaining);
+    return adjustLogicalRightOffsetForLine(offset, applyTextIndent);
+}
+
</ins><span class="cx"> LayoutPoint RenderBlockFlow::computeLogicalLocationForFloat(const FloatingObject* floatingObject, LayoutUnit logicalTopOffset) const
</span><span class="cx"> {
</span><span class="cx">     RenderBox&amp; childBox = floatingObject-&gt;renderer();
</span><span class="lines">@@ -2066,10 +2082,10 @@
</span><span class="cx">     if (childBox.style().floating() == LeftFloat) {
</span><span class="cx">         LayoutUnit heightRemainingLeft = 1;
</span><span class="cx">         LayoutUnit heightRemainingRight = 1;
</span><del>-        floatLogicalLeft = logicalLeftOffsetForLineIgnoringShapeOutside(logicalTopOffset, logicalLeftOffset, false, &amp;heightRemainingLeft);
-        while (logicalRightOffsetForLineIgnoringShapeOutside(logicalTopOffset, logicalRightOffset, false, &amp;heightRemainingRight) - floatLogicalLeft &lt; floatLogicalWidth) {
</del><ins>+        floatLogicalLeft = logicalLeftOffsetForPositioningFloat(logicalTopOffset, logicalLeftOffset, false, &amp;heightRemainingLeft);
+        while (logicalRightOffsetForPositioningFloat(logicalTopOffset, logicalRightOffset, false, &amp;heightRemainingRight) - floatLogicalLeft &lt; floatLogicalWidth) {
</ins><span class="cx">             logicalTopOffset += min(heightRemainingLeft, heightRemainingRight);
</span><del>-            floatLogicalLeft = logicalLeftOffsetForLineIgnoringShapeOutside(logicalTopOffset, logicalLeftOffset, false, &amp;heightRemainingLeft);
</del><ins>+            floatLogicalLeft = logicalLeftOffsetForPositioningFloat(logicalTopOffset, logicalLeftOffset, false, &amp;heightRemainingLeft);
</ins><span class="cx">             if (insideFlowThread) {
</span><span class="cx">                 // Have to re-evaluate all of our offsets, since they may have changed.
</span><span class="cx">                 logicalRightOffset = logicalRightOffsetForContent(logicalTopOffset); // Constant part of right offset.
</span><span class="lines">@@ -2081,10 +2097,10 @@
</span><span class="cx">     } else {
</span><span class="cx">         LayoutUnit heightRemainingLeft = 1;
</span><span class="cx">         LayoutUnit heightRemainingRight = 1;
</span><del>-        floatLogicalLeft = logicalRightOffsetForLineIgnoringShapeOutside(logicalTopOffset, logicalRightOffset, false, &amp;heightRemainingRight);
-        while (floatLogicalLeft - logicalLeftOffsetForLineIgnoringShapeOutside(logicalTopOffset, logicalLeftOffset, false, &amp;heightRemainingLeft) &lt; floatLogicalWidth) {
</del><ins>+        floatLogicalLeft = logicalRightOffsetForPositioningFloat(logicalTopOffset, logicalRightOffset, false, &amp;heightRemainingRight);
+        while (floatLogicalLeft - logicalLeftOffsetForPositioningFloat(logicalTopOffset, logicalLeftOffset, false, &amp;heightRemainingLeft) &lt; floatLogicalWidth) {
</ins><span class="cx">             logicalTopOffset += min(heightRemainingLeft, heightRemainingRight);
</span><del>-            floatLogicalLeft = logicalRightOffsetForLineIgnoringShapeOutside(logicalTopOffset, logicalRightOffset, false, &amp;heightRemainingRight);
</del><ins>+            floatLogicalLeft = logicalRightOffsetForPositioningFloat(logicalTopOffset, logicalRightOffset, false, &amp;heightRemainingRight);
</ins><span class="cx">             if (insideFlowThread) {
</span><span class="cx">                 // Have to re-evaluate all of our offsets, since they may have changed.
</span><span class="cx">                 logicalRightOffset = logicalRightOffsetForContent(logicalTopOffset); // Constant part of right offset.
</span><span class="lines">@@ -2244,18 +2260,18 @@
</span><span class="cx">         setLogicalHeight(newY);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-LayoutUnit RenderBlockFlow::logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit* heightRemaining, LayoutUnit logicalHeight, ShapeOutsideFloatOffsetMode offsetMode) const
</del><ins>+LayoutUnit RenderBlockFlow::logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const
</ins><span class="cx"> {
</span><span class="cx">     if (m_floatingObjects &amp;&amp; m_floatingObjects-&gt;hasLeftObjects())
</span><del>-        return m_floatingObjects-&gt;logicalLeftOffset(fixedOffset, logicalTop, logicalHeight, offsetMode, heightRemaining);
</del><ins>+        return m_floatingObjects-&gt;logicalLeftOffset(fixedOffset, logicalTop, logicalHeight);
</ins><span class="cx"> 
</span><span class="cx">     return fixedOffset;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-LayoutUnit RenderBlockFlow::logicalRightFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit* heightRemaining, LayoutUnit logicalHeight, ShapeOutsideFloatOffsetMode offsetMode) const
</del><ins>+LayoutUnit RenderBlockFlow::logicalRightFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const
</ins><span class="cx"> {
</span><span class="cx">     if (m_floatingObjects &amp;&amp; m_floatingObjects-&gt;hasRightObjects())
</span><del>-        return m_floatingObjects-&gt;logicalRightOffset(fixedOffset, logicalTop, logicalHeight, offsetMode, heightRemaining);
</del><ins>+        return m_floatingObjects-&gt;logicalRightOffset(fixedOffset, logicalTop, logicalHeight);
</ins><span class="cx"> 
</span><span class="cx">     return fixedOffset;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (158854 => 158855)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.h        2013-11-07 18:05:55 UTC (rev 158854)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h        2013-11-07 18:11:43 UTC (rev 158855)
</span><span class="lines">@@ -416,8 +416,12 @@
</span><span class="cx"> 
</span><span class="cx">     void newLine(EClear);
</span><span class="cx"> 
</span><del>-    virtual LayoutUnit logicalRightFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit* heightRemaining, LayoutUnit logicalHeight, ShapeOutsideFloatOffsetMode) const OVERRIDE;
-    virtual LayoutUnit logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit* heightRemaining, LayoutUnit logicalHeight, ShapeOutsideFloatOffsetMode) const OVERRIDE;
</del><ins>+    virtual LayoutUnit logicalRightFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const OVERRIDE;
+    virtual LayoutUnit logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const OVERRIDE;
+
+    LayoutUnit logicalRightOffsetForPositioningFloat(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const;
+    LayoutUnit logicalLeftOffsetForPositioningFloat(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const;
+
</ins><span class="cx">     LayoutUnit lowestFloatLogicalBottom(FloatingObject::Type = FloatingObject::FloatLeftRight) const; 
</span><span class="cx">     LayoutUnit nextFloatLogicalBottomBelow(LayoutUnit, ShapeOutsideFloatOffsetMode = ShapeOutsideFloatMarginBoxOffset) const;
</span><span class="cx">     
</span></span></pre>
</div>
</div>

</body>
</html>