Skip to content

Commit a10802c

Browse files
authored
Tweak flexbox_justifycontent-center-overflow.html to match implementations (#26256)
The offsets -2.85em and 4.95em in the ref perhaps (at a guess) initially matched precisely the Presto behavior, but now look like magic constants, and is slightly off in all implementations: https://wpt.fyi/results/css/css-flexbox/flexbox_justifycontent-center-overflow.html?run_id=711240001&run_id=697770002&run_id=737900001&run_id=715540002&run_id=705490001 Control the width of the boxes more explicitly, so that the ref can be written in a more straightforward way. Also replaces "dam" (lady in Norwegian) with "x" to make the text much shorter than the span widths, and matching an earlier rewrite: #16820
1 parent 0c6b6ed commit a10802c

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

css/css-flexbox/flexbox_justifycontent-center-overflow-ref.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,26 @@
1212
position: relative;
1313
}
1414
span {
15-
background: yellow;
16-
margin: 1em 0 0 -2.85em;
15+
background: white;
16+
margin: 1em;
17+
width: 2em;
1718
height: 6em;
18-
display: inline-block;
19+
display: block;
20+
position: absolute;
21+
}
22+
span:nth-child(1) {
23+
background: yellow;
24+
left: -4em;
1925
}
2026
span:nth-child(2) {
2127
background: pink;
22-
margin-left: 2em;
2328
}
2429
span:nth-child(3) {
2530
background: lightblue;
26-
margin-left: 0;
27-
position: relative;
28-
top: -7em;
29-
left: 4.95em
31+
left: 4em;
3032
}
3133
</style>
3234

3335
<div>
34-
<span>dam</span><span>dam</span><span>dam</span>
36+
<span>x</span><span>x</span><span>x</span>
3537
</div>

css/css-flexbox/flexbox_justifycontent-center-overflow.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
div {
99
font-family: monospace;
1010
background: blue;
11-
padding: 0;
1211
margin: 1em 0 0 10em;
1312
border: 1px solid black;
1413
height: 8em;
@@ -20,8 +19,8 @@
2019
span {
2120
background: white;
2221
margin: 1em;
23-
width: 5em;
24-
max-width: 6em;
22+
min-width: 2em;
23+
max-width: 2em;
2524
display: inline-block;
2625

2726
flex: 1 0 0%;
@@ -32,5 +31,5 @@
3231
</style>
3332

3433
<div>
35-
<span>dam</span><span>dam</span><span>dam</span>
34+
<span>x</span><span>x</span><span>x</span>
3635
</div>

0 commit comments

Comments
 (0)