From 39ec6925e85b56c41f19f5bcb7f013c47be2a404 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Wed, 14 Feb 2024 19:24:01 -0800 Subject: [PATCH] Modify the logic for double-declarative shadow root attachment Per the discussion at https://github.com/whatwg/dom/issues/1235, this PR makes the *first* declarative shadow root "win". Prior behavior was for the *last* one to remain, but this PR changes second and subsequent declarative shadow roots to report an exception instead. --- source | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/source b/source index 9b91774e979..a37c3b578d1 100644 --- a/source +++ b/source @@ -126151,26 +126151,20 @@ document.body.appendChild(text); data-x="attr-template-shadowrootdelegatesfocus">shadowrootdelegatesfocus attribute; otherwise false.

-
  • Attach a shadow root with - declarative shadow host element, mode, clonable, - delegatesFocus, and "named".

  • +
  • If declarative shadow host element is a shadow host, then + insert an element at the adjusted insertion location with + template.

  • -

    If an exception was thrown by attach a - shadow root, then catch it, and run these steps:

    +

    Otherwise:

      -
    1. Report the exception.

    2. +
    3. Attach a shadow root with + declarative shadow host element, mode, clonable, + delegatesFocus, and "named". If an exception is thrown, + then catch it, report the exception, insert an element at the adjusted + insertion location with template, and return.

    4. -
    5. Insert an element at the adjusted insertion location with - template.

    6. -
    -
  • - -
  • -

    Otherwise:

    - -
    1. Let shadow be declarative shadow host element's shadow root.