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

Unified Diff: LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom.html

Issue 519003003: Tell synthetic attribute nodes inside shadow DOM about move to new Document (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | « no previous file | LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom.html
diff --git a/LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom.html b/LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom.html
new file mode 100644
index 0000000000000000000000000000000000000000..12c7a0129227075a92ea14c60fec63c37e55e239
--- /dev/null
+++ b/LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+
+<div id="div1"></div>
+<div id="div2"></div>
+
+<script>
+description('This tests ensures that an event listener on an attribute node inside a shadow DOM is properly unregistered when parent element of the attribute is moved to a new document.');
+
+var div1 = document.getElementById('div1');
+var div2 = document.getElementById('div2');
+var shadowRoot = div2.createShadowRoot();
+
+// Register an event listener on an attribute node.
+div1.attributes[0].addEventListener('touchstart', function() { });
+if (window.internals)
+ shouldBe('window.internals.touchEventHandlerCount(document)', '1');
+
+// Move the parent element into a shadow DOM.
+shadowRoot.appendChild(div1);
+
+// Move the shadow host into a new document.
+var doc = document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html');
+doc.adoptNode(div2);
+
+// Make sure the handler was unregistered.
+if (window.internals)
+ shouldBe('window.internals.touchEventHandlerCount(document)', '0');
+
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698