<!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>[126802] 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/126802">126802</a></dd>
<dt>Author</dt> <dd>tony@chromium.org</dd>
<dt>Date</dt> <dd>2012-08-27 14:57:27 -0700 (Mon, 27 Aug 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make RenderBox::computePositionedLogicalHeight const
https://bugs.webkit.org/show_bug.cgi?id=94984

Reviewed by Ojan Vafai.

This is step 1 in making computeLogical{Height,Width} const.
computeLogicalHeight calls computePositionedLogicalHeight, so this patch
makes that const first.

No new tests, just refactoring.  Covered by fast/block/positioning/differing-writing-modes-replaced.html
and others.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalHeight): Call const version of computePositionedLogicalHeight.
(WebCore::RenderBox::computePositionedLogicalHeight): Make const, fills in struct instead.
(WebCore::RenderBox::computePositionedLogicalHeightUsing): Make const
and pass in a LogicalExtentComputedValues struct instead of 4 separate args for the results.
(WebCore::RenderBox::computePositionedLogicalHeightReplaced): Make const, fills in struct instead.
* rendering/RenderBox.h:
(WebCore::RenderBox::MarginsComputedValues::MarginsComputedValues):
(MarginsComputedValues): Struct of just margins.  Not used yet, but will be for
computeInlineDirectionMargins and computeBlockDirectionMargins.
(WebCore::RenderBox::LogicalExtentComputedValues::LogicalExtentComputedValues):
(LogicalExtentComputedValues): Struct to be used by computeLogical{Width,Height}. Only used by
computeLogicalHeight so far.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxh">trunk/Source/WebCore/rendering/RenderBox.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (126801 => 126802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2012-08-27 21:53:22 UTC (rev 126801)
+++ trunk/Source/WebCore/ChangeLog        2012-08-27 21:57:27 UTC (rev 126802)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2012-08-27  Tony Chang  &lt;tony@chromium.org&gt;
+
+        Make RenderBox::computePositionedLogicalHeight const
+        https://bugs.webkit.org/show_bug.cgi?id=94984
+
+        Reviewed by Ojan Vafai.
+
+        This is step 1 in making computeLogical{Height,Width} const.
+        computeLogicalHeight calls computePositionedLogicalHeight, so this patch
+        makes that const first.
+
+        No new tests, just refactoring.  Covered by fast/block/positioning/differing-writing-modes-replaced.html
+        and others.
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeLogicalHeight): Call const version of computePositionedLogicalHeight.
+        (WebCore::RenderBox::computePositionedLogicalHeight): Make const, fills in struct instead.
+        (WebCore::RenderBox::computePositionedLogicalHeightUsing): Make const
+        and pass in a LogicalExtentComputedValues struct instead of 4 separate args for the results.
+        (WebCore::RenderBox::computePositionedLogicalHeightReplaced): Make const, fills in struct instead.
+        * rendering/RenderBox.h:
+        (WebCore::RenderBox::MarginsComputedValues::MarginsComputedValues):
+        (MarginsComputedValues): Struct of just margins.  Not used yet, but will be for
+        computeInlineDirectionMargins and computeBlockDirectionMargins.
+        (WebCore::RenderBox::LogicalExtentComputedValues::LogicalExtentComputedValues):
+        (LogicalExtentComputedValues): Struct to be used by computeLogical{Width,Height}. Only used by
+        computeLogicalHeight so far.
+
</ins><span class="cx"> 2012-08-27  Rob Buis  &lt;rbuis@rim.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix compiler warnings in TextureMapperLayer.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (126801 => 126802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2012-08-27 21:53:22 UTC (rev 126801)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2012-08-27 21:57:27 UTC (rev 126802)
</span><span class="lines">@@ -1960,9 +1960,15 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     Length h;
</span><del>-    if (isOutOfFlowPositioned())
-        computePositionedLogicalHeight();
-    else {
</del><ins>+    if (isOutOfFlowPositioned()) {
+        LogicalExtentComputedValues computedValues;
+        computePositionedLogicalHeight(computedValues);
+
+        setLogicalHeight(computedValues.m_extent);
+        setLogicalTop(computedValues.m_position);
+        setMarginBefore(computedValues.m_margins.m_before);
+        setMarginAfter(computedValues.m_margins.m_after);
+    } else {
</ins><span class="cx">         RenderBlock* cb = containingBlock();
</span><span class="cx">         bool hasPerpendicularContainingBlock = cb-&gt;isHorizontalWritingMode() != isHorizontalWritingMode();
</span><span class="cx">     
</span><span class="lines">@@ -2851,10 +2857,10 @@
</span><span class="cx">     logicalTop.setValue(Fixed, staticLogicalTop);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderBox::computePositionedLogicalHeight()
</del><ins>+void RenderBox::computePositionedLogicalHeight(LogicalExtentComputedValues&amp; computedValues) const
</ins><span class="cx"> {
</span><span class="cx">     if (isReplaced()) {
</span><del>-        computePositionedLogicalHeightReplaced();
</del><ins>+        computePositionedLogicalHeightReplaced(computedValues);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -2874,9 +2880,6 @@
</span><span class="cx">     const LayoutUnit bordersPlusPadding = borderAndPaddingLogicalHeight();
</span><span class="cx">     const Length marginBefore = styleToUse-&gt;marginBefore();
</span><span class="cx">     const Length marginAfter = styleToUse-&gt;marginAfter();
</span><del>-    LayoutUnit&amp; marginBeforeAlias = m_marginBox.mutableBefore(styleToUse-&gt;writingMode());
-    LayoutUnit&amp; marginAfterAlias = m_marginBox.mutableAfter(styleToUse-&gt;writingMode());
-
</del><span class="cx">     Length logicalTopLength = styleToUse-&gt;logicalTop();
</span><span class="cx">     Length logicalBottomLength = styleToUse-&gt;logicalBottom();
</span><span class="cx"> 
</span><span class="lines">@@ -2901,62 +2904,52 @@
</span><span class="cx">     // Calculate the static distance if needed.
</span><span class="cx">     computeBlockStaticDistance(logicalTopLength, logicalBottomLength, this, containerBlock);
</span><span class="cx"> 
</span><del>-    LayoutUnit logicalHeightResult; // Needed to compute overflow.
-    LayoutUnit logicalTopPos;
-
</del><span class="cx">     // Calculate constraint equation values for 'height' case.
</span><span class="cx">     computePositionedLogicalHeightUsing(MainOrPreferredSize, styleToUse-&gt;logicalHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding,
</span><span class="cx">                                         logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
</span><del>-                                        logicalHeightResult, marginBeforeAlias, marginAfterAlias, logicalTopPos);
-    setLogicalTop(logicalTopPos);
</del><ins>+                                        computedValues);
</ins><span class="cx"> 
</span><span class="cx">     // Avoid doing any work in the common case (where the values of min-height and max-height are their defaults).
</span><span class="cx">     // see FIXME 2
</span><span class="cx"> 
</span><span class="cx">     // Calculate constraint equation values for 'max-height' case.
</span><span class="cx">     if (!styleToUse-&gt;logicalMaxHeight().isUndefined()) {
</span><del>-        LayoutUnit maxLogicalHeight;
-        LayoutUnit maxMarginBefore;
-        LayoutUnit maxMarginAfter;
-        LayoutUnit maxLogicalTopPos;
</del><ins>+        LogicalExtentComputedValues maxValues;
</ins><span class="cx"> 
</span><span class="cx">         computePositionedLogicalHeightUsing(MaxSize, styleToUse-&gt;logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding,
</span><span class="cx">                                             logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
</span><del>-                                            maxLogicalHeight, maxMarginBefore, maxMarginAfter, maxLogicalTopPos);
</del><ins>+                                            maxValues);
</ins><span class="cx"> 
</span><del>-        if (logicalHeightResult &gt; maxLogicalHeight) {
-            logicalHeightResult = maxLogicalHeight;
-            marginBeforeAlias = maxMarginBefore;
-            marginAfterAlias = maxMarginAfter;
-            setLogicalTop(maxLogicalTopPos);
</del><ins>+        if (computedValues.m_extent &gt; maxValues.m_extent) {
+            computedValues.m_extent = maxValues.m_extent;
+            computedValues.m_position = maxValues.m_position;
+            computedValues.m_margins.m_before = maxValues.m_margins.m_before;
+            computedValues.m_margins.m_after = maxValues.m_margins.m_after;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Calculate constraint equation values for 'min-height' case.
</span><span class="cx">     if (!styleToUse-&gt;logicalMinHeight().isZero()) {
</span><del>-        LayoutUnit minLogicalHeight;
-        LayoutUnit minMarginBefore;
-        LayoutUnit minMarginAfter;
-        LayoutUnit minLogicalTopPos;
</del><ins>+        LogicalExtentComputedValues minValues;
</ins><span class="cx"> 
</span><span class="cx">         computePositionedLogicalHeightUsing(MinSize, styleToUse-&gt;logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding,
</span><span class="cx">                                             logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
</span><del>-                                            minLogicalHeight, minMarginBefore, minMarginAfter, minLogicalTopPos);
</del><ins>+                                            minValues);
</ins><span class="cx"> 
</span><del>-        if (logicalHeightResult &lt; minLogicalHeight) {
-            logicalHeightResult = minLogicalHeight;
-            marginBeforeAlias = minMarginBefore;
-            marginAfterAlias = minMarginAfter;
-            setLogicalTop(minLogicalTopPos);
</del><ins>+        if (computedValues.m_extent &lt; minValues.m_extent) {
+            computedValues.m_extent = minValues.m_extent;
+            computedValues.m_position = minValues.m_position;
+            computedValues.m_margins.m_before = minValues.m_margins.m_before;
+            computedValues.m_margins.m_after = minValues.m_margins.m_after;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Set final height value.
</span><del>-    setLogicalHeight(logicalHeightResult + bordersPlusPadding);
</del><ins>+    computedValues.m_extent += bordersPlusPadding;
</ins><span class="cx">     
</span><span class="cx">     // Adjust logicalTop if we need to for perpendicular writing modes in regions.
</span><span class="cx">     if (inRenderFlowThread() &amp;&amp; isHorizontalWritingMode() != containerBlock-&gt;isHorizontalWritingMode()) {
</span><del>-        LayoutUnit logicalTopPos = logicalTop();
</del><ins>+        LayoutUnit logicalTopPos = computedValues.m_position;
</ins><span class="cx">         const RenderBlock* cb = toRenderBlock(containerBlock);
</span><span class="cx">         LayoutUnit cbPageOffset = cb-&gt;offsetFromLogicalTopOfFirstPage() - logicalLeft();
</span><span class="cx">         RenderRegion* cbRegion = cb-&gt;regionAtBlockOffset(cbPageOffset);
</span><span class="lines">@@ -2965,7 +2958,7 @@
</span><span class="cx">             RenderBoxRegionInfo* boxInfo = cb-&gt;renderBoxRegionInfo(cbRegion, cbPageOffset);
</span><span class="cx">             if (boxInfo) {
</span><span class="cx">                 logicalTopPos += boxInfo-&gt;logicalLeft();
</span><del>-                setLogicalTop(logicalTopPos);
</del><ins>+                computedValues.m_position = logicalTopPos;
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2996,7 +2989,7 @@
</span><span class="cx"> void RenderBox::computePositionedLogicalHeightUsing(SizeType heightSizeType, Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
</span><span class="cx">                                                     LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding,
</span><span class="cx">                                                     Length logicalTop, Length logicalBottom, Length marginBefore, Length marginAfter,
</span><del>-                                                    LayoutUnit&amp; logicalHeightValue, LayoutUnit&amp; marginBeforeValue, LayoutUnit&amp; marginAfterValue, LayoutUnit&amp; logicalTopPos)
</del><ins>+                                                    LogicalExtentComputedValues&amp; computedValues) const
</ins><span class="cx"> {
</span><span class="cx">     if (heightSizeType == MinSize &amp;&amp; logicalHeightLength.isAuto())
</span><span class="cx">         logicalHeightLength = Length(0, Fixed);
</span><span class="lines">@@ -3005,6 +2998,7 @@
</span><span class="cx">     // converted to the static position in computePositionedLogicalHeight()
</span><span class="cx">     ASSERT(!(logicalTop.isAuto() &amp;&amp; logicalBottom.isAuto()));
</span><span class="cx"> 
</span><ins>+    LayoutUnit logicalHeightValue;
</ins><span class="cx">     LayoutUnit contentLogicalHeight = logicalHeight() - bordersPlusPadding;
</span><span class="cx"> 
</span><span class="cx">     LayoutUnit logicalTopValue = 0;
</span><span class="lines">@@ -3041,20 +3035,20 @@
</span><span class="cx">         if (marginBefore.isAuto() &amp;&amp; marginAfter.isAuto()) {
</span><span class="cx">             // Both margins auto, solve for equality
</span><span class="cx">             // NOTE: This may result in negative values.
</span><del>-            marginBeforeValue = availableSpace / 2; // split the difference
-            marginAfterValue = availableSpace - marginBeforeValue; // account for odd valued differences
</del><ins>+            computedValues.m_margins.m_before = availableSpace / 2; // split the difference
+            computedValues.m_margins.m_after = availableSpace - computedValues.m_margins.m_before; // account for odd valued differences
</ins><span class="cx">         } else if (marginBefore.isAuto()) {
</span><span class="cx">             // Solve for top margin
</span><del>-            marginAfterValue = valueForLength(marginAfter, containerLogicalHeight, renderView);
-            marginBeforeValue = availableSpace - marginAfterValue;
</del><ins>+            computedValues.m_margins.m_after = valueForLength(marginAfter, containerLogicalHeight, renderView);
+            computedValues.m_margins.m_before = availableSpace - computedValues.m_margins.m_after;
</ins><span class="cx">         } else if (marginAfter.isAuto()) {
</span><span class="cx">             // Solve for bottom margin
</span><del>-            marginBeforeValue = valueForLength(marginBefore, containerLogicalHeight, renderView);
-            marginAfterValue = availableSpace - marginBeforeValue;
</del><ins>+            computedValues.m_margins.m_before = valueForLength(marginBefore, containerLogicalHeight, renderView);
+            computedValues.m_margins.m_after = availableSpace - computedValues.m_margins.m_before;
</ins><span class="cx">         } else {
</span><span class="cx">             // Over-constrained, (no need solve for bottom)
</span><del>-            marginBeforeValue = valueForLength(marginBefore, containerLogicalHeight, renderView);
-            marginAfterValue = valueForLength(marginAfter, containerLogicalHeight, renderView);
</del><ins>+            computedValues.m_margins.m_before = valueForLength(marginBefore, containerLogicalHeight, renderView);
+            computedValues.m_margins.m_after = valueForLength(marginAfter, containerLogicalHeight, renderView);
</ins><span class="cx">         }
</span><span class="cx">     } else {
</span><span class="cx">         /*--------------------------------------------------------------------*\
</span><span class="lines">@@ -3083,10 +3077,10 @@
</span><span class="cx">         // because the value is not used for any further calculations.
</span><span class="cx"> 
</span><span class="cx">         // Calculate margins, 'auto' margins are ignored.
</span><del>-        marginBeforeValue = minimumValueForLength(marginBefore, containerLogicalHeight, renderView);
-        marginAfterValue = minimumValueForLength(marginAfter, containerLogicalHeight, renderView);
</del><ins>+        computedValues.m_margins.m_before = minimumValueForLength(marginBefore, containerLogicalHeight, renderView);
+        computedValues.m_margins.m_after = minimumValueForLength(marginAfter, containerLogicalHeight, renderView);
</ins><span class="cx"> 
</span><del>-        const LayoutUnit availableSpace = containerLogicalHeight - (marginBeforeValue + marginAfterValue + bordersPlusPadding);
</del><ins>+        const LayoutUnit availableSpace = containerLogicalHeight - (computedValues.m_margins.m_before + computedValues.m_margins.m_after + bordersPlusPadding);
</ins><span class="cx"> 
</span><span class="cx">         // Use rule/case that applies.
</span><span class="cx">         if (logicalTopIsAuto &amp;&amp; logicalHeightIsAuto &amp;&amp; !logicalBottomIsAuto) {
</span><span class="lines">@@ -3111,10 +3105,11 @@
</span><span class="cx">             logicalTopValue = valueForLength(logicalTop, containerLogicalHeight, renderView);
</span><span class="cx">         }
</span><span class="cx">     }
</span><ins>+    computedValues.m_extent = logicalHeightValue;
</ins><span class="cx"> 
</span><span class="cx">     // Use computed values to calculate the vertical position.
</span><del>-    logicalTopPos = logicalTopValue + marginBeforeValue;
-    computeLogicalTopPositionedOffset(logicalTopPos, this, logicalHeightValue, containerBlock, containerLogicalHeight);
</del><ins>+    computedValues.m_position = logicalTopValue + computedValues.m_margins.m_before;
+    computeLogicalTopPositionedOffset(computedValues.m_position, this, logicalHeightValue, containerBlock, containerLogicalHeight);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderBox::computePositionedLogicalWidthReplaced()
</span><span class="lines">@@ -3286,7 +3281,7 @@
</span><span class="cx">     setLogicalLeft(logicalLeftPos.round());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderBox::computePositionedLogicalHeightReplaced()
</del><ins>+void RenderBox::computePositionedLogicalHeightReplaced(LogicalExtentComputedValues&amp; computedValues) const
</ins><span class="cx"> {
</span><span class="cx">     // The following is based off of the W3C Working Draft from April 11, 2006 of
</span><span class="cx">     // CSS 2.1: Section 10.6.5 &quot;Absolutely positioned, replaced elements&quot;
</span><span class="lines">@@ -3302,8 +3297,8 @@
</span><span class="cx">     // Variables to solve.
</span><span class="cx">     Length marginBefore = style()-&gt;marginBefore();
</span><span class="cx">     Length marginAfter = style()-&gt;marginAfter();
</span><del>-    LayoutUnit&amp; marginBeforeAlias = m_marginBox.mutableBefore(style()-&gt;writingMode());
-    LayoutUnit&amp; marginAfterAlias = m_marginBox.mutableAfter(style()-&gt;writingMode());
</del><ins>+    LayoutUnit&amp; marginBeforeAlias = computedValues.m_margins.m_before;
+    LayoutUnit&amp; marginAfterAlias = computedValues.m_margins.m_after;
</ins><span class="cx"> 
</span><span class="cx">     Length logicalTop = style()-&gt;logicalTop();
</span><span class="cx">     Length logicalBottom = style()-&gt;logicalBottom();
</span><span class="lines">@@ -3316,8 +3311,8 @@
</span><span class="cx">     // NOTE: This value of height is FINAL in that the min/max height calculations
</span><span class="cx">     // are dealt with in computeReplacedHeight().  This means that the steps to produce
</span><span class="cx">     // correct max/min in the non-replaced version, are not necessary.
</span><del>-    setLogicalHeight(computeReplacedLogicalHeight() + borderAndPaddingLogicalHeight());
-    const LayoutUnit availableSpace = containerLogicalHeight - logicalHeight();
</del><ins>+    computedValues.m_extent = computeReplacedLogicalHeight() + borderAndPaddingLogicalHeight();
+    const LayoutUnit availableSpace = containerLogicalHeight - computedValues.m_extent;
</ins><span class="cx"> 
</span><span class="cx">     /*-----------------------------------------------------------------------*\
</span><span class="cx">      * 2. If both 'top' and 'bottom' have the value 'auto', replace 'top'
</span><span class="lines">@@ -3411,8 +3406,8 @@
</span><span class="cx"> 
</span><span class="cx">     // Use computed values to calculate the vertical position.
</span><span class="cx">     LayoutUnit logicalTopPos = logicalTopValue + marginBeforeAlias;
</span><del>-    computeLogicalTopPositionedOffset(logicalTopPos, this, logicalHeight(), containerBlock, containerLogicalHeight);
-    setLogicalTop(logicalTopPos.round());
</del><ins>+    computeLogicalTopPositionedOffset(logicalTopPos, this, computedValues.m_extent, containerBlock, containerLogicalHeight);
+    computedValues.m_position = logicalTopPos.round();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LayoutRect RenderBox::localCaretRect(InlineBox* box, int caretOffset, LayoutUnit* extraWidthToEndOfLine)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.h (126801 => 126802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.h        2012-08-27 21:53:22 UTC (rev 126801)
+++ trunk/Source/WebCore/rendering/RenderBox.h        2012-08-27 21:57:27 UTC (rev 126802)
</span><span class="lines">@@ -306,6 +306,30 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void borderFitAdjust(LayoutRect&amp;) const { } // Shrink the box in which the border paints if border-fit is set.
</span><span class="cx"> 
</span><ins>+    struct ComputedMarginValues {
+        ComputedMarginValues()
+            : m_before(0)
+            , m_after(0)
+            , m_start(0)
+            , m_end(0)
+        {
+        }
+        LayoutUnit m_before;
+        LayoutUnit m_after;
+        LayoutUnit m_start;
+        LayoutUnit m_end;
+    };
+    struct LogicalExtentComputedValues {
+        LogicalExtentComputedValues()
+            : m_extent(0)
+            , m_position(0)
+        {
+        }
+
+        LayoutUnit m_extent;
+        LayoutUnit m_position;
+        ComputedMarginValues m_margins;
+    };
</ins><span class="cx">     // Resolve auto margins in the inline direction of the containing block so that objects can be pushed to the start, middle or end
</span><span class="cx">     // of the containing block.
</span><span class="cx">     void computeInlineDirectionMargins(RenderBlock* containingBlock, LayoutUnit containerWidth, LayoutUnit childWidth);
</span><span class="lines">@@ -338,7 +362,7 @@
</span><span class="cx">     LayoutUnit containingBlockLogicalWidthForContentInRegion(RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage) const;
</span><span class="cx">     LayoutUnit containingBlockAvailableLineWidthInRegion(RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage) const;
</span><span class="cx">     LayoutUnit perpendicularContainingBlockLogicalHeight() const;
</span><del>-    
</del><ins>+
</ins><span class="cx">     virtual void computeLogicalWidth();
</span><span class="cx">     virtual void computeLogicalHeight();
</span><span class="cx"> 
</span><span class="lines">@@ -561,7 +585,7 @@
</span><span class="cx">         LayoutUnit offsetFromLogicalTopOfFirstPage = 0, bool checkForPerpendicularWritingMode = true) const;
</span><span class="cx">     LayoutUnit containingBlockLogicalHeightForPositioned(const RenderBoxModelObject* containingBlock, bool checkForPerpendicularWritingMode = true) const;
</span><span class="cx"> 
</span><del>-    void computePositionedLogicalHeight();
</del><ins>+    void computePositionedLogicalHeight(LogicalExtentComputedValues&amp;) const;
</ins><span class="cx">     void computePositionedLogicalWidthUsing(SizeType, Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
</span><span class="cx">                                             LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding,
</span><span class="cx">                                             Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight,
</span><span class="lines">@@ -569,9 +593,9 @@
</span><span class="cx">     void computePositionedLogicalHeightUsing(SizeType, Length logicalHeight, const RenderBoxModelObject* containerBlock,
</span><span class="cx">                                              LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding,
</span><span class="cx">                                              Length logicalTop, Length logicalBottom, Length marginLogicalTop, Length marginLogicalBottom,
</span><del>-                                             LayoutUnit&amp; logicalHeightValue, LayoutUnit&amp; marginLogicalTopValue, LayoutUnit&amp; marginLogicalBottomValue, LayoutUnit&amp; logicalTopPos);
</del><ins>+                                             LogicalExtentComputedValues&amp;) const;
</ins><span class="cx"> 
</span><del>-    void computePositionedLogicalHeightReplaced();
</del><ins>+    void computePositionedLogicalHeightReplaced(LogicalExtentComputedValues&amp;) const;
</ins><span class="cx">     void computePositionedLogicalWidthReplaced();
</span><span class="cx"> 
</span><span class="cx">     // This function calculates the minimum and maximum preferred widths for an object.
</span></span></pre>
</div>
</div>

</body>
</html>