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

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

Issue 2477133002: Import wpt@306326cfe973b6c7019c50879ad03b02825c7539 (Closed)
Patch Set: Modify TestExpectations or download new baselines for tests. Created 4 years, 1 month 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 HTMLOutputElement interface</title>
5 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
6 <meta name="assert" content="value and defaultValue of HTMLOutputElement interfa ce must have CEReactions">
7 <meta name="help" content="https://dom.spec.whatwg.org/#node">
8 <script src="/resources/testharness.js"></script>
9 <script src="/resources/testharnessreport.js"></script>
10 <script src="../resources/custom-elements-helpers.js"></script>
11 <script src="./resources/reactions.js"></script>
12 </head>
13 <body>
14 <div id="log"></div>
15 <script>
16
17 test_with_window(function (contentWindow, contentDocument) {
18 const element = define_custom_element_in_window(contentWindow, 'custom-eleme nt', []);
19 contentDocument.body.innerHTML = `<output><custom-element>hello</custom-elem ent></output>`;
20 const anchor = contentDocument.querySelector('output');
21
22 assert_array_equals(element.takeLog().types(), ['constructed', 'connected']) ;
23 assert_equals(anchor.innerHTML, '<custom-element>hello</custom-element>');
24
25 anchor.value = 'world';
26 assert_equals(anchor.innerHTML, 'world');
27 assert_array_equals(element.takeLog().types(), ['disconnected']);
28 }, 'value on HTMLOutputElement must enqueue disconnectedCallback when removing a custom element');
29
30 test_with_window(function (contentWindow, contentDocument) {
31 const element = define_custom_element_in_window(contentWindow, 'custom-eleme nt', []);
32 contentDocument.body.innerHTML = `<output><custom-element>hello</custom-elem ent></output>`;
33 const anchor = contentDocument.querySelector('output');
34
35 assert_array_equals(element.takeLog().types(), ['constructed', 'connected']) ;
36 assert_equals(anchor.innerHTML, '<custom-element>hello</custom-element>');
37
38 anchor.defaultValue = 'world';
39 assert_equals(anchor.innerHTML, 'world');
40 assert_array_equals(element.takeLog().types(), ['disconnected']);
41 }, 'defaultValue on HTMLOutputElement must enqueue disconnectedCallback when rem oving a custom element');
42
43 </script>
44 </body>
45 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698