OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Custom Elements: CEReactions on ParentNode interface</title> | 4 <title>Custom Elements: CEReactions on Document interface</title> |
5 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> | 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"> | 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"> | 7 <meta name="help" content="https://dom.spec.whatwg.org/#document"> |
| 8 <meta name="help" content="https://html.spec.whatwg.org/#document"> |
8 <script src="/resources/testharness.js"></script> | 9 <script src="/resources/testharness.js"></script> |
9 <script src="/resources/testharnessreport.js"></script> | 10 <script src="/resources/testharnessreport.js"></script> |
10 <script src="../resources/custom-elements-helpers.js"></script> | 11 <script src="../resources/custom-elements-helpers.js"></script> |
11 <script src="./resources/reactions.js"></script> | 12 <script src="./resources/reactions.js"></script> |
12 </head> | 13 </head> |
13 <body> | 14 <body> |
14 <div id="log"></div> | 15 <div id="log"></div> |
15 <script> | 16 <script> |
16 | 17 |
17 test(function () { | 18 test(function () { |
(...skipping 17 matching lines...) Expand all Loading... |
35 | 36 |
36 var newDoc = document.implementation.createHTMLDocument(); | 37 var newDoc = document.implementation.createHTMLDocument(); |
37 newDoc.adoptNode(instance); | 38 newDoc.adoptNode(instance); |
38 | 39 |
39 var logEntries = element.takeLog(); | 40 var logEntries = element.takeLog(); |
40 assert_array_equals(logEntries.types(), ['adopted']); | 41 assert_array_equals(logEntries.types(), ['adopted']); |
41 assert_equals(logEntries.last().oldDocument, document); | 42 assert_equals(logEntries.last().oldDocument, document); |
42 assert_equals(logEntries.last().newDocument, newDoc); | 43 assert_equals(logEntries.last().newDocument, newDoc); |
43 }, 'adoptNode on Document must enqueue an adopted reaction when importing a cust
om element'); | 44 }, 'adoptNode on Document must enqueue an adopted reaction when importing a cust
om element'); |
44 | 45 |
| 46 test(function () { |
| 47 var element = define_new_custom_element(); |
| 48 var instance = document.createElement(element.name); |
| 49 |
| 50 var container = document.createElement('div'); |
| 51 container.contentEditable = true; |
| 52 container.appendChild(instance); |
| 53 document.body.appendChild(container); |
| 54 |
| 55 assert_array_equals(element.takeLog().types(), ['constructed', 'connected'])
; |
| 56 |
| 57 container.focus(); |
| 58 document.execCommand('delete', false, null); |
| 59 |
| 60 assert_array_equals(element.takeLog().types(), ['disconnected']); |
| 61 }, 'execCommand on Document must enqueue a disconnected reaction when deleting a
custom element from a contenteditable element'); |
| 62 |
45 </script> | 63 </script> |
46 </body> | 64 </body> |
47 </html> | 65 </html> |
OLD | NEW |