diff --git a/dom.bs b/dom.bs index d2af7842..3574b5fd 100644 --- a/dom.bs +++ b/dom.bs @@ -2910,17 +2910,13 @@ optional boolean suppressObservers (default f continue.
  • -

    If inclusiveDescendant is an element: +

    If inclusiveDescendant is an element and + inclusiveDescendant's custom element registry is non-null:

      -
    1. If inclusiveDescendant's custom element registry is - null, then set inclusiveDescendant's custom element registry to - the result of looking up a custom element registry given - inclusiveDescendant's parent. - -

    2. Otherwise, if inclusiveDescendant's - custom element registry's is scoped is - true, append inclusiveDescendant's node document to +

    3. If inclusiveDescendant's custom element registry's + is scoped is true, then append + inclusiveDescendant's node document to inclusiveDescendant's custom element registry's scoped document set. @@ -2937,25 +2933,13 @@ optional boolean suppressObservers (default f upgrade an element algorithm.

    -
  • -

    Otherwise, if inclusiveDescendant is a shadow root: - -

      -
    1. If inclusiveDescendant's custom element registry is - null and inclusiveDescendant's - keep custom element registry null is false, then set - inclusiveDescendant's custom element registry to the result - of looking up a custom element registry given inclusiveDescendant's - host. - -

    2. Otherwise, if inclusiveDescendant's - custom element registry is non-null and - inclusiveDescendant's custom element registry's - is scoped is true, append - inclusiveDescendant's node document to - inclusiveDescendant's custom element registry's - scoped document set. -

    +
  • Otherwise, if inclusiveDescendant is a shadow root, + inclusiveDescendant's custom element registry is non-null, and + inclusiveDescendant's custom element registry's + is scoped is true, then append + inclusiveDescendant's node document to + inclusiveDescendant's custom element registry's + scoped document set. @@ -6032,8 +6016,8 @@ algorithm is passed node and oldDocument, as

    -

    To adopt a node into a document, run -these steps: +

    To adopt a node node into a +document document:

    1. Let oldDocument be node's node document. @@ -6046,17 +6030,27 @@ these steps:

      1. -

        For each inclusiveDescendant in node's - shadow-including inclusive descendants: +

        For each inclusiveDescendant of node's + shadow-including inclusive descendants, in shadow-including tree order:

        1. Set inclusiveDescendant's node document to document. -

        2. If inclusiveDescendant is a shadow root and - inclusiveDescendant's custom element registry - is a global custom element registry, then set inclusiveDescendant's - custom element registry to document's - effective global custom element registry. +

        3. +

          If inclusiveDescendant is a shadow root and if any of the following + are true: + +

          + +

          then set inclusiveDescendant's custom element registry to + document's effective global custom element registry.

        4. Otherwise, if inclusiveDescendant is an element: @@ -6065,21 +6059,23 @@ these steps:

        5. Set the node document of each attribute in inclusiveDescendant's attribute list to document. -

        6. If inclusiveDescendant's custom element registry - is a global custom element registry, then set inclusiveDescendant's - custom element registry to document's - effective global custom element registry. +

        7. If inclusiveDescendant's custom element registry is null + or inclusiveDescendant's custom element registry's + is scoped is false, then set + inclusiveDescendant's custom element registry to + document's effective global custom element registry.

      -
    2. For each inclusiveDescendant in node's - shadow-including inclusive descendants that is custom, - enqueue a custom element callback reaction with inclusiveDescendant, callback - name "adoptedCallback", and « oldDocument, document ». +

    3. For each inclusiveDescendant of node's + shadow-including inclusive descendants that is custom, in + shadow-including tree order: enqueue a custom element callback reaction with + inclusiveDescendant, callback name "adoptedCallback", and + « oldDocument, document ». -

    4. For each inclusiveDescendant in node's - shadow-including inclusive descendants, in shadow-including tree order, run the +

    5. For each inclusiveDescendant of node's + shadow-including inclusive descendants, in shadow-including tree order: run the adopting steps with inclusiveDescendant and oldDocument.

    @@ -11074,6 +11070,7 @@ James Graham, James Greene, James M Snell, James Robinson, +Jayson Chen, Jeffrey Yasskin, Jens Lindström, Jeremy Davis,