fune/testing/web-platform/tests/css/css-flexbox/negative-overflow.html
Daniel Holbert 8128c8ce1c Bug 1626108: Adjust test expectations in flexbox WPT negative-overflow.html, to indicate that negative cross-axis overflow in a "wrap-reverse" flexbox should be scrollable. r=TYLin
This testcase wasn't accounting for the fact that "flex-wrap: wrap-reverse"
flips the direction in which overflow is reachable/scrollable, in a flex
container's cross axis (just as "flex-direction: column-reverse" does in the
main axis).  The CSSWG resolved on this here:
https://lists.w3.org/Archives/Public/www-style/2014Sep/0187.html

This commit makes the test account for this, by increasing the expected
scrollHeight of the "wrap-reverse" pieces of the test (which have overflow that
should be scrollable).

Note that Chromium doesn't pass these amended subtests, because it doesn't
correctly handle scrolling with wrap-reverse; this is covered by
https://bugs.chromium.org/p/chromium/issues/detail?id=1114306 .  (However, if I
modify the test to use "wrap" instead of "wrap-reverse", then Chromium does
pass these subtests.  This indicates that Chromium does essentially agree on
the expected value here, aside from that bug report about making the overflow
scrollable.)

Differential Revision: https://phabricator.services.mozilla.com/D110968
2021-04-06 23:54:16 +00:00

98 lines
2.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>CSS Flexbox: align-items: center/flex-end and bottom padding.</title>
<link rel="stylesheet" href="support/flexbox.css" >
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#align-items-property">
<meta name="assert" content="This test ensures that flexbox containers with 'align-items: center|flex-end' and 'overflow: auto/scroll' have no extra bottom padding."/>
<style>
.flexbox {
overflow: auto;
height: 50px;
width: 50px;
background-color: red;
position: relative;
}
.vertical-padding {
padding-top: 5px;
padding-bottom: 10px;
background-color: lime;
}
.vertical-border {
border-top: 2px solid black;
border-bottom: 8px solid lightblue;
}
.flexbox > div {
width: 100%;
height: 100px;
background-color: green;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script>
window.onload = function() {
checkLayout('.flexbox');
// Make failures more obvious by showing the red background that should have been clipped.
Array.prototype.forEach.call(document.querySelectorAll(".flexbox"), function(element) {
element.scrollTop = 1000;
});
};
</script>
</head>
<body>
<div id=log></div>
<div class="flexbox align-items-flex-end" data-expected-scroll-height="50">
<div></div>
</div>
<div class="flexbox align-items-flex-end" data-expected-scroll-height="150">
<div></div>
<div style="position: absolute; left: 0; top: 50px;"></div>
</div>
<div class="flexbox align-items-center" data-expected-scroll-height="75">
<div></div>
</div>
<div class="flexbox" data-expected-scroll-height="100">
<div></div>
</div>
<div class="flexbox wrap-reverse" data-expected-scroll-height="200">
<div></div>
<div></div>
</div>
<div class="flexbox align-items-flex-end vertical-padding" data-expected-scroll-height="65">
<div></div>
</div>
<div class="flexbox align-items-flex-end vertical-padding vertical-border" data-expected-scroll-height="65">
<div></div>
</div>
<div class="flexbox align-items-center vertical-padding" data-expected-scroll-height="90">
<div></div>
</div>
<div class="flexbox vertical-padding" data-expected-scroll-height="115">
<div></div>
</div>
<div class="flexbox vertical-padding vertical-border" data-expected-scroll-height="115">
<div></div>
</div>
<div class="flexbox wrap-reverse vertical-padding" data-expected-scroll-height="215">
<div></div>
<div></div>
</div>
</body>
</html>