Title: [201709] trunk
Revision
201709
Author
[email protected]
Date
2016-06-06 05:11:22 -0700 (Mon, 06 Jun 2016)

Log Message

[css-grid] Horizontal scroll must account for grid container's height
https://bugs.webkit.org/show_bug.cgi?id=157971

Reviewed by Darin Adler.

Source/WebCore:

We don't consider the scrollbar when computing the grid container's
logical height at the beginning of the 'layoutBlock' logic. We must
do it because otherwise, contentLogicalHeight may return a negative
value.

Test: fast/css-grid-layout/grid-container-scroll-accounts-for-sizing.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):

LayoutTests:

Test to verify we account horizontal scrollbar's size for grid container's
height computation.

* fast/css-grid-layout/grid-container-scroll-accounts-for-sizing-expected.html: Added.
* fast/css-grid-layout/grid-container-scroll-accounts-for-sizing.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (201708 => 201709)


--- trunk/LayoutTests/ChangeLog	2016-06-06 08:25:16 UTC (rev 201708)
+++ trunk/LayoutTests/ChangeLog	2016-06-06 12:11:22 UTC (rev 201709)
@@ -1,3 +1,16 @@
+2016-06-06  Javier Fernandez  <[email protected]>
+
+        [css-grid] Horizontal scroll must account for grid container's height
+        https://bugs.webkit.org/show_bug.cgi?id=157971
+
+        Reviewed by Darin Adler.
+
+        Test to verify we account horizontal scrollbar's size for grid container's
+        height computation.
+
+        * fast/css-grid-layout/grid-container-scroll-accounts-for-sizing-expected.html: Added.
+        * fast/css-grid-layout/grid-container-scroll-accounts-for-sizing.html: Added.
+
 2016-06-05  Sam Weinig  <[email protected]>
 
         Add experimental support for spring based CSS animations

Added: trunk/LayoutTests/fast/css-grid-layout/grid-container-scroll-accounts-for-sizing-expected.html (0 => 201709)


--- trunk/LayoutTests/fast/css-grid-layout/grid-container-scroll-accounts-for-sizing-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-container-scroll-accounts-for-sizing-expected.html	2016-06-06 12:11:22 UTC (rev 201709)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<link href="" rel="stylesheet">
+<style>
+html {
+   overflow-x: scroll;
+}
+.container {
+   overflow-y: scroll;
+   overflow-x: scroll;
+}
+.item {
+    background: lime;
+    width: 100px;
+    height: 100px;
+}
+</style>
+<p>This test passes if you see a 100x100px green box and scrollbars are disabled.</p>
+<div class="container fit-content">
+    <div class="item">item</div>
+</div>

Added: trunk/LayoutTests/fast/css-grid-layout/grid-container-scroll-accounts-for-sizing.html (0 => 201709)


--- trunk/LayoutTests/fast/css-grid-layout/grid-container-scroll-accounts-for-sizing.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-container-scroll-accounts-for-sizing.html	2016-06-06 12:11:22 UTC (rev 201709)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<link href="" rel="stylesheet">
+<style>
+html {
+   overflow-x: scroll;
+}
+.container {
+   display: grid;
+   overflow-y: scroll;
+   overflow-x: scroll;
+}
+.item {
+    background: lime;
+    width: 100px;
+    height: 100px;
+}
+</style>
+<p>This test passes if you see a 100x100px green box and scrollbars are disabled.</p>
+<div class="container fit-content">
+    <div class="item">item</div>
+</div>

Modified: trunk/Source/WebCore/ChangeLog (201708 => 201709)


--- trunk/Source/WebCore/ChangeLog	2016-06-06 08:25:16 UTC (rev 201708)
+++ trunk/Source/WebCore/ChangeLog	2016-06-06 12:11:22 UTC (rev 201709)
@@ -1,3 +1,20 @@
+2016-06-06  Javier Fernandez  <[email protected]>
+
+        [css-grid] Horizontal scroll must account for grid container's height
+        https://bugs.webkit.org/show_bug.cgi?id=157971
+
+        Reviewed by Darin Adler.
+
+        We don't consider the scrollbar when computing the grid container's
+        logical height at the beginning of the 'layoutBlock' logic. We must
+        do it because otherwise, contentLogicalHeight may return a negative
+        value.
+
+        Test: fast/css-grid-layout/grid-container-scroll-accounts-for-sizing.html
+
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::layoutBlock):
+
 2016-06-06  Alex Christensen  <[email protected]>
 
         Reduce ResourceRequest copying in loading code

Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (201708 => 201709)


--- trunk/Source/WebCore/rendering/RenderGrid.cpp	2016-06-06 08:25:16 UTC (rev 201708)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp	2016-06-06 12:11:22 UTC (rev 201709)
@@ -399,7 +399,7 @@
         computeIntrinsicLogicalHeight(sizingData);
     else
         computeTrackSizesForDirection(ForRows, sizingData, availableLogicalHeight(ExcludeMarginBorderPadding));
-    setLogicalHeight(computeTrackBasedLogicalHeight(sizingData) + borderAndPaddingLogicalHeight());
+    setLogicalHeight(computeTrackBasedLogicalHeight(sizingData) + borderAndPaddingLogicalHeight() + scrollbarLogicalHeight());
 
     LayoutUnit oldClientAfterEdge = clientLogicalBottom();
     updateLogicalHeight();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to