fune/testing/web-platform/tests/css/css-flexbox/overflow-auto-001.html
Christian Biesinger 72df509024 Bug 1558564 [wpt PR 17270] - [css-flexbox] Make sure to layout overflow:auto elements, a=testonly
Automatic update from web-platform-tests
[css-flexbox] Make sure to layout overflow:auto elements

For overflow: auto, we need to layout before running the flex algorithm
if layout is dirty, so we can up-to-date scrollbar information, because
scrollbar size is included in the intrinsic size.

Bug: 972227
Change-Id: I58b5c0590575c5babc505b2927d8464f3f540775
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1652198
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: David Grogan <dgrogan@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#668199}

--

wp5At-commits: 562e24f280cc12acbbe0f2b0b136dd319c2604b3
wpt-pr: 17270
2019-06-19 11:07:00 -07:00

51 lines
1.2 KiB
HTML

<!DOCTYPE html>
<title>Tests that we consider main axis sizes to be definite in column flexboxes
when the height is an explicit definite height, even if the container does
not have a definite main axis size.</title>
<link rel="author" title="Google LLC" href="https://www.google.com/">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#algo-main-item">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<style>
/* Make it possible for red to appear in webkit/blink browsers. But the test
* still works in other browsers, you'll just get a grey scrollbar that
* shouldn't be there.
*/
::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb, ::-webkit-scrollbar {
width: 10px;
background: red;
}
#flex {
display: flex;
}
#item {
height: 300px;
overflow: auto;
scrollbar-color: red;
}
#child {
height: 600px;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="width: 100px; height: 100px; background: green;"></div>
<div id="flex">
<div id="item">
<div id="child">
Text
</div>
</div>
</div>
<script>
var item = document.getElementById('item');
item.offsetHeight;
item.style.width = 0;
</script>