| Index: third_party/WebKit/LayoutTests/fast/block/positioning/absolute-in-inline-dynamic.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/block/positioning/absolute-in-inline-dynamic.html b/third_party/WebKit/LayoutTests/fast/block/positioning/absolute-in-inline-dynamic.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..00dd58079a44497b77e9d82cdea84935969b4d4c
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/block/positioning/absolute-in-inline-dynamic.html
|
| @@ -0,0 +1,45 @@
|
| +<!doctype html>
|
| +<script src="../../../resources/testharness.js"></script>
|
| +<script src="../../../resources/testharnessreport.js"></script>
|
| +<body>
|
| +<p>Dynamic absolute positioning inside inline-relative container</p>
|
| +<div id="LIKEBODY" style="position:relative">
|
| + <div id="CONTAIN" style="position:relative; display:inline">CONTAIN
|
| + <div id="TARGET" style="position:absolute; right:0; top:0; width:20px; height:20px; background: green">T</div>
|
| + THE TARGET
|
| + </div>
|
| +</div>
|
| +<script>
|
| +let contain = document.querySelector('#CONTAIN');
|
| +let target = document.querySelector('#TARGET');
|
| +let likebody = document.querySelector('#LIKEBODY');
|
| +
|
| +test(() => {
|
| + let containRect = contain.getClientRects();
|
| + let targetRect = target.getClientRects();
|
| + assert_equals(containRect[0].right, targetRect[0].right, "#TARGET right aligns with #CONTAIN");
|
| + assert_equals(containRect[0].top, targetRect[0].top, "#TARGET top aligns with #CONTAIN");
|
| + }, "test0: initial #TARGET containing rect is #CONTAIN"
|
| +);
|
| +
|
| +test(() => {
|
| + contain.style.position = 'static';
|
| + let likebodyRect = likebody.getClientRects();
|
| + let targetRect = target.getClientRects();
|
| + assert_equals(likebodyRect[0].right, targetRect[0].right, "#TARGET right aligns with #LIKEBODY");
|
| + assert_equals(likebodyRect[0].top, targetRect[0].top, "#TARGET top aligns with #LIKEBODY");
|
| +
|
| + }, "test1: after relative->static, #TARGET containing rect is #LIKEBODY"
|
| +);
|
| +
|
| +test(() => {
|
| + contain.style.position = 'relative';
|
| + let containRect = contain.getClientRects();
|
| + let targetRect = target.getClientRects();
|
| + assert_equals(containRect[0].right, targetRect[0].right, "#TARGET right aligns with #CONTAIN");
|
| + assert_equals(containRect[0].top, targetRect[0].top, "#TARGET top aligns with #CONTAIN");
|
| + }, "test2: after static->relative, #TARGET containing rect is #CONTAIN"
|
| +);
|
| +</script>
|
| +
|
| +
|
|
|