Index: LayoutTests/fast/dom/shadow/event-path-in-shadow-tree.html |
diff --git a/LayoutTests/fast/dom/shadow/event-path-in-shadow-tree.html b/LayoutTests/fast/dom/shadow/event-path-in-shadow-tree.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..398218d9697978fd5edcb9e6add40527d3e45c9e |
--- /dev/null |
+++ b/LayoutTests/fast/dom/shadow/event-path-in-shadow-tree.html |
@@ -0,0 +1,43 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../js/resources/js-test-pre.js"></script> |
+<script src="resources/shadow-dom.js"></script> |
+</head> |
+<body> |
+<p id="description"></p> |
+<div id="sandbox"></div> |
+<pre id="console"></pre> |
+<script> |
+var sandbox = document.getElementById('sandbox'); |
+ |
+// The following DOM tree came from the picture I've drawn on a whiteboard. |
+// https://chromium.googlecode.com/issues/attachment?aid=2340300011000&name=IMG_20130508_160406.jpg&token=GBf6WauXYBNwzm3iC2p9qdtsPUQ%3A1367996888205&inline=1 |
+sandbox.appendChild( |
+ createDOM('div', {'id': 'A'}, |
+ createDOM('div', {'id': 'B'}, |
+ createDOM('div', {'id': 'C'})), |
+ createShadowRoot({'id': 'D'}, |
+ createDOM('div', {'id': 'E'}, |
+ createDOM('content', {'id': 'F'}), |
+ createShadowRoot({'id': 'G'}, |
+ createDOM('div', {'id': 'H'}, |
+ createDOM('div', {'id': 'I'}, |
+ createDOM('content', {'id': 'J'})), |
+ createShadowRoot({'id': 'K'}, |
+ createDOM('div', {'id': 'L'}, |
+ createDOM('content', {'id': 'M'}))))))))); |
+ |
+['A', 'B', 'C', 'A/', 'A/E', 'A/F', 'A/E/', 'A/E/H', 'A/E/I', 'A/E/J', 'A/E/H/', 'A/E/H/L', 'A/E/H/M'].forEach(function(path) { |
+ getNodeInShadowTreeStack(path).addEventListener('click', function(event) { |
+ debug('\nevent.path() on node ' + dumpNode(event.currentTarget)); |
+ debug(dumpNodeList(event.path())); |
+ }); |
+}); |
+var clickEvent = document.createEvent("MouseEvents"); |
+clickEvent.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); |
+document.getElementById('C').dispatchEvent(clickEvent); |
+</script> |
+<script src="../../js/resources/js-test-post.js"></script> |
+</body> |
+</html> |