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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutBlock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
+
+
« 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