|
14 | 14 | let element = new MyElement1(); |
15 | 15 | assert_true(element.attachInternals() instanceof ElementInternals, |
16 | 16 | 'New - 1st call'); |
17 | | - assert_throws('InvalidStateError', () => { element.attachInternals(); }, |
| 17 | + assert_throws('NotSupportedError', () => { element.attachInternals(); }, |
18 | 18 | 'New - 2nd call'); |
19 | 19 |
|
20 | 20 | element = document.createElement('my-element1'); |
21 | 21 | assert_true(element.attachInternals() instanceof ElementInternals, |
22 | 22 | 'createElement - 1st call'); |
23 | | - assert_throws('InvalidStateError', () => { element.attachInternals(); }, |
| 23 | + assert_throws('NotSupportedError', () => { element.attachInternals(); }, |
24 | 24 | 'createElement - 2nd call'); |
25 | 25 |
|
26 | 26 | container.innerHTML = '<my-element1></my-element1>'; |
27 | 27 | assert_true(container.firstChild.attachInternals() instanceof ElementInternals, |
28 | 28 | 'Parser - 1st call'); |
29 | | - assert_throws('InvalidStateError', () => { |
| 29 | + assert_throws('NotSupportedError', () => { |
30 | 30 | container.firstChild.attachInternals(); |
31 | 31 | }, 'Parser - 2nd call'); |
32 | 32 | }, 'Successful attachInternals() and the second call.'); |
|
41 | 41 |
|
42 | 42 | test(() => { |
43 | 43 | const builtin = document.createElement('div'); |
44 | | - assert_throws('InvalidStateError', () => { builtin.attachInternals() }); |
| 44 | + assert_throws('NotSupportedError', () => { builtin.attachInternals() }); |
45 | 45 |
|
46 | 46 | const doc = document.implementation.createDocument('foo', null); |
47 | 47 | const span = doc.appendChild(doc.createElementNS('http://www.w3.org/1999/xhtml', 'html:span')); |
48 | 48 | assert_true(span instanceof HTMLElement); |
49 | | - assert_throws('InvalidStateError', () => { span.attachInternals(); }); |
| 49 | + assert_throws('NotSupportedError', () => { span.attachInternals(); }); |
50 | 50 |
|
51 | 51 | const undefinedCustom = document.createElement('undefined-element'); |
52 | | - assert_throws('InvalidStateError', () => { undefinedCustom.attachInternals() }); |
| 52 | + assert_throws('NotSupportedError', () => { undefinedCustom.attachInternals() }); |
53 | 53 | }, 'If a custom element definition for the local name of the element doesn\'t' + |
54 | | - ' exist, throw an InvalidStateError'); |
| 54 | + ' exist, throw an NotSupportedError'); |
55 | 55 |
|
56 | 56 | test(() => { |
57 | 57 | class MyElement2 extends HTMLElement { |
|
0 commit comments