Skip to content

Commit 723d6fd

Browse files
committed
Port in Jake's newest algorithm
1 parent abcc6b6 commit 723d6fd

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

spec.bs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,17 @@ spec: html; urlPrefix: https://html.spec.whatwg.org/multipage/
5050
spec: html; urlPrefix: https://whatpr.org/html/6315/
5151
type: dfn
5252
text: traversable navigable; for: navigable; url: history.html#nav-traversable
53-
text: current session history entry; for: navigable; url: history.html#nav-current-history-entry
53+
text: active session history entry; for: navigable; url: history.html#nav-active-history-entry
5454
text: get the session history entries; for: navigable; url: history.html#getting-session-history-entries
5555
text: session history traversal queue; for: traversable navigable; url: history.html#tn-session-history-traversal-queue
56+
text: current session history step; for: traversable navigable; url: history.html#tn-current-session-history-step
57+
text: get all history steps; for: traversable navigable; url: history.html#getting-all-history-steps
5658
text: step; for: session history entry; url: history.html#she-step
5759
text: apply the history step; url: history.html#apply-the-history-step
5860
text: checkForUserCancelation; for: apply the history step; url: history.html#apply-the-history-step
5961
text: initiatorToCheck; for: apply the history step; url: history.html#apply-the-history-step
62+
text: containing navigable; for: browsing context; url: browsers.html#bc-navigable
63+
text: session; for: browsing context group; url: browsers.html#bcg-session
6064
spec: uuid; type: dfn; urlPrefix: https://wicg.github.io/uuid/
6165
text: generate a random UUID; url: #dfn-generate-a-random-uuid
6266
</pre>
@@ -519,7 +523,7 @@ Each {{AppHistory}} object has an associated <dfn for="AppHistory">navigate meth
519523

520524
1. Let |navigateInfo| be |options|["{{AppHistoryNavigationOptions/navigateInfo}}"] if it [=map/exists=], or undefined otherwise.
521525

522-
1. Let |navigable| be |appHistory|'s [=relevant global object=]'s [=associated Document=]'s navigable.
526+
1. Let |navigable| be |appHistory|'s [=relevant global object=]'s [=Window/browsing context=]'s [=browsing context/containing navigable=].
523527

524528
1. Let |traversable| be |navigable|'s [=navigable/traversable navigable=].
525529

@@ -539,9 +543,19 @@ Each {{AppHistory}} object has an associated <dfn for="AppHistory">navigate meth
539543

540544
<p class="note">This can occur if the |appHistory| object's view of session history is outdated, which can happen for brief periods while all the relevant threads and processes are being synchronized in reaction to a history change (such as the user clearing their history).
541545

542-
1. Assert: |targetEntry| is not |navigable|'s [=navigable/current session history entry=].
546+
1. Assert: |targetEntry| is not |navigable|'s [=navigable/active session history entry=].
543547

544-
1. Let |targetStep| be |targetEntry|'s [=session history entry/step=].
548+
1. Let |targetStep| be null.
549+
550+
1. If |targetEntry|'s [=session history entry/step=] is greater than |traversable|'s [=traversable navigable/current session history step=], then set |targetStep| to |targetEntry|'s [=session history entry/step=].
551+
552+
1. Otherwise:
553+
554+
1. Let |afterTarget| be the [=session history entry=] after |targetEntry| in |navigableEntries|.
555+
556+
1. Let |allSteps| be the result of [=traversable navigable/getting all history steps=] in |traversable| within |navigable|'s [=navigable/browsing context group=]'s [=browsing context group/session=].
557+
558+
1. Set |targetStep| to the greatest number in |allSteps| that is less than |afterTarget|'s [=session history entry/step=].
545559

546560
1. [=Apply the history step=] |targetStep| to |traversable|, with <i>[=apply the history step/checkForUserCancelation=]</i> set to true, <i>[=apply the history step/initiatorToCheck=]</i> set to |initiatorBC|, and <i>[=apply the history step/appHistoryInfo=]</i> set to |navigateInfo|.
547561

@@ -875,8 +889,7 @@ interface AppHistoryEntry : EventTarget {
875889
<dd>
876890
<p>A [=user agent=]-generated random UUID string representing this app history entry's place in the app history list. This value will be reused by other {{AppHistoryEntry}} instances that replace this one due to replace-style navigations. This value will survive session restores.
877891

878-
<!-- TODO proper cross-link -->
879-
<p>This is useful for navigating back to this location in the app history entry list, using `appHistory.goTo(key)`.
892+
<p>This is useful for navigating back to this location in the app history entry list, using {{AppHistory/goTo(key)|appHistory.goTo(key)}}.
880893
</dd>
881894

882895
<dt><code>entry . {{AppHistoryEntry/id}}</code>

0 commit comments

Comments
 (0)