Skip to content

Commit 2791c1a

Browse files
committed
Bug 1575407 [wpt PR 18573] - [css-flexbox] Only clear the override size if we're doing layout, a=testonly
Automatic update from web-platform-tests [css-flexbox] Only clear the override size if we're doing layout And make ChildUnstretchedLogical{Width,Height} handle the case where an override size is set (by clearing and re-setting). The problem with clearing the override size, but not doing layout, is that we may later do a simplified layout which will then lay out as shrink-to-fit, which is undesired. Bug: 992010 Change-Id: I18d3ae66f62cbdc9cdcf76810dc0eff6be915af6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1758940 Commit-Queue: Christian Biesinger <cbiesingerchromium.org> Auto-Submit: Christian Biesinger <cbiesingerchromium.org> Reviewed-by: David Grogan <dgroganchromium.org> Reviewed-by: Morten Stenshorne <mstenshochromium.org> Reviewed-by: Emil A Eklund <eaechromium.org> Cr-Commit-Position: refs/heads/master{#689485} -- wpt-commits: 768d6294ed324158d4269a833fda94ea7927efe3 wpt-pr: 18573 UltraBlame original commit: ffeb51048e9b089ec1a2899bbf11dbcca798b201
1 parent e9471e1 commit 2791c1a

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!DOCTYPE html>
2+
<link rel="match" href="../reference/ref-filled-green-100px-square.xht" />
3+
<link rel="author" title="Google LLC" href="http://www.google.com" />
4+
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#cross-sizing" />
5+
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=992010" />
6+
<title>Tests that certain dynamic changes don't lead to a flex item being sized as shrink to fit when it should stretch in the cross axis</title>
7+
8+
<style>
9+
#flex {
10+
display: flex;
11+
flex-direction: column;
12+
flex-wrap: wrap;
13+
position: absolute;
14+
top: 20px;
15+
width: 100px;
16+
}
17+
18+
#it1 {
19+
background: green;
20+
flex: none;
21+
height: 100px;
22+
min-height: 0;
23+
position: relative;
24+
}
25+
26+
#child {
27+
position: absolute;
28+
top: 0;
29+
left: 0;
30+
}
31+
</style>
32+
33+
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
34+
35+
<div style="position: relative;">
36+
<div id="flex">
37+
<div id="it1" style=""><div id="child"></div></div>
38+
<div id="it2"></div>
39+
</div>
40+
</div>
41+
42+
<script>
43+
var flex = document.getElementById("flex");
44+
flex.offsetWidth;
45+
var it2 = document.getElementById("it2");
46+
it2.style.width = "50px";
47+
flex.offsetWidth;
48+
flex.style.top = "0px";
49+
var child = document.getElementById("child");
50+
child.style.top = "1px";
51+
flex.offsetWidth;
52+
</script>

0 commit comments

Comments
 (0)