Skip to content

Commit

Permalink
Fix and clarify firing traverse navigate events
Browse files Browse the repository at this point in the history
Some call sites were not correct in how they specified the target Navigation object. Also, add an assert about userInvolvementForNavigateEvents, and make a very long condition clause into a bulleted list.
  • Loading branch information
ADKaster authored Feb 9, 2024
1 parent 5b5c167 commit 12b0d58
Showing 1 changed file with 33 additions and 11 deletions.
44 changes: 33 additions & 11 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -99033,8 +99033,8 @@ location.href = '#foo';</code></pre>

<li><p>Let <var>navigateEventResult</var> be the result of <span data-x="fire a traverse
navigate event">firing a traverse <code data-x="event-navigate">navigate</code>
event</span> at a <code>Navigation</code> <var>navigation</var> given
<var>targetEntry</var> and <var>userInvolvementForNavigateEvent</var>.</p></li>
event</span> at <var>navigation</var> given <var>targetEntry</var> and
<var>userInvolvementForNavigateEvent</var>.</p></li>

<li><p>If <var>navigateEventResult</var> is false, then set <var>finalStatus</var> to
"<code data-x="">canceled-by-navigate</code>".</p></li>
Expand Down Expand Up @@ -100883,15 +100883,37 @@ location.href = '#foo';</code></pre>
data-x="she-document-state">document state</span>'s <span
data-x="document-state-origin">origin</span>.</p></li>

<li id="descendant-navigable-traversal-navigate-events"><p>If <var>navigable</var> is not
<var>traversable</var>, and <var>targetEntry</var> is not <var>navigable</var>'s <span
data-x="nav-current-history-entry">current session history entry</span>, and
<var>oldOrigin</var> is the <span data-x="same origin">same</span> as <var>navigable</var>'s
<span data-x="nav-current-history-entry">current session history entry</span>'s <span
data-x="she-document-state">document state</span>'s <span
data-x="document-state-origin">origin</span>, then <span>fire a traverse <code
data-x="event-navigate">navigate</code> event</span> given <var>targetEntry</var> and
<var>userInvolvementForNavigateEvents</var>.</p></li>
<li id="descendant-navigable-traversal-navigate-events">
<p>If all of the following are true:</p>

<ul>
<li><p><var>navigable</var> is not <var>traversable;</var></p></li>

<li><p><var>targetEntry</var> is not <var>navigable</var>'s <span
data-x="nav-current-history-entry">current session history entry</span>; and</p></li>

<li><p><var>oldOrigin</var> is the <span data-x="same origin">same</span> as
<var>navigable</var>'s <span
data-x="nav-current-history-entry">current session history entry</span>'s <span
data-x="she-document-state">document state</span>'s <span
data-x="document-state-origin">origin</span>,</p></li>
</ul>

<p>then:</p>

<ol>
<li><p><span>Assert</span>: <var>userInvolvementForNavigateEvents</var> is not
null.</p></li>

<li><p>Let <var>navigation</var> be <var>navigable</var>'s <span
data-x="nav-window">active window</span>'s <span
data-x="window-navigation-api">navigation API.</span></p></li>

<li><p><span>Fire a traverse <code data-x="event-navigate">navigate</code> event</span> at
<var>navigation</var> given <var>targetEntry</var> and
<var>userInvolvementForNavigateEvents</var>.</p></li>
</ol>
</li>

<li>
<p>If <var>targetEntry</var>'s <span data-x="she-document">document</span> is null, or
Expand Down

0 comments on commit 12b0d58

Please sign in to comment.