From 16667c370e29d9be8d4e24886c27a10f0189bb11 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Mon, 28 Sep 2020 09:29:45 -0700 Subject: [PATCH] Prevent attachInternals() use before custom element constructor Change to DOM: https://github.com/whatwg/dom/pull/894. Tests: https://github.com/web-platform-tests/wpt/pull/25402. --- source | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source b/source index a0de396c3ee..9ea4370ceca 100644 --- a/source +++ b/source @@ -66871,6 +66871,9 @@ customElements.define("x-foo", class extends HTMLElement { does.

+
  • Set element's custom element state to "precustomized".

  • +
  • Let constructResult be the result of constructing C, with no @@ -66930,7 +66933,8 @@ customElements.define("x-foo", class extends HTMLElement {

    If the above steps threw an exception, then element's custom - element state will remain "failed".

    + element state will remain "failed" or "precustomized".

  • @@ -67435,6 +67439,10 @@ dictionary ValidityStateFlags {
  • If element's attached internals is true, then throw an "NotSupportedError" DOMException.

  • +
  • If element's custom element state is not "precustomized" or "custom", then throw a + "NotSupportedError" DOMException.

  • +
  • Set element's attached internals to true.

  • Create a new ElementInternals instance