Commit 42f53f97 authored by Mario Sanchez Prada's avatar Mario Sanchez Prada Committed by Commit Bot

[css-flexbox] Migrate overflow-auto-resizes-correctly.html test to WPT

Partially migrate the contents of this test into the WPT-specific
directory, including only the checks that can be upstreamed and
leaving the parts that are Chromium-specific in the original test.

In addition, this CL also adapts the description of the original
Chromium-specific test to reflect what it actually does now after
having removed some parts. In the newly-added test, we also add
the relevant meta information i.e links to the relevant specs and
a test assertion describing its purpose.

Bug: 1063749
Change-Id: I57df80bf8a3c48dd94c70315a07d31715477a28b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2129537
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Reviewed-by: default avatarDavid Grogan <dgrogan@chromium.org>
Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757780}
parent 6f53783e
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<title>When a block inside a flexbox adds scrollbars due to overflow, the parent flexbox should re-flex based on the child size including scrollbars.</title>
<title>When a block inside an horizontal flexbox adds vertical scrollbars due to overflow, the parent flexbox should re-flex based on the child size including scrollbars.</title>
<style>
.vflex {
display: flex;
flex-direction: column;
max-width: 200px;
margin: 10px 0 10px 0;
}
.hflex {
display: flex;
flex-direction: row;
max-height: 200px;
margin: 10px 0 10px 0;
}
.hbox {
overflow-x: auto;
white-space: nowrap;
}
.vbox {
overflow-y: auto;
max-height: 200px;
......@@ -31,13 +21,6 @@
}
</style>
<div class="vflex">
<div class="hbox">
<div class="rect"></div>
<div class="rect"></div>
</div>
</div>
<div class="hflex">
<div class="vbox">
<div class="rect" style="min-height: 300px;"></div>
......@@ -56,12 +39,6 @@
</div>
<script>
var hbox = document.querySelector('.hbox');
test(function() {
assert_equals(hbox.parentNode.clientHeight, hbox.parentNode.scrollHeight);
assert_equals(hbox.clientHeight, hbox.scrollHeight);
}, 'hbox dimensions');
var measure = document.getElementById('measure');
var scrollbarSize = measure.offsetWidth - measure.clientWidth;
test(function() {
......
<!DOCTYPE html>
<html>
<title>CSS Flexbox: adding scrollbars with overflow: auto and flex-direction: column.</title>
<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#overflow-properties">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-direction-property">
<link rel="help" href="https://crbug.com/512229">
<meta name="assert" content="This test checks that, when a block inside a flexbox with flex-direction: column adds horizontal scrollbars due to overflow, the parent flexbox is still able to render its contents without overflowing."/>
<style>
.vflex {
display: flex;
flex-direction: column;
max-width: 200px;
margin: 10px 0 10px 0;
}
.hbox {
overflow-x: auto;
white-space: nowrap;
}
.rect {
min-height: 100px;
min-width: 100px;
background-color: green;
display: inline-block;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<div class="vflex">
<div class="hbox">
<div class="rect"></div>
<div class="rect"></div>
</div>
</div>
<script>
var hbox = document.querySelector('.hbox');
test(function() {
assert_equals(hbox.parentNode.clientHeight, hbox.parentNode.scrollHeight);
assert_equals(hbox.clientHeight, hbox.scrollHeight);
}, 'hbox dimensions');
</script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment