Title: [261894] trunk
Revision
261894
Author
obru...@igalia.com
Date
2020-05-19 16:50:25 -0700 (Tue, 19 May 2020)

Log Message

Fix marginLogicalSizeForChild to check auto margins in the right axis
https://bugs.webkit.org/show_bug.cgi?id=212055

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Import new WPT test.

* web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001.html: Added.
* web-platform-tests/css/css-grid/grid-items/w3c-import.log:

Source/WebCore:

GridLayoutFunctions::marginLogicalSizeForChild checks for 'auto' margins
before retrieving the margin size, since these should be treated as 0.
However, for orthogonal grid items, it used to check the wrong axis.
So if an item had 'margin-top: auto' and 'margin-left: 5px', when asking
for the horizontal margin we could get 0px instead of 5px due to the
auto margin in the vertical axis.

Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001.html

* rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::marginLogicalSizeForChild):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (261893 => 261894)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-05-19 23:35:58 UTC (rev 261893)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-05-19 23:50:25 UTC (rev 261894)
@@ -1,3 +1,16 @@
+2020-05-19  Oriol Brufau  <obru...@igalia.com>
+
+        Fix marginLogicalSizeForChild to check auto margins in the right axis
+        https://bugs.webkit.org/show_bug.cgi?id=212055
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        Import new WPT test.
+
+        * web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001-expected.txt: Added.
+        * web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001.html: Added.
+        * web-platform-tests/css/css-grid/grid-items/w3c-import.log:
+
 2020-05-14  Sergio Villar Senin  <svil...@igalia.com>
 
         [WebXR] Implement requestSession()

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001-expected.txt (0 => 261894)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001-expected.txt	2020-05-19 23:50:25 UTC (rev 261894)
@@ -0,0 +1,98 @@
+
+PASS .grid 1 
+PASS .grid 2 
+PASS .grid 3 
+PASS .grid 4 
+PASS .grid 5 
+PASS .grid 6 
+PASS .grid 7 
+PASS .grid 8 
+PASS .grid 9 
+PASS .grid 10 
+PASS .grid 11 
+PASS .grid 12 
+PASS .grid 13 
+PASS .grid 14 
+PASS .grid 15 
+PASS .grid 16 
+PASS .grid 17 
+PASS .grid 18 
+PASS .grid 19 
+PASS .grid 20 
+PASS .grid 21 
+PASS .grid 22 
+PASS .grid 23 
+PASS .grid 24 
+PASS .grid 25 
+PASS .grid 26 
+PASS .grid 27 
+PASS .grid 28 
+PASS .grid 29 
+PASS .grid 30 
+PASS .grid 31 
+PASS .grid 32 
+PASS .grid 33 
+PASS .grid 34 
+PASS .grid 35 
+PASS .grid 36 
+PASS .grid 37 
+PASS .grid 38 
+PASS .grid 39 
+PASS .grid 40 
+PASS .grid 41 
+PASS .grid 42 
+PASS .grid 43 
+PASS .grid 44 
+PASS .grid 45 
+PASS .grid 46 
+Direction LTR
+
+Item height: 60px;
+ Item min-height: 60px;
+ Item height: 60px; & margin-left: 5px;
+ Item min-height: 60px; & margin-left: 5px;
+ Item min-height: 60px; & margin-top: 5px; & margin-left: auto
+ Item height: 60px; & margin-right: 10px;
+ Item min-height: 60px; & margin-right: 10px;
+ Item height: 60px; & margin-left: 5px; & margin-right: 10px;
+ Item min-height: 60px; & margin-left: 5px; & margin-right: 10px;
+ Item height: 60px; & padding-left: 6px;
+ Item min-height: 60px; & padding-left: 6px;
+ Item height: 60px; & padding-right: 3px;
+ Item min-height: 60px; & padding-right: 3px;
+ Item height: 60px; & padding-left: 6px; & padding-right: 3px;
+ Item min-height: 60px; & padding-left: 6px; & padding-right: 3px;
+ Item height: 60px; & border-left-width: 2px;
+ Item min-height: 60px; & border-left-width: 2px;
+ Item height: 60px; & border-right-width: 4px;
+ Item min-height: 60px; & border-right-width: 4px;
+ Item height: 60px; & border-left-width: 2px; & border-right-width: 4px;
+ Item min-height: 60px; & border-left-width: 2px; & border-right-width: 4px;
+ Item height: 60px; & margin-left: 5px; & margin-right: 10px; & padding-left: 6px; & padding-right: 3px; & border-left-width: 2px; & border-right-width: 4px;
+ Item min-height: 60px; & margin-left: 5px; & margin-right: 10px; & padding-left: 6px; & padding-right: 3px; & border-left-width: 2px; & border-right-width: 4px;
+Direction RTL
+
+Item height: 60px;
+ Item min-height: 60px;
+ Item height: 60px; & margin-left: 5px;
+ Item min-height: 60px; & margin-left: 5px;
+ Item min-height: 60px; & margin-top: 5px; & margin-left: auto
+ Item height: 60px; & margin-right: 10px;
+ Item min-height: 60px; & margin-right: 10px;
+ Item height: 60px; & margin-left: 5px; & margin-right: 10px;
+ Item min-height: 60px; & margin-left: 5px; & margin-right: 10px;
+ Item height: 60px; & padding-left: 6px;
+ Item min-height: 60px; & padding-left: 6px;
+ Item height: 60px; & padding-right: 3px;
+ Item min-height: 60px; & padding-right: 3px;
+ Item height: 60px; & padding-left: 6px; & padding-right: 3px;
+ Item min-height: 60px; & padding-left: 6px; & padding-right: 3px;
+ Item height: 60px; & border-left-width: 2px;
+ Item min-height: 60px; & border-left-width: 2px;
+ Item height: 60px; & border-right-width: 4px;
+ Item min-height: 60px; & border-right-width: 4px;
+ Item height: 60px; & border-left-width: 2px; & border-right-width: 4px;
+ Item min-height: 60px; & border-left-width: 2px; & border-right-width: 4px;
+ Item height: 60px; & margin-left: 5px; & margin-right: 10px; & padding-left: 6px; & padding-right: 3px; & border-left-width: 2px; & border-right-width: 4px;
+ Item min-height: 60px; & margin-left: 5px; & margin-right: 10px; & padding-left: 6px; & padding-right: 3px; & border-left-width: 2px; & border-right-width: 4px;
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001.html (0 => 261894)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001.html	2020-05-19 23:50:25 UTC (rev 261894)
@@ -0,0 +1,365 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Grid Layout Test: Mininum height of grid items orthogonal</title>
+<link rel="author" title="Oriol Brufau" href=""
+<link rel="help" href=""
+<meta name="assert" content="Checks that orthogonal grid items minimum height take into account borders, padding and margins for grid containers with definite height.">
+<link rel="stylesheet" href=""
+<style>
+.grid {
+  display: inline-grid;
+  height: 100px;
+  border: solid thick;
+  grid: minmax(auto, 0px) / 10px 10px;
+}
+
+.grid > div:nth-child(1) { background: cyan; writing-mode: vertical-lr; }
+.grid > div:nth-child(2) { background: magenta; }
+
+.height60 { height: 60px; }
+.minHeight60 { min-height: 60px; }
+
+.marginTop5 { margin-top: 5px; }
+.marginBottom10 { margin-bottom: 10px; }
+.marginLeftAuto { margin-left: auto }
+
+.paddingTop6 { padding-top: 6px; }
+.paddingBottom3 { padding-bottom: 3px; }
+
+.borderTop2, .borderBottom4 { border: solid yellow 0px; }
+.borderTop2 { border-top-width: 2px; }
+.borderBottom4 { border-bottom-width: 4px; }
+</style>
+<script src=""
+<script src=""
+<script src=""
+
+<body _onload_="checkLayout('.grid')">
+
+<div id="log"></div>
+
+<h3>Direction LTR</h3>
+
+<pre>Item height: 60px;</pre>
+
+<div class="grid">
+  <div class="height60" data-expected-height="60"></div>
+  <div data-expected-height="60"></div>
+</div>
+
+<pre>Item min-height: 60px;</pre>
+
+<div class="grid">
+  <div class="minHeight60" data-expected-height="60"></div>
+  <div data-expected-height="60"></div>
+</div>
+
+<pre>Item height: 60px; &amp; margin-left: 5px;</pre>
+
+<div class="grid">
+  <div class="height60 marginTop5" data-expected-height="60"></div>
+  <div data-expected-height="65"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; margin-left: 5px;</pre>
+
+<div class="grid">
+  <div class="minHeight60 marginTop5" data-expected-height="60"></div>
+  <div data-expected-height="65"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; margin-top: 5px; &amp; margin-left: auto</pre>
+
+<div class="grid">
+  <div class="minHeight60 marginTop5 marginLeftAuto" data-expected-height="60"></div>
+  <div data-expected-height="65"></div>
+</div>
+
+<pre>Item height: 60px; &amp; margin-right: 10px;</pre>
+
+<div class="grid">
+  <div class="height60 marginBottom10" data-expected-height="60"></div>
+  <div data-expected-height="70"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; margin-right: 10px;</pre>
+
+<div class="grid">
+  <div class="minHeight60 marginBottom10" data-expected-height="60"></div>
+  <div data-expected-height="70"></div>
+</div>
+
+<pre>Item height: 60px; &amp; margin-left: 5px; &amp; margin-right: 10px;</pre>
+
+<div class="grid">
+  <div class="height60 marginTop5 marginBottom10" data-expected-height="60"></div>
+  <div data-expected-height="75"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; margin-left: 5px; &amp; margin-right: 10px;</pre>
+
+<div class="grid">
+  <div class="minHeight60 marginTop5 marginBottom10" data-expected-height="60"></div>
+  <div data-expected-height="75"></div>
+</div>
+
+<pre>Item height: 60px; &amp; padding-left: 6px;</pre>
+
+<div class="grid">
+  <div class="height60 paddingTop6" data-expected-height="66"></div>
+  <div data-expected-height="66"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; padding-left: 6px;</pre>
+
+<div class="grid">
+  <div class="minHeight60 paddingTop6" data-expected-height="66"></div>
+  <div data-expected-height="66"></div>
+</div>
+
+<pre>Item height: 60px; &amp; padding-right: 3px;</pre>
+
+<div class="grid">
+  <div class="height60 paddingBottom3" data-expected-height="63"></div>
+  <div data-expected-height="63"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; padding-right: 3px;</pre>
+
+<div class="grid">
+  <div class="minHeight60 paddingBottom3" data-expected-height="63"></div>
+  <div data-expected-height="63"></div>
+</div>
+
+<pre>Item height: 60px; &amp; padding-left: 6px; &amp; padding-right: 3px;</pre>
+
+<div class="grid">
+  <div class="height60 paddingTop6 paddingBottom3" data-expected-height="69"></div>
+  <div data-expected-height="69"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; padding-left: 6px; &amp; padding-right: 3px;</pre>
+
+<div class="grid">
+  <div class="minHeight60 paddingTop6 paddingBottom3" data-expected-height="69"></div>
+  <div data-expected-height="69"></div>
+</div>
+
+<pre>Item height: 60px; &amp; border-left-width: 2px;</pre>
+
+<div class="grid">
+  <div class="height60 borderTop2" data-expected-height="62"></div>
+  <div data-expected-height="62"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; border-left-width: 2px;</pre>
+
+<div class="grid">
+  <div class="minHeight60 borderTop2" data-expected-height="62"></div>
+  <div data-expected-height="62"></div>
+</div>
+
+<pre>Item height: 60px; &amp; border-right-width: 4px;</pre>
+
+<div class="grid">
+  <div class="height60 borderBottom4" data-expected-height="64"></div>
+  <div data-expected-height="64"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; border-right-width: 4px;</pre>
+
+<div class="grid">
+  <div class="minHeight60 borderBottom4" data-expected-height="64"></div>
+  <div data-expected-height="64"></div>
+</div>
+
+<pre>Item height: 60px; &amp; border-left-width: 2px; &amp; border-right-width: 4px;</pre>
+
+<div class="grid">
+  <div class="height60 borderTop2 borderBottom4" data-expected-height="66"></div>
+  <div data-expected-height="66"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; border-left-width: 2px; &amp; border-right-width: 4px;</pre>
+
+<div class="grid">
+  <div class="minHeight60 borderTop2 borderBottom4" data-expected-height="66"></div>
+  <div data-expected-height="66"></div>
+</div>
+
+<pre>Item height: 60px; &amp; margin-left: 5px; &amp; margin-right: 10px; &amp; padding-left: 6px; &amp; padding-right: 3px; &amp; border-left-width: 2px; &amp; border-right-width: 4px;</pre>
+
+<div class="grid">
+  <div class="height60 marginTop5 marginBottom10 paddingTop6 paddingBottom3 borderTop2 borderBottom4" data-expected-height="75"></div>
+  <div data-expected-height="90"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; margin-left: 5px; &amp; margin-right: 10px; &amp; padding-left: 6px; &amp; padding-right: 3px; &amp; border-left-width: 2px; &amp; border-right-width: 4px;</pre>
+
+<div class="grid">
+  <div class="minHeight60 marginTop5 marginBottom10 paddingTop6 paddingBottom3 borderTop2 borderBottom4" data-expected-height="75"></div>
+  <div data-expected-height="90"></div>
+</div>
+
+<h3>Direction RTL</h3>
+
+<pre>Item height: 60px;</pre>
+
+<div class="grid directionRTL">
+  <div class="height60" data-expected-height="60"></div>
+  <div data-expected-height="60"></div>
+</div>
+
+<pre>Item min-height: 60px;</pre>
+
+<div class="grid directionRTL">
+  <div class="minHeight60" data-expected-height="60"></div>
+  <div data-expected-height="60"></div>
+</div>
+
+<pre>Item height: 60px; &amp; margin-left: 5px;</pre>
+
+<div class="grid directionRTL">
+  <div class="height60 marginTop5" data-expected-height="60"></div>
+  <div data-expected-height="65"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; margin-left: 5px;</pre>
+
+<div class="grid directionRTL">
+  <div class="minHeight60 marginTop5" data-expected-height="60"></div>
+  <div data-expected-height="65"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; margin-top: 5px; &amp; margin-left: auto</pre>
+
+<div class="grid directionRTL">
+  <div class="minHeight60 marginTop5 marginLeftAuto" data-expected-height="60"></div>
+  <div data-expected-height="65"></div>
+</div>
+
+<pre>Item height: 60px; &amp; margin-right: 10px;</pre>
+
+<div class="grid directionRTL">
+  <div class="height60 marginBottom10" data-expected-height="60"></div>
+  <div data-expected-height="70"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; margin-right: 10px;</pre>
+
+<div class="grid directionRTL">
+  <div class="minHeight60 marginBottom10" data-expected-height="60"></div>
+  <div data-expected-height="70"></div>
+</div>
+
+<pre>Item height: 60px; &amp; margin-left: 5px; &amp; margin-right: 10px;</pre>
+
+<div class="grid directionRTL">
+  <div class="height60 marginTop5 marginBottom10" data-expected-height="60"></div>
+  <div data-expected-height="75"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; margin-left: 5px; &amp; margin-right: 10px;</pre>
+
+<div class="grid directionRTL">
+  <div class="minHeight60 marginTop5 marginBottom10" data-expected-height="60"></div>
+  <div data-expected-height="75"></div>
+</div>
+
+<pre>Item height: 60px; &amp; padding-left: 6px;</pre>
+
+<div class="grid directionRTL">
+  <div class="height60 paddingTop6" data-expected-height="66"></div>
+  <div data-expected-height="66"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; padding-left: 6px;</pre>
+
+<div class="grid directionRTL">
+  <div class="minHeight60 paddingTop6" data-expected-height="66"></div>
+  <div data-expected-height="66"></div>
+</div>
+
+<pre>Item height: 60px; &amp; padding-right: 3px;</pre>
+
+<div class="grid directionRTL">
+  <div class="height60 paddingBottom3" data-expected-height="63"></div>
+  <div data-expected-height="63"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; padding-right: 3px;</pre>
+
+<div class="grid directionRTL">
+  <div class="minHeight60 paddingBottom3" data-expected-height="63"></div>
+  <div data-expected-height="63"></div>
+</div>
+
+<pre>Item height: 60px; &amp; padding-left: 6px; &amp; padding-right: 3px;</pre>
+
+<div class="grid directionRTL">
+  <div class="height60 paddingTop6 paddingBottom3" data-expected-height="69"></div>
+  <div data-expected-height="69"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; padding-left: 6px; &amp; padding-right: 3px;</pre>
+
+<div class="grid directionRTL">
+  <div class="minHeight60 paddingTop6 paddingBottom3" data-expected-height="69"></div>
+  <div data-expected-height="69"></div>
+</div>
+
+<pre>Item height: 60px; &amp; border-left-width: 2px;</pre>
+
+<div class="grid directionRTL">
+  <div class="height60 borderTop2" data-expected-height="62"></div>
+  <div data-expected-height="62"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; border-left-width: 2px;</pre>
+
+<div class="grid directionRTL">
+  <div class="minHeight60 borderTop2" data-expected-height="62"></div>
+  <div data-expected-height="62"></div>
+</div>
+
+<pre>Item height: 60px; &amp; border-right-width: 4px;</pre>
+
+<div class="grid directionRTL">
+  <div class="height60 borderBottom4" data-expected-height="64"></div>
+  <div data-expected-height="64"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; border-right-width: 4px;</pre>
+
+<div class="grid directionRTL">
+  <div class="minHeight60 borderBottom4" data-expected-height="64"></div>
+  <div data-expected-height="64"></div>
+</div>
+
+<pre>Item height: 60px; &amp; border-left-width: 2px; &amp; border-right-width: 4px;</pre>
+
+<div class="grid directionRTL">
+  <div class="height60 borderTop2 borderBottom4" data-expected-height="66"></div>
+  <div data-expected-height="66"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; border-left-width: 2px; &amp; border-right-width: 4px;</pre>
+
+<div class="grid directionRTL">
+  <div class="minHeight60 borderTop2 borderBottom4" data-expected-height="66"></div>
+  <div data-expected-height="66"></div>
+</div>
+
+<pre>Item height: 60px; &amp; margin-left: 5px; &amp; margin-right: 10px; &amp; padding-left: 6px; &amp; padding-right: 3px; &amp; border-left-width: 2px; &amp; border-right-width: 4px;</pre>
+
+<div class="grid directionRTL">
+  <div class="height60 marginTop5 marginBottom10 paddingTop6 paddingBottom3 borderTop2 borderBottom4" data-expected-height="75"></div>
+  <div data-expected-height="90"></div>
+</div>
+
+<pre>Item min-height: 60px; &amp; margin-left: 5px; &amp; margin-right: 10px; &amp; padding-left: 6px; &amp; padding-right: 3px; &amp; border-left-width: 2px; &amp; border-right-width: 4px;</pre>
+
+<div class="grid directionRTL">
+  <div class="minHeight60 marginTop5 marginBottom10 paddingTop6 paddingBottom3 borderTop2 borderBottom4" data-expected-height="75"></div>
+  <div data-expected-height="90"></div>
+</div>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/w3c-import.log (261893 => 261894)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/w3c-import.log	2020-05-19 23:35:58 UTC (rev 261893)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/w3c-import.log	2020-05-19 23:50:25 UTC (rev 261894)
@@ -84,6 +84,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-003.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-inline-blocks-001-expected.xht
 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-inline-blocks-001.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-width-001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-width-002.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-width-orthogonal-001.html

