Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/block/positioning/absolute-in-inline-dynamic.html

Issue 2342173002: Fix #641162: LayoutInline propagate position changes to abspos descendants (Closed)
Patch Set: 80 col rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutBlock.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <body>
5 <p>Dynamic absolute positioning inside inline-relative container</p>
6 <div id="LIKEBODY" style="position:relative">
7 <div id="CONTAIN" style="position:relative; display:inline">CONTAIN
8 <div id="TARGET" style="position:absolute; right:0; top:0; width:20px; hei ght:20px; background: green">T</div>
9 THE TARGET
10 </div>
11 </div>
12 <script>
13 let contain = document.querySelector('#CONTAIN');
14 let target = document.querySelector('#TARGET');
15 let likebody = document.querySelector('#LIKEBODY');
16
17 test(() => {
18 let containRect = contain.getClientRects();
19 let targetRect = target.getClientRects();
20 assert_equals(containRect[0].right, targetRect[0].right, "#TARGET right alig ns with #CONTAIN");
21 assert_equals(containRect[0].top, targetRect[0].top, "#TARGET top aligns wit h #CONTAIN");
22 }, "test0: initial #TARGET containing rect is #CONTAIN"
23 );
24
25 test(() => {
26 contain.style.position = 'static';
27 let likebodyRect = likebody.getClientRects();
28 let targetRect = target.getClientRects();
29 assert_equals(likebodyRect[0].right, targetRect[0].right, "#TARGET right ali gns with #LIKEBODY");
30 assert_equals(likebodyRect[0].top, targetRect[0].top, "#TARGET top aligns wi th #LIKEBODY");
31
32 }, "test1: after relative->static, #TARGET containing rect is #LIKEBODY"
33 );
34
35 test(() => {
36 contain.style.position = 'relative';
37 let containRect = contain.getClientRects();
38 let targetRect = target.getClientRects();
39 assert_equals(containRect[0].right, targetRect[0].right, "#TARGET right alig ns with #CONTAIN");
40 assert_equals(containRect[0].top, targetRect[0].top, "#TARGET top aligns wit h #CONTAIN");
41 }, "test2: after static->relative, #TARGET containing rect is #CONTAIN"
42 );
43 </script>
44
45
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutBlock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698