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

@annevk commented on this pull request.



>  
 <ol>
  <li><p>Set <var>event</var>'s <a>dispatch flag</a>.
 
  <li>
   <p>Let <var>targetOverride</var> be <var>target</var>, if <var>legacy target override flag</var>
-  is not given, and <var>target</var>'s <a>associated <code>Document</code></a> otherwise.
+  is true, and <var>target</var>'s <a>associated <code>Document</code></a> otherwise.

This should be false. But if we're going to change this we should also change it away from being a flag. Hmm.

It also seems you are referencing these flags from HTML but haven't turned them into `<dfn>`s here.

> @@ -1765,7 +1765,8 @@ string <var>phase</var>, a boolean <var>invocationTargetInShadowTree</var>, and
 <div algorithm>
 <p>To <dfn export id=concept-event-fire>fire an event</dfn> named <var>e</var> at <var>target</var>,
 optionally using an <var>eventConstructor</var>, with a description of how IDL attributes are to be
-initialized, and a <var>legacy target override flag</var>, run these steps:
+initialized, an optional boolean <var>legacy target override flag</var> (default false), and an
+optional {{EventTarget}} <var>relatedTarget</var>:

```suggestion
optional {{EventTarget}} object <var>relatedTarget</var>:
```

> @@ -1776,14 +1777,17 @@ initialized, and a <var>legacy target override flag</var>, run these steps:
 
  <li><p>Initialize <var>event</var>'s {{Event/type}} attribute to <var>e</var>.
 
+ <li><p>If <var>relatedTarget</var> is given, then set <var>event</var>'s <a
+ for=Event>relatedTarget</a> to <var>relatedTarget</var>.

Might be easier to use (default null) above and then always set here?

> @@ -6705,6 +6714,12 @@ 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>.

I think this getter and setter should appear before `host`. Also in the IDL. We should keep the order consistent across all the places we introduce this concept.

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

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

Received on Tuesday, 25 August 2026 07:24:01 UTC