Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (279226 => 279227)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-06-24 15:31:22 UTC (rev 279226)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2021-06-24 15:33:10 UTC (rev 279227)
@@ -1,5 +1,16 @@
2021-06-24 Chris Dumez <cdu...@apple.com>
+ Resync custom-elements WPT tests from upstream
+ https://bugs.webkit.org/show_bug.cgi?id=227330
+
+ Reviewed by Alex Christensen.
+
+ Resync custom-elements WPT tests from upstream a38612f39e7752c353.
+
+ * web-platform-tests/custom-elements/*: Updated.
+
+2021-06-24 Chris Dumez <cdu...@apple.com>
+
Resync WebIDL WPT tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=227322
Modified: trunk/LayoutTests/imported/w3c/resources/resource-files.json (279226 => 279227)
--- trunk/LayoutTests/imported/w3c/resources/resource-files.json 2021-06-24 15:31:22 UTC (rev 279226)
+++ trunk/LayoutTests/imported/w3c/resources/resource-files.json 2021-06-24 15:33:10 UTC (rev 279227)
@@ -1341,6 +1341,8 @@
"web-platform-tests/css/selectors/selection-image-001-noref.html",
"web-platform-tests/cssom-view/iframe.html",
"web-platform-tests/cssom/support/xmlss-pi.xhtml",
+ "web-platform-tests/custom-elements/prevent-extensions-crash.html",
+ "web-platform-tests/custom-elements/xhtml-crash.xhtml",
"web-platform-tests/dom/events/EventListener-incumbent-global-subframe-1.sub.html",
"web-platform-tests/dom/events/EventListener-incumbent-global-subframe-2.sub.html",
"web-platform-tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html",
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/CustomElementRegistry.html (279226 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/CustomElementRegistry.html 2021-06-24 15:31:22 UTC (rev 279226)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/CustomElementRegistry.html 2021-06-24 15:33:10 UTC (rev 279227)
@@ -738,13 +738,13 @@
class ResolvedCustomElement extends HTMLElement {};
customElements.define('resolved-custom-element', ResolvedCustomElement);
return customElements.whenDefined('resolved-custom-element').then(function (value) {
- assert_true(value === ResolvedCustomElement, 'The promise returned by "whenDefined" must resolve with the defined class');
+ assert_equals(value, ResolvedCustomElement, 'The promise returned by "whenDefined" must resolve with the defined class');
});
}, 'A promise returned by customElements.whenDefined must be resolved with the defined class');
promise_test(function () {
var promise = customElements.whenDefined('not-resolved-yet-custom-element').then(function (value) {
- assert_true(value === NotResolvedYetCustomElement, 'The promise returned by "whenDefined" must resolve with the defined class once such class is defined');
+ assert_equals(value, NotResolvedYetCustomElement, 'The promise returned by "whenDefined" must resolve with the defined class once such class is defined');
});
class NotResolvedYetCustomElement extends HTMLElement {};
customElements.define('not-resolved-yet-custom-element', NotResolvedYetCustomElement);
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/customized-built-in-constructor-exceptions.html (279226 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/customized-built-in-constructor-exceptions.html 2021-06-24 15:31:22 UTC (rev 279226)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/customized-built-in-constructor-exceptions.html 2021-06-24 15:33:10 UTC (rev 279227)
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<title>Customized built-in element constructor behavior</title>
-<meta name='author' title='Mason Freed' href=''>
+<meta name='author' href=''>
<link rel='help' href=''>
<script src=''></script>
<script src=''></script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/element-internals-shadowroot-expected.txt (0 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/element-internals-shadowroot-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/element-internals-shadowroot-expected.txt 2021-06-24 15:33:10 UTC (rev 279227)
@@ -0,0 +1,15 @@
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+
+Harness Error (FAIL), message = TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+
+FAIL ElementInternals.shadowRoot allows access to open shadow root assert_true: expected true got false
+FAIL ElementInternals.shadowRoot allows access to closed shadow root assert_true: expected true got false
+FAIL ElementInternals cannot be called before constructor, upgrade case assert_throws_dom: attachInternals cannot be called before definition exists function "() => element.attachInternals()" threw object "TypeError: element.attachInternals is not a function. (In 'element.attachInternals()', 'element.attachInternals' is undefined)" that is not a DOMException NotSupportedError: property "code" is equal to undefined, expected 9
+FAIL ElementInternals *can* be called after constructor, upgrade case assert_throws_dom: attachInternals cannot be called before constructor function "() => element.attachInternals()" threw object "TypeError: element.attachInternals is not a function. (In 'element.attachInternals()', 'element.attachInternals' is undefined)" that is not a DOMException NotSupportedError: property "code" is equal to undefined, expected 9
+FAIL ElementInternals cannot be called after constructor calls it, create case assert_true: expected true got false
+FAIL ElementInternals disabled by disabledFeatures assert_throws_dom: attachInternals forbidden by disabledFeatures, pre-upgrade function "() => element.attachInternals()" threw object "TypeError: element.attachInternals is not a function. (In 'element.attachInternals()', 'element.attachInternals' is undefined)" that is not a DOMException NotSupportedError: property "code" is equal to undefined, expected 9
+FAIL ElementInternals.shadowRoot doesn't reveal pre-attached closed shadowRoot assert_true: Failed to construct - test failed expected true got false
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/element-internals-shadowroot.html (0 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/element-internals-shadowroot.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/element-internals-shadowroot.html 2021-06-24 15:33:10 UTC (rev 279227)
@@ -0,0 +1,130 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>ElementInternals.shadowRoot</title>
+<link rel="author" href=""
+<link rel="help" href=""
+<script src=""
+<script src=""
+
+<script>
+
+test(() => {
+ let constructed = false;
+ customElements.define('custom-open', class extends HTMLElement {
+ constructor() {
+ super();
+ const elementInternals = this.attachInternals();
+ assert_equals(elementInternals.shadowRoot, null);
+ const shadow = this.attachShadow({mode: 'open'});
+ assert_equals(elementInternals.shadowRoot, shadow);
+ constructed = true;
+ }
+ });
+ const element = document.createElement('custom-open');
+ assert_true(constructed);
+}, 'ElementInternals.shadowRoot allows access to open shadow root');
+
+test(() => {
+ let constructed = false;
+ customElements.define('custom-closed', class extends HTMLElement {
+ constructor() {
+ super();
+ const elementInternals = this.attachInternals();
+ assert_equals(elementInternals.shadowRoot, null);
+ const shadow = this.attachShadow({mode: 'closed'});
+ assert_equals(elementInternals.shadowRoot, shadow);
+ assert_equals(this.shadowRoot, null);
+ constructed = true;
+ }
+ });
+ const element = document.createElement('custom-closed');
+ assert_true(constructed);
+}, 'ElementInternals.shadowRoot allows access to closed shadow root');
+
+test(() => {
+ let constructed = false;
+ const element = document.createElement('x-1');
+ assert_throws_dom('NotSupportedError', () => element.attachInternals(),'attachInternals cannot be called before definition exists');
+ customElements.define('x-1', class extends HTMLElement {
+ constructor() {
+ super();
+ assert_true(!!this.attachInternals());
+ constructed = true;
+ }
+ });
+ assert_false(constructed);
+ assert_throws_dom('NotSupportedError', () => element.attachInternals(),'attachInternals cannot be called before constructor');
+ customElements.upgrade(element);
+ assert_true(constructed);
+ assert_throws_dom('NotSupportedError', () => element.attachInternals(),'attachInternals already called');
+}, 'ElementInternals cannot be called before constructor, upgrade case');
+
+test(() => {
+ let constructed = false;
+ const element = document.createElement('x-2');
+ customElements.define('x-2', class extends HTMLElement {
+ constructor() {
+ super();
+ // Don't attachInternals() here
+ constructed = true;
+ }
+ });
+ assert_throws_dom('NotSupportedError', () => element.attachInternals(),'attachInternals cannot be called before constructor');
+ assert_false(constructed);
+ customElements.upgrade(element);
+ assert_true(constructed);
+ assert_true(!!element.attachInternals(),'After the constructor, ok to call from outside');
+}, 'ElementInternals *can* be called after constructor, upgrade case');
+
+test(() => {
+ let constructed = false;
+ customElements.define('x-3', class extends HTMLElement {
+ constructor() {
+ super();
+ assert_true(!!this.attachInternals());
+ constructed = true;
+ }
+ });
+ const element = document.createElement('x-3');
+ assert_true(constructed);
+ assert_throws_dom('NotSupportedError', () => element.attachInternals(), 'attachInternals already called');
+}, 'ElementInternals cannot be called after constructor calls it, create case');
+
+test(() => {
+ let constructed = false;
+ const element = document.createElement('x-5');
+ customElements.define('x-5', class extends HTMLElement {
+ static disabledFeatures = [ 'internals' ];
+ constructor() {
+ super();
+ assert_throws_dom('NotSupportedError', () => this.attachInternals(), 'attachInternals forbidden by disabledFeatures, constructor');
+ constructed = true;
+ }
+ });
+ assert_false(constructed);
+ assert_throws_dom('NotSupportedError', () => element.attachInternals(), 'attachInternals forbidden by disabledFeatures, pre-upgrade');
+ customElements.upgrade(element);
+ assert_true(constructed);
+ assert_throws_dom('NotSupportedError', () => element.attachInternals(), 'attachInternals forbidden by disabledFeatures, post-upgrade');
+}, 'ElementInternals disabled by disabledFeatures');
+
+test(() => {
+ let constructed = false;
+ const element = document.createElement('x-6');
+ const sr = element.attachShadow({mode: 'closed'});
+ assert_true(sr instanceof ShadowRoot);
+ customElements.define('x-6', class extends HTMLElement {
+ constructor() {
+ super();
+ assert_throws_dom('NotSupportedError', () => this.attachShadow({mode:'open'}), 'attachShadow already called');
+ const elementInternals = this.attachInternals();
+ assert_equals(elementInternals.shadowRoot, null, 'ElementInternals.shadowRoot should not be available for pre-attached shadow');
+ constructed = true;
+ }
+ });
+ assert_false(constructed);
+ customElements.upgrade(element);
+ assert_true(constructed,'Failed to construct - test failed');
+ assert_equals(element.shadowRoot, null, 'shadow root is closed');
+}, 'ElementInternals.shadowRoot doesn\'t reveal pre-attached closed shadowRoot');
+</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-setFormValue-expected.txt (279226 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-setFormValue-expected.txt 2021-06-24 15:31:22 UTC (rev 279226)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-setFormValue-expected.txt 2021-06-24 15:33:10 UTC (rev 279227)
@@ -7,6 +7,54 @@
CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+CONSOLE MESSAGE: TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
Harness Error (FAIL), message = TypeError: this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
@@ -17,4 +65,52 @@
FAIL Null value should submit nothing undefined is not an object (evaluating 'this.internals_.setFormValue')
FAIL Multiple values - name content attribute is ignored undefined is not an object (evaluating 'this.internals_.setFormValue')
FAIL setFormValue with an empty FormData should submit nothing undefined is not an object (evaluating 'this.internals_.setFormValue')
+FAIL Newline normalization - \n in name (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n in name (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r in name (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r in name (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r\n in name (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r\n in name (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n\r in name (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n\r in name (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n in value (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n in value (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r in value (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r in value (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r\n in value (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r\n in value (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n\r in value (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n\r in value (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n in filename (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n in filename (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r in filename (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r in filename (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r\n in filename (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r\n in filename (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n\r in filename (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n\r in filename (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n in FormData name (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n in FormData name (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r in FormData name (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r in FormData name (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r\n in FormData name (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r\n in FormData name (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n\r in FormData name (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n\r in FormData name (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n in FormData value (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n in FormData value (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r in FormData value (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r in FormData value (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r\n in FormData value (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r\n in FormData value (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n\r in FormData value (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n\r in FormData value (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n in FormData filename (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n in FormData filename (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r in FormData filename (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r in FormData filename (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r\n in FormData filename (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \r\n in FormData filename (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n\r in FormData filename (urlencoded) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
+FAIL Newline normalization - \n\r in FormData filename (formdata) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'this.internals_.setFormValue')"
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-setFormValue.html (279226 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-setFormValue.html 2021-06-24 15:31:22 UTC (rev 279226)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-setFormValue.html 2021-06-24 15:33:10 UTC (rev 279227)
@@ -1,4 +1,5 @@
<!DOCTYPE html>
+<meta charset="utf-8">
<script src=""
<script src=""
<div id="container"></div>
@@ -30,15 +31,87 @@
customElements.define('my-control', MyControl);
const $ = document.querySelector.bind(document);
-function submitPromise(t) {
+function submitPromise(t, extractFromIframe) {
+ if (!extractFromIframe) {
+ extractFromIframe = (iframe) => iframe.contentWindow.location.search;
+ }
return new Promise((resolve, reject) => {
const iframe = $('iframe');
- iframe._onload_ = () => resolve(iframe.contentWindow.location.search);
+ iframe._onload_ = () => resolve(extractFromIframe(iframe));
iframe._onerror_ = () => reject(new Error('iframe onerror fired'));
$('form').submit();
});
}
+function testSerializedEntry({name, value, expected, description}) {
+ // urlencoded
+ {
+ const {name: expectedName, value: expectedValue} = expected.urlencoded;
+ promise_test(async t => {
+ $('#container').innerHTML = '<form action="" target="if1">' +
+ '<my-control></my-control>' +
+ '</form>' +
+ '<iframe name="if1"></iframe>';
+ if (name !== undefined) {
+ $('my-control').setAttribute("name", name);
+ }
+ if (Array.isArray(value)) {
+ $('my-control').setValues(value);
+ } else {
+ $('my-control').value = value;
+ }
+ const query = await submitPromise(t);
+ assert_equals(query, `?${expectedName}=${expectedValue}`);
+ }, `${description} (urlencoded)`);
+ }
+
+ // formdata
+ {
+ const {name: expectedName, filename: expectedFilename, value: expectedValue} = expected.formdata;
+ promise_test(async t => {
+ $('#container').innerHTML =
+ '<form action="" method="post" enctype="multipart/form-data" target="if1">' +
+ '<my-control></my-control>' +
+ '</form>' +
+ '<iframe name="if1"></iframe>';
+ if (name !== undefined) {
+ $('my-control').setAttribute("name", name);
+ }
+ if (Array.isArray(value)) {
+ $('my-control').setValues(value);
+ } else {
+ $('my-control').value = value;
+ }
+ const escaped = await submitPromise(t, iframe => iframe.contentDocument.body.textContent);
+ const formdata = escaped
+ .replace(/\r\n?|\n/g, "\r\n")
+ .replace(
+ /\\x[0-9A-Fa-f]{2}/g,
+ escape => String.fromCodePoint(parseInt(escape.substring(2), 16))
+ );
+ const boundary = formdata.split("\r\n")[0];
+ const expected = [
+ boundary,
+ ...(() => {
+ if (expectedFilename === undefined) {
+ return [`Content-Disposition: form-data; name="${expectedName}"`];
+ } else {
+ return [
+ `Content-Disposition: form-data; name="${expectedName}"; filename="${expectedFilename}"`,
+ "Content-Type: text/plain"
+ ];
+ }
+ })(),
+ "",
+ expectedValue,
+ boundary + "--",
+ ""
+ ].join("\r\n");
+ assert_equals(formdata, expected);
+ }, `${description} (formdata)`);
+ }
+}
+
promise_test(t => {
$('#container').innerHTML = '<form action="" target="if1">' +
'<input name=name-pd1 value="value-pd1">' +
@@ -122,4 +195,384 @@
assert_equals(query, '?name-pd1=value-pd1');
});
}, 'setFormValue with an empty FormData should submit nothing');
+
+testSerializedEntry({
+ name: 'a\nb',
+ value: 'c',
+ expected: {
+ urlencoded: {
+ name: 'a%0D%0Ab',
+ value: 'c'
+ },
+ formdata: {
+ name: 'a%0D%0Ab',
+ value: 'c'
+ }
+ },
+ description: 'Newline normalization - \\n in name'
+});
+
+testSerializedEntry({
+ name: 'a\rb',
+ value: 'c',
+ expected: {
+ urlencoded: {
+ name: 'a%0D%0Ab',
+ value: 'c'
+ },
+ formdata: {
+ name: 'a%0D%0Ab',
+ value: 'c'
+ }
+ },
+ description: 'Newline normalization - \\r in name'
+});
+
+testSerializedEntry({
+ name: 'a\r\nb',
+ value: 'c',
+ expected: {
+ urlencoded: {
+ name: 'a%0D%0Ab',
+ value: 'c'
+ },
+ formdata: {
+ name: 'a%0D%0Ab',
+ value: 'c'
+ }
+ },
+ description: 'Newline normalization - \\r\\n in name'
+});
+
+testSerializedEntry({
+ name: 'a\n\rb',
+ value: 'c',
+ expected: {
+ urlencoded: {
+ name: 'a%0D%0A%0D%0Ab',
+ value: 'c'
+ },
+ formdata: {
+ name: 'a%0D%0A%0D%0Ab',
+ value: 'c'
+ }
+ },
+ description: 'Newline normalization - \\n\\r in name'
+});
+
+testSerializedEntry({
+ name: 'a',
+ value: 'b\nc',
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ value: 'b\r\nc'
+ }
+ },
+ description: 'Newline normalization - \\n in value'
+});
+
+testSerializedEntry({
+ name: 'a',
+ value: 'b\rc',
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ value: 'b\r\nc'
+ }
+ },
+ description: 'Newline normalization - \\r in value'
+});
+
+testSerializedEntry({
+ name: 'a',
+ value: 'b\r\nc',
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ value: 'b\r\nc'
+ }
+ },
+ description: 'Newline normalization - \\r\\n in value'
+});
+
+testSerializedEntry({
+ name: 'a',
+ value: 'b\n\rc',
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0A%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ value: 'b\r\n\r\nc'
+ }
+ },
+ description: 'Newline normalization - \\n\\r in value'
+});
+
+testSerializedEntry({
+ name: 'a',
+ value: new File([], "b\nc", {type: "text/plain"}),
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ filename: 'b%0Ac',
+ value: ''
+ }
+ },
+ description: 'Newline normalization - \\n in filename'
+});
+
+testSerializedEntry({
+ name: 'a',
+ value: new File([], "b\rc", {type: "text/plain"}),
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ filename: 'b%0Dc',
+ value: ''
+ }
+ },
+ description: 'Newline normalization - \\r in filename'
+});
+
+testSerializedEntry({
+ name: 'a',
+ value: new File([], "b\r\nc", {type: "text/plain"}),
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ filename: 'b%0D%0Ac',
+ value: ''
+ }
+ },
+ description: 'Newline normalization - \\r\\n in filename'
+});
+
+testSerializedEntry({
+ name: 'a',
+ value: new File([], "b\n\rc", {type: "text/plain"}),
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0A%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ filename: 'b%0A%0Dc',
+ value: ''
+ }
+ },
+ description: 'Newline normalization - \\n\\r in filename'
+});
+
+testSerializedEntry({
+ value: [['a\nb', 'c']],
+ expected: {
+ urlencoded: {
+ name: 'a%0D%0Ab',
+ value: 'c'
+ },
+ formdata: {
+ name: 'a%0D%0Ab',
+ value: 'c'
+ }
+ },
+ description: 'Newline normalization - \\n in FormData name'
+});
+
+testSerializedEntry({
+ value: [['a\rb', 'c']],
+ expected: {
+ urlencoded: {
+ name: 'a%0D%0Ab',
+ value: 'c'
+ },
+ formdata: {
+ name: 'a%0D%0Ab',
+ value: 'c'
+ }
+ },
+ description: 'Newline normalization - \\r in FormData name'
+});
+
+testSerializedEntry({
+ value: [['a\r\nb', 'c']],
+ expected: {
+ urlencoded: {
+ name: 'a%0D%0Ab',
+ value: 'c'
+ },
+ formdata: {
+ name: 'a%0D%0Ab',
+ value: 'c'
+ }
+ },
+ description: 'Newline normalization - \\r\\n in FormData name'
+});
+
+testSerializedEntry({
+ value: [['a\n\rb', 'c']],
+ expected: {
+ urlencoded: {
+ name: 'a%0D%0A%0D%0Ab',
+ value: 'c'
+ },
+ formdata: {
+ name: 'a%0D%0A%0D%0Ab',
+ value: 'c'
+ }
+ },
+ description: 'Newline normalization - \\n\\r in FormData name'
+});
+
+testSerializedEntry({
+ value: [['a', 'b\nc']],
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ value: 'b\r\nc'
+ }
+ },
+ description: 'Newline normalization - \\n in FormData value'
+});
+
+testSerializedEntry({
+ value: [['a', 'b\rc']],
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ value: 'b\r\nc'
+ }
+ },
+ description: 'Newline normalization - \\r in FormData value'
+});
+
+testSerializedEntry({
+ value: [['a', 'b\r\nc']],
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ value: 'b\r\nc'
+ }
+ },
+ description: 'Newline normalization - \\r\\n in FormData value'
+});
+
+testSerializedEntry({
+ value: [['a', 'b\n\rc']],
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0A%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ value: 'b\r\n\r\nc'
+ }
+ },
+ description: 'Newline normalization - \\n\\r in FormData value'
+});
+
+testSerializedEntry({
+ value: [['a', new File([], 'b\nc', {type: "text/plain"})]],
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ filename: 'b%0Ac',
+ value: ''
+ }
+ },
+ description: 'Newline normalization - \\n in FormData filename'
+});
+
+testSerializedEntry({
+ value: [['a', new File([], 'b\rc', {type: "text/plain"})]],
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ filename: 'b%0Dc',
+ value: ''
+ }
+ },
+ description: 'Newline normalization - \\r in FormData filename'
+});
+
+testSerializedEntry({
+ value: [['a', new File([], 'b\r\nc', {type: "text/plain"})]],
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ filename: 'b%0D%0Ac',
+ value: ''
+ }
+ },
+ description: 'Newline normalization - \\r\\n in FormData filename'
+});
+
+testSerializedEntry({
+ value: [['a', new File([], 'b\n\rc', {type: "text/plain"})]],
+ expected: {
+ urlencoded: {
+ name: 'a',
+ value: 'b%0D%0A%0D%0Ac'
+ },
+ formdata: {
+ name: 'a',
+ filename: 'b%0A%0Dc',
+ value: ''
+ }
+ },
+ description: 'Newline normalization - \\n\\r in FormData filename'
+});
</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/form-elements-namedItem-expected.txt (0 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/form-elements-namedItem-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/form-elements-namedItem-expected.txt 2021-06-24 15:33:10 UTC (rev 279227)
@@ -0,0 +1,3 @@
+
+FAIL Form associated custom elements should work with document.forms.elements.namedItem() assert_equals: Single input should be returned as-is expected (object) Element node <custom-input id="custom-1" name="alone"></custom-input> but got (undefined) undefined
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/form-elements-namedItem.html (0 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/form-elements-namedItem.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/form-elements-namedItem.html 2021-06-24 15:33:10 UTC (rev 279227)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<script src=""
+
+<script>
+customElements.define('custom-input', class extends HTMLElement {
+ static get formAssociated() {return true;}
+});
+</script>
+
+<form>
+ <custom-input id="custom-1" name="alone"></custom-input>
+ <custom-input id="custom-2" name="group"></custom-input>
+ <custom-input id="custom-3" name="group"></custom-input>
+</form>
+
+<script>
+test(() => {
+ const formElements = document.forms[0].elements;
+ assert_equals(formElements['invalid'],undefined);
+ assert_equals(formElements['alone'],document.getElementById('custom-1'),'Single input should be returned as-is');
+ assert_true(formElements['group'] instanceof RadioNodeList,'Repeated names should result in RadioNodeList');
+ const expected = [document.getElementById('custom-2'),
+ document.getElementById('custom-3')];
+ assert_array_equals(formElements['group'],expected,'Repeated names should be contained in RadioNodeList, in tree order');
+}, 'Form associated custom elements should work with document.forms.elements.namedItem()');
+
+</script>
+</body>
\ No newline at end of file
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/w3c-import.log (279226 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/w3c-import.log 2021-06-24 15:31:22 UTC (rev 279226)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/w3c-import.log 2021-06-24 15:33:10 UTC (rev 279227)
@@ -21,4 +21,5 @@
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/ElementInternals-validation.html
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/form-associated-callback.html
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/form-disabled-callback.html
+/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/form-elements-namedItem.html
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/form-associated/form-reset-callback.html
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-constructs-custom-element-in-document-write-expected.txt (279226 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-constructs-custom-element-in-document-write-expected.txt 2021-06-24 15:31:22 UTC (rev 279226)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-constructs-custom-element-in-document-write-expected.txt 2021-06-24 15:33:10 UTC (rev 279227)
@@ -1,3 +1,4 @@
PASS HTML parser must instantiate custom elements inside document.write
-
+PASS HTML parser should call connectedCallback before appending child nodes inside document.write
+hello world
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-constructs-custom-element-in-document-write.html (279226 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-constructs-custom-element-in-document-write.html 2021-06-24 15:31:22 UTC (rev 279226)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-constructs-custom-element-in-document-write.html 2021-06-24 15:33:10 UTC (rev 279227)
@@ -14,10 +14,16 @@
<div id="log"></div>
<script>
-class MyCustomElement extends HTMLElement { }
+var numberOfChildNodesInConnectedCallback = 0;
+
+class MyCustomElement extends HTMLElement {
+ connectedCallback() {
+ numberOfChildNodesInConnectedCallback = this.childNodes.length;
+ }
+}
customElements.define('my-custom-element', MyCustomElement);
-document.write('<my-custom-element></my-custom-element>');
+document.write('<my-custom-element>hello <b>world</b></my-custom-element>');
test(function () {
var instance = document.querySelector('my-custom-element');
@@ -27,6 +33,11 @@
}, 'HTML parser must instantiate custom elements inside document.write');
+test(function () {
+ assert_equals(numberOfChildNodesInConnectedCallback, 0);
+
+}, 'HTML parser should call connectedCallback before appending child nodes inside document.write');
+
</script>
</body>
</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/prevent-extensions-crash.html (0 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/prevent-extensions-crash.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/prevent-extensions-crash.html 2021-06-24 15:33:10 UTC (rev 279227)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Check for crash at step #12 of HTML Constructors</title>
+<meta name='author' href=''>
+<link rel='help' href=''>
+<link rel='help' href=''>
+
+<uh-oh></uh-oh>
+
+<script type="module">
+ Reflect.preventExtensions(document.querySelector('uh-oh'));
+ customElements.define('uh-oh', class extends HTMLElement {});
+</script>
+
+This test passes if it does not crash.
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined-print-expected.html (0 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined-print-expected.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined-print-expected.html 2021-06-24 15:33:10 UTC (rev 279227)
@@ -0,0 +1,9 @@
+<!doctype html>
+<style>
+ div {
+ width: 100px;
+ height: 100px;
+ background: green;
+ }
+</style>
+<div></div>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined-print.html (0 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined-print.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined-print.html 2021-06-24 15:33:10 UTC (rev 279227)
@@ -0,0 +1,17 @@
+<!doctype html>
+<link rel="match" href=""
+<style>
+ custom-element {
+ display: block;
+ width: 100px;
+ height: 100px;
+ background: green;
+ }
+ custom-element:not(:defined) {
+ background: red;
+ }
+</style>
+<custom-element></custom-element>
+<script>
+ customElements.define("custom-element", class extends HTMLElement { });
+</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined.html (279226 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined.html 2021-06-24 15:31:22 UTC (rev 279226)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined.html 2021-06-24 15:33:10 UTC (rev 279227)
@@ -96,14 +96,17 @@
var log = [];
var instance = document.createElement('my-custom-element-2');
document.body.appendChild(instance);
+ assert_false(instance.matches(":defined"), "Prior to definition, instance should not match :defined");
customElements.define('my-custom-element-2',class extends HTMLElement {
constructor() {
+ assert_false(instance.matches(":defined"), "During construction, prior to super(), instance should not match :defined");
super();
log.push([this, 'begin']);
- assert_false(this.matches(":defined"), "During construction, this should not match :defined");
+ assert_false(this.matches(":defined"), "During construction, after super(), this should not match :defined");
log.push([this, 'end']);
}
});
+ assert_true(instance.matches(":defined"), "After construction, instance should match :defined");
assert_equals(log.length, 2);
assert_array_equals(log[0], [instance, 'begin']);
assert_array_equals(log[1], [instance, 'end']);
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/HTMLElement.html (279226 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/HTMLElement.html 2021-06-24 15:31:22 UTC (rev 279226)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/HTMLElement.html 2021-06-24 15:33:10 UTC (rev 279227)
@@ -28,12 +28,9 @@
customElement.parentNode.innerText = '';
}, 'innerText on HTMLElement');
-if ('outerText' in HTMLElement.prototype) {
- // Not yet to be in the standard but all but Gecko supports this property: https://github.com/whatwg/html/issues/668
- testNodeDisconnector(function (customElement) {
- customElement.outerText = '';
- }, 'outerText on HTMLElement');
-}
+testNodeDisconnector(function (customElement) {
+ customElement.outerText = '';
+}, 'outerText on HTMLElement');
</script>
</body>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/ElementInternals-states-expected.txt (0 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/ElementInternals-states-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/ElementInternals-states-expected.txt 2021-06-24 15:33:10 UTC (rev 279227)
@@ -0,0 +1,6 @@
+
+FAIL CustomStateSet behavior of ElementInternals.states: Initial state this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+FAIL CustomStateSet behavior of ElementInternals.states: Exceptions this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+FAIL CustomStateSet behavior of ElementInternals.states: Modifications this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+FAIL Updating a CustomStateSet while iterating it should work this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/ElementInternals-states.html (0 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/ElementInternals-states.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/ElementInternals-states.html 2021-06-24 15:33:10 UTC (rev 279227)
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<script src=""
+<script src=""
+<script>
+class TestElement extends HTMLElement {
+ constructor() {
+ super();
+ this._internals = this.attachInternals();
+ }
+
+ get internals() {
+ return this._internals;
+ }
+}
+customElements.define("test-element", TestElement);
+
+test(() => {
+ let i = (new TestElement()).internals;
+
+ assert_true(i.states instanceof CustomStateSet);
+ assert_equals(i.states.size, 0);
+ assert_false(i.states.has('foo'));
+ assert_false(i.states.has('--foo'));
+ assert_equals(i.states.toString(), '[object CustomStateSet]');
+}, 'CustomStateSet behavior of ElementInternals.states: Initial state');
+
+test(() => {
+ let i = (new TestElement()).internals;
+ assert_throws_js(TypeError, () => { i.states.supports('foo'); });
+ assert_throws_dom('SyntaxError', () => { i.states.add(''); });
+ assert_throws_dom('SyntaxError', () => { i.states.add('--a\tb'); });
+}, 'CustomStateSet behavior of ElementInternals.states: Exceptions');
+
+test(() => {
+ let i = (new TestElement()).internals;
+ i.states.add('--foo');
+ i.states.add('--bar');
+ i.states.add('--foo');
+ assert_equals(i.states.size, 2);
+ assert_true(i.states.has('--foo'));
+ assert_true(i.states.has('--bar'));
+ assert_array_equals([...i.states], ['--foo', '--bar']);
+ i.states.delete('--foo');
+ assert_array_equals([...i.states], ['--bar']);
+ i.states.add('--foo');
+ assert_array_equals([...i.states], ['--bar', '--foo']);
+ i.states.delete('--bar');
+ i.states.add('--baz');
+ assert_array_equals([...i.states], ['--foo', '--baz']);
+}, 'CustomStateSet behavior of ElementInternals.states: Modifications');
+
+test(() => {
+ let i = (new TestElement()).internals;
+ i.states.add('--one');
+ i.states.add('--two');
+ i.states.add('--three');
+ let iter = i.states.values();
+
+ // Delete the next item.
+ i.states.delete('--one');
+ let item = iter.next();
+ assert_false(item.done);
+ assert_equals(item.value, '--two');
+
+ // Clear the set.
+ i.states.clear();
+ item = iter.next();
+ assert_true(item.done);
+
+ // Delete the previous item.
+ i.states.add('--one');
+ i.states.add('--two');
+ i.states.add('--three');
+ iter = i.states.values();
+ item = iter.next();
+ assert_equals(item.value, '--one');
+ i.states.delete('--one');
+ item = iter.next();
+ assert_equals(item.value, '--two');
+}, 'Updating a CustomStateSet while iterating it should work');
+</script>
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/README.md (0 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/README.md (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/README.md 2021-06-24 15:33:10 UTC (rev 279227)
@@ -0,0 +1 @@
+Tests for [Custom State Pseudo Class](https://wicg.github.io/custom-state-pseudo-class/)
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/state-pseudo-class-expected.txt (0 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/state-pseudo-class-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/state-pseudo-class-expected.txt 2021-06-24 15:33:10 UTC (rev 279227)
@@ -0,0 +1,9 @@
+
+FAIL :--foo parsing passes The string did not match the expected pattern.
+PASS :--foo parsing failures
+FAIL :--foo serialization undefined is not an object (evaluating 'document.styleSheets[0].cssRules[1].cssText')
+FAIL :--foo in simple cases this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+FAIL :--foo and other pseudo classes this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+FAIL :--foo and ::part() this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+FAIL :--foo and :host() this.attachInternals is not a function. (In 'this.attachInternals()', 'this.attachInternals' is undefined)
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/state-pseudo-class.html (0 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/state-pseudo-class.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/state-pseudo-class.html 2021-06-24 15:33:10 UTC (rev 279227)
@@ -0,0 +1,132 @@
+<!DOCTYPE html>
+<script src=""
+<script src=""
+<style>
+#state-and-part::part(inner) {
+ opacity: 0;
+}
+#state-and-part::part(inner):--innerFoo {
+ opacity: 0.5;
+}
+#state-and-part:--outerFoo::part(inner) {
+ opacity: 0.25;
+}
+:--\(escaped\ state {}
+</style>
+<body>
+<script>
+class TestElement extends HTMLElement {
+ constructor() {
+ super();
+ this._internals = this.attachInternals();
+ }
+
+ get i() {
+ return this._internals;
+ }
+}
+customElements.define('test-element', TestElement);
+
+class ContainerElement extends HTMLElement {
+ constructor() {
+ super();
+ this._internals = this.attachInternals();
+ this._shadow = this.attachShadow({mode:'open'});
+ this._shadow.innerHTML = `
+<style>
+:host {
+ border-style: solid;
+}
+:host(:--dotted) {
+ border-style: dotted;
+}
+</style>
+<test-element part="inner"></test-element>`;
+ }
+
+ get i() {
+ return this._internals;
+ }
+ get innerElement() {
+ return this._shadow.querySelector('test-element');
+ }
+}
+customElements.define('container-element', ContainerElement);
+
+test(() => {
+ document.querySelector(':--');
+ document.querySelector(':--16px');
+}, ':--foo parsing passes');
+
+test(() => {
+ assert_throws_dom('SyntaxError', () => { document.querySelector(':--('); });
+ assert_throws_dom('SyntaxError', () => { document.querySelector(':--)'); });
+ assert_throws_dom('SyntaxError', () => { document.querySelector(':--='); });
+ assert_throws_dom('SyntaxError', () => { document.querySelector(':--name=value'); });
+}, ':--foo parsing failures');
+
+test(() => {
+ assert_equals(document.styleSheets[0].cssRules[1].cssText,
+ '#state-and-part::part(inner):--innerFoo { opacity: 0.5; }');
+ assert_equals(document.styleSheets[0].cssRules[3].selectorText,
+ ':--\\(escaped\\ state');
+}, ':--foo serialization');
+
+test(() => {
+ let element = new TestElement();
+ let states = element.i.states;
+
+ assert_false(element.matches(':--foo'));
+ assert_true(element.matches(':not(:--foo)'));
+ states.add('--foo');
+ assert_true(element.matches(':--foo'));
+ assert_true(element.matches(':is(:--foo)'));
+ element.classList.add('c1', 'c2');
+ assert_true(element.matches('.c1:--foo'));
+ assert_true(element.matches(':--foo.c1'));
+ assert_true(element.matches('.c2:--foo.c1'));
+}, ':--foo in simple cases');
+
+test(() => {
+ let element = new TestElement();
+ element.tabIndex = 0;
+ document.body.appendChild(element);
+ element.focus();
+ let states = element.i.states;
+
+ states.add('--foo');
+ assert_true(element.matches(':focus:--foo'));
+ assert_true(element.matches(':--foo:focus'));
+}, ':--foo and other pseudo classes');
+
+test(() => {
+ let outer = new ContainerElement();
+ outer.id = 'state-and-part';
+ document.body.appendChild(outer);
+ let inner = outer.innerElement;
+ let innerStates = inner.i.states;
+
+ innerStates.add('--innerFoo');
+ assert_equals(getComputedStyle(inner).opacity, '0.5',
+ '::part() followed by :--foo');
+ innerStates.delete('--innerFoo');
+ innerStates.add('--innerfoo');
+ assert_equals(getComputedStyle(inner).opacity, '0',
+ ':--foo matching should be case-sensitive');
+ innerStates.delete('--innerfoo');
+
+ outer.i.states.add('--outerFoo');
+ assert_equals(getComputedStyle(inner).opacity, '0.25',
+ ':--foo followed by ::part()');
+}, ':--foo and ::part()');
+
+test(() => {
+ let outer = new ContainerElement();
+ document.body.appendChild(outer);
+
+ assert_equals(getComputedStyle(outer).borderStyle, 'solid');
+ outer.i.states.add('--dotted');
+ assert_equals(getComputedStyle(outer).borderStyle, 'dotted');
+}, ':--foo and :host()');
+</script>
+</body>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/w3c-import.log (0 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/w3c-import.log 2021-06-24 15:33:10 UTC (rev 279227)
@@ -0,0 +1,19 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+ https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/ElementInternals-states.html
+/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/README.md
+/LayoutTests/imported/w3c/web-platform-tests/custom-elements/state/tentative/state-pseudo-class.html
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/upgrading.html (279226 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/upgrading.html 2021-06-24 15:31:22 UTC (rev 279226)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/upgrading.html 2021-06-24 15:33:10 UTC (rev 279227)
@@ -41,7 +41,7 @@
var name = generateNextCustomElementName();
var unresolvedElement = document.createElement(name);
- assert_equals(unresolvedElement.__proto__, HTMLElement.prototype,
+ assert_equals(Object.getPrototypeOf(unresolvedElement), HTMLElement.prototype,
'[[Prototype]] internal slot of the unresolved custom element must be the HTMLElement prototype');
return getDocument().then(function (doc) {
@@ -48,13 +48,13 @@
var unresolvedElementInDoc = doc.createElement(name);
var prototype = (unresolvedElementInDoc.namespaceURI == 'http://www.w3.org/1999/xhtml' ? HTMLElement : Element).prototype;
- assert_equals(unresolvedElementInDoc.__proto__, prototype,
+ assert_equals(Object.getPrototypeOf(unresolvedElementInDoc), prototype,
'[[Prototype]] internal slot of the unresolved custom element must be the ' + prototype.toString() + ' prototype');
var someCustomElement = class extends HTMLElement {};
customElements.define(name, someCustomElement);
- assert_equals(unresolvedElementInDoc.__proto__, prototype, '"define" must not upgrade a disconnected unresolved custom elements');
+ assert_equals(Object.getPrototypeOf(unresolvedElementInDoc), prototype, '"define" must not upgrade a disconnected unresolved custom elements');
doc.documentElement.appendChild(unresolvedElementInDoc);
- assert_equals(unresolvedElementInDoc.__proto__, prototype,
+ assert_equals(Object.getPrototypeOf(unresolvedElementInDoc), prototype,
'Inserting an element into a document without a browsing context must not enqueue a custom element upgrade reaction');
});
}, 'Creating an element in ' + documentName + ' and inserting into the document must not enqueue a custom element upgrade reaction');
@@ -63,7 +63,7 @@
var name = generateNextCustomElementName();
var unresolvedElement = document.createElement(name);
- assert_equals(unresolvedElement.__proto__, HTMLElement.prototype,
+ assert_equals(Object.getPrototypeOf(unresolvedElement), HTMLElement.prototype,
'[[Prototype]] internal slot of the unresolved custom element must be the HTMLElement prototype');
return getDocument().then(function (doc) {
@@ -70,18 +70,18 @@
var unresolvedElementInDoc = doc.createElement(name);
var prototype = (unresolvedElementInDoc.namespaceURI == 'http://www.w3.org/1999/xhtml' ? HTMLElement : Element).prototype;
- assert_equals(unresolvedElementInDoc.__proto__, prototype,
+ assert_equals(Object.getPrototypeOf(unresolvedElementInDoc), prototype,
'[[Prototype]] internal slot of the unresolved custom element must be the ' + prototype.toString() + ' prototype');
var someCustomElement = class extends HTMLElement {};
customElements.define(name, someCustomElement);
- assert_equals(unresolvedElementInDoc.__proto__, prototype, '"define" must not upgrade a disconnected unresolved custom elements');
+ assert_equals(Object.getPrototypeOf(unresolvedElementInDoc), prototype, '"define" must not upgrade a disconnected unresolved custom elements');
document.body.appendChild(unresolvedElementInDoc);
if (unresolvedElementInDoc.namespaceURI == 'http://www.w3.org/1999/xhtml') {
- assert_equals(unresolvedElementInDoc.__proto__, someCustomElement.prototype,
+ assert_equals(Object.getPrototypeOf(unresolvedElementInDoc), someCustomElement.prototype,
'Inserting an element into a document with a browsing context must enqueue a custom element upgrade reaction');
} else {
- assert_equals(unresolvedElementInDoc.__proto__, prototype,
+ assert_equals(Object.getPrototypeOf(unresolvedElementInDoc), prototype,
'Looking up a custom element definition must return null if the element is not in the HTML namespace');
}
});
@@ -116,13 +116,13 @@
class UnresolvedElement extends docWindow.HTMLElement { };
var unresolvedElementInDoc = doc.createElement('unresolved-element');
- assert_equals(unresolvedElement.__proto__, HTMLElement.prototype);
- assert_equals(unresolvedElementInDoc.__proto__, docWindow.HTMLElement.prototype);
+ assert_equals(Object.getPrototypeOf(unresolvedElement), HTMLElement.prototype);
+ assert_equals(Object.getPrototypeOf(unresolvedElementInDoc), docWindow.HTMLElement.prototype);
docWindow.customElements.define('unresolved-element', UnresolvedElement);
- assert_equals(unresolvedElement.__proto__, HTMLElement.prototype);
- assert_equals(unresolvedElementInDoc.__proto__, docWindow.HTMLElement.prototype);
+ assert_equals(Object.getPrototypeOf(unresolvedElement), HTMLElement.prototype);
+ assert_equals(Object.getPrototypeOf(unresolvedElementInDoc), docWindow.HTMLElement.prototype);
});
}, '"define" in ' + documentName + ' must not enqueue a custom element upgrade reaction on a disconnected unresolved custom element');
@@ -134,14 +134,14 @@
class UnresolvedElement extends docWindow.HTMLElement { };
var unresolvedElementInDoc = doc.createElement('unresolved-element');
- assert_equals(unresolvedElement.__proto__, HTMLElement.prototype);
- assert_equals(unresolvedElementInDoc.__proto__, docWindow.HTMLElement.prototype);
+ assert_equals(Object.getPrototypeOf(unresolvedElement), HTMLElement.prototype);
+ assert_equals(Object.getPrototypeOf(unresolvedElementInDoc), docWindow.HTMLElement.prototype);
docWindow.customElements.define('unresolved-element', UnresolvedElement);
doc.documentElement.appendChild(unresolvedElementInDoc);
- assert_equals(unresolvedElement.__proto__, HTMLElement.prototype);
- assert_equals(unresolvedElementInDoc.__proto__, UnresolvedElement.prototype);
+ assert_equals(Object.getPrototypeOf(unresolvedElement), HTMLElement.prototype);
+ assert_equals(Object.getPrototypeOf(unresolvedElementInDoc), UnresolvedElement.prototype);
});
}, 'Inserting an unresolved custom element into ' + documentName + ' must enqueue a custom element upgrade reaction');
@@ -153,13 +153,13 @@
var unresolvedElementInDoc = doc.createElement('unresolved-element');
doc.documentElement.appendChild(unresolvedElementInDoc);
- assert_equals(unresolvedElement.__proto__, HTMLElement.prototype);
- assert_equals(unresolvedElementInDoc.__proto__, docWindow.HTMLElement.prototype);
+ assert_equals(Object.getPrototypeOf(unresolvedElement), HTMLElement.prototype);
+ assert_equals(Object.getPrototypeOf(unresolvedElementInDoc), docWindow.HTMLElement.prototype);
docWindow.customElements.define('unresolved-element', UnresolvedElement);
- assert_equals(unresolvedElement.__proto__, HTMLElement.prototype);
- assert_equals(unresolvedElementInDoc.__proto__, UnresolvedElement.prototype);
+ assert_equals(Object.getPrototypeOf(unresolvedElement), HTMLElement.prototype);
+ assert_equals(Object.getPrototypeOf(unresolvedElementInDoc), UnresolvedElement.prototype);
});
}, '"define" in ' + documentName + ' must enqueue a custom element upgrade reaction on a connected unresolved custom element');
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/w3c-import.log (279226 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/w3c-import.log 2021-06-24 15:31:22 UTC (rev 279226)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/w3c-import.log 2021-06-24 15:33:10 UTC (rev 279227)
@@ -29,10 +29,14 @@
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/custom-element-reaction-queue.html
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/customized-built-in-constructor-exceptions.html
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/disconnected-callbacks.html
+/LayoutTests/imported/w3c/web-platform-tests/custom-elements/element-internals-shadowroot.html
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/historical.html
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/microtasks-and-constructors.html
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/perform-microtask-checkpoint-before-construction.html
+/LayoutTests/imported/w3c/web-platform-tests/custom-elements/prevent-extensions-crash.html
+/LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined-print-expected.html
+/LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined-print.html
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined.html
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/range-and-constructors.html
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/reaction-timing.html
@@ -39,3 +43,4 @@
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html
/LayoutTests/imported/w3c/web-platform-tests/custom-elements/upgrading.html
+/LayoutTests/imported/w3c/web-platform-tests/custom-elements/xhtml-crash.xhtml
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/xhtml-crash.xhtml (0 => 279227)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/xhtml-crash.xhtml (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/custom-elements/xhtml-crash.xhtml 2021-06-24 15:33:10 UTC (rev 279227)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <script>
+ customElements.define('custom-el-1',
+ class extends HTMLElement {
+ constructor () {
+ super()
+ this.attachShadow({ mode: 'open' })
+ this.shadowRoot.innerHTML = '<span/>'
+ }
+ })
+ </script>
+</head>
+<body>
+<custom-el-1/>