From e06f9031447d5afbc1d7469432a0df54de23a60d Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Tue, 4 Feb 2025 20:13:45 +0000 Subject: [PATCH] Add reference target to shadow root --- dom.bs | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/dom.bs b/dom.bs index 8645c1ff4..12e58fb52 100644 --- a/dom.bs +++ b/dom.bs @@ -4587,8 +4587,9 @@ and an optional document docume
  • Attach a shadow root with copy, node's shadow root's mode, true, node's shadow root's serializable, node's - shadow root's delegates focus, and node's - shadow root's slot assignment. + shadow root's delegates focus, node's + shadow root's slot assignment, and node's + shadow root's reference target.

  • Set copy's shadow root's declarative to node's shadow root's declarative. @@ -6057,6 +6058,7 @@ interface ShadowRoot : DocumentFragment { readonly attribute boolean clonable; readonly attribute boolean serializable; readonly attribute Element host; + attribute DOMString? referenceTarget; attribute EventHandler onslotchange; }; @@ -6092,6 +6094,9 @@ It is initially set to false.

    Shadow roots have an associated serializable (a boolean). It is initially set to false.

    +

    Shadow roots have an associated reference target. +It is initially set to null.

    +

    A shadow root's get the parent algorithm, given an event, returns null if event's composed flag is unset and shadow root is the root of event's path's first struct's @@ -6116,6 +6121,12 @@ null if event's composed flag is unset and shadow roo

    The host getter steps are to return this's host. +

    The referenceTarget getter steps are to return +this's reference target. + +

    The {{ShadowRoot/referenceTarget}} setter steps are to set +this's reference target to the given value. +

    The onslotchange attribute is an event handler IDL attribute for the onslotchange event handler, whose @@ -6246,6 +6257,7 @@ dictionary ShadowRootInit { SlotAssignmentMode slotAssignment = "named"; boolean clonable = false; boolean serializable = false; + DOMString? referenceTarget = null; }; @@ -7099,8 +7111,9 @@ are:

  • Run attach a shadow root with this, init["{{ShadowRootInit/mode}}"], init["{{ShadowRootInit/clonable}}"], init["{{ShadowRootInit/serializable}}"], - init["{{ShadowRootInit/delegatesFocus}}"], and - init["{{ShadowRootInit/slotAssignment}}"]. + init["{{ShadowRootInit/delegatesFocus}}"], + init["{{ShadowRootInit/slotAssignment}}"], and + init["{{ShadowRootInit/referenceTarget}}"].

  • Return this's shadow root. @@ -7109,8 +7122,8 @@ are:

    To attach a shadow root, given an element element, a string mode, a boolean clonable, -a boolean serializable, a boolean delegatesFocus, and a string -slotAssignment: +a boolean serializable, a boolean delegatesFocus, a string +slotAssignment, and null or a string referenceTarget:

    1. If element's namespace is not the HTML namespace, @@ -7178,6 +7191,8 @@ a boolean serializable, a boolean delegatesFocus, and a st

    2. Set shadow's slot assignment to slotAssignment. +

    3. Set shadow's reference target to referenceTarget. +

    4. Set shadow's declarative to false.

    5. Set shadow's clonable to clonable.