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

Unified Diff: LayoutTests/fast/multicol/cssom-view.html

Issue 256743006: [New Multicolumn] Make offsetLeft, offsetTop and getClientRects() behave. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase master Created 6 years, 8 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 | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/multicol/cssom-view-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/multicol/cssom-view.html
diff --git a/LayoutTests/fast/multicol/cssom-view.html b/LayoutTests/fast/multicol/cssom-view.html
new file mode 100644
index 0000000000000000000000000000000000000000..c86d9fbccedc5b2a09f12ad2128fa3723eb0d328
--- /dev/null
+++ b/LayoutTests/fast/multicol/cssom-view.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+ if (window.internals)
+ internals.settings.setRegionBasedColumnsEnabled(true);
+</script>
+<body style="margin-left:10px; margin-top:15px;">
+ <div style="-webkit-columns:3; columns:3;" id="mc">
+ <div id="elm1" class="rodent">elm1</div>
+ <br>
+ <div>
+ <div id="elm2" class="rodent">elm2</div>
+ <div id="elm3" class="rodent">elm3</div>
+ </div>
+ <div id="elm4" class="rodent">elm4</div>
+ <div id="elm5" class="rodent">elm5</div>
+ </div>
+ <p id="console"></p>
+ <script>
+ var mc = document.getElementById('mc');
+ var elm1 = document.getElementById('elm1');
+ var elm2 = document.getElementById('elm2');
+ var elm3 = document.getElementById('elm3');
+ var elm4 = document.getElementById('elm4');
+ var elm5 = document.getElementById('elm5');
+ shouldBe("mc.offsetLeft", "10");
+ shouldBe("mc.offsetTop", "15");
+
+ shouldBe("elm1.offsetLeft", "mc.offsetLeft");
+ shouldBe("elm1.offsetTop", "mc.offsetTop");
+ shouldBeGreaterThan("elm2.offsetLeft", "elm1.offsetLeft");
+ shouldBe("elm2.offsetTop", "elm1.offsetTop");
+ shouldBe("elm3.offsetLeft", "elm2.offsetLeft");
+ shouldBeGreaterThan("elm3.offsetTop", "elm2.offsetTop");
+ shouldBeGreaterThan("elm4.offsetLeft", "elm3.offsetLeft");
+ shouldBe("elm4.offsetTop", "elm1.offsetTop");
+ shouldBe("elm5.offsetLeft", "elm4.offsetLeft");
+ shouldBe("elm5.offsetTop", "elm3.offsetTop");
+
+ var elements = document.getElementsByClassName('rodent');
+ for (var i = 0; i < elements.length; i++) {
+ var rects = elements[i].getClientRects();
+ shouldBe("rects.length", "1");
+ shouldBe("rects[0].left", "elements[i].offsetLeft");
+ shouldBe("rects[0].top", "elements[i].offsetTop");
+ }
+ </script>
+</body>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/multicol/cssom-view-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698