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

Unified Diff: LayoutTests/fast/multicol/event-offset.html

Issue 1024023002: [New Multicolumn] mapAbsoluteToLocalPoint() needs to convert to flow thread coordinates. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: code review - remove more cruft. Created 5 years, 9 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/event-offset-complex-tree.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/multicol/event-offset.html
diff --git a/LayoutTests/fast/multicol/event-offset.html b/LayoutTests/fast/multicol/event-offset.html
new file mode 100644
index 0000000000000000000000000000000000000000..242f3015a099684b4abbf09a753467cc42bcefff
--- /dev/null
+++ b/LayoutTests/fast/multicol/event-offset.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<style>
+body {
+ margin: 0;
+}
+
+#columns {
+ position: absolute;
+ width: 332px;
+ height: 200px;
+ top: 220px;
+ left: 300px;
+ border: 1px solid black;
+ -webkit-column-count: 3;
+ -webkit-column-gap: 16px;
+ column-fill: auto;
+ line-height: 50px;
+}
+</style>
+
+<div id="columns">
+ <br>
+ <br>
+ <br>
+ <div id="in-column1">first</div>
+ <br>
+ <div id="in-column2">second</div>
+ <br>
+ <br>
+ <div id="in-column3">third</div>
+ <br>
+</div>
+
+<script src="../../resources/js-test.js"></script>
+<script>
+description("Dispatch mouse click events in each column and check the result.");
+
+function dispatchEvent(clientX, clientY, expectedElementID, expectedOffsetX, expectedOffsetY) {
+ var e = document.createEvent("MouseEvent");
+ e.initMouseEvent("click", true, true, window, 1, 1, 1, clientX, clientY, false, false, false, false, 0, document);
+ e.expectedElementID = expectedElementID;
+ e.expectedOffsetX = expectedOffsetX;
+ e.expectedOffsetY = expectedOffsetY;
+ var target = document.elementFromPoint(e.clientX, e.clientY);
+ target.dispatchEvent(e);
+}
+
+onclick = function(event) {
+ if (!event.expectedElementID)
+ return;
+ shouldBe("event.target.id", "event.expectedElementID");
+ shouldBe("event.offsetX", "event.expectedOffsetX");
+ shouldBe("event.offsetY", "event.expectedOffsetY");
+}
+
+window.onload = function() {
+ dispatchEvent(380, 400, 'in-column1', 79, 29);
+ dispatchEvent(480, 300, 'in-column2', 63, 29);
+ dispatchEvent(632, 221, 'in-column3', 99, 0);
+}
+</script>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/multicol/event-offset-complex-tree.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698