Re: [whatwg/dom] Add reference target to shadow root (PR #1353)

@annevk commented on this pull request.



> @@ -6603,10 +6611,22 @@ is null.
 <hr>
 
 <p>A <a for=/>shadow root</a>'s <a>get the parent</a> algorithm, given an <var>event</var>, returns
-null if <var>event</var>'s <a>composed flag</a> is unset and <a for=/>shadow root</a> is the
-<a for=tree>root</a> of <var>event</var>'s <a for=Event>path</a>'s first struct's
-<a for=Event/path>invocation target</a>; otherwise <a for=/>shadow root</a>'s
-<a for=DocumentFragment>host</a>.
+the result of the following steps:</p>
+
+<ol>
+ <li><p>If <var>event</var>’s <a>composed flag</a> is set, return <a for=/>shadow root</a>’s

Now that we're making this a proper algorithm we should make _shadowRoot_ a variable in the introduction as I don't think we can use "this" here.

> @@ -6603,10 +6611,22 @@ is null.
 <hr>
 
 <p>A <a for=/>shadow root</a>'s <a>get the parent</a> algorithm, given an <var>event</var>, returns
-null if <var>event</var>'s <a>composed flag</a> is unset and <a for=/>shadow root</a> is the
-<a for=tree>root</a> of <var>event</var>'s <a for=Event>path</a>'s first struct's
-<a for=Event/path>invocation target</a>; otherwise <a for=/>shadow root</a>'s
-<a for=DocumentFragment>host</a>.
+the result of the following steps:</p>
+
+<ol>
+ <li><p>If <var>event</var>’s <a>composed flag</a> is set, return <a for=/>shadow root</a>’s
+ <a for=DocumentFragment>host</a>.</p></li>
+ <li><p>Let <var>target</var> be <var>event</var>’s <a for=Event>path</a>'s first struct's

The `<li>`s are separated by newlines.

> @@ -6603,10 +6611,22 @@ is null.
 <hr>
 
 <p>A <a for=/>shadow root</a>'s <a>get the parent</a> algorithm, given an <var>event</var>, returns
-null if <var>event</var>'s <a>composed flag</a> is unset and <a for=/>shadow root</a> is the
-<a for=tree>root</a> of <var>event</var>'s <a for=Event>path</a>'s first struct's
-<a for=Event/path>invocation target</a>; otherwise <a for=/>shadow root</a>'s
-<a for=DocumentFragment>host</a>.
+the result of the following steps:</p>
+
+<ol>
+ <li><p>If <var>event</var>’s <a>composed flag</a> is set, return <a for=/>shadow root</a>’s

then return* (applies multiple times)

> @@ -6603,10 +6611,22 @@ is null.
 <hr>
 
 <p>A <a for=/>shadow root</a>'s <a>get the parent</a> algorithm, given an <var>event</var>, returns
-null if <var>event</var>'s <a>composed flag</a> is unset and <a for=/>shadow root</a> is the
-<a for=tree>root</a> of <var>event</var>'s <a for=Event>path</a>'s first struct's
-<a for=Event/path>invocation target</a>; otherwise <a for=/>shadow root</a>'s
-<a for=DocumentFragment>host</a>.
+the result of the following steps:</p>
+
+<ol>
+ <li><p>If <var>event</var>’s <a>composed flag</a> is set, return <a for=/>shadow root</a>’s
+ <a for=DocumentFragment>host</a>.</p></li>
+ <li><p>Let <var>target</var> be <var>event</var>’s <a for=Event>path</a>'s first struct's

Can we use path[0] here?

> @@ -6628,6 +6648,10 @@ null if <var>event</var>'s <a>composed flag</a> is unset and <a for=/>shadow roo
 <p>The <dfn attribute for=ShadowRoot><code>host</code></dfn> getter steps are to return
 <a>this</a>'s <a for=DocumentFragment>host</a>.
 
+<p>The <dfn attribute for=ShadowRoot><code>referenceTarget</code></dfn> getter steps are to return
+<a>this</a>'s <a for=ShadowRoot>reference target</a>. The {{ShadowRoot/referenceTarget}} setter
+steps are to set <a>this</a>'s <a for=ShadowRoot>reference target</a> to the given value.

These should be separate paragraphs.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1353#pullrequestreview-4329567637
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/pull/1353/review/4329567637@github.com>

Received on Wednesday, 20 May 2026 14:52:57 UTC