Modified: trunk/Source/WebCore/ChangeLog (261893 => 261894)


--- trunk/Source/WebCore/ChangeLog	2020-05-19 23:35:58 UTC (rev 261893)
+++ trunk/Source/WebCore/ChangeLog	2020-05-19 23:50:25 UTC (rev 261894)
@@ -1,3 +1,22 @@
+2020-05-19  Oriol Brufau  <obru...@igalia.com>
+
+        Fix marginLogicalSizeForChild to check auto margins in the right axis
+        https://bugs.webkit.org/show_bug.cgi?id=212055
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        GridLayoutFunctions::marginLogicalSizeForChild checks for 'auto' margins
+        before retrieving the margin size, since these should be treated as 0.
+        However, for orthogonal grid items, it used to check the wrong axis.
+        So if an item had 'margin-top: auto' and 'margin-left: 5px', when asking
+        for the horizontal margin we could get 0px instead of 5px due to the
+        auto margin in the vertical axis.
+
+        Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001.html
+
+        * rendering/GridLayoutFunctions.cpp:
+        (WebCore::GridLayoutFunctions::marginLogicalSizeForChild):
+
 2020-05-19  Jacob Uphoff  <jacob_uph...@apple.com>
 
         Unreviewed, reverting r261856.

Modified: trunk/Source/WebCore/rendering/GridLayoutFunctions.cpp (261893 => 261894)


