Title: [151554] trunk
Revision
151554
Author
[email protected]
Date
2013-06-13 09:49:20 -0700 (Thu, 13 Jun 2013)

Log Message

[CSS Regions] Regions auto-height and absolute positioning bug
https://bugs.webkit.org/show_bug.cgi?id=111092

Patch by Anton Obzhirov <[email protected]> on 2013-06-13
Reviewed by David Hyatt.

During last layout that should update the auto-height regions new auto-height region height
is calculated correctly based on the text content, but it requires extra step
to reposition the render block after new logical height is set (correct logical height becomes
available only during last layout).

Tests: fast/regions/autoheight-abspos-bottom-align.html

* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::updateLogicalHeight):

Modified Paths

Added Paths

Diff

Added: trunk/LayoutTests/fast/regions/autoheight-abspos-bottom-align-expected.txt (0 => 151554)


--- trunk/LayoutTests/fast/regions/autoheight-abspos-bottom-align-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/regions/autoheight-abspos-bottom-align-expected.txt	2013-06-13 16:49:20 UTC (rev 151554)
@@ -0,0 +1,7 @@
+Test for [CSS Regions] Regions auto-height and absolute positioning bug.
+
+On success you should see PASS below.
+
+this is some body copy.
+this is some body copy.
+PASS

Added: trunk/LayoutTests/fast/regions/autoheight-abspos-bottom-align.html (0 => 151554)


--- trunk/LayoutTests/fast/regions/autoheight-abspos-bottom-align.html	                        (rev 0)
+++ trunk/LayoutTests/fast/regions/autoheight-abspos-bottom-align.html	2013-06-13 16:49:20 UTC (rev 151554)
@@ -0,0 +1,22 @@
+<!doctype html>
+<html>
+    <head>
+        <style>		
+            #content { -webkit-flow-into: flow; }
+            #region { -webkit-flow-from: flow; position: absolute; bottom: 0px; right: 0px; width: 100px; background-color: white;}
+            #reference { position: absolute; bottom: 0px; right: 0px; width: 100px; background-color: red;}
+        </style>
+    </head>
+    <script src=""
+    <body _onload_="checkLayout('#region')">
+        <p>Test for <a href="" [CSS Regions] Regions auto-height and absolute positioning bug</a>.</p>
+        <p>On success you should see PASS below.</p>
+        <div id="content">this is some body copy.</div>
+        <div id="reference">this is some body copy.</div>        
+        <div id="region" data-total-y=0></div>
+        <script>
+            document.body.offsetTop; // force layout
+            document.getElementById("region").setAttribute("data-total-y", document.getElementById('reference').offsetTop);
+        </script>
+    </body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (151553 => 151554)


--- trunk/Source/WebCore/ChangeLog	2013-06-13 16:47:59 UTC (rev 151553)
+++ trunk/Source/WebCore/ChangeLog	2013-06-13 16:49:20 UTC (rev 151554)
@@ -1,3 +1,20 @@
+2013-06-13  Anton Obzhirov  <[email protected]>
+
+        [CSS Regions] Regions auto-height and absolute positioning bug
+        https://bugs.webkit.org/show_bug.cgi?id=111092
+
+        Reviewed by David Hyatt.
+
+        During last layout that should update the auto-height regions new auto-height region height
+        is calculated correctly based on the text content, but it requires extra step 
+        to reposition the render block after new logical height is set (correct logical height becomes
+        available only during last layout). 
+
+        Tests: fast/regions/autoheight-abspos-bottom-align.html
+
+        * rendering/RenderRegion.cpp:
+        (WebCore::RenderRegion::updateLogicalHeight):
+
 2013-06-13  Brent Fulgham  <[email protected]>
 
         [WinCairo] Unreviewed build correction.

Modified: trunk/Source/WebCore/rendering/RenderRegion.cpp (151553 => 151554)


--- trunk/Source/WebCore/rendering/RenderRegion.cpp	2013-06-13 16:47:59 UTC (rev 151553)
+++ trunk/Source/WebCore/rendering/RenderRegion.cpp	2013-06-13 16:49:20 UTC (rev 151554)
@@ -666,8 +666,12 @@
 
     LayoutUnit newLogicalHeight = overrideLogicalContentHeight() + borderAndPaddingLogicalHeight();
     ASSERT(newLogicalHeight < LayoutUnit::max() / 2);
-    if (newLogicalHeight > logicalHeight())
+    if (newLogicalHeight > logicalHeight()) {
         setLogicalHeight(newLogicalHeight);
+        // Recalculate position of the render block after new logical height is set.
+        // (needed in absolute positioning case with bottom alignment for example)
+        RenderBlock::updateLogicalHeight();
+    }
 }
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to