From 2506df2706065814e7ddf27cb141708afbf9ceef Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Wed, 15 May 2019 15:01:58 -0400 Subject: [PATCH] Update error type test for attachInternals() Follows latest developments in https://github.com/whatwg/html/pull/4324. --- custom-elements/HTMLElement-attachInternals.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/custom-elements/HTMLElement-attachInternals.html b/custom-elements/HTMLElement-attachInternals.html index e537983059054e..22c9545215c8d9 100644 --- a/custom-elements/HTMLElement-attachInternals.html +++ b/custom-elements/HTMLElement-attachInternals.html @@ -14,19 +14,19 @@ let element = new MyElement1(); assert_true(element.attachInternals() instanceof ElementInternals, 'New - 1st call'); - assert_throws('InvalidStateError', () => { element.attachInternals(); }, + assert_throws('NotSupportedError', () => { element.attachInternals(); }, 'New - 2nd call'); element = document.createElement('my-element1'); assert_true(element.attachInternals() instanceof ElementInternals, 'createElement - 1st call'); - assert_throws('InvalidStateError', () => { element.attachInternals(); }, + assert_throws('NotSupportedError', () => { element.attachInternals(); }, 'createElement - 2nd call'); container.innerHTML = ''; assert_true(container.firstChild.attachInternals() instanceof ElementInternals, 'Parser - 1st call'); - assert_throws('InvalidStateError', () => { + assert_throws('NotSupportedError', () => { container.firstChild.attachInternals(); }, 'Parser - 2nd call'); }, 'Successful attachInternals() and the second call.'); @@ -41,17 +41,17 @@ test(() => { const builtin = document.createElement('div'); - assert_throws('InvalidStateError', () => { builtin.attachInternals() }); + assert_throws('NotSupportedError', () => { builtin.attachInternals() }); const doc = document.implementation.createDocument('foo', null); const span = doc.appendChild(doc.createElementNS('http://www.w3.org/1999/xhtml', 'html:span')); assert_true(span instanceof HTMLElement); - assert_throws('InvalidStateError', () => { span.attachInternals(); }); + assert_throws('NotSupportedError', () => { span.attachInternals(); }); const undefinedCustom = document.createElement('undefined-element'); - assert_throws('InvalidStateError', () => { undefinedCustom.attachInternals() }); + assert_throws('NotSupportedError', () => { undefinedCustom.attachInternals() }); }, 'If a custom element definition for the local name of the element doesn\'t' + - ' exist, throw an InvalidStateError'); + ' exist, throw an NotSupportedError'); test(() => { class MyElement2 extends HTMLElement {