Skip to content

Commit 02a180f

Browse files
[css-grid] Relayout grid items when definiteness changes.
https://bugs.webkit.org/show_bug.cgi?id=220657 LayoutTests/imported/w3c: Tests percentage-size-subitems-002.html and relative-grandchild.html are imported from WPT. Patch by Ziran Sun <[email protected]> on 2021-01-22 Reviewed by Manuel Rego Casasnovas. * web-platform-tests/css/css-grid/grid-items/percentage-size-subitems-002-expected.html: Added. * web-platform-tests/css/css-grid/grid-items/percentage-size-subitems-002.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-grid/relative-grandchild.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-grid/relative-grandchild-expected.xht: Added. * web-platform-tests/css/css-grid/grid-items/w3c-import.log: Source/WebCore: Patch by Ziran Sun <[email protected]> on 2021-01-22 Reviewed by Manuel Rego Casasnovas. When setting an override logical-height the definiteness can change causing %-height children to resolve differently. This change adds this check to determine if a grid-item needs relayout. It is an import of Chromium changes at https://chromium-review.googlesource.com/c/chromium/src/+/2474917 Instead of adding maybeHasPercentHeightDescendant() in WebKit, this change calls hasPercentHeightDescendants(). In Chromium it wasn't possible to use hasPercentHeightDescendants() because of this quirk: https://quirks.spec.whatwg.org/#the-percentage-height-calculation-quirk WebKit doesn't seem to use the quirk for grid according to the image in w3c/csswg-drafts#5545 This also fixes issues in test: grid-child-percent-basis-resize-1.html Tests have been ported in WPT at web-platform-tests/wpt#26136 Tests: imported/w3c/web-platform-tests/css/css-grid/grid-items/percentage-size-subitems-002.html imported/w3c/web-platform-tests/css/css-grid/relative-grandchild.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded): LayoutTests: Patch by Ziran Sun <[email protected]> on 2021-01-22 Reviewed by Manuel Rego Casasnovas. * TestExpectations: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@271745 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 509e8fc commit 02a180f

File tree

11 files changed

+106
-3
lines changed

11 files changed

+106
-3
lines changed

LayoutTests/ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2021-01-22 Ziran Sun <[email protected]>
2+
3+
[css-grid] Relayout grid items when definiteness changes.
4+
https://bugs.webkit.org/show_bug.cgi?id=220657
5+
6+
Reviewed by Manuel Rego Casasnovas.
7+
8+
* TestExpectations:
9+
110
2021-01-21 Rob Buis <[email protected]>
211

312
Handle shapeMargin becoming NaN

LayoutTests/TestExpectations

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3970,7 +3970,6 @@ webkit.org/b/212246 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-
39703970
webkit.org/b/212246 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-alignment-baseline-with-grid-002.html [ ImageOnlyFailure ]
39713971
webkit.org/b/212246 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-alignment-baseline-with-grid-003.html [ ImageOnlyFailure ]
39723972
webkit.org/b/212246 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-self-alignment-baseline-with-grid-004.html [ ImageOnlyFailure ]
3973-
webkit.org/b/212246 imported/w3c/web-platform-tests/css/css-grid/grid-child-percent-basis-resize-1.html [ ImageOnlyFailure ]
39743973
webkit.org/b/212246 imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-areas-overflowing-grid-container-001.html [ ImageOnlyFailure ]
39753974
webkit.org/b/212246 imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-areas-overflowing-grid-container-002.html [ ImageOnlyFailure ]
39763975
webkit.org/b/212246 imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-areas-overflowing-grid-container-003.html [ ImageOnlyFailure ]

LayoutTests/imported/w3c/ChangeLog

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2021-01-22 Ziran Sun <[email protected]>
2+
3+
[css-grid] Relayout grid items when definiteness changes.
4+
https://bugs.webkit.org/show_bug.cgi?id=220657
5+
6+
Tests percentage-size-subitems-002.html and relative-grandchild.html are
7+
imported from WPT.
8+
9+
Reviewed by Manuel Rego Casasnovas.
10+
11+
* web-platform-tests/css/css-grid/grid-items/percentage-size-subitems-002-expected.html: Added.
12+
* web-platform-tests/css/css-grid/grid-items/percentage-size-subitems-002.html: Added.
13+
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/relative-grandchild.html: Added.
14+
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/relative-grandchild-expected.xht: Added.
15+
* web-platform-tests/css/css-grid/grid-items/w3c-import.log:
16+
117
2021-01-21 Devin Rousso <[email protected]>
218

