From 1693576b4b0302a345a80f812e859b03ba01ddd2 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 16 Dec 2024 16:53:07 +0100 Subject: [PATCH] Editorial: add a concept for Window's CustomElementRegistry --- source | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/source b/source index 0553c000382..9448016b5ea 100644 --- a/source +++ b/source @@ -12041,8 +12041,8 @@ console.assert(el.constructor === Element); overridden constructor steps:

    -
  1. Let registry be the current global object's - CustomElementRegistry object.

  2. +
  3. Let registry be current global object's custom element registry.

  4. If NewTarget is equal to the active function @@ -12065,23 +12065,25 @@ document.createElement("bad-1"); // (2)

  5. -

    Let definition be the entry in registry with Let definition be the item in registry's custom element + definition set with constructor equal to - NewTarget. If there is no such definition, then throw a TypeError.

    + NewTarget. If there is no such item, then throw a TypeError.

    -

    Since there can be no entry in registry with a Since there can be no item in registry's custom element + definition set with a constructor of undefined, this step also prevents HTML element constructors from being called as functions (since in that case NewTarget will be undefined).

  6. -
  7. Let is value be null.

  8. +
  9. Let isValue be null.

  10. If definition's local name is equal to definition's name (i.e., definition is for - an autonomous custom element), then:

    + an autonomous custom element):

    1. @@ -12130,7 +12132,7 @@ document.createElement("bad-1"); // (2)
    2. -
    3. Set is value to definition's

      Set isValue to definition's name.

  11. @@ -12138,7 +12140,7 @@ document.createElement("bad-1"); // (2)
  12. If definition's construction stack is - empty, then:

    + empty:

    1. Let element be the result of element definition to definition.

    2. Set element's is value to is value.

    3. + data-x="">is value to isValue.

    4. Return element.

    @@ -72625,7 +72627,7 @@ document.body.append(parent); null, then return null.

  13. Let registry be document's relevant global object's - CustomElementRegistry object.

  14. + custom element registry.

  15. If registry's custom element definition set contains an item with The CustomElementRegistry interface -

    Each Window object is associated with a unique instance of a - CustomElementRegistry object, allocated when the Window object is - created.

    +

    Each Window object has an associated custom element registry (a + CustomElementRegistry object). It is set to a new + CustomElementRegistry object when the Window object is created.

    Custom element registries are associated with Window objects, instead of Document objects, since each custom element constructor inherits from