<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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 #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#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>
<title>[20653] trunk/WebCore</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/20653">20653</a></dd>
<dt>Author</dt> <dd>antti</dd>
<dt>Date</dt> <dd>2007-04-02 02:43:08 -0700 (Mon, 02 Apr 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>        Reviewed by Hyatt.

        Render tree memory savings, part 2
        
        - Move staticX and staticY variables to RenderLayer since they are only
          applicable to positioned objects
        - Move very rarely used overrideSize variable to hash
        
        These changes shrink all box types by 12 bytes

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::RenderBox):
        (WebCore::RenderBox::destroy):
        (WebCore::RenderBox::overrideSize):
        (WebCore::RenderBox::setOverrideSize):
        (WebCore::RenderBox::overrideWidth):
        (WebCore::RenderBox::overrideHeight):
        (WebCore::RenderBox::position):
        (WebCore::RenderBox::calcWidth):
        (WebCore::RenderBox::calcHeight):
        (WebCore::RenderBox::staticX):
        (WebCore::RenderBox::staticY):
        (WebCore::RenderBox::setStaticX):
        (WebCore::RenderBox::setStaticY):
        (WebCore::RenderBox::calcAbsoluteHorizontal):
        (WebCore::RenderBox::calcAbsoluteVertical):
        (WebCore::RenderBox::calcAbsoluteHorizontalReplaced):
        (WebCore::RenderBox::calcAbsoluteVerticalReplaced):
        * rendering/RenderBox.h:
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::RenderLayer):
        * rendering/RenderLayer.h:
        (WebCore::RenderLayer::staticX):
        (WebCore::RenderLayer::staticY):
        (WebCore::RenderLayer::setStaticX):
        (WebCore::RenderLayer::setStaticY):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::RenderObject):
        * rendering/RenderObject.h:
        (WebCore::):
        (WebCore::RenderObject::hasOverrideSize):
        (WebCore::RenderObject::setHasOverrideSize):
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::destroy):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCorerenderingRenderBoxcpp">trunk/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkWebCorerenderingRenderBoxh">trunk/WebCore/rendering/RenderBox.h</a></li>
<li><a href="#trunkWebCorerenderingRenderFlexibleBoxcpp">trunk/WebCore/rendering/RenderFlexibleBox.cpp</a></li>
<li><a href="#trunkWebCorerenderingRenderLayercpp">trunk/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkWebCorerenderingRenderLayerh">trunk/WebCore/rendering/RenderLayer.h</a></li>
<li><a href="#trunkWebCorerenderingRenderObjectcpp">trunk/WebCore/rendering/RenderObject.cpp</a></li>
<li><a href="#trunkWebCorerenderingRenderObjecth">trunk/WebCore/rendering/RenderObject.h</a></li>
<li><a href="#trunkWebCorerenderingRenderWidgetcpp">trunk/WebCore/rendering/RenderWidget.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (20652 => 20653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2007-04-02 03:04:02 UTC (rev 20652)
+++ trunk/WebCore/ChangeLog        2007-04-02 09:43:08 UTC (rev 20653)
</span><span class="lines">@@ -1,3 +1,50 @@
</span><ins>+2007-03-30  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Reviewed by Hyatt.
+
+        Render tree memory savings, part 2
+        
+        - Move staticX and staticY variables to RenderLayer since they are only
+          applicable to positioned objects
+        - Move very rarely used overrideSize variable to hash
+        
+        These changes shrink all box types by 12 bytes
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::RenderBox):
+        (WebCore::RenderBox::destroy):
+        (WebCore::RenderBox::overrideSize):
+        (WebCore::RenderBox::setOverrideSize):
+        (WebCore::RenderBox::overrideWidth):
+        (WebCore::RenderBox::overrideHeight):
+        (WebCore::RenderBox::position):
+        (WebCore::RenderBox::calcWidth):
+        (WebCore::RenderBox::calcHeight):
+        (WebCore::RenderBox::staticX):
+        (WebCore::RenderBox::staticY):
+        (WebCore::RenderBox::setStaticX):
+        (WebCore::RenderBox::setStaticY):
+        (WebCore::RenderBox::calcAbsoluteHorizontal):
+        (WebCore::RenderBox::calcAbsoluteVertical):
+        (WebCore::RenderBox::calcAbsoluteHorizontalReplaced):
+        (WebCore::RenderBox::calcAbsoluteVerticalReplaced):
+        * rendering/RenderBox.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::RenderLayer):
+        * rendering/RenderLayer.h:
+        (WebCore::RenderLayer::staticX):
+        (WebCore::RenderLayer::staticY):
+        (WebCore::RenderLayer::setStaticX):
+        (WebCore::RenderLayer::setStaticY):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::RenderObject):
+        * rendering/RenderObject.h:
+        (WebCore::):
+        (WebCore::RenderObject::hasOverrideSize):
+        (WebCore::RenderObject::setHasOverrideSize):
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::destroy):
+
</ins><span class="cx"> 2007-03-31  Krzysztof Kowalczyk  &lt;kkowalczyk@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Not reviewed - gdk build fix.
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderBox.cpp (20652 => 20653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderBox.cpp        2007-04-02 03:04:02 UTC (rev 20652)
+++ trunk/WebCore/rendering/RenderBox.cpp        2007-04-02 09:43:08 UTC (rev 20653)
</span><span class="lines">@@ -49,6 +49,10 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><ins>+    
+// Used by flexible boxes when flexing this element.
+typedef WTF::HashMap&lt;const RenderBox*, int&gt; OverrideSizeMap;
+static OverrideSizeMap* gOverrideSizeMap = 0;
</ins><span class="cx"> 
</span><span class="cx"> RenderBox::RenderBox(Node* node)
</span><span class="cx">     : RenderObject(node)
</span><span class="lines">@@ -64,9 +68,6 @@
</span><span class="cx">     , m_maxWidth(-1)
</span><span class="cx">     , m_layer(0)
</span><span class="cx">     , m_inlineBoxWrapper(0)
</span><del>-    , m_overrideSize(-1)
-    , m_staticX(0)
-    , m_staticY(0)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -148,6 +149,9 @@
</span><span class="cx">     // A lot of the code in this funtion is just pasted into
</span><span class="cx">     // RenderWidget::destroy. If anything in this function changes,
</span><span class="cx">     // be sure to fix RenderWidget::destroy() as well.
</span><ins>+    
+    if (hasOverrideSize())
+        gOverrideSizeMap-&gt;remove(this);
</ins><span class="cx"> 
</span><span class="cx">     RenderLayer* layer = m_layer;
</span><span class="cx">     RenderArena* arena = renderArena();
</span><span class="lines">@@ -162,14 +166,36 @@
</span><span class="cx">         layer-&gt;destroy(arena);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+int RenderBox::overrideSize() const
+{
+    if (!hasOverrideSize())
+        return -1;
+    return gOverrideSizeMap-&gt;get(this);
+}
+
+void RenderBox::setOverrideSize(int s)
+{
+    if (s == -1) {
+        if (hasOverrideSize()) {
+            setHasOverrideSize(false);
+            gOverrideSizeMap-&gt;remove(this);
+        }
+    } else {
+        if (!gOverrideSizeMap)
+            gOverrideSizeMap = new OverrideSizeMap();
+        setHasOverrideSize(true);
+        gOverrideSizeMap-&gt;set(this, s);
+    }
+}
+
</ins><span class="cx"> int RenderBox::overrideWidth() const
</span><span class="cx"> {
</span><del>-    return m_overrideSize == -1 ? m_width : m_overrideSize;
</del><ins>+    return hasOverrideSize() ? overrideSize() : m_width;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int RenderBox::overrideHeight() const
</span><span class="cx"> {
</span><del>-    return m_overrideSize == -1 ? m_height : m_overrideSize;
</del><ins>+    return hasOverrideSize() ? overrideSize() : m_height;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderBox::setPos(int xPos, int yPos)
</span><span class="lines">@@ -821,14 +847,14 @@
</span><span class="cx">             // The value is cached in the xPos of the box.  We only need this value if
</span><span class="cx">             // our object was inline originally, since otherwise it would have ended up underneath
</span><span class="cx">             // the inlines.
</span><del>-            m_staticX = box-&gt;xPos();
</del><ins>+            setStaticX(box-&gt;xPos());
</ins><span class="cx">             setChildNeedsLayout(true, false); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
</span><span class="cx">         } else if (!wasInline &amp;&amp; hasStaticY()) {
</span><span class="cx">             // Our object was a block originally, so we make our normal flow position be
</span><span class="cx">             // just below the line box (as though all the inlines that came before us got
</span><span class="cx">             // wrapped in an anonymous block, which is what would have happened had we been
</span><span class="cx">             // in flow).  This value was cached in the yPos() of the box.
</span><del>-            m_staticY = box-&gt;yPos();
</del><ins>+            setStaticY(box-&gt;yPos());
</ins><span class="cx">             setChildNeedsLayout(true, false); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -1015,9 +1041,9 @@
</span><span class="cx"> 
</span><span class="cx">     // The parent box is flexing us, so it has increased or decreased our
</span><span class="cx">     // width.  Use the width from the style context.
</span><del>-    if (m_overrideSize != -1 &amp;&amp; parent()-&gt;style()-&gt;boxOrient() == HORIZONTAL
</del><ins>+    if (hasOverrideSize() &amp;&amp;  parent()-&gt;style()-&gt;boxOrient() == HORIZONTAL
</ins><span class="cx">             &amp;&amp; parent()-&gt;isFlexibleBox() &amp;&amp; parent()-&gt;isFlexingChildren()) {
</span><del>-        m_width = m_overrideSize;
</del><ins>+        m_width = overrideSize();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1200,9 +1226,9 @@
</span><span class="cx"> 
</span><span class="cx">         // The parent box is flexing us, so it has increased or decreased our height.  We have to
</span><span class="cx">         // grab our cached flexible height.
</span><del>-        if (m_overrideSize != -1 &amp;&amp; parent()-&gt;isFlexibleBox() &amp;&amp; parent()-&gt;style()-&gt;boxOrient() == VERTICAL
</del><ins>+        if (hasOverrideSize() &amp;&amp; parent()-&gt;isFlexibleBox() &amp;&amp; parent()-&gt;style()-&gt;boxOrient() == VERTICAL
</ins><span class="cx">                 &amp;&amp; parent()-&gt;isFlexingChildren())
</span><del>-            h = Length(m_overrideSize - borderTop() - borderBottom() - paddingTop() - paddingBottom(), Fixed);
</del><ins>+            h = Length(overrideSize() - borderTop() - borderBottom() - paddingTop() - paddingBottom(), Fixed);
</ins><span class="cx">         else if (treatAsReplaced)
</span><span class="cx">             h = Length(calcReplacedHeight(), Fixed);
</span><span class="cx">         else {
</span><span class="lines">@@ -1441,12 +1467,30 @@
</span><span class="cx">     m_marginBottom = style()-&gt;marginBottom().calcMinValue(cw);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+int RenderBox::staticX() const
+{
+    return m_layer ? m_layer-&gt;staticX() : 0;
+}
+
+int RenderBox::staticY() const
+{
+    return m_layer ? m_layer-&gt;staticY() : 0;
+}
+
+void RenderBox::setStaticX(int staticX)
+{
+    ASSERT(isPositioned());
+    m_layer-&gt;setStaticX(staticX);
+}
+
</ins><span class="cx"> void RenderBox::setStaticY(int staticY)
</span><span class="cx"> {
</span><del>-    if (staticY == m_staticY)
</del><ins>+    ASSERT(isPositioned());
+    
+    if (staticY == m_layer-&gt;staticY())
</ins><span class="cx">         return;
</span><span class="cx">     
</span><del>-    m_staticY = staticY;
</del><ins>+    m_layer-&gt;setStaticY(staticY);
</ins><span class="cx">     setChildNeedsLayout(true, false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1560,15 +1604,15 @@
</span><span class="cx">     // Calculate the static distance if needed.
</span><span class="cx">     if (left.isAuto() &amp;&amp; right.isAuto()) {
</span><span class="cx">         if (containerDirection == LTR) {
</span><del>-            // 'm_staticX' should already have been set through layout of the parent.
-            int staticPosition = m_staticX - containerBlock-&gt;borderLeft();
</del><ins>+            // 'staticX' should already have been set through layout of the parent.
+            int staticPosition = staticX() - containerBlock-&gt;borderLeft();
</ins><span class="cx">             for (RenderObject* po = parent(); po &amp;&amp; po != containerBlock; po = po-&gt;parent())
</span><span class="cx">                 staticPosition += po-&gt;xPos();
</span><span class="cx">             left.setValue(Fixed, staticPosition);
</span><span class="cx">         } else {
</span><span class="cx">             RenderObject* po = parent();
</span><del>-            // 'm_staticX' should already have been set through layout of the parent.
-            int staticPosition = m_staticX + containerWidth + containerBlock-&gt;borderRight() - po-&gt;width();
</del><ins>+            // 'staticX' should already have been set through layout of the parent.
+            int staticPosition = staticX() + containerWidth + containerBlock-&gt;borderRight() - po-&gt;width();
</ins><span class="cx">             for (; po &amp;&amp; po != containerBlock; po = po-&gt;parent())
</span><span class="cx">                 staticPosition -= po-&gt;xPos();
</span><span class="cx">             right.setValue(Fixed, staticPosition);
</span><span class="lines">@@ -1848,8 +1892,8 @@
</span><span class="cx">     // see FIXME 2
</span><span class="cx">     // Calculate the static distance if needed.
</span><span class="cx">     if (top.isAuto() &amp;&amp; bottom.isAuto()) {
</span><del>-        // m_staticY should already have been set through layout of the parent()
-        int staticTop = m_staticY - containerBlock-&gt;borderTop();
</del><ins>+        // staticY should already have been set through layout of the parent()
+        int staticTop = staticY() - containerBlock-&gt;borderTop();
</ins><span class="cx">         for (RenderObject* po = parent(); po &amp;&amp; po != containerBlock; po = po-&gt;parent()) {
</span><span class="cx">             if (!po-&gt;isTableRow())
</span><span class="cx">                 staticTop += po-&gt;yPos();
</span><span class="lines">@@ -2073,15 +2117,15 @@
</span><span class="cx">     if (left.isAuto() &amp;&amp; right.isAuto()) {
</span><span class="cx">         // see FIXME 1
</span><span class="cx">         if (containerDirection == LTR) {
</span><del>-            // 'm_staticX' should already have been set through layout of the parent.
-            int staticPosition = m_staticX - containerBlock-&gt;borderLeft();
</del><ins>+            // 'staticX' should already have been set through layout of the parent.
+            int staticPosition = staticX() - containerBlock-&gt;borderLeft();
</ins><span class="cx">             for (RenderObject* po = parent(); po &amp;&amp; po != containerBlock; po = po-&gt;parent())
</span><span class="cx">                 staticPosition += po-&gt;xPos();
</span><span class="cx">             left.setValue(Fixed, staticPosition);
</span><span class="cx">         } else {
</span><span class="cx">             RenderObject* po = parent();
</span><del>-            // 'm_staticX' should already have been set through layout of the parent.
-            int staticPosition = m_staticX + containerWidth + containerBlock-&gt;borderRight() - po-&gt;width();
</del><ins>+            // 'staticX' should already have been set through layout of the parent.
+            int staticPosition = staticX() + containerWidth + containerBlock-&gt;borderRight() - po-&gt;width();
</ins><span class="cx">             for (; po &amp;&amp; po != containerBlock; po = po-&gt;parent())
</span><span class="cx">                 staticPosition -= po-&gt;xPos();
</span><span class="cx">             right.setValue(Fixed, staticPosition);
</span><span class="lines">@@ -2239,8 +2283,8 @@
</span><span class="cx">     \*-----------------------------------------------------------------------*/
</span><span class="cx">     // see FIXME 2
</span><span class="cx">     if (top.isAuto() &amp;&amp; bottom.isAuto()) {
</span><del>-        // m_staticY should already have been set through layout of the parent().
-        int staticTop = m_staticY - containerBlock-&gt;borderTop();
</del><ins>+        // staticY should already have been set through layout of the parent().
+        int staticTop = staticY() - containerBlock-&gt;borderTop();
</ins><span class="cx">         for (RenderObject* po = parent(); po &amp;&amp; po != containerBlock; po = po-&gt;parent()) {
</span><span class="cx">             if (!po-&gt;isTableRow())
</span><span class="cx">                 staticTop += po-&gt;yPos();
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderBoxh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderBox.h (20652 => 20653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderBox.h        2007-04-02 03:04:02 UTC (rev 20652)
+++ trunk/WebCore/rendering/RenderBox.h        2007-04-02 09:43:08 UTC (rev 20653)
</span><span class="lines">@@ -45,10 +45,10 @@
</span><span class="cx">     virtual int minWidth() const { return m_minWidth; }
</span><span class="cx">     virtual int maxWidth() const { return m_maxWidth; }
</span><span class="cx"> 
</span><del>-    virtual int overrideSize() const { return m_overrideSize; }
</del><ins>+    virtual int overrideSize() const;
</ins><span class="cx">     virtual int overrideWidth() const;
</span><span class="cx">     virtual int overrideHeight() const;
</span><del>-    virtual void setOverrideSize(int s) { m_overrideSize = s; }
</del><ins>+    virtual void setOverrideSize(int);
</ins><span class="cx"> 
</span><span class="cx">     virtual bool absolutePosition(int&amp; x, int&amp; y, bool fixed = false) const;
</span><span class="cx"> 
</span><span class="lines">@@ -141,9 +141,9 @@
</span><span class="cx">     virtual void paintBackgroundExtended(GraphicsContext*, const Color&amp;, const BackgroundLayer*, int clipY, int clipHeight,
</span><span class="cx">                                          int tx, int ty, int width, int height, bool includeLeftEdge = true, bool includeRightEdge = true);
</span><span class="cx"> 
</span><del>-    virtual int staticX() const { return m_staticX; }
-    virtual int staticY() const { return m_staticY; }
-    virtual void setStaticX(int staticX) { m_staticX = staticX; }
</del><ins>+    virtual int staticX() const;
+    virtual int staticY() const;
+    virtual void setStaticX(int staticX);
</ins><span class="cx">     virtual void setStaticY(int staticY);
</span><span class="cx"> 
</span><span class="cx">     virtual IntRect getOverflowClipRect(int tx, int ty);
</span><span class="lines">@@ -208,14 +208,6 @@
</span><span class="cx"> 
</span><span class="cx">     // For inline replaced elements, the inline box that owns us.
</span><span class="cx">     InlineBox* m_inlineBoxWrapper;
</span><del>-
-private:
-    // Used by flexible boxes when flexing this element.
-    int m_overrideSize;
-
-    // Cached normal flow values for absolute positioned elements with static left/top values.
-    int m_staticX;
-    int m_staticY;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderFlexibleBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderFlexibleBox.cpp (20652 => 20653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderFlexibleBox.cpp        2007-04-02 03:04:02 UTC (rev 20652)
+++ trunk/WebCore/rendering/RenderFlexibleBox.cpp        2007-04-02 09:43:08 UTC (rev 20653)
</span><span class="lines">@@ -314,11 +314,14 @@
</span><span class="cx">         // bottom margin max values to 0.  This way we don't factor in the values
</span><span class="cx">         // twice when we collapse with our previous vertically adjacent and
</span><span class="cx">         // following vertically adjacent blocks.
</span><del>-        if (m_maxBottomPosMargin &gt; m_maxTopPosMargin)
-            m_maxTopPosMargin = m_maxBottomPosMargin;
-        if (m_maxBottomNegMargin &gt; m_maxTopNegMargin)
-            m_maxTopNegMargin = m_maxBottomNegMargin;
-        m_maxBottomNegMargin = m_maxBottomPosMargin = 0;
</del><ins>+        int pos = maxTopPosMargin();
+        int neg = maxTopNegMargin();
+        if (maxBottomPosMargin() &gt; pos)
+            pos = maxBottomPosMargin();
+        if (maxBottomNegMargin() &gt; neg)
+            neg = maxBottomNegMargin();
+        setMaxTopMargins(pos, neg);
+        setMaxBottomMargins(0, 0);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Always ensure our overflow width is at least as large as our width.
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderLayer.cpp (20652 => 20653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderLayer.cpp        2007-04-02 03:04:02 UTC (rev 20652)
+++ trunk/WebCore/rendering/RenderLayer.cpp        2007-04-02 09:43:08 UTC (rev 20653)
</span><span class="lines">@@ -148,6 +148,8 @@
</span><span class="cx">     , m_visibleDescendantStatusDirty(false)
</span><span class="cx">     , m_hasVisibleDescendant(false)
</span><span class="cx">     , m_marquee(0)
</span><ins>+    , m_staticX(0)
+    , m_staticY(0)
</ins><span class="cx"> {
</span><span class="cx">     if (!object-&gt;firstChild() &amp;&amp; object-&gt;style()) {
</span><span class="cx">         m_visibleContentStatusDirty = false;
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderLayerh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderLayer.h (20652 => 20653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderLayer.h        2007-04-02 03:04:02 UTC (rev 20652)
+++ trunk/WebCore/rendering/RenderLayer.h        2007-04-02 09:43:08 UTC (rev 20653)
</span><span class="lines">@@ -338,6 +338,11 @@
</span><span class="cx">     void updateHoverActiveState(const HitTestRequest&amp;, HitTestResult&amp;);
</span><span class="cx"> 
</span><span class="cx">     IntRect repaintRect() const { return m_repaintRect; }
</span><ins>+    
+    int staticX() const { return m_staticX; }
+    int staticY() const { return m_staticY; }
+    void setStaticX(int staticX) { m_staticX = staticX; }
+    void setStaticY(int staticY) { m_staticY = staticY; }
</ins><span class="cx"> 
</span><span class="cx">     void destroy(RenderArena*);
</span><span class="cx"> 
</span><span class="lines">@@ -450,6 +455,10 @@
</span><span class="cx">     bool m_hasVisibleDescendant : 1;
</span><span class="cx"> 
</span><span class="cx">     Marquee* m_marquee; // Used by layers with overflow:marquee
</span><ins>+    
+    // Cached normal flow values for absolute positioned elements with static left/top values.
+    int m_staticX;
+    int m_staticY;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderObject.cpp (20652 => 20653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderObject.cpp        2007-04-02 03:04:02 UTC (rev 20652)
+++ trunk/WebCore/rendering/RenderObject.cpp        2007-04-02 09:43:08 UTC (rev 20653)
</span><span class="lines">@@ -188,6 +188,7 @@
</span><span class="cx">     , m_replaced(false)
</span><span class="cx">     , m_isDragging(false)
</span><span class="cx">     , m_hasOverflowClip(false)
</span><ins>+    , m_hasOverrideSize(false)
</ins><span class="cx">     , m_hasCounterNodeMap(false)
</span><span class="cx"> {
</span><span class="cx"> #ifndef NDEBUG
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderObjecth"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderObject.h (20652 => 20653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderObject.h        2007-04-02 03:04:02 UTC (rev 20652)
+++ trunk/WebCore/rendering/RenderObject.h        2007-04-02 09:43:08 UTC (rev 20653)
</span><span class="lines">@@ -101,9 +101,9 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> enum VerticalPositionHint {
</span><del>-    PositionTop = -0x4000,
-    PositionBottom = 0x4000,
-    PositionUndefined = 0x3fff
</del><ins>+    PositionTop = -0x2000,
+    PositionBottom = 0x2000,
+    PositionUndefined = 0x1fff
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> struct DashboardRegionValue {
</span><span class="lines">@@ -881,6 +881,9 @@
</span><span class="cx">         return !paintInfo.paintingRoot || paintInfo.paintingRoot == this;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    bool hasOverrideSize() const { return m_hasOverrideSize; }
+    void setHasOverrideSize(bool b) { m_hasOverrideSize = b; }
+    
</ins><span class="cx">     void remove() { if (parent()) parent()-&gt;removeChild(this); }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="lines">@@ -904,7 +907,7 @@
</span><span class="cx">     RenderObject* m_previous;
</span><span class="cx">     RenderObject* m_next;
</span><span class="cx"> 
</span><del>-    mutable short m_verticalPosition;
</del><ins>+    mutable short m_verticalPosition : 15;
</ins><span class="cx"> 
</span><span class="cx">     bool m_needsLayout               : 1;
</span><span class="cx">     bool m_normalChildNeedsLayout    : 1;
</span><span class="lines">@@ -926,6 +929,8 @@
</span><span class="cx"> 
</span><span class="cx">     bool m_hasOverflowClip           : 1;
</span><span class="cx"> 
</span><ins>+    bool m_hasOverrideSize           : 1;
+    
</ins><span class="cx"> public:
</span><span class="cx">     bool m_hasCounterNodeMap         : 1;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderWidgetcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderWidget.cpp (20652 => 20653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderWidget.cpp        2007-04-02 03:04:02 UTC (rev 20652)
+++ trunk/WebCore/rendering/RenderWidget.cpp        2007-04-02 09:43:08 UTC (rev 20653)
</span><span class="lines">@@ -84,6 +84,10 @@
</span><span class="cx">             m_view-&gt;removeChild(m_widget);
</span><span class="cx">         widgetRendererMap().remove(m_widget);
</span><span class="cx">     }
</span><ins>+    
+    // removes from override size map
+    if (hasOverrideSize())
+        setOverrideSize(-1);
</ins><span class="cx"> 
</span><span class="cx">     RenderLayer* layer = m_layer;
</span><span class="cx">     RenderArena* arena = renderArena();
</span></span></pre>
</div>
</div>

</body>
</html>