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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/custom-elements/reactions/Document.html

Issue 2376103007: Import wpt@09907a9c4bcee14986431d53e4381384c7c69107 (Closed)
Patch Set: update platform expectations Created 4 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Custom Elements: CEReactions on ParentNode interface</title>
5 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
6 <meta name="assert" content="importNode and adoptNode of Document interface must have CEReactions">
7 <meta name="help" content="https://dom.spec.whatwg.org/#document">
8 <script src="/resources/testharness.js"></script>
9 <script src="/resources/testharnessreport.js"></script>
10 <script src="./resources/reactions.js"></script>
11 </head>
12 <body>
13 <div id="log"></div>
14 <script>
15
16 test(function () {
17 var element = defineNewCustomElement();
18 var instance = document.createElement(element.name);
19 assert_array_equals(element.log().types(), ['constructed']);
20
21 var newDoc = document.implementation.createHTMLDocument();
22 newDoc.importNode(instance);
23
24 var logEntries = element.log();
25 assert_array_equals(logEntries.types(), ['constructed']);
26 assert_equals(logEntries.log().oldDocument, document);
27 assert_equals(logEntries.log().newDocument, newDoc);
28 }, 'importNode on Document must construct a new custom element when importing a custom element');
29
30 test(function () {
31 var element = defineNewCustomElement();
32 var instance = document.createElement(element.name);
33 assert_array_equals(element.log().types(), ['constructed']);
34
35 var newDoc = document.implementation.createHTMLDocument();
36 newDoc.adoptNode(instance);
37
38 var logEntries = element.log();
39 assert_array_equals(logEntries.types(), ['adopted']);
40 assert_equals(logEntries.log().oldDocument, document);
41 assert_equals(logEntries.log().newDocument, newDoc);
42 }, 'adoptNode on Document must enqueue an adopted reaction when importing a cust om element');
43
44 </script>
45 </body>
46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698