--- trunk/Source/WebCore/rendering/GridLayoutFunctions.cpp	2020-05-19 23:35:58 UTC (rev 261893)
+++ trunk/Source/WebCore/rendering/GridLayoutFunctions.cpp	2020-05-19 23:50:25 UTC (rev 261894)
@@ -69,9 +69,10 @@
 {
     if (child.needsLayout())
         return computeMarginLogicalSizeForChild(grid, direction, child);
-    bool isRowAxis = flowAwareDirectionForChild(grid, child, direction) == ForColumns;
-    LayoutUnit marginStart = marginStartIsAuto(child, direction) ? 0_lu : isRowAxis ? child.marginStart() : child.marginBefore();
-    LayoutUnit marginEnd = marginEndIsAuto(child, direction) ? 0_lu : isRowAxis ? child.marginEnd() : child.marginAfter();
+    GridTrackSizingDirection flowAwareDirection = GridLayoutFunctions::flowAwareDirectionForChild(grid, child, direction);
+    bool isRowAxis = flowAwareDirection == ForColumns;
+    LayoutUnit marginStart = marginStartIsAuto(child, flowAwareDirection) ? 0_lu : isRowAxis ? child.marginStart() : child.marginBefore();
+    LayoutUnit marginEnd = marginEndIsAuto(child, flowAwareDirection) ? 0_lu : isRowAxis ? child.marginEnd() : child.marginAfter();
     return marginStart + marginEnd;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to