| Index: third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-get-bounding-client-rect.html
|
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-get-bounding-client-rect.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-get-bounding-client-rect.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a664ab3d181e7f40526d93965c36d3b9eab4216b
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-get-bounding-client-rect.html
|
| @@ -0,0 +1,54 @@
|
| +<!DOCTYPE html>
|
| +<title>Sticky positioned element should be observable by getBoundingClientRect.</title>
|
| +<link rel="help" href="https://www.w3.org/TR/css-position-3/#sticky-pos" />
|
| +<meta name="assert" content="This test checks that sticky positioned element
|
| +should be observable by getBoundingClientRect." />
|
| +
|
| +<script src="/resources/testharness.js"></script>
|
| +<script src="/resources/testharnessreport.js"></script>
|
| +
|
| +<style>
|
| +body {
|
| + margin: 0;
|
| +}
|
| +
|
| +.container {
|
| + overflow: scroll;
|
| + width: 200px;
|
| + height: 200px;
|
| +}
|
| +
|
| +.spacer {
|
| + height: 2000px;
|
| +}
|
| +
|
| +.box {
|
| + width: 100px;
|
| + height: 100px;
|
| + background-color: green;
|
| + top: 50px;
|
| +}
|
| +
|
| +.sticky {
|
| + position: sticky;
|
| +}
|
| +</style>
|
| +
|
| +<div id="scroller" class="container">
|
| + <div id="sticky" class="sticky box"></div>
|
| + <div class="spacer"></div>
|
| +</div>
|
| +
|
| +<script>
|
| +test(() => {
|
| + var element = document.getElementById('sticky');
|
| + assert_equals(element.getBoundingClientRect().top, 50);
|
| + document.getElementById('scroller').scrollTop = 100;
|
| + assert_equals(element.getBoundingClientRect().top, 50);
|
| + sticky.style.position = 'relative';
|
| + assert_equals(element.getBoundingClientRect().top, -50);
|
| + sticky.style.position = 'sticky';
|
| + assert_equals(element.getBoundingClientRect().top, 50);
|
| +}, 'sticky positioned element should be observable by getBoundingClientRect.');
|
| +</script>
|
| +
|
|
|