Title: [208082] trunk
Revision
208082
Author
rn...@webkit.org
Date
2016-10-28 16:49:46 -0700 (Fri, 28 Oct 2016)

Log Message

Add CEReactions to the remaining HTML DOM APIs
https://bugs.webkit.org/show_bug.cgi?id=163969

Reviewed by Chris Dumez.

Source/WebCore:

Added CEReactions to the remaining DOM and HTML APIs as needed.

Tests: fast/custom-elements/reactions-for-indieui.html
       fast/custom-elements/reactions/Document.html
       fast/custom-elements/reactions/HTMLAnchorElement.html
       fast/custom-elements/reactions/HTMLOptionElement.html
       fast/custom-elements/reactions/HTMLOptionsCollection.html
       fast/custom-elements/reactions/HTMLOutputElement.html
       fast/custom-elements/reactions/HTMLSelectElement.html
       fast/custom-elements/reactions/HTMLTableElement.html
       fast/custom-elements/reactions/HTMLTableRowElement.html
       fast/custom-elements/reactions/HTMLTableSectionElement.html
       fast/custom-elements/reactions/HTMLTitleElement.html
       fast/custom-elements/reactions/ShadowRoot.html

* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::setLength):
(WebCore::JSHTMLOptionsCollection::indexSetter):
* bindings/js/JSHTMLSelectElementCustom.cpp:
(WebCore::JSHTMLSelectElement::indexSetter):
* dom/CharacterData.idl:
* dom/Document.idl:
* dom/Element.idl:
* dom/ShadowRoot.idl:
* html/HTMLAnchorElement.idl:
* html/HTMLDocument.idl:
* html/HTMLOptionElement.idl:
* html/HTMLOptionsCollection.idl:
* html/HTMLOutputElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTableElement.idl:
* html/HTMLTableRowElement.idl:
* html/HTMLTableSectionElement.idl:
* html/HTMLTitleElement.idl:

LayoutTests:

Added W3C style testharness.js tests for CEReactions to various HTMLElements under fast/custom-elements/reactions.
Also added some WebKit specific tests using the same harness outside that directory.

* fast/custom-elements/reactions-for-indieui-expected.txt: Added.
* fast/custom-elements/reactions-for-indieui.html: Added.
* fast/custom-elements/reactions-for-webkit-extensions-expected.txt:
* fast/custom-elements/reactions-for-webkit-extensions.html:
* fast/custom-elements/reactions/Document-expected.txt: Added.
* fast/custom-elements/reactions/Document.html: Added.
* fast/custom-elements/reactions/HTMLAnchorElement-expected.txt: Added.
* fast/custom-elements/reactions/HTMLAnchorElement.html: Added.
* fast/custom-elements/reactions/HTMLOptionElement-expected.txt: Added.
* fast/custom-elements/reactions/HTMLOptionElement.html: Added.
* fast/custom-elements/reactions/HTMLOptionsCollection-expected.txt: Added.
* fast/custom-elements/reactions/HTMLOptionsCollection.html: Added.
* fast/custom-elements/reactions/HTMLOutputElement-expected.txt: Added.
* fast/custom-elements/reactions/HTMLOutputElement.html: Added.
* fast/custom-elements/reactions/HTMLSelectElement-expected.txt: Added.
* fast/custom-elements/reactions/HTMLSelectElement.html: Added.
* fast/custom-elements/reactions/HTMLTableElement-expected.txt: Added.
* fast/custom-elements/reactions/HTMLTableElement.html: Added.
* fast/custom-elements/reactions/HTMLTableRowElement-expected.txt: Added.
* fast/custom-elements/reactions/HTMLTableRowElement.html: Added.
* fast/custom-elements/reactions/HTMLTableSectionElement-expected.txt: Added.
* fast/custom-elements/reactions/HTMLTableSectionElement.html: Added.
* fast/custom-elements/reactions/HTMLTitleElement-expected.txt: Added.
* fast/custom-elements/reactions/HTMLTitleElement.html: Added.
* fast/custom-elements/reactions/ShadowRoot-expected.txt: Added.
* fast/custom-elements/reactions/ShadowRoot.html: Added.
* fast/custom-elements/resources/additional-helpers.js: Added.
* fast/custom-elements/upgrading-enqueue-reactions-expected.txt:
* fast/custom-elements/upgrading-enqueue-reactions.html:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (208081 => 208082)


--- trunk/LayoutTests/ChangeLog	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/LayoutTests/ChangeLog	2016-10-28 23:49:46 UTC (rev 208082)
@@ -1,3 +1,45 @@
+2016-10-28  Ryosuke Niwa  <rn...@webkit.org>
+
+        Add CEReactions to the remaining HTML DOM APIs
+        https://bugs.webkit.org/show_bug.cgi?id=163969
+
+        Reviewed by Chris Dumez.
+
+        Added W3C style testharness.js tests for CEReactions to various HTMLElements under fast/custom-elements/reactions.
+        Also added some WebKit specific tests using the same harness outside that directory.
+
+        * fast/custom-elements/reactions-for-indieui-expected.txt: Added.
+        * fast/custom-elements/reactions-for-indieui.html: Added.
+        * fast/custom-elements/reactions-for-webkit-extensions-expected.txt:
+        * fast/custom-elements/reactions-for-webkit-extensions.html:
+        * fast/custom-elements/reactions/Document-expected.txt: Added.
+        * fast/custom-elements/reactions/Document.html: Added.
+        * fast/custom-elements/reactions/HTMLAnchorElement-expected.txt: Added.
+        * fast/custom-elements/reactions/HTMLAnchorElement.html: Added.
+        * fast/custom-elements/reactions/HTMLOptionElement-expected.txt: Added.
+        * fast/custom-elements/reactions/HTMLOptionElement.html: Added.
+        * fast/custom-elements/reactions/HTMLOptionsCollection-expected.txt: Added.
+        * fast/custom-elements/reactions/HTMLOptionsCollection.html: Added.
+        * fast/custom-elements/reactions/HTMLOutputElement-expected.txt: Added.
+        * fast/custom-elements/reactions/HTMLOutputElement.html: Added.
+        * fast/custom-elements/reactions/HTMLSelectElement-expected.txt: Added.
+        * fast/custom-elements/reactions/HTMLSelectElement.html: Added.
+        * fast/custom-elements/reactions/HTMLTableElement-expected.txt: Added.
+        * fast/custom-elements/reactions/HTMLTableElement.html: Added.
+        * fast/custom-elements/reactions/HTMLTableRowElement-expected.txt: Added.
+        * fast/custom-elements/reactions/HTMLTableRowElement.html: Added.
+        * fast/custom-elements/reactions/HTMLTableSectionElement-expected.txt: Added.
+        * fast/custom-elements/reactions/HTMLTableSectionElement.html: Added.
+        * fast/custom-elements/reactions/HTMLTitleElement-expected.txt: Added.
+        * fast/custom-elements/reactions/HTMLTitleElement.html: Added.
+        * fast/custom-elements/reactions/ShadowRoot-expected.txt: Added.
+        * fast/custom-elements/reactions/ShadowRoot.html: Added.
+        * fast/custom-elements/resources/additional-helpers.js: Added.
+        * fast/custom-elements/upgrading-enqueue-reactions-expected.txt:
+        * fast/custom-elements/upgrading-enqueue-reactions.html:
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+
 2016-10-28  Antoine Quint  <grao...@apple.com>
 
         [Modern Media Controls] Media Controller: volume control support

