From 7a7de8cf9e46de1a2537633034f08ff9f066ebb8 Mon Sep 17 00:00:00 2001 From: Kent Tamura Date: Tue, 29 Jan 2019 14:58:32 +0900 Subject: [PATCH 1/2] html,custom-elements: Add tests for HTMLElement.attachInternals() Specification PR: https://github.com/whatwg/html/pull/4324 --- .../HTMLElement-attachInternals.html | 82 +++++++++++++++++++ interfaces/html.idl | 7 ++ 2 files changed, 89 insertions(+) create mode 100644 custom-elements/HTMLElement-attachInternals.html diff --git a/custom-elements/HTMLElement-attachInternals.html b/custom-elements/HTMLElement-attachInternals.html new file mode 100644 index 00000000000000..6ffbb913d62a7c --- /dev/null +++ b/custom-elements/HTMLElement-attachInternals.html @@ -0,0 +1,82 @@ + + + + + +
+ + diff --git a/interfaces/html.idl b/interfaces/html.idl index 46d0b852f095a6..3a8af03f828628 100644 --- a/interfaces/html.idl +++ b/interfaces/html.idl @@ -114,6 +114,8 @@ interface HTMLElement : Element { [CEReactions] attribute DOMString autocapitalize; [CEReactions] attribute [TreatNullAs=EmptyString] DOMString innerText; + + ElementInternals attachInternals(); }; HTMLElement includes GlobalEventHandlers; @@ -1408,6 +1410,11 @@ dictionary ElementDefinitionOptions { DOMString extends; }; +[Exposed=Window] +interface ElementInternals { + +}; + dictionary FocusOptions { boolean preventScroll = false; }; From 43b7b021c3bff4835670001dc7bc13d926e15d85 Mon Sep 17 00:00:00 2001 From: Kent Tamura Date: Tue, 5 Feb 2019 17:24:04 +0900 Subject: [PATCH 2/2] 'my-element' => 'undefined-element' --- custom-elements/HTMLElement-attachInternals.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom-elements/HTMLElement-attachInternals.html b/custom-elements/HTMLElement-attachInternals.html index 6ffbb913d62a7c..e537983059054e 100644 --- a/custom-elements/HTMLElement-attachInternals.html +++ b/custom-elements/HTMLElement-attachInternals.html @@ -48,7 +48,7 @@ assert_true(span instanceof HTMLElement); assert_throws('InvalidStateError', () => { span.attachInternals(); }); - const undefinedCustom = document.createElement('my-element'); + const undefinedCustom = document.createElement('undefined-element'); assert_throws('InvalidStateError', () => { undefinedCustom.attachInternals() }); }, 'If a custom element definition for the local name of the element doesn\'t' + ' exist, throw an InvalidStateError');