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

Unified Diff: LayoutTests/fast/dom/shadow/event-path-in-shadow-tree.html

Issue 14508005: Support an Event Path API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Introduce TreeScope::isInclusiveAncestorOf Created 7 years, 7 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
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>

Powered by Google App Engine
This is Rietveld 408576698