Title: [193413] trunk
Revision
193413
Author
[email protected]
Date
2015-12-04 03:14:49 -0800 (Fri, 04 Dec 2015)

Log Message

[css-grid] Fix height computation of grid items with borders inside fr tracks
https://bugs.webkit.org/show_bug.cgi?id=151798

Reviewed by Zalan Bujtas.

Source/WebCore:

Since r192154 we run a second pass of the track sizing
algorithm whenever the height of the grid is indefinite in
order to properly compute row sizes. The available space
passed to the track sizing algorithm must not contain neither
borders nor paddings, otherwise it will think that it has more
space available than the existing one. We should use the
height of the content box instead.

Test: fast/css-grid-layout/grid-item-with-border-in-fr.html

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

LayoutTests:

* fast/css-grid-layout/grid-item-with-border-in-fr-expected.txt: Added.
* fast/css-grid-layout/grid-item-with-border-in-fr.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (193412 => 193413)


--- trunk/LayoutTests/ChangeLog	2015-12-04 07:45:05 UTC (rev 193412)
+++ trunk/LayoutTests/ChangeLog	2015-12-04 11:14:49 UTC (rev 193413)
@@ -1,3 +1,13 @@
+2015-12-03  Sergio Villar Senin  <[email protected]>
+
+        [css-grid] Fix height computation of grid items with borders inside fr tracks
+        https://bugs.webkit.org/show_bug.cgi?id=151798
+
+        Reviewed by Zalan Bujtas.
+
+        * fast/css-grid-layout/grid-item-with-border-in-fr-expected.txt: Added.
+        * fast/css-grid-layout/grid-item-with-border-in-fr.html: Added.
+
 2015-12-03  Brady Eidson  <[email protected]>
 
         Modern IDB: Fix up tests that refer to non-standard IDBVersionChangeEvent.dataLoss.

Added: trunk/LayoutTests/fast/css-grid-layout/grid-item-with-border-in-fr-expected.txt (0 => 193413)


--- trunk/LayoutTests/fast/css-grid-layout/grid-item-with-border-in-fr-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-item-with-border-in-fr-expected.txt	2015-12-04 11:14:49 UTC (rev 193413)
@@ -0,0 +1,4 @@
+X
+PASS
+PASS
+PASS
Property changes on: trunk/LayoutTests/fast/css-grid-layout/grid-item-with-border-in-fr-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/fast/css-grid-layout/grid-item-with-border-in-fr.html (0 => 193413)


--- trunk/LayoutTests/fast/css-grid-layout/grid-item-with-border-in-fr.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-item-with-border-in-fr.html	2015-12-04 11:14:49 UTC (rev 193413)
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+
+<link href="" rel="stylesheet">
+<link href="" rel="stylesheet">
+<style>
+.frGrid {
+    -webkit-grid: 1fr / 1fr;
+    font: 50px/1 Ahem;
+    border: 50px solid magenta;
+    width: 300px;
+}
+
+.item {
+    border: 50px solid rgba(0, 255, 250, 0.5);
+}
+
+.borderMargin {
+    border: 20px solid blue;
+    margin: 30px;
+}
+
+.frRowsGrid {
+    -webkit-grid-auto-columns: 100px;
+    -webkit-grid-auto-rows: minmax(0, 1fr);
+}
+
+.frColsGrid {
+    -webkit-grid-auto-columns: minmax(0, 1fr);
+    -webkit-grid-auto-rows: 100px;
+}
+
+span {
+    background: yellow;
+    border: 10px solid;
+}
+
+.child {
+    height:40px;
+    width:40px;
+}
+
+</style>
+<script src=""
+
+<body _onload_="checkLayout('.grid')">
+
+<div class="grid frGrid" data-expected-width="400" data-expected-height="250" data-expected-client-width="300" data-expected-client-height="150">
+    <div class="item" data-expected-width="300" data-expected-height="150" data-expected-client-width="200" data-expected-client-height="50">X</div>
+</div>
+
+<div class="grid borderMargin fit-content frRowsGrid" data-expected-width="140" data-expected-height="100" data-expected-client-width="100" data-expected-client-height="60">
+    <span data-expected-width="100" data-expected-height="60" data-expected-client-width="80" data-expected-client-height="40">
+        <div class="child"></div>
+    </span>
+</div>
+
+<div class="grid borderMargin fit-content frColsGrid" data-expected-width="100" data-expected-height="140" data-expected-client-width="60" data-expected-client-height="100">
+    <span data-expected-width="60" data-expected-height="100" data-expected-client-width="40" data-expected-client-height="80">
+        <div class="child"></div>
+    </span>
+</div>
+
+</body>
Property changes on: trunk/LayoutTests/fast/css-grid-layout/grid-item-with-border-in-fr.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (193412 => 193413)


--- trunk/Source/WebCore/ChangeLog	2015-12-04 07:45:05 UTC (rev 193412)
+++ trunk/Source/WebCore/ChangeLog	2015-12-04 11:14:49 UTC (rev 193413)
@@ -1,3 +1,23 @@
+2015-12-03  Sergio Villar Senin  <[email protected]>
+
+        [css-grid] Fix height computation of grid items with borders inside fr tracks
+        https://bugs.webkit.org/show_bug.cgi?id=151798
+
+        Reviewed by Zalan Bujtas.
+
+        Since r192154 we run a second pass of the track sizing
+        algorithm whenever the height of the grid is indefinite in
+        order to properly compute row sizes. The available space
+        passed to the track sizing algorithm must not contain neither
+        borders nor paddings, otherwise it will think that it has more
+        space available than the existing one. We should use the
+        height of the content box instead.
+
+        Test: fast/css-grid-layout/grid-item-with-border-in-fr.html
+
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::layoutBlock):
+
 2015-12-03  Brady Eidson  <[email protected]>
 
         Modern IDB: storage/indexeddb/cursor-index-delete.html fails.

Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (193412 => 193413)


--- trunk/Source/WebCore/rendering/RenderGrid.cpp	2015-12-04 07:45:05 UTC (rev 193412)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp	2015-12-04 11:14:49 UTC (rev 193413)
@@ -376,7 +376,7 @@
     // The above call might have changed the grid's logical height depending on min|max height restrictions.
     // Update the sizes of the rows whose size depends on the logical height (also on definite|indefinite sizes).
     if (logicalHeightWasIndefinite)
-        computeTrackSizesForDirection(ForRows, sizingData, logicalHeight());
+        computeTrackSizesForDirection(ForRows, sizingData, contentLogicalHeight());
 
     // Grid container should have the minimum height of a line if it's editable. That does not affect track sizing though.
     if (hasLineIfEmpty()) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to