319
[Apple Pay] use the first item in `shippingOptions` even when it's not `selected`
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!DOCTYPE html>
2+
<link rel="author" title="Morten Stenshorne" href="[email protected]">
3+
<p>Test passes if there is a filled green square.</p>
4+
<div style="width:100px; height:100px; background:green;"></div>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1138504">
3+
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
4+
<p>Test passes if there is a filled green square.</p>
5+
<div style="display: grid; grid-template-columns: 100px 100px;">
6+
<div style="min-height: 100px;">
7+
<div style="height: 100%; background: green;"></div>
8+
</div>
9+
<div style="height: 100px;"></div>
10+
</div>

LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/w3c-import.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ List of files:
276276
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/percentage-size-replaced-subitems-001.html
277277
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/percentage-size-subitems-001-expected.html
278278
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/percentage-size-subitems-001.html
279+
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/percentage-size-subitems-002.html
279280
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/ref-filled-green-100px-square-image.html
280281
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/remove-svg-grid-item-001-expected.html
281282
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/remove-svg-grid-item-001.html
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<title>CSS Reftest Reference</title>
5+
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
6+
<style type="text/css"><![CDATA[
7+
div
8+
{
9+
background-color: green;
10+
height: 100px;
11+
width: 100px;
12+
}
13+
]]></style>
14+
</head>
15+
<body>
16+
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
17+
<div></div>
18+
</body>
19+
</html>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
3+
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1138504">
4+
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
5+
<div style="width: 100px; height: 100px; background: red;"></div>
6+
<div style="display: grid; width: 100px; height: 100px;">
7+
<div>
8+
<div style="position: relative; height: 100px; background: green; top: -100%;"></div>
9+
</div>
10+
</div>

LayoutTests/imported/w3c/web-platform-tests/css/css-grid/w3c-import.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ List of files:
3434
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-layout-properties.html
3535
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-tracks-stretched-with-different-flex-factors-sum.html
3636
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/inheritance.html
37+
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/relative-grandchild.html
3738
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/table-grid-item-dynamic-001-expected.html
3839
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/table-grid-item-dynamic-001.html

Source/WebCore/ChangeLog

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
2021-01-22 Ziran Sun <[email protected]>
2+
3+
[css-grid] Relayout grid items when definiteness changes.
4+
https://bugs.webkit.org/show_bug.cgi?id=220657
5+
6+
Reviewed by Manuel Rego Casasnovas.
7+
8+
When setting an override logical-height the definiteness can change causing %-height
9+
children to resolve differently. This change adds this check to determine if a grid-item
10+
needs relayout. It is an import of Chromium changes at
11+
https://chromium-review.googlesource.com/c/chromium/src/+/2474917
12+
Instead of adding maybeHasPercentHeightDescendant() in WebKit, this change calls
13+
hasPercentHeightDescendants(). In Chromium it wasn't possible to use
14+
hasPercentHeightDescendants() because of this quirk:
15+
https://quirks.spec.whatwg.org/#the-percentage-height-calculation-quirk
16+
WebKit doesn't seem to use the quirk for grid according to the image in
17+
https://github.com/w3c/csswg-drafts/issues/5545
18+
19+
This also fixes issues in test:
20+
grid-child-percent-basis-resize-1.html
21+
22+
Tests have been ported in WPT at
23+
https://github.com/web-platform-tests/wpt/pull/26136
24+
25+
Tests: imported/w3c/web-platform-tests/css/css-grid/grid-items/percentage-size-subitems-002.html
26+
imported/w3c/web-platform-tests/css/css-grid/relative-grandchild.html
27+
28+
* rendering/RenderGrid.cpp:
29+
(WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
30+
131
2021-01-22 Kate Cheney <[email protected]>
232

333
Denying storage access on playstation.com then clicking sign-in fails to show the prompt again

0 commit comments

Comments
 (0)