-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathscrollWidthHeight-negative-margin-001.html
More file actions
42 lines (42 loc) · 1.31 KB
/
scrollWidthHeight-negative-margin-001.html
File metadata and controls
42 lines (42 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!doctype html>
<meta charset="utf-8">
<title>scroll{Width,Height} with visible overflow and negative margins.</title>
<link rel="help" href="https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1906475">
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="author" title="Mozilla" href="https://mozilla.org">
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<style>
body { margin: 0 }
.wrapper {
width: 90px;
border: 10px solid #d1d1d2;
}
.inner {
margin: -10px;
height: 100px;
width: 100px;
background-color: blue;
}
</style>
<div class="wrapper" style="overflow: visible">
<div class="inner"></div>
</div>
<div class="wrapper" style="overflow: hidden">
<div class="inner"></div>
</div>
<div class="wrapper" style="overflow: auto">
<div class="inner"></div>
</div>
<div class="wrapper" style="overflow: clip">
<div class="inner"></div>
</div>
<script>
for (let wrapper of document.querySelectorAll(".wrapper")) {
test(function() {
assert_equals(wrapper.scrollWidth, 90, "scrollWidth");
assert_equals(wrapper.scrollHeight, 90, "scrollHeight");
}, "scrollWidth/Height with negative margins: " + wrapper.style.cssText);
}
</script>