Skip to content

Commit

Permalink
[LayoutNG] testcase for codependent scrollbars
Browse files Browse the repository at this point in the history
Just a testcase, because the bug cannot be fixed at this time.

Aborted attempt to fix this is at:
https://chromium-review.googlesource.com/c/chromium/src/+/1820177/4

Bug: 1007065
Change-Id: I44195ec77cc8b0924c81a567a9505e8a77f7d492
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829878
Auto-Submit: Aleks Totic <atotic@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701345}
  • Loading branch information
Aleks Totic authored and chromium-wpt-export-bot committed Sep 30, 2019
1 parent e2d4b54 commit e2f3222
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions css/css-overflow/overflow-codependent-scrollbars.html
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<link rel="author" href="mailto:atotic@google.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://www.w3.org/TR/css-overflow-3/#scrollable">
<meta name="assert" content="What happens when appearance of one scrollbar triggers the other one?">
<style>
.container {
width: 100px;
height: 100px;
overflow: auto;
background: #DDD;
--too-big: 120px;
--slightly-smaller: 95px;
}
.target {
width: 120px;
height: 95px;
background: rgba(0,255,0,0.3);
}
</style>
<!-- -->
<div class="container">
<div class="target" style="width:var(--too-big);height:var(--slightly-smaller)" ></div>
</div>
<div class="container">
<div class="target" style="height:var(--too-big);width:var(--slightly-smaller)" ></div>
</div>

<script>
test(() => {
Array.from(document.querySelectorAll(".container")).forEach( el => {
let verticalScrollbar = el.offsetWidth - el.clientWidth;
let horizontalScrollbar = el.offsetHeight - el.clientHeight;
assert_equals(verticalScrollbar, horizontalScrollbar, "both scrollbars are visible.");
});
}, 'appearance of one scrollbar caused the other scrollbar to appear.');
</script>

0 comments on commit e2f3222

Please sign in to comment.