| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>Custom Elements: CEReactions on HTMLOptionElement interface</title> | |
| 5 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> | |
| 6 <meta name="assert" content="text of HTMLOptionElement interface must have CERea
ctions"> | |
| 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 = `<select><option></option></select>`; | |
| 20 const option = contentDocument.querySelector('option'); | |
| 21 const instance = document.createElement('custom-element'); | |
| 22 option.appendChild(instance); | |
| 23 instance.textContent = 'hello'; | |
| 24 | |
| 25 assert_array_equals(element.takeLog().types(), ['constructed', 'connected'])
; | |
| 26 assert_equals(option.innerHTML, '<custom-element>hello</custom-element>'); | |
| 27 | |
| 28 option.text = 'world'; | |
| 29 assert_equals(option.innerHTML, 'world'); | |
| 30 assert_array_equals(element.takeLog().types(), ['disconnected']); | |
| 31 }, 'text on HTMLOptionElement must enqueue disconnectedCallback when removing a
custom element'); | |
| 32 | |
| 33 </script> | |
| 34 </body> | |
| 35 </html> | |
| OLD | NEW |