Skip to content

Commit 9b41097

Browse files
committed
Improve CommandEvent.source retargeting
This change prevents CommandEvent.source from leaking nodes across shadow boundaries. More context here: whatwg#11255 (comment)
1 parent fd08f81 commit 9b41097

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

source

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80565,10 +80565,21 @@ dictionary <dfn dictionary>CommandEventInit</dfn> : <span>EventInit</span> {
8056580565
initialized to.</p>
8056680566

8056780567
<p>The <dfn attribute
80568-
for="CommandEvent"><code data-x="dom-CommandEvent-source">source</code></dfn> getter steps are to
80569-
return the result of <span data-x="dom-retarget">retargeting</span> <code
80570-
data-x="dom-CommandEvent-source">source</code> against <span>this</span>'s <code
80571-
data-x="dom-Event-currentTarget">currentTarget</code>.</p>
80568+
for="CommandEvent"><code data-x="dom-CommandEvent-source">source</code></dfn> getter steps
80569+
are:</p>
80570+
80571+
<ol>
80572+
<li><p>Let <var>retargetAgainst</var> be <span>this</span>'s <code
80573+
data-x="dom-Event-currentTarget">currentTarget</code>.</p></li>
80574+
80575+
<li><p>If <var>retargetAgainst</var> is null, then set <var>retargetAgainst</var> to
80576+
<span>this</span>'s <span data-x="concept-event-target">target</span>.</p></li>
80577+
80578+
<li><p>If <var>retargetAgainst</var> is null, then return null.</p></li>
80579+
80580+
<li><p>Return the result of <span data-x="dom-retarget">retargeting</span> <code
80581+
data-x="dom-CommandEvent-source">source</code> against <var>retargetAgainst</var>.</p></li>
80582+
</ol>
8057280583

8057380584
<p class="XXX"><a href="https://github.com/whatwg/dom/issues/1328">DOM standard issue #1328</a>
8057480585
tracks how to better standardize associated event data in a way which makes sense on Events.

0 commit comments

Comments
 (0)