Skip to content

Improve CommandEvent and ToggleEvent source retargeting #11345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -80593,11 +80593,10 @@ dictionary <dfn dictionary>ToggleEventInit</dfn> : <span>EventInit</span> {
data-x="dom-ToggleEvent-newState">newState</code></dfn> attributes must return the values they are
initialized to.</p>

<p>The <dfn attribute for="ToggleEvent"><code
data-x="dom-ToggleEvent-source">source</code></dfn> getter steps are to return the result of
<span data-x="dom-retarget">retargeting</span> <code
data-x="dom-ToggleEvent-source">source</code> against <span>this</span>'s <code
data-x="dom-Event-currentTarget">currentTarget</code>.</p>
<p>The <dfn attribute for="ToggleEvent"><code data-x="dom-ToggleEvent-source">source</code></dfn>
getter steps are to return the result of <span>retarget against an event</span> given
<span>this</span> and <span>this</span>'s <code
data-x="dom-ToggleEvent-source">source</code>.</p>

<p class="XXX"><a href="https://github.com/whatwg/dom/issues/1328">DOM standard issue #1328</a>
tracks how to better standardize associated event data in a way which makes sense on Events.
Expand Down Expand Up @@ -80651,15 +80650,25 @@ dictionary <dfn dictionary>CommandEventInit</dfn> : <span>EventInit</span> {

<p>The <dfn attribute
for="CommandEvent"><code data-x="dom-CommandEvent-source">source</code></dfn> getter steps are to
return the result of <span data-x="dom-retarget">retargeting</span> <code
data-x="dom-CommandEvent-source">source</code> against <span>this</span>'s <code
data-x="dom-Event-currentTarget">currentTarget</code>.</p>
return the result of <span>retarget against an event</span> given <span>this</span> and
<span>this</span>'s <code data-x="dom-CommandEvent-source">source</code>.</p>

<p class="XXX"><a href="https://github.com/whatwg/dom/issues/1328">DOM standard issue #1328</a>
tracks how to better standardize associated event data in a way which makes sense on Events.
Currently an event attribute initialized to a value cannot also have a getter, and so an internal
slot (or map of additional fields) is required to properly specify this.</p>

<p>To <dfn>retarget against an event</dfn>, given an <code>Event</code> <var>event</var> and a
<code>Node</code> <var>node</var>:</p>

<ol>
<li><p>If <var>event</var>'s <span data-x="concept-event-target">target</span> is null, then
return null.</p></li>

<li><p>Return the result of <span data-x="dom-retarget">retargeting</span> <var>node</var>
against <var>event</var>'s <span data-x="concept-event-target">target</span>.</p></li>
</ol>

<h3>Focus</h3>

<!-- https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2807 -->
Expand Down