Skip to content

Commit fa1b4b9

Browse files
bfgeekChromium LUCI CQ
authored and
Chromium LUCI CQ
committed
[wpt] Fix grid-item (no) aspect-ratio tests.
Renaming scheme got lost, however basically: grid-item-no-aspect-ratio-stretch-4.html -> grid-item-aspect-ratio-stretch-1.html grid-item-no-aspect-ratio-stretch-5.html -> grid-item-aspect-ratio-stretch-2.html grid-item-no-aspect-ratio-stretch-6.html -> grid-item-aspect-ratio-stretch-3.html grid-item-no-aspect-ratio-stretch-7.html -> grid-item-aspect-ratio-stretch-4.html These tests all had a viewBox defining a valid aspect-ratio. Due to: w3c/csswg-drafts#6286 (comment) These tests *should* have an aspect-ratio, and when stretched in one dimension, should reflect to the other dimension (if unconstrained). See: w3c/csswg-drafts#5713 (comment) The below two tests basically just got renamed: grid-item-no-aspect-ratio-stretch-8.html -> grid-item-no-aspect-ratio-stretch-4.html grid-item-no-aspect-ratio-stretch-9.html -> grid-item-no-aspect-ratio-stretch-5.html grid-item-no-aspect-ratio-stretch-10.html -> grid-item-no-aspect-ratio-stretch-6.html But tests updated to correctly assert that the natural size would still be respected. To all these test-cases I also added "grid-template: 100% / 100%;" as there is further complexity when inside an auto row/column which is tested elsewhere. (Transferred minimum size for replaced elements with an aspect-ratio). Bug: 1114013 Change-Id: I062f67e291cc62fa63a53370595780dae16abf3b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3003564 Reviewed-by: David Grogan Reviewed-by: Kurt Catti-Schmidt Commit-Queue: Ian Kilpatrick Cr-Commit-Position: refs/heads/master@{#898351}
1 parent e24d133 commit fa1b4b9

17 files changed

+209
-82
lines changed

third_party/blink/web_tests/FlagExpectations/disable-layout-ng

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-alignment-implies-siz
121121
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-alignment-implies-size-change-035.html [ Failure ]
122122
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-alignment-implies-size-change-036.html [ Failure ]
123123
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-baseline-004.html [ Failure ]
124+
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-item-aspect-ratio-stretch-1.html [ Failure ]
125+
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-item-aspect-ratio-stretch-2.html [ Failure ]
126+
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-item-aspect-ratio-stretch-3.html [ Failure ]
127+
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-item-aspect-ratio-stretch-4.html [ Failure ]
124128
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-001.html [ Failure ]
125129
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-002.html [ Failure ]
126130
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-003.html [ Failure ]