Added: trunk/LayoutTests/fast/custom-elements/reactions/Document-expected.txt (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/Document-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/Document-expected.txt	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,10 @@
+
+PASS title on Document must enqueue disconnectedCallback when removing a custom element 
+PASS body on Document must enqueue disconnectedCallback when removing a custom element 
+PASS body on Document must enqueue connectedCallback when inserting a custom element 
+PASS open on Document must enqueue disconnectedCallback when removing a custom element 
+PASS write on Document must enqueue disconnectedCallback when removing a custom element 
+PASS write on Document must enqueue connectedCallback after constructing a custom element 
+PASS writeln on Document must enqueue disconnectedCallback when removing a custom element 
+PASS writeln on Document must enqueue connectedCallback after constructing a custom element 
+

Added: trunk/LayoutTests/fast/custom-elements/reactions/Document.html (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/Document.html	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/Document.html	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,112 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Custom Elements: CEReactions on Document interface</title>
+<meta name="author" title="Ryosuke Niwa" href=""
+<meta name="assert" content="title, body, open, write, and writeln of Document interface must have CEReactions">
+<meta name="help" content="https://dom.spec.whatwg.org/#node">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.title = '';
+    const title = contentDocument.querySelector('title');
+    const instance = document.createElement('custom-element');
+    title.appendChild(instance);
+    instance.textContent = 'hello';
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(title.innerHTML, '<custom-element>hello</custom-element>');
+
+    title.text = 'world';
+    assert_equals(title.innerHTML, 'world');
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'title on Document must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    const body = contentDocument.body;
+    body.innerHTML = '<custom-element>hello</custom-element>';
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(body.innerHTML, '<custom-element>hello</custom-element>');
+
+    contentDocument.body = document.createElement('body');
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'body on Document must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    const instance = contentDocument.createElement('custom-element');
+    const body = contentDocument.createElement('body');
+    body.appendChild(instance);
+
+    assert_array_equals(element.takeLog().types(), ['constructed']);
+    assert_equals(body.innerHTML, '<custom-element></custom-element>');
+
+    contentDocument.body = body;
+    assert_array_equals(element.takeLog().types(), ['connected']);
+}, 'body on Document must enqueue connectedCallback when inserting a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = '<custom-element></custom-element>';
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+
+    contentDocument.open();
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'open on Document must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = '<custom-element></custom-element>';
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+
+    contentDocument.write('');
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'write on Document must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+    contentWindow.document.write('<custom-element></custom-element>');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+}, 'write on Document must enqueue connectedCallback after constructing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = '<custom-element></custom-element>';
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+
+    contentDocument.writeln('');
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'writeln on Document must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+    contentWindow.document.writeln('<custom-element></custom-element>');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+}, 'writeln on Document must enqueue connectedCallback after constructing a custom element');
+
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLAnchorElement-expected.txt (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLAnchorElement-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLAnchorElement-expected.txt	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,3 @@
+
+PASS text on HTMLAnchorElement must enqueue disconnectedCallback when removing a custom element 
+

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLAnchorElement.html (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLAnchorElement.html	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLAnchorElement.html	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Custom Elements: CEReactions on HTMLAnchorElement interface</title>
+<meta name="author" title="Ryosuke Niwa" href=""
+<meta name="assert" content="text of HTMLAnchorElement interface must have CEReactions">
+<meta name="help" content="https://dom.spec.whatwg.org/#node">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<a><custom-element>hello</custom-element></a>`;
+    const anchor = contentDocument.querySelector('a');
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(anchor.innerHTML, '<custom-element>hello</custom-element>');
+
+    anchor.text = 'world';
+    assert_equals(anchor.innerHTML, 'world');
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'text on HTMLAnchorElement must enqueue disconnectedCallback when removing a custom element');
+
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLOptionElement-expected.txt (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLOptionElement-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLOptionElement-expected.txt	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,3 @@
+
+PASS text on HTMLOptionElement must enqueue disconnectedCallback when removing a custom element 
+

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLOptionElement.html (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLOptionElement.html	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLOptionElement.html	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Custom Elements: CEReactions on HTMLOptionElement interface</title>
+<meta name="author" title="Ryosuke Niwa" href=""
+<meta name="assert" content="text of HTMLOptionElement interface must have CEReactions">
+<meta name="help" content="https://dom.spec.whatwg.org/#node">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<select><option></option></select>`;
+    const option = contentDocument.querySelector('option');
+    const instance = document.createElement('custom-element');
+    option.appendChild(instance);
+    instance.textContent = 'hello';
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(option.innerHTML, '<custom-element>hello</custom-element>');
+
+    option.text = 'world';
+    assert_equals(option.innerHTML, 'world');
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'text on HTMLOptionElement must enqueue disconnectedCallback when removing a custom element');
+
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLOptionsCollection-expected.txt (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLOptionsCollection-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLOptionsCollection-expected.txt	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,7 @@
+
+PASS length on HTMLOptionsCollection must enqueue disconnectedCallback when removing a custom element 
+PASS The indexed setter on HTMLOptionsCollection must enqueue connectedCallback when inserting a custom element 
+PASS The indexed setter on HTMLOptionsCollection must enqueue disconnectedCallback when removing a custom element 
+PASS add on HTMLOptionsCollection must enqueue connectedCallback when inserting a custom element 
+PASS remove on HTMLOptionsCollection must enqueue disconnectedCallback when removing a custom element 
+

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLOptionsCollection.html (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLOptionsCollection.html	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLOptionsCollection.html	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,125 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Custom Elements: CEReactions on HTMLOptionsCollection interface</title>
+<meta name="author" title="Ryosuke Niwa" href=""
+<meta name="assert" content="length, the indexed setter, add, and remove of HTMLOptionsCollection interface must have CEReactions">
+<meta name="help" content="https://dom.spec.whatwg.org/#node">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<select><option></option></select>`;
+    const option = contentDocument.querySelector('option');
+
+    const instance = contentDocument.createElement(element.name);
+    option.appendChild(instance);
+    instance.textContent = 'hello';
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(option.innerHTML, '<custom-element>hello</custom-element>');
+
+    const select = contentDocument.querySelector('select');
+    assert_equals(select.options[0], option);
+    select.options.length = 0;
+    assert_equals(select.firstChild, null);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'length on HTMLOptionsCollection must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<select></select>`;
+    const select = contentDocument.querySelector('select');
+
+    const option = contentDocument.createElement('option');
+    const instance = contentDocument.createElement(element.name);
+    option.appendChild(instance);
+    instance.textContent = 'hello';
+
+    assert_array_equals(element.takeLog().types(), ['constructed']);
+    assert_equals(option.innerHTML, '<custom-element>hello</custom-element>');
+
+    assert_equals(select.options.length, 0);
+    select.options[0] = option;
+    assert_equals(select.options.length, 1);
+    assert_array_equals(element.takeLog().types(), ['connected']);
+}, 'The indexed setter on HTMLOptionsCollection must enqueue connectedCallback when inserting a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<select><option></option></select>`;
+    const option = contentDocument.querySelector('option');
+
+    const instance = contentDocument.createElement(element.name);
+    option.appendChild(instance);
+    instance.textContent = 'hello';
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(option.innerHTML, '<custom-element>hello</custom-element>');
+
+    const select = contentDocument.querySelector('select');
+    assert_equals(select.options[0], option);
+    select.options[0] = null;
+    assert_equals(select.options.length, 0);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'The indexed setter on HTMLOptionsCollection must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<select></select>`;
+    const select = contentDocument.querySelector('select');
+
+    const option = contentDocument.createElement('option');
+    const instance = contentDocument.createElement(element.name);
+    option.appendChild(instance);
+    instance.textContent = 'hello';
+
+    assert_array_equals(element.takeLog().types(), ['constructed']);
+    assert_equals(option.innerHTML, '<custom-element>hello</custom-element>');
+
+    assert_equals(select.options.length, 0);
+    select.options.add(option);
+    assert_equals(select.options.length, 1);
+    assert_array_equals(element.takeLog().types(), ['connected']);
+}, 'add on HTMLOptionsCollection must enqueue connectedCallback when inserting a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<select><option></option></select>`;
+    const option = contentDocument.querySelector('option');
+
+    const instance = contentDocument.createElement(element.name);
+    option.appendChild(instance);
+    instance.textContent = 'hello';
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(option.innerHTML, '<custom-element>hello</custom-element>');
+
+    const select = contentDocument.querySelector('select');
+    assert_equals(select.options[0], option);
+    select.options.remove(0);
+    assert_equals(select.options.length, 0);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'remove on HTMLOptionsCollection must enqueue disconnectedCallback when removing a custom element');
+
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLOutputElement-expected.txt (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLOutputElement-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLOutputElement-expected.txt	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,4 @@
+
+PASS value on HTMLOutputElement must enqueue disconnectedCallback when removing a custom element 
+PASS defaultValue on HTMLOutputElement must enqueue disconnectedCallback when removing a custom element 
+

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLOutputElement.html (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLOutputElement.html	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLOutputElement.html	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Custom Elements: CEReactions on HTMLOutputElement interface</title>
+<meta name="author" title="Ryosuke Niwa" href=""
+<meta name="assert" content="value and defaultValue of HTMLOutputElement interface must have CEReactions">
+<meta name="help" content="https://dom.spec.whatwg.org/#node">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<output><custom-element>hello</custom-element></output>`;
+    const anchor = contentDocument.querySelector('output');
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(anchor.innerHTML, '<custom-element>hello</custom-element>');
+
+    anchor.value = 'world';
+    assert_equals(anchor.innerHTML, 'world');
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'value on HTMLOutputElement must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<output><custom-element>hello</custom-element></output>`;
+    const anchor = contentDocument.querySelector('output');
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(anchor.innerHTML, '<custom-element>hello</custom-element>');
+
+    anchor.defaultValue = 'world';
+    assert_equals(anchor.innerHTML, 'world');
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'defaultValue on HTMLOutputElement must enqueue disconnectedCallback when removing a custom element');
+
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLSelectElement-expected.txt (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLSelectElement-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLSelectElement-expected.txt	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,7 @@
+
+PASS length on HTMLSelectElement must enqueue disconnectedCallback when removing a custom element 
+PASS The indexed setter on HTMLSelectElement must enqueue connectedCallback when inserting a custom element 
+PASS The indexed setter on HTMLSelectElement must enqueue disconnectedCallback when removing a custom element 
+PASS add on HTMLSelectElement must enqueue connectedCallback when inserting a custom element 
+PASS remove on HTMLSelectElement must enqueue disconnectedCallback when removing a custom element 
+

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLSelectElement.html (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLSelectElement.html	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLSelectElement.html	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,125 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Custom Elements: CEReactions on HTMLSelectElement interface</title>
+<meta name="author" title="Ryosuke Niwa" href=""
+<meta name="assert" content="length, add, remove, and the setter of HTMLSelectElement interface must have CEReactions">
+<meta name="help" content="https://dom.spec.whatwg.org/#node">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<select><option></option></select>`;
+    const option = contentDocument.querySelector('option');
+
+    const instance = contentDocument.createElement(element.name);
+    option.appendChild(instance);
+    instance.textContent = 'hello';
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(option.innerHTML, '<custom-element>hello</custom-element>');
+
+    const select = contentDocument.querySelector('select');
+    assert_equals(select.length, 1);
+    select.length = 0;
+    assert_equals(select.firstChild, null);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'length on HTMLSelectElement must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<select></select>`;
+    const select = contentDocument.querySelector('select');
+
+    const option = contentDocument.createElement('option');
+    const instance = contentDocument.createElement(element.name);
+    option.appendChild(instance);
+    instance.textContent = 'hello';
+
+    assert_array_equals(element.takeLog().types(), ['constructed']);
+    assert_equals(option.innerHTML, '<custom-element>hello</custom-element>');
+
+    assert_equals(select.options.length, 0);
+    select[0] = option;
+    assert_equals(select.options.length, 1);
+    assert_array_equals(element.takeLog().types(), ['connected']);
+}, 'The indexed setter on HTMLSelectElement must enqueue connectedCallback when inserting a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<select><option></option></select>`;
+    const option = contentDocument.querySelector('option');
+
+    const instance = contentDocument.createElement(element.name);
+    option.appendChild(instance);
+    instance.textContent = 'hello';
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(option.innerHTML, '<custom-element>hello</custom-element>');
+
+    const select = contentDocument.querySelector('select');
+    assert_equals(select.options[0], option);
+    select[0] = null;
+    assert_equals(select.options.length, 0);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'The indexed setter on HTMLSelectElement must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<select></select>`;
+    const select = contentDocument.querySelector('select');
+
+    const option = contentDocument.createElement('option');
+    const instance = contentDocument.createElement(element.name);
+    option.appendChild(instance);
+    instance.textContent = 'hello';
+
+    assert_array_equals(element.takeLog().types(), ['constructed']);
+    assert_equals(option.innerHTML, '<custom-element>hello</custom-element>');
+
+    assert_equals(select.options.length, 0);
+    select.add(option);
+    assert_equals(select.options.length, 1);
+    assert_array_equals(element.takeLog().types(), ['connected']);
+}, 'add on HTMLSelectElement must enqueue connectedCallback when inserting a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<select><option></option></select>`;
+    const option = contentDocument.querySelector('option');
+
+    const instance = contentDocument.createElement(element.name);
+    option.appendChild(instance);
+    instance.textContent = 'hello';
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(option.innerHTML, '<custom-element>hello</custom-element>');
+
+    const select = contentDocument.querySelector('select');
+    assert_equals(select.options[0], option);
+    select.remove(0);
+    assert_equals(select.options.length, 0);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'remove on HTMLSelectElement must enqueue disconnectedCallback when removing a custom element');
+
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableElement-expected.txt (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableElement-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableElement-expected.txt	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,12 @@
+
+PASS caption on HTMLTableElement must enqueue connectedCallback when inserting a custom element 
+PASS caption on HTMLTableElement must enqueue disconnectedCallback when removing a custom element 
+PASS deleteCaption() on HTMLTableElement must enqueue disconnectedCallback when removing a custom element 
+PASS tHead on HTMLTableElement must enqueue connectedCallback when inserting a custom element 
+PASS tHead on HTMLTableElement must enqueue disconnectedCallback when removing a custom element 
+PASS deleteTHead() on HTMLTableElement must enqueue disconnectedCallback when removing a custom element 
+PASS tFoot on HTMLTableElement must enqueue connectedCallback when inserting a custom element 
+PASS tFoot on HTMLTableElement must enqueue disconnectedCallback when removing a custom element 
+PASS deleteTFoot() on HTMLTableElement must enqueue disconnectedCallback when removing a custom element 
+PASS deleteRow() on HTMLTableElement must enqueue disconnectedCallback when removing a custom element 
+

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableElement.html (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableElement.html	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableElement.html	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,194 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Custom Elements: CEReactions on HTMLTableElement interface</title>
+<meta name="author" title="Ryosuke Niwa" href=""
+<meta name="assert" content="caption, deleteCaption, thead, deleteTHead, tFoot, deleteTFoot, and deleteRow of HTMLTableElement interface must have CEReactions">
+<meta name="help" content="https://dom.spec.whatwg.org/#node">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<table></table>`;
+    const table = contentDocument.querySelector('table');
+
+    const caption = contentDocument.createElement('caption');
+    caption.innerHTML = '<custom-element>hello</custom-element>';
+
+    assert_array_equals(element.takeLog().types(), ['constructed']);
+    assert_equals(caption.innerHTML, '<custom-element>hello</custom-element>');
+
+    assert_equals(table.caption, null);
+    table.caption = caption;
+    assert_array_equals(element.takeLog().types(), ['connected']);
+}, 'caption on HTMLTableElement must enqueue connectedCallback when inserting a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<table><caption><custom-element>hello</custom-element></caption></table>`;
+    const caption = contentDocument.querySelector('caption');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(caption.innerHTML, '<custom-element>hello</custom-element>');
+
+    const table = contentDocument.querySelector('table');
+    assert_equals(table.caption, caption);
+    const newCaption = contentDocument.createElement('caption');
+    table.caption = newCaption; // Chrome doesn't support setting to null.
+    assert_equals(table.caption, newCaption);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'caption on HTMLTableElement must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<table><caption><custom-element>hello</custom-element></caption></table>`;
+    const caption = contentDocument.querySelector('caption');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(caption.innerHTML, '<custom-element>hello</custom-element>');
+
+    const table = contentDocument.querySelector('table');
+    assert_equals(table.caption, caption);
+    const newCaption = contentDocument.createElement('caption');
+    table.deleteCaption();
+    assert_equals(table.caption, null);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'deleteCaption() on HTMLTableElement must enqueue disconnectedCallback when removing a custom element');
+
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<table></table>`;
+    const table = contentDocument.querySelector('table');
+
+    const thead = contentDocument.createElement('thead');
+    thead.innerHTML = '<tr><td><custom-element>hello</custom-element></td></tr>';
+
+    assert_array_equals(element.takeLog().types(), ['constructed']);
+    assert_equals(thead.innerHTML, '<tr><td><custom-element>hello</custom-element></td></tr>');
+
+    assert_equals(table.tHead, null);
+    table.tHead = thead;
+    assert_array_equals(element.takeLog().types(), ['connected']);
+}, 'tHead on HTMLTableElement must enqueue connectedCallback when inserting a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<table><thead><tr><td><custom-element>hello</custom-element></td></tr></thead></table>`;
+    const thead = contentDocument.querySelector('thead');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(thead.innerHTML, '<tr><td><custom-element>hello</custom-element></td></tr>');
+
+    const table = contentDocument.querySelector('table');
+    assert_equals(table.tHead, thead);
+    const newThead = contentDocument.createElement('thead');
+    table.tHead = newThead; // Chrome doesn't support setting to null.
+    assert_equals(table.tHead, newThead);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'tHead on HTMLTableElement must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<table><thead><tr><td><custom-element>hello</custom-element></td></tr></thead></table>`;
+    const thead = contentDocument.querySelector('thead');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(thead.innerHTML, '<tr><td><custom-element>hello</custom-element></td></tr>');
+
+    const table = contentDocument.querySelector('table');
+    assert_equals(table.tHead, thead);
+    table.deleteTHead();
+    assert_equals(table.tHead, null);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'deleteTHead() on HTMLTableElement must enqueue disconnectedCallback when removing a custom element');
+
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<table></table>`;
+    const table = contentDocument.querySelector('table');
+
+    const tfoot = contentDocument.createElement('tfoot');
+    tfoot.innerHTML = '<tr><td><custom-element>hello</custom-element></td></tr>';
+
+    assert_array_equals(element.takeLog().types(), ['constructed']);
+    assert_equals(tfoot.innerHTML, '<tr><td><custom-element>hello</custom-element></td></tr>');
+
+    assert_equals(table.tFoot, null);
+    table.tFoot = tfoot;
+    assert_array_equals(element.takeLog().types(), ['connected']);
+}, 'tFoot on HTMLTableElement must enqueue connectedCallback when inserting a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<table><tfoot><tr><td><custom-element>hello</custom-element></td></tr></tfoot></table>`;
+    const tfoot = contentDocument.querySelector('tfoot');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(tfoot.innerHTML, '<tr><td><custom-element>hello</custom-element></td></tr>');
+
+    const table = contentDocument.querySelector('table');
+    assert_equals(table.tFoot, tfoot);
+    const newThead = contentDocument.createElement('tfoot');
+    table.tFoot = newThead; // Chrome doesn't support setting to null.
+    assert_equals(table.tFoot, newThead);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'tFoot on HTMLTableElement must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<table><tfoot><tr><td><custom-element>hello</custom-element></td></tr></tfoot></table>`;
+    const tfoot = contentDocument.querySelector('tfoot');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(tfoot.innerHTML, '<tr><td><custom-element>hello</custom-element></td></tr>');
+
+    const table = contentDocument.querySelector('table');
+    assert_equals(table.tFoot, tfoot);
+    table.deleteTFoot();
+    assert_equals(table.tFoot, null);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'deleteTFoot() on HTMLTableElement must enqueue disconnectedCallback when removing a custom element');
+
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<table><tr><td><custom-element>hello</custom-element></td></tr></table>`;
+    const tr = contentDocument.querySelector('tr');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(tr.innerHTML, '<td><custom-element>hello</custom-element></td>');
+
+    const table = contentDocument.querySelector('table');
+    assert_equals(table.rows.length, 1);
+    assert_equals(table.rows[0], tr);
+    table.deleteRow(0);
+    assert_equals(table.rows.length, 0);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'deleteRow() on HTMLTableElement must enqueue disconnectedCallback when removing a custom element');
+
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableRowElement-expected.txt (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableRowElement-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableRowElement-expected.txt	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,3 @@
+
+PASS deleteCell() on HTMLTableRowElement must enqueue disconnectedCallback when removing a custom element 
+

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableRowElement.html (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableRowElement.html	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableRowElement.html	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Custom Elements: CEReactions on HTMLTableRowElement interface</title>
+<meta name="author" title="Ryosuke Niwa" href=""
+<meta name="assert" content="deleteCell of HTMLTableRowElement interface must have CEReactions">
+<meta name="help" content="https://dom.spec.whatwg.org/#node">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<table><tr><td><custom-element>hello</custom-element></td></tr></table>`;
+    const td = contentDocument.querySelector('td');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(td.innerHTML, '<custom-element>hello</custom-element>');
+
+    const table = contentDocument.querySelector('table');
+    const row = table.rows[0];
+    assert_equals(row.cells[0], td);
+    row.deleteCell(0);
+    assert_equals(row.cells.length, 0);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'deleteCell() on HTMLTableRowElement must enqueue disconnectedCallback when removing a custom element');
+
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableSectionElement-expected.txt (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableSectionElement-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableSectionElement-expected.txt	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,4 @@
+
+PASS deleteRow() on HTMLTableSectionElement on thead must enqueue disconnectedCallback when removing a custom element 
+PASS deleteRow() on HTMLTableSectionElement on tfoot must enqueue disconnectedCallback when removing a custom element 
+

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableSectionElement.html (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableSectionElement.html	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLTableSectionElement.html	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Custom Elements: CEReactions on HTMLTableSectionElement interface</title>
+<meta name="author" title="Ryosuke Niwa" href=""
+<meta name="assert" content="deleteRow of HTMLTableSectionElement interface must have CEReactions">
+<meta name="help" content="https://dom.spec.whatwg.org/#node">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<table><thead><tr><td><custom-element>hello</custom-element></td></tr></thead></table>`;
+    const thead = contentDocument.querySelector('thead');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(thead.innerHTML, '<tr><td><custom-element>hello</custom-element></td></tr>');
+
+    const table = contentDocument.querySelector('table');
+    assert_equals(table.tHead, thead);
+    table.tHead.deleteRow(0);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'deleteRow() on HTMLTableSectionElement on thead must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<table><tfoot><tr><td><custom-element>hello</custom-element></td></tr></tfoot></table>`;
+    const tfoot = contentDocument.querySelector('tfoot');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(tfoot.innerHTML, '<tr><td><custom-element>hello</custom-element></td></tr>');
+
+    const table = contentDocument.querySelector('table');
+    assert_equals(table.tFoot, tfoot);
+    table.tFoot.deleteRow(0);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'deleteRow() on HTMLTableSectionElement on tfoot must enqueue disconnectedCallback when removing a custom element');
+
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLTitleElement-expected.txt (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLTitleElement-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLTitleElement-expected.txt	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,3 @@
+
+PASS text on HTMLTitleElement must enqueue disconnectedCallback when removing a custom element 
+

Added: trunk/LayoutTests/fast/custom-elements/reactions/HTMLTitleElement.html (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/HTMLTitleElement.html	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/HTMLTitleElement.html	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Custom Elements: CEReactions on HTMLTitleElement interface</title>
+<meta name="author" title="Ryosuke Niwa" href=""
+<meta name="assert" content="text of HTMLTitleElement interface must have CEReactions">
+<meta name="help" content="https://dom.spec.whatwg.org/#node">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+    const instance = contentWindow.document.createElement(element.name);
+    assert_array_equals(element.takeLog().types(), ['constructed']);
+
+    contentWindow.document.title = 'hello';
+    var titleElement = contentWindow.document.querySelector('title');
+    titleElement.appendChild(instance);
+    assert_array_equals(element.takeLog().types(), ['connected']);
+    assert_equals(titleElement.childNodes.length, 2);
+
+    titleElement.text = 'world';
+    assert_equals(titleElement.childNodes.length, 1);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'text on HTMLTitleElement must enqueue disconnectedCallback when removing a custom element');
+
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/custom-elements/reactions/ShadowRoot-expected.txt (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/ShadowRoot-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/ShadowRoot-expected.txt	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,5 @@
+
+PASS innerHTML on ShadowRoot must upgrade a custom element 
+PASS innerHTML on ShadowRoot must enqueue connectedCallback on newly upgraded custom elements when the shadow root is connected 
+PASS innerHTML on ShadowRoot must enqueue disconnectedCallback when removing a custom element 
+

Added: trunk/LayoutTests/fast/custom-elements/reactions/ShadowRoot.html (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions/ShadowRoot.html	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions/ShadowRoot.html	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Custom Elements: CEReactions on ShadowRoot interface</title>
+<meta name="author" title="Ryosuke Niwa" href=""
+<meta name="assert" content="innerHTML of ShadowRoot interface must have CEReactions">
+<meta name="help" content="https://dom.spec.whatwg.org/#node">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    const host = contentDocument.createElement('div');
+    const shadowRoot = host.attachShadow({mode: 'closed'});
+    shadowRoot.innerHTML = '<custom-element></custom-element>';
+
+    assert_array_equals(element.takeLog().types(), ['constructed']);
+}, 'innerHTML on ShadowRoot must upgrade a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    const host = contentDocument.createElement('div');
+    contentDocument.body.appendChild(host);
+    const shadowRoot = host.attachShadow({mode: 'closed'});
+    shadowRoot.innerHTML = '<custom-element></custom-element>';
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+}, 'innerHTML on ShadowRoot must enqueue connectedCallback on newly upgraded custom elements when the shadow root is connected');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    const host = contentDocument.createElement('div');
+    contentDocument.body.appendChild(host);
+
+    const shadowRoot = host.attachShadow({mode: 'closed'});
+    shadowRoot.innerHTML = '<custom-element></custom-element>';
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+
+    shadowRoot.innerHTML = '';
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+
+}, 'innerHTML on ShadowRoot must enqueue disconnectedCallback when removing a custom element');
+
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/custom-elements/reactions-for-indieui-expected.txt (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions-for-indieui-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions-for-indieui-expected.txt	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,4 @@
+
+PASS uiactions on Element must enqueue an attributeChanged reaction when adding uiactions content attribute 
+PASS uiactions on Element must enqueue an attributeChanged reaction when replacing an existing attribute 
+

Copied: trunk/LayoutTests/fast/custom-elements/reactions-for-indieui.html (from rev 208081, trunk/LayoutTests/fast/custom-elements/reactions-for-webkit-extensions.html) (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions-for-indieui.html	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/reactions-for-indieui.html	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Custom Elements: CEReactions on uiactions of Element interface</title>
+<meta name="author" title="Ryosuke Niwa" href=""
+<meta name="assert" content="uiactions of Element interface must have CEReactions">
+<meta name="help" content="https://dom.spec.whatwg.org/#node">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+testReflectAttribute('uiactions', 'uiactions', 'delete', 'dismiss', 'uiactions on Element');
+
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/fast/custom-elements/reactions-for-webkit-extensions-expected.txt (208081 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions-for-webkit-extensions-expected.txt	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/LayoutTests/fast/custom-elements/reactions-for-webkit-extensions-expected.txt	2016-10-28 23:49:46 UTC (rev 208082)
@@ -1,4 +1,12 @@
 
 PASS dropzone on HTMLElement must enqueue an attributeChanged reaction when adding webkitdropzone content attribute 
 PASS dropzone on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute 
+PASS data on CharacterData must enqueue an attributeChanged reaction when replacing an existing attribute 
+PASS data on CharacterData must not enqueue an attributeChanged reaction when replacing an existing unobserved attribute 
+PASS appendData on CharacterData must enqueue an attributeChangedCallback when mutating an existing attribute 
+PASS insertData on CharacterData must enqueue an attributeChangedCallback when mutating an existing attribute 
+PASS deleteData on CharacterData must enqueue an attributeChangedCallback when mutating an existing attribute 
+PASS replaceData on CharacterData must enqueue an attributeChangedCallback when mutating an existing attribute 
+PASS remove(HTMLOptionElement) on HTMLOptionsCollection must enqueue disconnectedCallback when removing a custom element 
+PASS remove(HTMLOptionElement) on HTMLSelectElement must enqueue disconnectedCallback when removing a custom element 
 

Modified: trunk/LayoutTests/fast/custom-elements/reactions-for-webkit-extensions.html (208081 => 208082)


--- trunk/LayoutTests/fast/custom-elements/reactions-for-webkit-extensions.html	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/LayoutTests/fast/custom-elements/reactions-for-webkit-extensions.html	2016-10-28 23:49:46 UTC (rev 208082)
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html>
 <head>
-<title>Custom Elements: CEReactions on HTMLElement interface</title>
+<title>Custom Elements: CEReactions on HTMLElement and Attr interfaces</title>
 <meta name="author" title="Ryosuke Niwa" href=""
-<meta name="assert" content="webkitdropzone of HTMLElement interface must have CEReactions">
+<meta name="assert" content="webkitdropzone of HTMLElement and Attr interface must have CEReactions">
 <meta name="help" content="https://dom.spec.whatwg.org/#node">
 <script src=""
 <script src=""
 <script src=""
 <script src=""
+<script src=""
 </head>
 <body>
 <div id="log"></div>
@@ -16,6 +17,96 @@
 
 testReflectAttribute('webkitdropzone', 'webkitdropzone', 'copy', 'move', 'dropzone on HTMLElement');
 
+testAttributeMutator(function (element, name, value) {
+    element.attributes[name].firstChild.data = ""
+}, 'data on CharacterData');
+
+test(function () {
+    var element = define_new_custom_element(['title']);
+    var instance = document.createElement(element.name);
+    instance.setAttribute('title', 'hello');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'attributeChanged']);
+    instance.attributes.title.firstChild.appendData(' world');
+    var logEntries = element.takeLog();
+    assert_array_equals(logEntries.types(), ['attributeChanged']);
+    assert_attribute_log_entry(logEntries.last(), {name: 'title', oldValue: 'hello', newValue: 'hello world', namespace: null});
+}, 'appendData on CharacterData must enqueue an attributeChangedCallback when mutating an existing attribute');
+
+test(function () {
+    var element = define_new_custom_element(['title']);
+    var instance = document.createElement(element.name);
+    instance.setAttribute('title', 'foo');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'attributeChanged']);
+    instance.attributes.title.firstChild.insertData(2, 'bar');
+    var logEntries = element.takeLog();
+    assert_array_equals(logEntries.types(), ['attributeChanged']);
+    assert_attribute_log_entry(logEntries.last(), {name: 'title', oldValue: 'foo', newValue: 'fobaro', namespace: null});
+}, 'insertData on CharacterData must enqueue an attributeChangedCallback when mutating an existing attribute');
+
+test(function () {
+    var element = define_new_custom_element(['title']);
+    var instance = document.createElement(element.name);
+    instance.setAttribute('title', 'hello world');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'attributeChanged']);
+    instance.attributes.title.firstChild.deleteData(5, 100);
+    var logEntries = element.takeLog();
+    assert_array_equals(logEntries.types(), ['attributeChanged']);
+    assert_attribute_log_entry(logEntries.last(), {name: 'title', oldValue: 'hello world', newValue: 'hello', namespace: null});
+}, 'deleteData on CharacterData must enqueue an attributeChangedCallback when mutating an existing attribute');
+
+test(function () {
+    var element = define_new_custom_element(['title']);
+    var instance = document.createElement(element.name);
+    instance.setAttribute('title', 'hello');
+    assert_array_equals(element.takeLog().types(), ['constructed', 'attributeChanged']);
+    instance.attributes.title.firstChild.replaceData(1, 4, 'i');
+    var logEntries = element.takeLog();
+    assert_array_equals(logEntries.types(), ['attributeChanged']);
+    assert_attribute_log_entry(logEntries.last(), {name: 'title', oldValue: 'hello', newValue: 'hi', namespace: null});
+}, 'replaceData on CharacterData must enqueue an attributeChangedCallback when mutating an existing attribute');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<select><option></option></select>`;
+    const option = contentDocument.querySelector('option');
+
+    const instance = contentDocument.createElement(element.name);
+    option.appendChild(instance);
+    instance.textContent = 'hello';
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(option.innerHTML, '<custom-element>hello</custom-element>');
+
+    const select = contentDocument.querySelector('select');
+    assert_equals(select.options[0], option);
+    select.options.remove(option);
+    assert_equals(select.options.length, 0);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'remove(HTMLOptionElement) on HTMLOptionsCollection must enqueue disconnectedCallback when removing a custom element');
+
+test_with_window(function (contentWindow) {
+    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
+
+    const contentDocument = contentWindow.document;
+    contentDocument.body.innerHTML = `<select><option></option></select>`;
+    const option = contentDocument.querySelector('option');
+
+    const instance = contentDocument.createElement(element.name);
+    option.appendChild(instance);
+    instance.textContent = 'hello';
+
+    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
+    assert_equals(option.innerHTML, '<custom-element>hello</custom-element>');
+
+    const select = contentDocument.querySelector('select');
+    assert_equals(select.options[0], option);
+    select.remove(option);
+    assert_equals(select.options.length, 0);
+    assert_array_equals(element.takeLog().types(), ['disconnected']);
+}, 'remove(HTMLOptionElement) on HTMLSelectElement must enqueue disconnectedCallback when removing a custom element');
+
 </script>
 </body>
 </html>

Added: trunk/LayoutTests/fast/custom-elements/resources/additional-helpers.js (0 => 208082)


--- trunk/LayoutTests/fast/custom-elements/resources/additional-helpers.js	                        (rev 0)
+++ trunk/LayoutTests/fast/custom-elements/resources/additional-helpers.js	2016-10-28 23:49:46 UTC (rev 208082)
@@ -0,0 +1,48 @@
+function create_constructor_log(element) {
+    return {type: 'constructed', element: element};
+}
+
+function assert_constructor_log_entry(log, element) {
+    assert_equals(log.type, 'constructed');
+    assert_equals(log.element, element);
+}
+
+function create_connected_callback_log(element) {
+    return {type: 'connected', element: element};
+}
+
+function assert_connected_log_entry(log, element) {
+    assert_equals(log.type, 'connected');
+    assert_equals(log.element, element);
+}
+
+function define_custom_element_in_window(window, name, observedAttributes) {
+    let log = [];
+
+    class CustomElement extends window.HTMLElement {
+        constructor() {
+            super();
+            log.push({type: 'constructed', element: this});
+        }
+        attributeChangedCallback(...args) {
+            log.push(create_attribute_changed_callback_log(this, ...args));
+        }
+        connectedCallback() { log.push({type: 'connected', element: this}); }
+        disconnectedCallback() { log.push({type: 'disconnected', element: this}); }
+        adoptedCallback(oldDocument, newDocument) { log.push({type: 'adopted', element: this, oldDocument: oldDocument, newDocument: newDocument}); }
+    }
+    CustomElement.observedAttributes = observedAttributes;
+
+    window.customElements.define(name, CustomElement);
+
+    return {
+        name: name,
+        class: CustomElement,
+        takeLog: function () {
+            let currentLog = log; log = [];
+            currentLog.types = () => currentLog.map((entry) => entry.type);
+            currentLog.last = () => currentLog[currentLog.length - 1];
+            return currentLog;
+        }
+    };
+}

Modified: trunk/LayoutTests/fast/custom-elements/upgrading-enqueue-reactions-expected.txt (208081 => 208082)


--- trunk/LayoutTests/fast/custom-elements/upgrading-enqueue-reactions-expected.txt	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/LayoutTests/fast/custom-elements/upgrading-enqueue-reactions-expected.txt	2016-10-28 23:49:46 UTC (rev 208082)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 157: Exception thrown as a part of test
+CONSOLE MESSAGE: line 140: Exception thrown as a part of test
 
 PASS Upgrading a custom element must enqueue attributeChangedCallback on each attribute 
 PASS Upgrading a custom element not must enqueue attributeChangedCallback on unobserved attributes 

Modified: trunk/LayoutTests/fast/custom-elements/upgrading-enqueue-reactions.html (208081 => 208082)


--- trunk/LayoutTests/fast/custom-elements/upgrading-enqueue-reactions.html	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/LayoutTests/fast/custom-elements/upgrading-enqueue-reactions.html	2016-10-28 23:49:46 UTC (rev 208082)
@@ -8,6 +8,7 @@
 <script src=""
 <script src=""
 <script src=""
+<script src=""
 </head>
 <body>
 <div id="log"></div>
@@ -14,24 +15,6 @@
 <script>
 setup({allow_uncaught_exception:true});
 
-function create_constructor_log(element) {
-    return {type: 'constructed', element: element};
-}
-
-function assert_constructor_log_entry(log, element) {
-    assert_equals(log.type, 'constructed');
-    assert_equals(log.element, element);
-}
-
-function create_connected_callback_log(element) {
-    return {type: 'connected', element: element};
-}
-
-function assert_connected_log_entry(log, element) {
-    assert_equals(log.type, 'connected');
-    assert_equals(log.element, element);
-}
-
 test_with_window(function (contentWindow) {
     const contentDocument = contentWindow.document;
     contentDocument.write('<test-element id="some" title="This is a test">');

Modified: trunk/LayoutTests/platform/efl/TestExpectations (208081 => 208082)


--- trunk/LayoutTests/platform/efl/TestExpectations	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/LayoutTests/platform/efl/TestExpectations	2016-10-28 23:49:46 UTC (rev 208082)
@@ -1636,6 +1636,7 @@
 
 # Requires INDIE_UI support
 webkit.org/b/111446 indieui [ Skip ]
+webkit.org/b/111446 fast/custom-elements/reactions-for-indieui.html [ Skip ]
 
 # Requires support for Web notifications
 webkit.org/b/73544 fast/notifications [ Skip ]

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (208081 => 208082)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2016-10-28 23:49:46 UTC (rev 208082)
@@ -176,6 +176,7 @@
 
 # Datalist is not yet enabled.
 webkit.org/b/98934 fast/forms/datalist [ Skip ]
+webkit.org/b/98934 fast/custom-elements/reactions-for-indieui.html [ Skip ]
 
 # ENABLE_INPUT_TYPE_* are not enabled.
 webkit.org/b/98936 fast/forms/date [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (208081 => 208082)


--- trunk/Source/WebCore/ChangeLog	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/ChangeLog	2016-10-28 23:49:46 UTC (rev 208082)
@@ -1,3 +1,45 @@
+2016-10-28  Ryosuke Niwa  <rn...@webkit.org>
+
+        Add CEReactions to the remaining HTML DOM APIs
+        https://bugs.webkit.org/show_bug.cgi?id=163969
+
+        Reviewed by Chris Dumez.
+
+        Added CEReactions to the remaining DOM and HTML APIs as needed.
+
+        Tests: fast/custom-elements/reactions-for-indieui.html
+               fast/custom-elements/reactions/Document.html
+               fast/custom-elements/reactions/HTMLAnchorElement.html
+               fast/custom-elements/reactions/HTMLOptionElement.html
+               fast/custom-elements/reactions/HTMLOptionsCollection.html
+               fast/custom-elements/reactions/HTMLOutputElement.html
+               fast/custom-elements/reactions/HTMLSelectElement.html
+               fast/custom-elements/reactions/HTMLTableElement.html
+               fast/custom-elements/reactions/HTMLTableRowElement.html
+               fast/custom-elements/reactions/HTMLTableSectionElement.html
+               fast/custom-elements/reactions/HTMLTitleElement.html
+               fast/custom-elements/reactions/ShadowRoot.html
+
+        * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
+        (WebCore::JSHTMLOptionsCollection::setLength):
+        (WebCore::JSHTMLOptionsCollection::indexSetter):
+        * bindings/js/JSHTMLSelectElementCustom.cpp:
+        (WebCore::JSHTMLSelectElement::indexSetter):
+        * dom/CharacterData.idl:
+        * dom/Document.idl:
+        * dom/Element.idl:
+        * dom/ShadowRoot.idl:
+        * html/HTMLAnchorElement.idl:
+        * html/HTMLDocument.idl:
+        * html/HTMLOptionElement.idl:
+        * html/HTMLOptionsCollection.idl:
+        * html/HTMLOutputElement.idl:
+        * html/HTMLSelectElement.idl:
+        * html/HTMLTableElement.idl:
+        * html/HTMLTableRowElement.idl:
+        * html/HTMLTableSectionElement.idl:
+        * html/HTMLTitleElement.idl:
+
 2016-10-28  Antoine Quint  <grao...@apple.com>
 
         [Modern Media Controls] Media Controller: volume control support

Modified: trunk/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp (208081 => 208082)


--- trunk/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp	2016-10-28 23:49:46 UTC (rev 208082)
@@ -20,6 +20,7 @@
 #include "config.h"
 #include "JSHTMLOptionsCollection.h"
 
+#include "CustomElementReactionQueue.h"
 #include "ExceptionCode.h"
 #include "HTMLNames.h"
 #include "HTMLOptionElement.h"
@@ -49,6 +50,10 @@
 
 void JSHTMLOptionsCollection::setLength(ExecState& state, JSValue value)
 {
+#if ENABLE(CUSTOM_ELEMENTS)
+    CustomElementReactionStack customElementReactionStack;
+#endif
+
     ExceptionCode ec = 0;
     unsigned newLength = 0;
     double lengthValue = value.toNumber(&state);
@@ -67,6 +72,10 @@
 
 void JSHTMLOptionsCollection::indexSetter(ExecState* exec, unsigned index, JSValue value)
 {
+#if ENABLE(CUSTOM_ELEMENTS)
+    CustomElementReactionStack customElementReactionStack;
+#endif
+
     selectIndexSetter(&wrapped().selectElement(), exec, index, value);
 }
 

Modified: trunk/Source/WebCore/bindings/js/JSHTMLSelectElementCustom.cpp (208081 => 208082)


--- trunk/Source/WebCore/bindings/js/JSHTMLSelectElementCustom.cpp	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/bindings/js/JSHTMLSelectElementCustom.cpp	2016-10-28 23:49:46 UTC (rev 208082)
@@ -21,6 +21,7 @@
 #include "config.h"
 #include "JSHTMLSelectElementCustom.h"
 
+#include "CustomElementReactionQueue.h"
 #include "ExceptionCode.h"
 #include "HTMLNames.h"
 #include "HTMLOptionElement.h"
@@ -49,6 +50,9 @@
 
 void JSHTMLSelectElement::indexSetter(JSC::ExecState* exec, unsigned index, JSC::JSValue value)
 {
+#if ENABLE(CUSTOM_ELEMENTS)
+    CustomElementReactionStack customElementReactionStack;
+#endif
     selectIndexSetter(&wrapped(), exec, index, value);
 }
 

Modified: trunk/Source/WebCore/dom/CharacterData.idl (208081 => 208082)


--- trunk/Source/WebCore/dom/CharacterData.idl	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/dom/CharacterData.idl	2016-10-28 23:49:46 UTC (rev 208082)
@@ -18,15 +18,15 @@
  */
 
 interface CharacterData : Node {
-    [TreatNullAs=EmptyString] attribute DOMString data;
+    [CEReactions, TreatNullAs=EmptyString] attribute DOMString data;
     readonly attribute unsigned long length;
 
     [MayThrowLegacyException] DOMString? substringData(unsigned long offset, unsigned long length);
 
-    void appendData(DOMString data);
-    [MayThrowLegacyException] void insertData(unsigned long offset, DOMString data);
-    [MayThrowLegacyException] void deleteData(unsigned long offset, unsigned long length);
-    [MayThrowLegacyException] void replaceData(unsigned long offset, unsigned long length, DOMString data);
+    [CEReactions] void appendData(DOMString data);
+    [CEReactions, MayThrowLegacyException] void insertData(unsigned long offset, DOMString data);
+    [CEReactions, MayThrowLegacyException] void deleteData(unsigned long offset, unsigned long length);
+    [CEReactions, MayThrowLegacyException] void replaceData(unsigned long offset, unsigned long length, DOMString data);
 };
 
 CharacterData implements ChildNode;

Modified: trunk/Source/WebCore/dom/Document.idl (208081 => 208082)


--- trunk/Source/WebCore/dom/Document.idl	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/dom/Document.idl	2016-10-28 23:49:46 UTC (rev 208082)
@@ -91,7 +91,7 @@
     boolean queryCommandSupported(DOMString command);
     DOMString queryCommandValue(DOMString command);
 
-    attribute DOMString title;
+    [CEReactions] attribute DOMString title;
     attribute DOMString dir;
     attribute DOMString designMode;
 
@@ -101,7 +101,7 @@
 
     [GetterMayThrowLegacyException, SetterMayThrowLegacyException] attribute USVString cookie;
 
-    [SetterMayThrowLegacyException, ImplementedAs=bodyOrFrameset] attribute HTMLElement? body;
+    [CEReactions, ImplementedAs=bodyOrFrameset, SetterMayThrowLegacyException] attribute HTMLElement? body;
 
     readonly attribute HTMLHeadElement? head;
     readonly attribute HTMLCollection images;

Modified: trunk/Source/WebCore/dom/Element.idl (208081 => 208082)


--- trunk/Source/WebCore/dom/Element.idl	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/dom/Element.idl	2016-10-28 23:49:46 UTC (rev 208082)
@@ -121,7 +121,7 @@
 #endif
 
 #if defined(ENABLE_INDIE_UI) && ENABLE_INDIE_UI
-    [Reflect] attribute DOMString uiactions;
+    [CEReactions, Reflect] attribute DOMString uiactions;
 #endif
 
     [CEReactions, MayThrowLegacyException] Element insertAdjacentElement(DOMString where, Element element);

Modified: trunk/Source/WebCore/dom/ShadowRoot.idl (208081 => 208082)


--- trunk/Source/WebCore/dom/ShadowRoot.idl	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/dom/ShadowRoot.idl	2016-10-28 23:49:46 UTC (rev 208082)
@@ -30,7 +30,7 @@
     readonly attribute ShadowRootMode   mode;
     readonly attribute Element          host;
 
-    [TreatNullAs=EmptyString, SetterMayThrowLegacyException] attribute DOMString innerHTML;
+    [CEReactions, SetterMayThrowLegacyException, TreatNullAs=EmptyString] attribute DOMString innerHTML;
 };
 
 ShadowRoot implements DocumentOrShadowRoot;

Modified: trunk/Source/WebCore/html/HTMLAnchorElement.idl (208081 => 208082)


--- trunk/Source/WebCore/html/HTMLAnchorElement.idl	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.idl	2016-10-28 23:49:46 UTC (rev 208082)
@@ -31,7 +31,7 @@
     [Reflect] attribute DOMString target;
     [Reflect] attribute DOMString type;
 
-    attribute DOMString text;
+    [CEReactions] attribute DOMString text;
 
     [PutForwards=value] readonly attribute DOMTokenList relList;
 };

Modified: trunk/Source/WebCore/html/HTMLDocument.idl (208081 => 208082)


--- trunk/Source/WebCore/html/HTMLDocument.idl	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/html/HTMLDocument.idl	2016-10-28 23:49:46 UTC (rev 208082)
@@ -25,10 +25,10 @@
     NewImpurePropertyFiresWatchpoints,
     OverrideBuiltins,
 ] interface HTMLDocument : Document {
-    [Custom, ForwardDeclareInHeader] void open();
+    [CEReactions, Custom, ForwardDeclareInHeader] void open();
     void close();
-    [Custom] void write(optional DOMString text);
-    [Custom] void writeln(optional DOMString text);
+    [CEReactions, Custom] void write(optional DOMString text);
+    [CEReactions, Custom] void writeln(optional DOMString text);
 
     [Custom, Replaceable] readonly attribute HTMLAllCollection all;
 

Modified: trunk/Source/WebCore/html/HTMLOptionElement.idl (208081 => 208082)


--- trunk/Source/WebCore/html/HTMLOptionElement.idl	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/html/HTMLOptionElement.idl	2016-10-28 23:49:46 UTC (rev 208082)
@@ -30,6 +30,6 @@
     attribute boolean selected;
     attribute DOMString value;
 
-    attribute DOMString text;
+    [CEReactions] attribute DOMString text;
     readonly attribute long index;
 };

Modified: trunk/Source/WebCore/html/HTMLOptionsCollection.idl (208081 => 208082)


--- trunk/Source/WebCore/html/HTMLOptionsCollection.idl	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/html/HTMLOptionsCollection.idl	2016-10-28 23:49:46 UTC (rev 208082)
@@ -25,14 +25,14 @@
     JSGenerateToNativeObject,
 ] interface HTMLOptionsCollection : HTMLCollection {
     attribute long selectedIndex;
-    [CustomSetter, SetterMayThrowLegacyException] attribute unsigned long length;
+    [CEReactions, CustomSetter, SetterMayThrowLegacyException] attribute unsigned long length;
 
     getter HTMLOptionElement? item(unsigned long index);
     getter HTMLOptionElement? namedItem(DOMString name);
 
-    [MayThrowException] void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
+    [CEReactions, MayThrowException] void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
 
-    void remove(long index);
+    [CEReactions] void remove(long index);
     // FIXME: This overload is not in the specification and has been dropped in Blink.
-    void remove(HTMLOptionElement option);
+    [CEReactions] void remove(HTMLOptionElement option);
 };

Modified: trunk/Source/WebCore/html/HTMLOutputElement.idl (208081 => 208082)


--- trunk/Source/WebCore/html/HTMLOutputElement.idl	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/html/HTMLOutputElement.idl	2016-10-28 23:49:46 UTC (rev 208082)
@@ -29,8 +29,8 @@
     [Reflect] attribute DOMString name;
 
     readonly attribute DOMString type;
-    [TreatNullAs=EmptyString] attribute DOMString defaultValue;
-    [TreatNullAs=EmptyString] attribute DOMString value;
+    [CEReactions, TreatNullAs=EmptyString] attribute DOMString defaultValue;
+    [CEReactions, TreatNullAs=EmptyString] attribute DOMString value;
 
     readonly attribute boolean willValidate;
     readonly attribute ValidityState validity;

Modified: trunk/Source/WebCore/html/HTMLSelectElement.idl (208081 => 208082)


--- trunk/Source/WebCore/html/HTMLSelectElement.idl	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/html/HTMLSelectElement.idl	2016-10-28 23:49:46 UTC (rev 208082)
@@ -35,17 +35,17 @@
     readonly attribute DOMString type;
 
     readonly attribute HTMLOptionsCollection options;
-    [SetterMayThrowLegacyException] attribute unsigned long length;
+    [CEReactions, SetterMayThrowLegacyException] attribute unsigned long length;
 
     getter HTMLOptionElement? item(unsigned long index);
     HTMLOptionElement? namedItem(DOMString name);
 
-    [MayThrowException] void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
+    [CEReactions, MayThrowException] void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
 
     [MayThrowLegacyException] void remove(); // ChildNode overload
     // FIXME: This overload is not in the specification and was dropped in Blink.
-    void remove(HTMLOptionElement option);
-    [ImplementedAs=removeByIndex] void remove(long index);
+    [CEReactions] void remove(HTMLOptionElement option);
+    [CEReactions, ImplementedAs=removeByIndex] void remove(long index);
 
     readonly attribute HTMLCollection selectedOptions;
     attribute long selectedIndex;

Modified: trunk/Source/WebCore/html/HTMLTableElement.idl (208081 => 208082)


--- trunk/Source/WebCore/html/HTMLTableElement.idl	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/html/HTMLTableElement.idl	2016-10-28 23:49:46 UTC (rev 208082)
@@ -19,9 +19,9 @@
  */
 
 interface HTMLTableElement : HTMLElement {
-    [SetterMayThrowLegacyException] attribute HTMLTableCaptionElement? caption;
-    [SetterMayThrowLegacyException] attribute HTMLTableSectionElement? tHead;
-    [SetterMayThrowLegacyException] attribute HTMLTableSectionElement? tFoot;
+    [CEReactions, SetterMayThrowLegacyException] attribute HTMLTableCaptionElement? caption;
+    [CEReactions, SetterMayThrowLegacyException] attribute HTMLTableSectionElement? tHead;
+    [CEReactions, SetterMayThrowLegacyException] attribute HTMLTableSectionElement? tFoot;
 
     readonly attribute HTMLCollection rows;
     readonly attribute HTMLCollection tBodies;
@@ -38,14 +38,14 @@
     [Reflect] attribute DOMString width;
 
     HTMLElement createTHead();
-    void deleteTHead();
+    [CEReactions] void deleteTHead();
     HTMLElement createTFoot();
-    void deleteTFoot();
+    [CEReactions] void deleteTFoot();
     HTMLElement createTBody();
     HTMLElement createCaption();
-    void deleteCaption();
+    [CEReactions] void deleteCaption();
 
     [MayThrowLegacyException] HTMLElement insertRow(optional long index = -1);
-    [MayThrowLegacyException] void deleteRow(long index);
+    [CEReactions, MayThrowLegacyException] void deleteRow(long index);
 };
 

Modified: trunk/Source/WebCore/html/HTMLTableRowElement.idl (208081 => 208082)


--- trunk/Source/WebCore/html/HTMLTableRowElement.idl	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/html/HTMLTableRowElement.idl	2016-10-28 23:49:46 UTC (rev 208082)
@@ -28,6 +28,6 @@
     [Reflect=charoff] attribute DOMString chOff;
     [Reflect] attribute DOMString vAlign;
     [MayThrowLegacyException] HTMLElement insertCell(optional long index = -1);
-    [MayThrowLegacyException] void deleteCell(long index);
+    [CEReactions, MayThrowLegacyException] void deleteCell(long index);
 };
 

Modified: trunk/Source/WebCore/html/HTMLTableSectionElement.idl (208081 => 208082)


--- trunk/Source/WebCore/html/HTMLTableSectionElement.idl	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/html/HTMLTableSectionElement.idl	2016-10-28 23:49:46 UTC (rev 208082)
@@ -27,6 +27,6 @@
     [Reflect] attribute DOMString vAlign;
     readonly attribute HTMLCollection rows;
     [MayThrowLegacyException] HTMLElement insertRow(optional long index = -1);
-    [MayThrowLegacyException] void deleteRow(long index);
+    [CEReactions, MayThrowLegacyException] void deleteRow(long index);
 };
 

Modified: trunk/Source/WebCore/html/HTMLTitleElement.idl (208081 => 208082)


--- trunk/Source/WebCore/html/HTMLTitleElement.idl	2016-10-28 23:39:36 UTC (rev 208081)
+++ trunk/Source/WebCore/html/HTMLTitleElement.idl	2016-10-28 23:49:46 UTC (rev 208082)
@@ -18,6 +18,6 @@
  */
 
 interface HTMLTitleElement : HTMLElement {
-    attribute DOMString text;
+    [CEReactions] attribute DOMString text;
 };
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to