Index: LayoutTests/fast/multicol/event-offset-complex-tree.html |
diff --git a/LayoutTests/fast/multicol/event-offset-complex-tree.html b/LayoutTests/fast/multicol/event-offset-complex-tree.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5d3aa7e73ff3b9bb2ba21786e2cde95ca08c3d45 |
--- /dev/null |
+++ b/LayoutTests/fast/multicol/event-offset-complex-tree.html |
@@ -0,0 +1,75 @@ |
+<!DOCTYPE html> |
Julien - ping for review
2015/03/25 21:41:32
complex-tree is just nested tree no?
mstensho (USE GERRIT)
2015/03/25 22:35:05
Yeah. Not complex enough to call complex? :)
|
+<style> |
+body { |
+ margin: 0; |
+} |
+ |
+#columns { |
+ position: absolute; |
+ width: 332px; |
+ height: 200px; |
+ top: 320px; |
+ 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> |
+ <div> |
+ <br> |
+ <div id="in-column1">first</div> |
+ </div> |
+ <br> |
+ <div> |
+ <div id="in-column2">second</div> |
+ <br> |
+ <br> |
+ <div id="in-column3">third</div> |
+ <br> |
+ </div> |
+</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); |
+} |
+ |
+function clicked(event) { |
+ if (!event.expectedElementID) |
+ return; |
+ shouldBe("event.target.id", "event.expectedElementID"); |
+ shouldBe("event.offsetX", "event.expectedOffsetX"); |
+ shouldBe("event.offsetY", "event.expectedOffsetY"); |
+} |
+ |
+if (window.testRunner) |
+ window.testRunner.waitUntilDone(); |
+ |
+document.body.addEventListener('click', clicked, false); |
+window.addEventListener('load', function() { |
+ setTimeout(function() { |
+ setTimeout(function() { |
+ dispatchEvent(380, 500, 'in-column1', 79, 29); |
+ dispatchEvent(480, 400, 'in-column2', 63, 29); |
+ dispatchEvent(632, 321, 'in-column3', 99, 0); |
+ |
+ if (window.testRunner) |
+ window.testRunner.notifyDone(); |
+ }, 0); |
+ }, 0); |
+}, false); |
+</script> |