Diff
Modified: trunk/LayoutTests/ChangeLog (294226 => 294227)
--- trunk/LayoutTests/ChangeLog 2022-05-16 10:27:00 UTC (rev 294226)
+++ trunk/LayoutTests/ChangeLog 2022-05-16 11:43:54 UTC (rev 294227)
@@ -1,3 +1,21 @@
+2022-05-16 Rob Buis <rb...@igalia.com>
+
+ Remove some custom-element tests
+ https://bugs.webkit.org/show_bug.cgi?id=240449
+
+ Reviewed by Tim Nguyen.
+
+ Remove some custom-element tests since they are now available in WPT.
+
+ * fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback-expected.txt: Removed.
+ * fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html: Removed.
+ * fast/custom-elements/perform-microtask-checkpoint-before-construction-expected.txt: Removed.
+ * fast/custom-elements/perform-microtask-checkpoint-before-construction.html: Removed.
+ * fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct-expected.txt: Removed.
+ * fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html: Removed.
+ * fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions-expected.txt: Removed.
+ * fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html: Removed.
+
2022-05-16 Tim Nguyen <n...@apple.com>
[css-ui] Make inner-spin-button/sliderthumb-horizontal/sliderthumb-vertical appearance values internal
Deleted: trunk/LayoutTests/fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback-expected.txt (294226 => 294227)
--- trunk/LayoutTests/fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback-expected.txt 2022-05-16 10:27:00 UTC (rev 294226)
+++ trunk/LayoutTests/fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback-expected.txt 2022-05-16 11:43:54 UTC (rev 294227)
@@ -1,10 +0,0 @@
-
-PASS Disconnecting an element with disconnectedCallback while it has a connectedCallback in its custom element reaction queue must result in connectedCallback getting invoked before the removal completes
-PASS Disconnecting an element without disconnectedCallback while it has a connectedCallback in its custom element reaction queue must not result in connectedCallback getting invoked before the removal completes
-PASS Connecting a element with connectedCallback while it has a disconnectedCallback in its custom element reaction queue must result in disconnectedCallback getting invoked before the insertion completes
-PASS Connecting an element without connectedCallback while it has a disconnectedCallback in its custom element reaction queue must not result in disconnectedCallback getting invoked before the insertion completes
-PASS Adopting an element with adoptingCallback while it has a connectedCallback in its custom element reaction queue must result in connectedCallback getting invoked before the adoption completes
-PASS Adopting an element without adoptingCallback while it has a connectedCallback in its custom element reaction queue must not result in connectedCallback getting invoked before the adoption completes
-PASS Setting an observed attribute on an element with attributeChangedCallback while it has a connectedCallback in its custom element reaction queue must result in connectedCallback getting invoked before the attribute change completes
-PASS Setting an observed attribute on an element with attributeChangedCallback while it has a connectedCallback in its custom element reaction queue must not result in connectedCallback getting invoked before the attribute change completes
-
Deleted: trunk/LayoutTests/fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html (294226 => 294227)
--- trunk/LayoutTests/fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html 2022-05-16 10:27:00 UTC (rev 294226)
+++ trunk/LayoutTests/fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html 2022-05-16 11:43:54 UTC (rev 294227)
@@ -1,223 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Custom Elements: must enqueue an element on the appropriate element queue after checking callback is null and the attribute name</title>
-<meta name="author" title="Ryosuke Niwa" href=""
-<meta name="assert" content="To enqueue a custom element callback reaction, the callback must be checked of being null and whether the attribute name is observed or not">
-<link rel="help" content="https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction">
-<link rel="help" content="https://github.com/w3c/webcomponents/issues/760">
-<script src=""
-<script src=""
-<script src=""
-</head>
-<body>
-<script>
-
-test_with_window((contentWindow, contentDocument) => {
- class ParentElement extends contentWindow.HTMLElement {
- connectedCallback()
- {
- logs.push('begin');
- const child = this.firstChild;
- child.remove();
- logs.push('end');
- }
- }
- contentWindow.customElements.define('parent-element', ParentElement);
-
- const logs = [];
- class ChildElement extends contentWindow.HTMLElement {
- connectedCallback() { logs.push('connected'); }
- disconnectedCallback() { logs.push('disconnected'); }
- }
- contentWindow.customElements.define('child-element', ChildElement);
-
- const parent = new ParentElement;
- const child = new ChildElement;
- parent.appendChild(child);
-
- contentDocument.body.appendChild(parent);
- assert_array_equals(logs, ['begin', 'connected', 'disconnected', 'end']);
-}, 'Disconnecting an element with disconnectedCallback while it has a connectedCallback in its custom element reaction queue must result in connectedCallback getting invoked before the removal completes');
-
-test_with_window((contentWindow, contentDocument) => {
- class ParentElement extends contentWindow.HTMLElement {
- connectedCallback()
- {
- logs.push('begin');
- const child = this.firstChild;
- child.remove();
- logs.push('end');
- }
- }
- contentWindow.customElements.define('parent-element', ParentElement);
-
- const logs = [];
- class ChildElement extends contentWindow.HTMLElement {
- connectedCallback() { logs.push('connected'); }
- }
- contentWindow.customElements.define('child-element', ChildElement);
-
- const parent = new ParentElement;
- const child = new ChildElement;
- parent.appendChild(child);
-
- contentDocument.body.appendChild(parent);
- assert_array_equals(logs, ['begin', 'end', 'connected']);
-}, 'Disconnecting an element without disconnectedCallback while it has a connectedCallback in its custom element reaction queue must not result in connectedCallback getting invoked before the removal completes');
-
-test_with_window((contentWindow, contentDocument) => {
- class ParentElement extends contentWindow.HTMLElement {
- disconnectedCallback()
- {
- logs.push('begin');
- contentDocument.body.appendChild(this.firstChild);
- logs.push('end');
- }
- }
- contentWindow.customElements.define('parent-element', ParentElement);
-
- const logs = [];
- class ChildElement extends contentWindow.HTMLElement {
- connectedCallback() { logs.push('connected'); }
- disconnectedCallback() { logs.push('disconnected'); }
- }
- contentWindow.customElements.define('child-element', ChildElement);
-
- const parent = new ParentElement;
- const child = new ChildElement;
- parent.appendChild(child);
- contentDocument.body.appendChild(parent);
- parent.remove();
- assert_array_equals(logs, ['connected', 'begin', 'disconnected', 'connected', 'end']);
-}, 'Connecting a element with connectedCallback while it has a disconnectedCallback in its custom element reaction queue must result in disconnectedCallback getting invoked before the insertion completes');
-
-test_with_window((contentWindow, contentDocument) => {
- class ParentElement extends contentWindow.HTMLElement {
- disconnectedCallback()
- {
- logs.push('begin');
- contentDocument.body.appendChild(this.firstChild);
- logs.push('end');
- }
- }
- contentWindow.customElements.define('parent-element', ParentElement);
-
- const logs = [];
- class ChildElement extends contentWindow.HTMLElement {
- disconnectedCallback() { logs.push('disconnected'); }
- }
- contentWindow.customElements.define('child-element', ChildElement);
-
- const parent = new ParentElement;
- const child = new ChildElement;
- parent.appendChild(child);
- contentDocument.body.appendChild(parent);
- parent.remove();
- assert_array_equals(logs, ['begin', 'end', 'disconnected']);
-}, 'Connecting an element without connectedCallback while it has a disconnectedCallback in its custom element reaction queue must not result in disconnectedCallback getting invoked before the insertion completes');
-
-test_with_window((contentWindow, contentDocument) => {
- class ParentElement extends contentWindow.HTMLElement {
- connectedCallback()
- {
- logs.push('begin');
- document.adoptNode(this.firstChild);
- logs.push('end');
- }
- }
- contentWindow.customElements.define('parent-element', ParentElement);
-
- const logs = [];
- class ChildElement extends contentWindow.HTMLElement {
- adoptedCallback() { logs.push('adopted'); }
- connectedCallback() { logs.push('connected'); }
- }
- contentWindow.customElements.define('child-element', ChildElement);
-
- const parent = new ParentElement;
- const child = new ChildElement;
- parent.appendChild(child);
- contentDocument.body.appendChild(parent);
- assert_array_equals(logs, ['begin', 'connected', 'adopted', 'end']);
-}, 'Adopting an element with adoptingCallback while it has a connectedCallback in its custom element reaction queue must result in connectedCallback getting invoked before the adoption completes');
-
-test_with_window((contentWindow, contentDocument) => {
- class ParentElement extends contentWindow.HTMLElement {
- connectedCallback()
- {
- logs.push('begin');
- document.adoptNode(this.firstChild);
- logs.push('end');
- }
- }
- contentWindow.customElements.define('parent-element', ParentElement);
-
- const logs = [];
- class ChildElement extends contentWindow.HTMLElement {
- connectedCallback() { logs.push('connected'); }
- }
- contentWindow.customElements.define('child-element', ChildElement);
-
- const parent = new ParentElement;
- const child = new ChildElement;
- parent.appendChild(child);
- contentDocument.body.appendChild(parent);
- assert_array_equals(logs, ['begin', 'end', 'connected']);
-}, 'Adopting an element without adoptingCallback while it has a connectedCallback in its custom element reaction queue must not result in connectedCallback getting invoked before the adoption completes');
-
-test_with_window((contentWindow, contentDocument) => {
- class ParentElement extends contentWindow.HTMLElement {
- connectedCallback()
- {
- logs.push('begin');
- this.firstChild.setAttribute('title', 'foo');
- logs.push('end');
- }
- }
- contentWindow.customElements.define('parent-element', ParentElement);
-
- const logs = [];
- class ChildElement extends contentWindow.HTMLElement {
- attributeChangedCallback() { logs.push('attributeChanged'); }
- connectedCallback() { logs.push('connected'); }
- static get observedAttributes() { return ['title']; }
- }
- contentWindow.customElements.define('child-element', ChildElement);
-
- const parent = new ParentElement;
- const child = new ChildElement;
- parent.appendChild(child);
- contentDocument.body.appendChild(parent);
- assert_array_equals(logs, ['begin', 'connected', 'attributeChanged', 'end']);
-}, 'Setting an observed attribute on an element with attributeChangedCallback while it has a connectedCallback in its custom element reaction queue must result in connectedCallback getting invoked before the attribute change completes');
-
-test_with_window((contentWindow, contentDocument) => {
- class ParentElement extends contentWindow.HTMLElement {
- connectedCallback()
- {
- logs.push('begin');
- this.firstChild.setAttribute('lang', 'en');
- logs.push('end');
- }
- }
- contentWindow.customElements.define('parent-element', ParentElement);
-
- const logs = [];
- class ChildElement extends contentWindow.HTMLElement {
- attributeChangedCallback() { logs.push('attributeChanged'); }
- connectedCallback() { logs.push('connected'); }
- static get observedAttributes() { return ['title']; }
- }
- contentWindow.customElements.define('child-element', ChildElement);
-
- const parent = new ParentElement;
- const child = new ChildElement;
- parent.appendChild(child);
- contentDocument.body.appendChild(parent);
- assert_array_equals(logs, ['begin', 'end', 'connected']);
-}, 'Setting an observed attribute on an element with attributeChangedCallback while it has a connectedCallback in its custom element reaction queue must not result in connectedCallback getting invoked before the attribute change completes');
-
-</script>
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/custom-elements/perform-microtask-checkpoint-before-construction-expected.txt (294226 => 294227)
--- trunk/LayoutTests/fast/custom-elements/perform-microtask-checkpoint-before-construction-expected.txt 2022-05-16 10:27:00 UTC (rev 294226)
+++ trunk/LayoutTests/fast/custom-elements/perform-microtask-checkpoint-before-construction-expected.txt 2022-05-16 11:43:54 UTC (rev 294227)
@@ -1,4 +0,0 @@
-
-PASS HTML parser must perform a microtask checkpoint before constructing a custom element
-PASS HTML parser must perform a microtask checkpoint before constructing a custom element during the adoption agency algorithm
-
Deleted: trunk/LayoutTests/fast/custom-elements/perform-microtask-checkpoint-before-construction.html (294226 => 294227)
--- trunk/LayoutTests/fast/custom-elements/perform-microtask-checkpoint-before-construction.html 2022-05-16 10:27:00 UTC (rev 294226)
+++ trunk/LayoutTests/fast/custom-elements/perform-microtask-checkpoint-before-construction.html 2022-05-16 11:43:54 UTC (rev 294227)
@@ -1,143 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Custom Elements: create an element for a token must perform a microtask checkpoint</title>
-<meta name="author" title="Ryosuke Niwa" href=""
-<meta name="assert" content="When the HTML parser creates an element for a token, it must perform a microtask checkpoint before invoking the constructor">
-<meta name="help" content="https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token">
-<meta name="help" content="https://html.spec.whatwg.org/multipage/webappapis.html#perform-a-microtask-checkpoint">
-<meta name="help" content="https://html.spec.whatwg.org/multipage/parsing.html#adoption-agency-algorithm">
-<script src=""
-<script src=""
-<script src=""
-</head>
-<body>
-<div id="log"></div>
-<script>
-
-async function construct_custom_element_in_parser(test, markup)
-{
- const window = await create_window_in_test(test, `
-<!DOCTYPE html>
-<html>
-<body><script>
-class SomeElement extends HTMLElement {
- constructor() {
- super();
- window.recordsListInConstructor = recordsList.map((records) => records.slice(0));
- }
-}
-customElements.define('some-element', SomeElement);
-
-const recordsList = [];
-const observer = new MutationObserver((records) => {
- recordsList.push(records);
-});
-observer.observe(document.body, {childList: true, subtree: true});
-
-window._onload_ = () => {
- window.recordsListInDOMContentLoaded = recordsList.map((records) => records.slice(0));
-}
-
-</scr` + `ipt>${markup}</body></html>`);
- return window;
-}
-
-promise_test(async function () {
- const contentWindow = await construct_custom_element_in_parser(this, '<b><some-element></b>');
- const contentDocument = contentWindow.document;
-
- let recordsList = contentWindow.recordsListInConstructor;
- assert_true(Array.isArray(recordsList));
- assert_equals(recordsList.length, 1);
- assert_true(Array.isArray(recordsList[0]));
- assert_equals(recordsList[0].length, 1);
- let record = recordsList[0][0];
- assert_equals(record.type, 'childList');
- assert_equals(record.target, contentDocument.body);
- assert_equals(record.previousSibling, contentDocument.querySelector('script'));
- assert_equals(record.nextSibling, null);
- assert_equals(record.removedNodes.length, 0);
- assert_equals(record.addedNodes.length, 1);
- assert_equals(record.addedNodes[0], contentDocument.querySelector('b'));
-
- recordsList = contentWindow.recordsListInDOMContentLoaded;
- assert_true(Array.isArray(recordsList));
- assert_equals(recordsList.length, 2);
- assert_true(Array.isArray(recordsList[1]));
- assert_equals(recordsList[1].length, 1);
- record = recordsList[1][0];
- assert_equals(record.type, 'childList');
- assert_equals(record.target, contentDocument.querySelector('b'));
- assert_equals(record.previousSibling, null);
- assert_equals(record.nextSibling, null);
- assert_equals(record.removedNodes.length, 0);
- assert_equals(record.addedNodes.length, 1);
- assert_equals(record.addedNodes[0], contentDocument.querySelector('some-element'));
-}, 'HTML parser must perform a microtask checkpoint before constructing a custom element');
-
-promise_test(async function () {
- const contentWindow = await construct_custom_element_in_parser(this, '<b><i>hello</b><some-element>');
- const contentDocument = contentWindow.document;
- let recordsList = contentWindow.recordsListInConstructor;
- assert_true(Array.isArray(recordsList));
- assert_equals(recordsList.length, 1);
- assert_true(Array.isArray(recordsList[0]));
- assert_equals(recordsList[0].length, 4);
-
- let record = recordsList[0][0];
- assert_equals(record.type, 'childList');
- assert_equals(record.target, contentDocument.body);
- assert_equals(record.previousSibling, contentDocument.querySelector('script'));
- assert_equals(record.nextSibling, null);
- assert_equals(record.removedNodes.length, 0);
- assert_equals(record.addedNodes.length, 1);
- assert_equals(record.addedNodes[0], contentDocument.querySelector('b'));
-
- record = recordsList[0][1];
- assert_equals(record.type, 'childList');
- assert_equals(record.target, contentDocument.querySelector('b'));
- assert_equals(record.previousSibling, null);
- assert_equals(record.nextSibling, null);
- assert_equals(record.removedNodes.length, 0);
- assert_equals(record.addedNodes.length, 1);
- assert_equals(record.addedNodes[0], contentDocument.querySelector('i'));
-
- record = recordsList[0][2];
- assert_equals(record.type, 'childList');
- assert_equals(record.target, contentDocument.querySelector('i'));
- assert_equals(record.previousSibling, null);
- assert_equals(record.nextSibling, null);
- assert_equals(record.removedNodes.length, 0);
- assert_equals(record.addedNodes.length, 1);
- assert_equals(record.addedNodes[0].nodeType, Node.TEXT_NODE);
- assert_equals(record.addedNodes[0].data, "hello");
-
- record = recordsList[0][3];
- assert_equals(record.type, 'childList');
- assert_equals(record.target, contentDocument.body);
- assert_equals(record.previousSibling, contentDocument.querySelector('b'));
- assert_equals(record.nextSibling, null);
- assert_equals(record.removedNodes.length, 0);
- assert_equals(record.addedNodes.length, 1);
- assert_equals(record.addedNodes[0], contentDocument.querySelectorAll('i')[1]);
-
- recordsList = contentWindow.recordsListInDOMContentLoaded;
- assert_true(Array.isArray(recordsList));
- assert_equals(recordsList.length, 2);
- assert_true(Array.isArray(recordsList[1]));
- assert_equals(recordsList[1].length, 1);
-
- record = recordsList[1][0];
- assert_equals(record.type, 'childList');
- assert_equals(record.target, contentDocument.querySelectorAll('i')[1]);
- assert_equals(record.previousSibling, null);
- assert_equals(record.nextSibling, null);
- assert_equals(record.removedNodes.length, 0);
- assert_equals(record.addedNodes.length, 1);
- assert_equals(record.addedNodes[0], contentDocument.querySelector('some-element'));
-}, 'HTML parser must perform a microtask checkpoint before constructing a custom element during the adoption agency algorithm');
-
-</script>
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct-expected.txt (294226 => 294227)
--- trunk/LayoutTests/fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct-expected.txt 2022-05-16 10:27:00 UTC (rev 294226)
+++ trunk/LayoutTests/fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct-expected.txt 2022-05-16 11:43:54 UTC (rev 294227)
@@ -1,13 +0,0 @@
-
-PASS document.open() must throw an InvalidStateError when synchronously constructing a custom element
-PASS document.open("text/html") must throw an InvalidStateError when synchronously constructing a custom element
-PASS document.open(URL) must NOT throw an InvalidStateError when synchronously constructing a custom element
-PASS document.close() must throw an InvalidStateError when synchronously constructing a custom element
-PASS document.write must throw an InvalidStateError when synchronously constructing a custom element
-PASS document.writeln must throw an InvalidStateError when synchronously constructing a custom element
-PASS document.open() of another document must not throw an InvalidStateError when synchronously constructing a custom element
-PASS document.open("text/html") of another document must not throw an InvalidStateError when synchronously constructing a custom element
-PASS document.close() of another document must not throw an InvalidStateError when synchronously constructing a custom element
-PASS document.write of another document must not throw an InvalidStateError when synchronously constructing a custom element
-PASS document.writeln of another document must not throw an InvalidStateError when synchronously constructing a custom element
-
Deleted: trunk/LayoutTests/fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html (294226 => 294227)
--- trunk/LayoutTests/fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html 2022-05-16 10:27:00 UTC (rev 294226)
+++ trunk/LayoutTests/fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html 2022-05-16 11:43:54 UTC (rev 294227)
@@ -1,117 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Custom Elements: create an element for a token must increment and decrement document's throw-on-dynamic-markup-insertion counter</title>
-<meta name="author" title="Ryosuke Niwa" href=""
-<meta name="assert" content="Invoking document.open, document.write, document.writeln, and document.write must throw an exception when the HTML parser is creating a custom element for a token">
-<meta name="help" content="https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token">
-<meta name="help" content="https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#throw-on-dynamic-markup-insertion-counter">
-<script src=""
-<script src=""
-<script src=""
-</head>
-<body>
-<div id="log"></div>
-<script>
-
-async function construct_custom_element_in_parser(test, call_function)
-{
- const window = await create_window_in_test(test);
- const document = window.document;
-
- document.open();
-
- let executed = false;
- let exception = null;
- class CustomElement extends window.HTMLElement {
- constructor() {
- super();
- try {
- call_function(document, window);
- } catch (error) {
- exception = error;
- }
- executed = true;
- }
- }
- window.customElements.define('some-element', CustomElement);
-
- document.write('<!DOCTYPE html><html><body><some-element></some-element></body></html>');
- document.close();
-
- assert_true(executed, 'Must synchronously instantiate a custom element');
- return {window, document, exception};
-}
-
-promise_test(async function () {
- const result = await construct_custom_element_in_parser(this, (document) => document.open());
- assert_throws_dom('InvalidStateError', result.window.DOMException, () => { throw result.exception; }, 'Must throw an InvalidStateError');
-}, 'document.open() must throw an InvalidStateError when synchronously constructing a custom element');
-
-promise_test(async function () {
- const result = await construct_custom_element_in_parser(this, (document) => document.open('text/html'));
- assert_throws_dom('InvalidStateError', result.window.DOMException, () => { throw result.exception; }, 'Must throw an InvalidStateError');
-}, 'document.open("text/html") must throw an InvalidStateError when synchronously constructing a custom element');
-
-// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-open-window
-promise_test(async function () {
- let load_promise = new Promise((resolve) => window._onmessage_ = (event) => resolve(event.data));
- const result = await construct_custom_element_in_parser(this, (document, window) => document.open('resources/navigation-destination.html', '_self', ''));
- assert_equals(result.exception, null);
- assert_equals(await load_promise, 'didNavigate');
-}, 'document.open(URL) must NOT throw an InvalidStateError when synchronously constructing a custom element');
-
-promise_test(async function () {
- const result = await construct_custom_element_in_parser(this, (document) => document.close());
- assert_throws_dom('InvalidStateError', result.window.DOMException, () => { throw result.exception; }, 'Must throw an InvalidStateError');
-}, 'document.close() must throw an InvalidStateError when synchronously constructing a custom element');
-
-promise_test(async function () {
- const result = await construct_custom_element_in_parser(this, (document) => document.write('<b>some text</b>'));
- assert_throws_dom('InvalidStateError', result.window.DOMException, () => { throw result.exception; }, 'Must throw an InvalidStateError');
- assert_equals(result.document.querySelector('b'), null, 'Must not insert new content');
- assert_false(result.document.documentElement.innerHTML.includes('some text'), 'Must not insert new content');
-}, 'document.write must throw an InvalidStateError when synchronously constructing a custom element');
-
-promise_test(async function () {
- const result = await construct_custom_element_in_parser(this, (document) => document.writeln('<b>some text</b>'));
- assert_throws_dom('InvalidStateError', result.window.DOMException, () => { throw result.exception; }, 'Must throw an InvalidStateError');
- assert_equals(result.document.querySelector('b'), null, 'Must not insert new content');
- assert_false(result.document.documentElement.innerHTML.includes('some text'), 'Must not insert new content');
-}, 'document.writeln must throw an InvalidStateError when synchronously constructing a custom element');
-
-promise_test(async function () {
- const another_window = await create_window_in_test(this);
- const result = await construct_custom_element_in_parser(this, (document) => another_window.document.open());
- assert_equals(result.exception, null);
-}, 'document.open() of another document must not throw an InvalidStateError when synchronously constructing a custom element');
-
-promise_test(async function () {
- const another_window = await create_window_in_test(this);
- const result = await construct_custom_element_in_parser(this, (document) => another_window.document.open('text/html'));
- assert_equals(result.exception, null);
-}, 'document.open("text/html") of another document must not throw an InvalidStateError when synchronously constructing a custom element');
-
-promise_test(async function () {
- const another_window = await create_window_in_test(this);
- const result = await construct_custom_element_in_parser(this, (document) => another_window.document.close());
- assert_equals(result.exception, null);
-}, 'document.close() of another document must not throw an InvalidStateError when synchronously constructing a custom element');
-
-promise_test(async function () {
- const another_window = await create_window_in_test(this);
- const result = await construct_custom_element_in_parser(this, (document) => another_window.document.write('<b>some text</b>'));
- assert_equals(result.exception, null);
- assert_equals(another_window.document.querySelector('b').outerHTML, '<b>some text</b>');
-}, 'document.write of another document must not throw an InvalidStateError when synchronously constructing a custom element');
-
-promise_test(async function () {
- const another_window = await create_window_in_test(this);
- const result = await construct_custom_element_in_parser(this, (document) => another_window.document.writeln('<b>some text</b>'));
- assert_equals(result.exception, null);
- assert_equals(another_window.document.querySelector('b').outerHTML, '<b>some text</b>');
-}, 'document.writeln of another document must not throw an InvalidStateError when synchronously constructing a custom element');
-
-</script>
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions-expected.txt (294226 => 294227)
--- trunk/LayoutTests/fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions-expected.txt 2022-05-16 10:27:00 UTC (rev 294226)
+++ trunk/LayoutTests/fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions-expected.txt 2022-05-16 11:43:54 UTC (rev 294227)
@@ -1,13 +0,0 @@
-
-PASS document.open() must throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element
-PASS document.open("text/html") must throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element
-PASS document.open(URL) must NOT throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element
-PASS document.close() must throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element
-PASS document.write must throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element
-PASS document.writeln must throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element
-PASS document.open() of another document must not throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element
-PASS document.open("text/html") of another document must not throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element
-PASS document.close() of another document must not throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element
-PASS document.write of another document must not throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element
-PASS document.writeln of another document must not throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element
-
Deleted: trunk/LayoutTests/fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html (294226 => 294227)
--- trunk/LayoutTests/fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html 2022-05-16 10:27:00 UTC (rev 294226)
+++ trunk/LayoutTests/fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html 2022-05-16 11:43:54 UTC (rev 294227)
@@ -1,117 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Custom Elements: create an element for a token must increment and decrement document's throw-on-dynamic-markup-insertion counter</title>
-<meta name="author" title="Ryosuke Niwa" href=""
-<meta name="assert" content="Invoking document.open, document.write, document.writeln, and document.write must throw an exception when the HTML parser is creating a custom element for a token">
-<meta name="help" content="https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token">
-<meta name="help" content="https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#throw-on-dynamic-markup-insertion-counter">
-<script src=""
-<script src=""
-<script src=""
-</head>
-<body>
-<div id="log"></div>
-<script>
-
-async function custom_element_reactions_in_parser(test, call_function)
-{
- const window = await create_window_in_test(test);
- const document = window.document;
-
- document.open();
-
- let executed = false;
- let exception = null;
- class CustomElement extends window.HTMLElement {
- attributeChangedCallback(name, oldValue, newValue) {
- try {
- call_function(document, window);
- } catch (error) {
- exception = error;
- }
- executed = true;
- }
- }
- CustomElement.observedAttributes = ['title'];
- window.customElements.define('some-element', CustomElement);
-
- document.write('<!DOCTYPE html><html><body><some-element title="some title"></some-element></body></html>');
- document.close();
-
- assert_true(executed, 'Must immediately process custom element reactions for setting attributes');
- return {frameElement, window, document, exception};
-}
-
-promise_test(async function () {
- const result = await custom_element_reactions_in_parser(this, (document) => document.open());
- assert_throws_dom('InvalidStateError', result.window.DOMException, () => { throw result.exception; }, 'Must throw an InvalidStateError');
-}, 'document.open() must throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element');
-
-promise_test(async function () {
- const result = await custom_element_reactions_in_parser(this, (document) => document.open('text/html'));
- assert_throws_dom('InvalidStateError', result.window.DOMException, () => { throw result.exception; }, 'Must throw an InvalidStateError');
-}, 'document.open("text/html") must throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element');
-
-// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-open-window
-promise_test(async function () {
- let load_promise = new Promise((resolve) => window._onmessage_ = (event) => resolve(event.data));
- const result = await custom_element_reactions_in_parser(this, (document, window) => document.open('resources/navigation-destination.html', '_self', ''));
- assert_equals(result.exception, null);
- assert_equals(await load_promise, 'didNavigate');
-}, 'document.open(URL) must NOT throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element');
-
-promise_test(async function () {
- const result = await custom_element_reactions_in_parser(this, (document) => document.close());
- assert_throws_dom('InvalidStateError', result.window.DOMException, () => { throw result.exception; }, 'Must throw an InvalidStateError');
-}, 'document.close() must throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element');
-
-promise_test(async function () {
- const result = await custom_element_reactions_in_parser(this, (document) => document.write('<b>some text</b>'));
- assert_throws_dom('InvalidStateError', result.window.DOMException, () => { throw result.exception; }, 'Must throw an InvalidStateError');
- assert_equals(result.document.querySelector('b'), null, 'Must not insert new content');
- assert_false(result.document.documentElement.innerHTML.includes('some text'), 'Must not insert new content');
-}, 'document.write must throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element');
-
-promise_test(async function () {
- const result = await custom_element_reactions_in_parser(this, (document) => document.writeln('<b>some text</b>'));
- assert_throws_dom('InvalidStateError', result.window.DOMException, () => { throw result.exception; }, 'Must throw an InvalidStateError');
- assert_equals(result.document.querySelector('b'), null, 'Must not insert new content');
- assert_false(result.document.documentElement.innerHTML.includes('some text'), 'Must not insert new content');
-}, 'document.writeln must throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element');
-
-promise_test(async function () {
- const another_window = await create_window_in_test(this);
- const result = await custom_element_reactions_in_parser(this, (document) => another_window.document.open());
- assert_equals(result.exception, null);
-}, 'document.open() of another document must not throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element');
-
-promise_test(async function () {
- const another_window = await create_window_in_test(this);
- const result = await custom_element_reactions_in_parser(this, (document) => another_window.document.open('text/html'));
- assert_equals(result.exception, null);
-}, 'document.open("text/html") of another document must not throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element');
-
-promise_test(async function () {
- const another_window = await create_window_in_test(this);
- const result = await custom_element_reactions_in_parser(this, (document) => another_window.document.close());
- assert_equals(result.exception, null);
-}, 'document.close() of another document must not throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element');
-
-promise_test(async function () {
- const another_window = await create_window_in_test(this);
- const result = await custom_element_reactions_in_parser(this, (document) => another_window.document.write('<b>some text</b>'));
- assert_equals(result.exception, null);
- assert_equals(another_window.document.querySelector('b').outerHTML, '<b>some text</b>');
-}, 'document.write of another document must not throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element');
-
-promise_test(async function () {
- const another_window = await create_window_in_test(this);
- const result = await custom_element_reactions_in_parser(this, (document) => another_window.document.writeln('<b>some text</b>'));
- assert_equals(result.exception, null);
- assert_equals(another_window.document.querySelector('b').outerHTML, '<b>some text</b>');
-}, 'document.writeln of another document must not throw an InvalidStateError when processing custom element reactions for a synchronous constructed custom element');
-
-</script>
-</body>
-</html>