third_party/blink/web_tests/TestExpectations

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3926,9 +3926,6 @@ crbug.com/1160916 external/wpt/css/css-backgrounds/box-shadow-radius-001.html [
39263926

39273927
# [css-grid]
39283928
crbug.com/1045599 external/wpt/css/css-grid/abspos/grid-abspos-staticpos-align-self-safe-001.html [ Failure ]
3929-
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-item-no-aspect-ratio-stretch-4.html [ Failure ]
3930-
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-item-no-aspect-ratio-stretch-6.html [ Failure ]
3931-
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-item-no-aspect-ratio-stretch-7.html [ Failure ]
39323929
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-004.html [ Failure ]
39333930
crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-003.html [ Failure ]
39343931
crbug.com/759665 external/wpt/css/css-grid/animation/grid-template-columns-001.html [ Failure ]
@@ -3959,6 +3956,10 @@ virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-alignment-implie
39593956
virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-alignment-implies-size-change-035.html [ Failure ]
39603957
virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-alignment-implies-size-change-036.html [ Failure ]
39613958
virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-baseline-004.html [ Failure ]
3959+
virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-item-aspect-ratio-stretch-1.html [ Failure ]
3960+
virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-item-aspect-ratio-stretch-2.html [ Failure ]
3961+
virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-item-aspect-ratio-stretch-3.html [ Failure ]
3962+
virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-item-aspect-ratio-stretch-4.html [ Failure ]
39623963
virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-001.html [ Failure ]
39633964
virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-002.html [ Failure ]
39643965
virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-003.html [ Failure ]
@@ -4008,18 +4009,6 @@ virtual/layout-ng-grid/fast/css-grid-layout/grid-item-spanning-and-orthogonal-fl
40084009
virtual/layout-ng-grid/fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html [ Failure ]
40094010
virtual/layout-ng-grid/fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html [ Failure ]
40104011

4011-
# Bad stretching of svgs without aspect-ratio.
4012-
crbug.com/1114013 external/wpt/css/css-grid/alignment/grid-item-no-aspect-ratio-stretch-5.html [ Failure ]
4013-
crbug.com/1114013 external/wpt/css/css-grid/alignment/grid-item-no-aspect-ratio-stretch-8.html [ Failure ]
4014-
crbug.com/1114013 external/wpt/css/css-grid/alignment/grid-item-no-aspect-ratio-stretch-9.html [ Failure ]
4015-
crbug.com/1114013 external/wpt/css/css-grid/alignment/grid-item-no-aspect-ratio-stretch-10.html [ Failure ]
4016-
4017-
# Open discussion of SVG aspect ratios at https://github.com/w3c/csswg-drafts/issues/6286
4018-
crbug.com/1045599 virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-item-no-aspect-ratio-stretch-4.html [ Failure ]
4019-
crbug.com/1045599 virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-item-no-aspect-ratio-stretch-5.html [ Failure ]
4020-
crbug.com/1045599 virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-item-no-aspect-ratio-stretch-6.html [ Failure ]
4021-
crbug.com/1045599 virtual/layout-ng-grid/external/wpt/css/css-grid/alignment/grid-item-no-aspect-ratio-stretch-7.html [ Failure ]
4022-
40234012
# The 'last baseline' keyword is not implemented yet
40244013
crbug.com/885175 external/wpt/css/css-grid/alignment/grid-item-self-baseline-001.html [ Skip ]
40254014
crbug.com/885175 external/wpt/css/css-grid/alignment/grid-self-alignment-baseline-with-grid-001.html [ Skip ]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
>
2+
<meta charset="utf-8">
3+
<title>Reference: stretching works for replaced items with a fallback aspect ratiotitle>
4+
<link rel="author" title="Mats Palmgren" href="mailto:[email protected]">
5+
<link rel="author" title="Mozilla" href="https://mozilla.org">
6+
<style>
7+
body {
8+
line-height: 0;
9+
}
10+
11+
div {
12+
display: inline-block;
13+
height: 250px;
14+
width: 350px;
15+
background: grey;
16+
margin: 10px;
17+
vertical-align: top;
18+
}
19+
20+
img {
21+
display: block;
22+
}
23+
24+
.justify {
25+
width: 350px;
26+
}
27+
.align {
28+
height: 250px;
29+
}
30+
style>
31+
<div>
32+
<img class="align justify">
33+
div>
34+
<div>
35+
<img class="align">
36+
div>
37+
<div>
38+
<img class="justify">
39+
div>
40+
<div>
41+
<img style="width:10px; height:20px">
42+
div>
43+
44+
<script>
45+
var url = 'data:image/svg+xml,'
46+
var imgs = document.querySelectorAll('img');
47+
for (var i = 0; i < imgs.length; ++i) {
48+
var img = imgs[i];
49+
img.src = url;
50+
}
51+
script>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
>
22
<meta charset="utf-8">
3-
<title>stretching works for replaced items with no aspect ratiotitle>
3+
<title>stretching works for replaced items with a fallback aspect ratiotitle>
44
<link rel="author" title="Mats Palmgren" href="mailto:[email protected]">
55
<link rel="author" title="Mozilla" href="https://mozilla.org">
66
<link rel="help" href="https://drafts.csswg.org/css-grid">
77
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1656281">
8-
<link rel="match" href="grid-item-no-aspect-ratio-stretch-8-ref.html">
8+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/6286#issuecomment-866986544">
9+
<link rel="match" href="grid-item-aspect-ratio-stretch-1-ref.html">
910
<style>
1011
body {
1112
line-height: 0;
1213
}
1314

1415
div {
1516
display: inline-grid;
17+
grid-template: 100% / 100%;
1618
height: 250px;
1719
width: 350px;
1820
background: grey;
@@ -41,7 +43,7 @@
4143
div>
4244

4345
<script>
44-
var url = 'data:image/svg+xml,width="0px" height="20px">'
46+
var url = 'data:image/svg+xml,height="20px" viewBox="0 0 50 100">'
4547
var imgs = document.querySelectorAll('img');
4648
for (var i = 0; i < imgs.length; ++i) {
4749
var img = imgs[i];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
>
2+
<meta charset="utf-8">
3+
<title>Reference: stretching works for replaced items with a fallback aspect ratiotitle>
4+
<link rel="author" title="Mats Palmgren" href="mailto:[email protected]">
5+
<link rel="author" title="Mozilla" href="https://mozilla.org">
6+
<style>
7+
body {
8+
line-height: 0;
9+
}
10+
11+
div {
12+
display: inline-block;
13+
height: 250px;
14+
width: 350px;
15+
background: grey;
16+
margin: 10px;
17+
vertical-align: top;
18+
}
19+
20+
img {
21+
display: block;
22+
}
23+
24+
.justify {
25+
width: 350px;
26+
}
27+
.align {
28+
height: 250px;
29+
}
30+
style>
31+
<div>
32+
<img class="align justify">
33+
div>
34+
<div>
35+
<img class="align">
36+
div>
37+
<div>
38+
<img class="justify">
39+
div>
40+
<div>
41+
<img style="width:20px; height:40px">
42+
div>
43+
44+
<script>
45+
var url = 'data:image/svg+xml,'
46+
var imgs = document.querySelectorAll('img');
47+
for (var i = 0; i < imgs.length; ++i) {
48+
var img = imgs[i];
49+
img.src = url;
50+
}
51+
script>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
>
22
<meta charset="utf-8">
3-
<title>stretching works for replaced items with no aspect ratiotitle>
3+
<title>stretching works for replaced items with a fallback aspect ratiotitle>
44
<link rel="author" title="Mats Palmgren" href="mailto:[email protected]">
55
<link rel="author" title="Mozilla" href="https://mozilla.org">
66
<link rel="help" href="https://drafts.csswg.org/css-grid">
77
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1656281">
8-
<link rel="match" href="grid-item-no-aspect-ratio-stretch-8-ref.html">
8+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/6286#issuecomment-866986544">
9+
<link rel="match" href="grid-item-aspect-ratio-stretch-2-ref.html">
910
<style>
1011
body {
1112
line-height: 0;
1213
}
1314

1415
div {
1516
display: inline-grid;
17+
grid-template: 100% / 100%;
1618
height: 250px;
1719
width: 350px;
1820
background: grey;
@@ -41,7 +43,7 @@
4143
div>
4244

4345
<script>
44-
var url = 'data:image/svg+xml,height="0px">'
46+
var url = 'data:image/svg+xml,viewBox="0 0 50 100">'
4547
var imgs = document.querySelectorAll('img');
4648
for (var i = 0; i < imgs.length; ++i) {
4749
var img = imgs[i];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
>
2+
<meta charset="utf-8">
3+
<title>Reference: stretching works for replaced items with a fallback aspect ratiotitle>
4+
<link rel="author" title="Mats Palmgren" href="mailto:[email protected]">
5+
<link rel="author" title="Mozilla" href="https://mozilla.org">
6+
<style>
7+
body {
8+
line-height: 0;
9+
}
10+
11+
div {
12+
display: inline-block;
13+
height: 250px;
14+
width: 350px;
15+
background: grey;
16+
margin: 10px;
17+
vertical-align: top;
18+
}
19+
20+
img {
21+
display: block;
22+
background: blue;
23+
}
24+
25+
.justify {
26+
width: 350px;
27+
}
28+
.align {
29+
height: 250px;
30+
}
31+
style>
32+
<div>
33+
<img class="align justify">
34+
div>
35+
<div>
36+
<img class="align">
37+
div>
38+
<div>
39+
<img class="justify">
40+
div>
41+
<div>
42+
<img style="width:0px; height:20px">
43+
div>
44+
45+
<script>
46+
var url = 'data:image/svg+xml,'
47+
var imgs = document.querySelectorAll('img');
48+
for (var i = 0; i < imgs.length; ++i) {
49+
var img = imgs[i];
50+
img.src = url;
51+
}
52+
script>
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
>
22
<meta charset="utf-8">
3-
<title>stretching works for replaced items with no aspect ratiotitle>
3+
<title>stretching works for replaced items with a fallback aspect ratiotitle>
44
<link rel="author" title="Mats Palmgren" href="mailto:[email protected]">
55
<link rel="author" title="Mozilla" href="https://mozilla.org">
66
<link rel="help" href="https://drafts.csswg.org/css-grid">
77
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1656281">
8-
<link rel="match" href="grid-item-no-aspect-ratio-stretch-8-ref.html">
8+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/6286#issuecomment-866986544">
9+
<link rel="match" href="grid-item-aspect-ratio-stretch-3-ref.html">
910
<style>
1011
body {
1112
line-height: 0;
1213
}
1314

1415
div {
1516
display: inline-grid;
17+
grid-template: 100% / 100%;
1618
height: 250px;
1719
width: 350px;
1820
background: grey;
1921
margin: 10px;
2022
vertical-align: top;
2123
}
24+
img { background: blue; }
2225

2326
.justify {
2427
justify-self: stretch;
@@ -41,7 +44,7 @@
4144
div>
4245

4346
<script>
44-
var url = 'data:image/svg+xml,0px">>'
47+
var url = 'data:image/svg+xml,20px" viewBox="0 0 50 100">'
4548
var imgs = document.querySelectorAll('img');
4649
for (var i = 0; i < imgs.length; ++i) {
4750
var img = imgs[i];
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
>
22
<meta charset="utf-8">
3-
<title>Reference: stretching works for replaced items with no aspect ratiotitle>
3+
<title>Reference: stretching works for replaced items with a fallback aspect ratiotitle>
44
<link rel="author" title="Mats Palmgren" href="mailto:[email protected]">
55
<link rel="author" title="Mozilla" href="https://mozilla.org">
66
<style>
@@ -19,8 +19,6 @@
1919

2020
img {
2121
display: block;
22-
width: 300px;
23-
height: 150px;
2422
background: blue;
2523
}
2624

@@ -35,17 +33,17 @@
3533
<img class="align justify">
3634
div>
3735
<div>
38-
<img class="align" style="width:20px">
36+
<img class="align">
3937
div>
4038
<div>
41-
<img class="justify" style="height:0px">
39+
<img class="justify">
4240
div>
4341
<div>
4442
<img style="width:20px; height:0px">
4543
div>
4644

4745
<script>
48-
var url = 'data:image/svg+xml,'
46+
var url = 'data:image/svg+xml, viewBox="0 0 50 100">'
4947
var imgs = document.querySelectorAll('img');
5048
for (var i = 0; i < imgs.length; ++i) {
5149
var img = imgs[i];
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
>
22
<meta charset="utf-8">
3-
<title>stretching works for replaced items with no aspect ratiotitle>
3+
<title>stretching works for replaced items with a fallback aspect ratiotitle>
44
<link rel="author" title="Mats Palmgren" href="mailto:[email protected]">
55
<link rel="author" title="Mozilla" href="https://mozilla.org">
66
<link rel="help" href="https://drafts.csswg.org/css-grid">
77
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1656281">
8-
<link rel="match" href="grid-item-no-aspect-ratio-stretch-7-ref.html">
8+
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/6286#issuecomment-866986544">
9+
<link rel="match" href="grid-item-aspect-ratio-stretch-4-ref.html">
910
<style>
1011
body {
1112
line-height: 0;
1213
}
1314

1415
div {
1516
display: inline-grid;
17+
grid-template: 100% / 100%;
1618
height: 250px;
1719
width: 350px;
1820
background: grey;

0 commit comments

Comments
 (0)