forked from mirrors/gecko-dev
Automatic update from web-platform-tests blink: makes scrollWidth/Height return overflow size When 'overflow: clip' is set along a particular axis, scrollWidth/Height should return the overflow size. BUG=1087667 TEST=external/wpt/css/css-overflow/overflow-clip-scroll-size.html Change-Id: I447d6249ca0234c491521d42b1139e415b78bcbc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2531117 Commit-Queue: Scott Violet <sky@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/master@{#829929} -- wpt-commits: bb2b039540b0a034687938aee6d82fcfd697a693 wpt-pr: 26493
80 lines
2.3 KiB
HTML
80 lines
2.3 KiB
HTML
<!doctype html>
|
|
<meta charset="utf-8">
|
|
<title>overflow: scroll width/height should return overflow size</title>
|
|
<link rel="help" href="https://drafts.csswg.org/css-overflow/#valdef-overflow-clip">
|
|
<link rel="author" title="Scott Violet" href="mailto:sky@chromium.org">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<style>
|
|
.parent {
|
|
width: 100px;
|
|
height: 101px;
|
|
}
|
|
.child {
|
|
width: 200px;
|
|
height: 201px;
|
|
}
|
|
.overflow_clip_and_border {
|
|
width: 100px;
|
|
height: 101px;
|
|
overflow: clip;
|
|
border-width: 2px;
|
|
border-style: solid;
|
|
}
|
|
</style>
|
|
<div id="parent-clip-both" class="parent" style="overflow: clip">
|
|
<div class="child"></div>
|
|
</div>
|
|
<div id="parent-clip-x" class="parent" style="overflow: clip-x">
|
|
<div class="child"></div>
|
|
</div>
|
|
<div id="parent-clip-y" class="parent" style="overflow: clip-y">
|
|
<div class="child"></div>
|
|
</div>
|
|
|
|
<div id="border-equal-clip" class="parent">
|
|
<div class="overflow_clip_and_border"
|
|
style="overflow-clip-margin: 2px">
|
|
<div class="child"></div>
|
|
</div>
|
|
</div>
|
|
<div id="border-smaller-clip" class="parent">
|
|
<div class="overflow_clip_and_border"
|
|
style="overflow-clip-margin: 3px">
|
|
<div class="child"></div>
|
|
</div>
|
|
</div>
|
|
<div id="border-greater-clip" class="parent">
|
|
<div class="overflow_clip_and_border"
|
|
style="overflow-clip-margin: 1px">
|
|
<div class="child"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
test(() => {
|
|
var pClipBoth = document.getElementById("parent-clip-both");
|
|
assert_equals(pClipBoth.scrollWidth, 200);
|
|
assert_equals(pClipBoth.scrollHeight, 201);
|
|
|
|
var pClipX = document.getElementById("parent-clip-x");
|
|
assert_equals(pClipX.scrollWidth, 200);
|
|
assert_equals(pClipX.scrollHeight, 201);
|
|
|
|
var pClipY = document.getElementById("parent-clip-y");
|
|
assert_equals(pClipY.scrollWidth, 200);
|
|
assert_equals(pClipY.scrollHeight, 201);
|
|
}, "scroll size should match that of size specified by overflow: clip");
|
|
|
|
test(() => {
|
|
assert_equals(document.getElementById("border-equal-clip").scrollWidth,
|
|
104);
|
|
|
|
assert_equals(document.getElementById("border-smaller-clip").scrollWidth,
|
|
105);
|
|
|
|
assert_equals(document.getElementById("border-greater-clip").scrollWidth,
|
|
104);
|
|
}, "scroll size should take into account border size and overflow-clip-margin");
|
|
|
|
</script>
|