Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit ea03394

Browse files
domenicjgraham
authored andcommitted
Bug 1557368 [wpt PR 16856] - Update error type test for attachInternals(), a=testonly
Automatic update from web-platform-tests Update error type test for attachInternals() (#16856) Follows latest developments in whatwg/html#4324. -- wp5At-commits: dc4519e0a9b6a0b5f53e622a31b420cb22d3a100 wpt-pr: 16856
1 parent 5746045 commit ea03394

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

testing/web-platform/tests/custom-elements/HTMLElement-attachInternals.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414
let element = new MyElement1();
1515
assert_true(element.attachInternals() instanceof ElementInternals,
1616
'New - 1st call');
17-
assert_throws('InvalidStateError', () => { element.attachInternals(); },
17+
assert_throws('NotSupportedError', () => { element.attachInternals(); },
1818
'New - 2nd call');
1919

2020
element = document.createElement('my-element1');
2121
assert_true(element.attachInternals() instanceof ElementInternals,
2222
'createElement - 1st call');
23-
assert_throws('InvalidStateError', () => { element.attachInternals(); },
23+
assert_throws('NotSupportedError', () => { element.attachInternals(); },
2424
'createElement - 2nd call');
2525

2626
container.innerHTML = '<my-element1></my-element1>';
2727
assert_true(container.firstChild.attachInternals() instanceof ElementInternals,
2828
'Parser - 1st call');
29-
assert_throws('InvalidStateError', () => {
29+
assert_throws('NotSupportedError', () => {
3030
container.firstChild.attachInternals();
3131
}, 'Parser - 2nd call');
3232
}, 'Successful attachInternals() and the second call.');
@@ -41,17 +41,17 @@
4141

4242
test(() => {
4343
const builtin = document.createElement('div');
44-
assert_throws('InvalidStateError', () => { builtin.attachInternals() });
44+
assert_throws('NotSupportedError', () => { builtin.attachInternals() });
4545

4646
const doc = document.implementation.createDocument('foo', null);
4747
const span = doc.appendChild(doc.createElementNS('http://www.w3.org/1999/xhtml', 'html:span'));
4848
assert_true(span instanceof HTMLElement);
49-
assert_throws('InvalidStateError', () => { span.attachInternals(); });
49+
assert_throws('NotSupportedError', () => { span.attachInternals(); });
5050

5151
const undefinedCustom = document.createElement('undefined-element');
52-
assert_throws('InvalidStateError', () => { undefinedCustom.attachInternals() });
52+
assert_throws('NotSupportedError', () => { undefinedCustom.attachInternals() });
5353
}, 'If a custom element definition for the local name of the element doesn\'t' +
54-
' exist, throw an InvalidStateError');
54+
' exist, throw an NotSupportedError');
5555

5656
test(() => {
5757
class MyElement2 extends HTMLElement {

0 commit comments

Comments
 (0)