Title: [140171] trunk
Revision
140171
Author
t...@chromium.org
Date
2013-01-18 10:02:08 -0800 (Fri, 18 Jan 2013)

Log Message

Incorrect scrollable height during simplified layout
https://bugs.webkit.org/show_bug.cgi?id=107193

Reviewed by Ojan Vafai.

Source/WebCore:

Test: fast/overflow/height-during-simplified-layout.html

When computing overflow, we use the height of the block before it was clamped
(i.e., before updateLogicalHeight() has been called).

During simplfied layout, we use the previous sizes rather than doing a full
layout. We still compute overflow, but we were using the clamped height rather
than the full height.

This caused us to incorrectly compute the overflow by the vertical padding.
Since we were passing in the already clamped clientHeight to RenderBlock::computeOverflow,
we would only include the overflow from our children sizes and not include the overflow
from ourselves caused by padding + content.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::simplifiedLayout): Use the scrollable height rather than the
already clamped height.

LayoutTests:

* fast/overflow/height-during-simplified-layout-expected.txt: Added.
* fast/overflow/height-during-simplified-layout.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (140170 => 140171)


--- trunk/LayoutTests/ChangeLog	2013-01-18 18:00:48 UTC (rev 140170)
+++ trunk/LayoutTests/ChangeLog	2013-01-18 18:02:08 UTC (rev 140171)
@@ -1,3 +1,13 @@
+2013-01-18  Tony Chang  <t...@chromium.org>
+
+        Incorrect scrollable height during simplified layout
+        https://bugs.webkit.org/show_bug.cgi?id=107193
+
+        Reviewed by Ojan Vafai.
+
+        * fast/overflow/height-during-simplified-layout-expected.txt: Added.
+        * fast/overflow/height-during-simplified-layout.html: Added.
+
 2013-01-18  Dominik Röttsches  <dominik.rottsc...@intel.com>
 
         [EFL] Unreviewed gardening.

Added: trunk/LayoutTests/fast/overflow/height-during-simplified-layout-expected.txt (0 => 140171)


--- trunk/LayoutTests/fast/overflow/height-during-simplified-layout-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/overflow/height-during-simplified-layout-expected.txt	2013-01-18 18:02:08 UTC (rev 140171)
@@ -0,0 +1,5 @@
+PASS document.getElementById('scrollable').scrollTop is 400
+PASS document.getElementById('scrollable').scrollHeight is 600
+This test passes if you see a green box below.
+
+

Added: trunk/LayoutTests/fast/overflow/height-during-simplified-layout.html (0 => 140171)


--- trunk/LayoutTests/fast/overflow/height-during-simplified-layout.html	                        (rev 0)
+++ trunk/LayoutTests/fast/overflow/height-during-simplified-layout.html	2013-01-18 18:02:08 UTC (rev 140171)
@@ -0,0 +1,21 @@
+<html>
+<body>
+
+<p>This test passes if you see a green box below.</p>
+
+<div id="scrollable" style="height: 0; overflow-y: auto; padding-bottom: 200px; background-color: green">
+  <div style="position: relative; height: 400px; background-color: red">
+    <div id="node-to-hide" style="position: absolute;">hello</div>
+  </div>
+</div>
+<script src=""
+<script>
+document.body.offsetLeft;
+document.getElementById("node-to-hide").style.display = "none";
+document.getElementById("scrollable").scrollTop = "400";
+shouldBe("document.getElementById('scrollable').scrollTop", "400");
+shouldBe("document.getElementById('scrollable').scrollHeight", "600");
+</script>
+</body>
+</html>
+

Modified: trunk/Source/WebCore/ChangeLog (140170 => 140171)


--- trunk/Source/WebCore/ChangeLog	2013-01-18 18:00:48 UTC (rev 140170)
+++ trunk/Source/WebCore/ChangeLog	2013-01-18 18:02:08 UTC (rev 140171)
@@ -1,3 +1,28 @@
+2013-01-18  Tony Chang  <t...@chromium.org>
+
+        Incorrect scrollable height during simplified layout
+        https://bugs.webkit.org/show_bug.cgi?id=107193
+
+        Reviewed by Ojan Vafai.
+
+        Test: fast/overflow/height-during-simplified-layout.html
+
+        When computing overflow, we use the height of the block before it was clamped
+        (i.e., before updateLogicalHeight() has been called).
+
+        During simplfied layout, we use the previous sizes rather than doing a full
+        layout. We still compute overflow, but we were using the clamped height rather
+        than the full height.
+
+        This caused us to incorrectly compute the overflow by the vertical padding.
+        Since we were passing in the already clamped clientHeight to RenderBlock::computeOverflow,
+        we would only include the overflow from our children sizes and not include the overflow
+        from ourselves caused by padding + content.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::simplifiedLayout): Use the scrollable height rather than the
+        already clamped height.
+
 2013-01-18  Joe Mason  <jma...@rim.com>
 
         [BlackBerry] fix compile warnings in NetworkJob

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (140170 => 140171)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2013-01-18 18:00:48 UTC (rev 140170)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2013-01-18 18:02:08 UTC (rev 140171)
@@ -2596,7 +2596,8 @@
     // For now just always recompute overflow.  This is no worse performance-wise than the old code that called rightmostPosition and
     // lowestPosition on every relayout so it's not a regression.
     m_overflow.clear();
-    computeOverflow(clientLogicalBottom(), true);
+    LayoutUnit logicalScrollHeight = style()->isHorizontalWritingMode() ? scrollHeight() : scrollWidth();
+    computeOverflow(borderBefore() + logicalScrollHeight, true);
 
     statePusher.pop();
     
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to