diff --git a/source b/source index 0a2796d0599..16c1070455d 100644 --- a/source +++ b/source @@ -91083,6 +91083,7 @@ interface Navigation : EventTarget { readonly attribute NavigationHistoryEntry? currentEntry; undefined updateCurrentEntry(NavigationUpdateCurrentEntryOptions options); readonly attribute NavigationTransition? transition; + readonly attribute NavigationActivation? activation; readonly attribute boolean canGoBack; readonly attribute boolean canGoForward; @@ -93041,6 +93042,96 @@ interface NavigationTransition { +
NavigationActivation
interface[Exposed=Window]
+interface NavigationActivation {
+ readonly attribute NavigationHistoryEntry? from;
+ readonly attribute NavigationHistoryEntry entry;
+ readonly attribute NavigationType navigationType;
+};
+
+ navigation.activation
A NavigationActivation
containing information about the most recent
+ cross-document navigation, the navigation that "activated" this Document
.
While navigation.currentEntry
and the
+ Document
's URL can be updated regularly
+ due to same-document navigations, navigation.activation
stays constant, and its properties
+ are only updated if the Document
is reactivated from history.
navigation.activation.entry
A NavigationHistoryEntry
, equivalent to the value of the navigation.currentEntry
property at the moment the
+ Document
was activated.
navigation.activation.from
A NavigationHistoryEntry
, representing the Document
that was active
+ right before the current Document
. This will have a value null in case the
+ previous Document
was not same origin with this one or if it was the
+ initial about:blank
+ Document
.
There are some cases in which either the from
or entry
NavigationHistoryEntry
objects
+ would not be viable targets for the traverseTo()
+ method, as they might not be retained in history. For example, the Document
can be
+ activated using location.replace()
or its initial
+ entry could be replaced by history.replaceState()
. However, those entries' url
property and getState()
method are still accessible.
navigation.activation.navigationType
One of "push
", "replace
", "reload
", or "traverse
", indicating what type of navigation
+ activated this Document
.
Each Navigation
has an associated activation, which is null or a
+ NavigationActivation
object, initially null.
Each NavigationActivation
has:
old entry, null or a
+ NavigationHistoryEntry
.
new entry, a
+ NavigationHistoryEntry
.
navigation type, a
+ NavigationType
.
The activation
getter steps are to return
+ this's activation.
The from
getter steps are to return
+ this's old entry.
The entry
getter steps are to return
+ this's new entry.
The navigationType
getter steps are to
+ return this's navigation type.
navigate
eventApply the push/replace history step targetStep to - traversable.
Update document for history step application given navigable's active document, historyEntry, true, - scriptHistoryIndex, and scriptHistoryLength.
+ scriptHistoryIndex, scriptHistoryLength, and + historyHandling.This algorithm will be called twice as a result of a single fragment navigation: once synchronously, where best-guess values scriptHistoryIndex and @@ -98545,7 +98637,8 @@ location.href = '#foo';
Finalize a same-document navigation given traversable, - navigable, historyEntry, and entryToReplace.
Invoke WebDriver BiDi fragment navigated with navigable's active browsing context and a new WebDriver BiDi navigation
@@ -98559,8 +98652,9 @@ location.href = '#foo';
To finalize a same-document navigation given a traversable navigable
traversable, a navigable targetNavigable, a session
- history entry targetEntry, and session history entry-or-null
- entryToReplace:
This is used by both fragment navigations and by the URL and history update steps, which are the only synchronous updates to @@ -98614,7 +98708,7 @@ location.href = '#foo';
Apply the push/replace history step targetStep to - traversable.
+ traversable given historyHandling.This is done even for "replace
" navigations, as it resolves race
@@ -99285,7 +99379,8 @@ location.href = '#foo';
Finalize a same-document navigation given traversable, - navigable, newEntry, and entryToReplace.
Return the result of applying the history - step step to traversable given false, null, null, and null.
To apply the push/replace history step given a non-negative integer step - to a traversable navigable traversable:
+ and a history handling behavior historyHandling to a + traversable navigable traversable:Return the result of applying the history - step step to traversable given false, null, null, and null.
Apply the push/replace history step never passes source @@ -100534,7 +100632,8 @@ location.href = '#foo'; data-x="tn-current-session-history-step">current session history step.
Return the result of applying the history - step step to traversable given true, null, null, and null.
reload
".
Apply the reload history step never passes source snapshot
@@ -100550,8 +100649,9 @@ location.href = '#foo';
Return the result of applying the history
step step to traversable given true,
- sourceSnapshotParams, initiatorToCheck, and
- userInvolvement.
traverse
".
initiatorToCheck, user navigation involvement-or-null
+ userInvolvementForNavigateEvents, and NavigationType
-or-null
+ navigationType, perform the following steps. They return "initiator-disallowed
", "canceled-by-beforeunload
", "canceled-by-navigate
", or "applied
".
@@ -100693,6 +100794,34 @@ location.href = '#foo';
data-x="nav-active-history-entry">active session history entry.
+ Switch on navigationType:
+ +reload
"Assert: targetEntry's document state's reload pending is true.
Assert: targetEntry's + document state's ever populated is true.
Assert: targetEntry's step + is displayedEntry's step and + targetEntry's document state's ever populated is false.
Assert: targetEntry's step is + displayedEntry's step + 1 and + targetEntry's document state's ever populated is false.
Let oldOrigin be targetEntry's document state's origin.
If targetEntry's document is equal to displayedDocument, then perform updateDocument.
To update document for history step application given a Document
document, a session history entry entry, a boolean
doNotReactivate, integers scriptHistoryLength and
- scriptHistoryIndex, and an optional list of session history entries entriesForNavigationAPI:
NavigationType
-or-null navigationType, an
+ optional list of session history entries
+ entriesForNavigationAPI, and an optional session history entry
+ previousEntryForActivation:
Let documentIsNew be true if document's latest entry @@ -101324,6 +101455,9 @@ location.href = '#foo';
Set document's history object's length to scriptHistoryLength.
Let navigation be history's relevant global object's + navigation API.
If documentsEntryChanged is true, then:
@@ -101336,9 +101470,6 @@ location.href = '#foo';Restore the history object state given document and entry.
Let navigation be history's relevant global object's - navigation API.
If documentIsNew is false, then:
@@ -101389,6 +101520,69 @@ location.href = '#foo';If all the following are true:
+ +reload
" or
+ previousEntryForActivation's document is not
+ documentthen:
+ +If navigation's activation is null, then set navigation's
+ activation to a new
+ NavigationActivation
object in navigation's
+ relevant realm.
Let previousEntryIndex be the result of + getting the navigation API entry index of previousEntryForActivation + within navigation.
If previousEntryIndex is non-negative, then set activation's + old entry to navigation's entry list[previousEntryIndex].
Otherwise, if all the following are true:
+ +navigationType is "replace
";
previousEntryForActivation's + document state's origin is same origin with + document's origin; and
previousEntryForActivation's document's
+ initial about:blank
is
+ false,
then set activation's old entry
+ to a new NavigationHistoryEntry
in navigation's relevant realm, whose session history entry is
+ previousEntryForActivation.
Set activation's new entry to + navigation's current entry.
Set activation's navigation type to + navigationType.
If documentIsNew is true, then: