Skip to content
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

Editorial: initialize clearTargets in event dispatch correctly #1347

Open
wants to merge 1 commit 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
32 changes: 17 additions & 15 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ first <a>following</a> <a for=tree>sibling</a> or null if it has no <a for=tree>

<li><p>Let <var>tokens</var> be a new <a>ordered set</a>.

<li><p><a for=list>For each</a> <var>token</var> in <var>inputTokens</var>, <a for=set>append</a>
<li><p><a for=list>For each</a> <var>token</var> of <var>inputTokens</var>, <a for=set>append</a>
<var>token</var> to <var>tokens</var>.

<li>Return <var>tokens</var>.
Expand Down Expand Up @@ -894,7 +894,7 @@ correct defaults.</p>
<a>relative high resolution coarse time</a> given <var>time</var> and <var>event</var>'s
<a>relevant global object</a>.

<li><p><a for=map>For each</a> <var>member</var> → <var>value</var> in <var>dictionary</var>, if
<li><p><a for=map>For each</a> <var>member</var> → <var>value</var> of <var>dictionary</var>, if
<var>event</var> has an attribute whose <a spec=webidl>identifier</a> is <var>member</var>, then
initialize that attribute to <var>value</var>.

Expand Down Expand Up @@ -1305,6 +1305,8 @@ property of the event being dispatched.
<li><p>Let <var>relatedTarget</var> be the result of <a>retargeting</a> <var>event</var>'s
<a for=Event>relatedTarget</a> against <var>target</var>.

<li><p>Let <var>clearTargets</var> be false.

<li>
<p>If <var>target</var> is not <var>relatedTarget</var> or <var>target</var> is <var>event</var>'s
<a for=Event>relatedTarget</a>:
Expand Down Expand Up @@ -1405,18 +1407,17 @@ property of the event being dispatched.
<li><p>Let <var>clearTargetsStruct</var> be the last struct in <var>event</var>'s
<a for=Event>path</a> whose <a for=Event/path>shadow-adjusted target</a> is non-null.

<li><p>Let <var>clearTargets</var> be true if <var>clearTargetsStruct</var>'s
<a for=Event/path>shadow-adjusted target</a>, <var>clearTargetsStruct</var>'s
<a for=Event/path>relatedTarget</a>, or an {{EventTarget}} object in
<var>clearTargetsStruct</var>'s <a for=Event/path>touch target list</a> is a <a for=/>node</a>
and its <a for=tree>root</a> is a <a for=/>shadow root</a>; otherwise false.
<li><p>If <var>clearTargetsStruct</var>'s <a for=Event/path>shadow-adjusted target</a>,
<var>clearTargetsStruct</var>'s <a for=Event/path>relatedTarget</a>, or an {{EventTarget}} object
in <var>clearTargetsStruct</var>'s <a for=Event/path>touch target list</a> is a <a for=/>node</a>
whose <a for=tree>root</a> is a <a for=/>shadow root</a>: set <var>clearTargets</var> to true.

<li><p>If <var>activationTarget</var> is non-null and <var>activationTarget</var> has
<a for=EventTarget>legacy-pre-activation behavior</a>, then run <var>activationTarget</var>'s
<a for=EventTarget>legacy-pre-activation behavior</a>.

<li>
<p><a for=list>For each</a> <var>struct</var> in <var>event</var>'s <a for=Event>path</a>, in
<p><a for=list>For each</a> <var>struct</var> of <var>event</var>'s <a for=Event>path</a>, in
reverse order:

<ol>
Expand All @@ -1431,7 +1432,7 @@ property of the event being dispatched.
</ol>

<li>
<p><a for=list>For each</a> <var>struct</var> in <var>event</var>'s <a for=Event>path</a>:
<p><a for=list>For each</a> <var>struct</var> of <var>event</var>'s <a for=Event>path</a>:

<ol>
<li><p>If <var>struct</var>'s <a for=Event/path>shadow-adjusted target</a> is non-null, then
Expand Down Expand Up @@ -1591,7 +1592,7 @@ and an optional <var>legacyOutputDidListenersThrowFlag</var>, run these steps:
<li><p>Let <var>found</var> be false.

<li>
<p><a for=list>For each</a> <var>listener</var> in <var>listeners</var>, whose
<p><a for=list>For each</a> <var>listener</var> of <var>listeners</var>, whose
<a for="event listener">removed</a> is false:

<ol>
Expand Down Expand Up @@ -4802,7 +4803,7 @@ steps are:

<ol>
<li>
<p><a for=list>For each</a> <var>attr</var> in <var>node2</var>'s
<p><a for=list>For each</a> <var>attr</var> of <var>node2</var>'s
<a for=Element>attribute list</a>:

<ol>
Expand Down Expand Up @@ -7370,7 +7371,7 @@ steps:
<li>
<p>If this {{NamedNodeMap}} object's <a for=NamedNodeMap>element</a> is in the
<a>HTML namespace</a> and its <a for=Node>node document</a> is an <a>HTML document</a>, then
<a for=list>for each</a> <var>name</var> in <var>names</var>:
<a for=list>for each</a> <var>name</var> of <var>names</var>:

<ol>
<li><p>Let <var>lowercaseName</var> be <var>name</var>, in <a>ASCII lowercase</a>.
Expand Down Expand Up @@ -10050,7 +10051,7 @@ method steps are:

<ol>
<li>
<p><a for=list>For each</a> <var>token</var> in <var>tokens</var>:
<p><a for=list>For each</a> <var>token</var> of <var>tokens</var>:

<ol>
<li><p>If <var>token</var> is the empty string, then <a>throw</a> a "{{SyntaxError!!exception}}"
Expand All @@ -10060,7 +10061,7 @@ method steps are:
"{{InvalidCharacterError!!exception}}" {{DOMException}}.
</ol>

<li><p><a for=list>For each</a> <var>token</var> in <var>tokens</var>, <a for=set>append</a>
<li><p><a for=list>For each</a> <var>token</var> of <var>tokens</var>, <a for=set>append</a>
<var>token</var> to <a>this</a>'s <a>token set</a>.

<li><p>Run the <a>update steps</a>.
Expand All @@ -10072,7 +10073,7 @@ method steps are:

<ol>
<li>
<p><a for=list>For each</a> <var>token</var> in <var>tokens</var>:
<p><a for=list>For each</a> <var>token</var> of <var>tokens</var>:

<ol>
<li><p>If <var>token</var> is the empty string, then <a>throw</a> a "{{SyntaxError!!exception}}"
Expand Down Expand Up @@ -10549,6 +10550,7 @@ Sergey G. Grekhov,
Shiki Okasaka,
Shinya Kawanaka,
Simon Pieters,
Simon Wülker,
Stef Busking,
Steve Byrne,
Stig Halvorsen,
Expand Down