Skip to content

Commit ede03fe

Browse files
committed
Clarify prefetch vs. activation navigable navigable issues
Closes #384.
1 parent 2a00a68 commit ede03fe

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

prefetch.bs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,18 @@ The <dfn>list of sufficiently strict speculative navigation referrer policies</d
821821
1. Let |global| be |document|'s [=relevant global object=].
822822
1. [=In parallel=]:
823823
1. Let |navigationParams| be the result of [=creating navigation params by fetching=] given |request|, |entry|, |coopEnforcementResult|, |document|'s [=node navigable=], |sourceSnapshotParams|, |targetSnapshotParams|, "`other`", null (navigationId), "`navigate`", and <a href="#create-navigation-params-by-fetching-prefetchRecord"><i>prefetchRecord</i></a> |prefetchRecord|.
824+
825+
<div class="note" id="note-create-navingation-params-navigable">
826+
The [=navigable=] used here, i.e. |document|'s [=node navigable=], could potentially be different from the one that might be used when calling [=create navigation params by fetching=] for a non-prefetched navigation. The latter case would use the target navigable passed the [=navigate=] algorithm, whereas prefetch records are looked up on the initiator document of the navigation.
827+
828+
This is, actually, fine. During the [=navigate|navigation=] that results in prefetch activation, the target navigable will still be used for most of the important checks, which are performed earlier in the process before <a spec=HTML>attempt to populate the history entry's document</a> is called, and thus before [=create navigation params by fetching=] would be called. Of the checks that are perform during [=create navigation params by fetching=]:
829+
830+
* Some, such as those for [:Cross-Origin-Resource-Policy:], are not applicable, since <a href="#note-prefetch-top-level">prefetches are only supported in top-level navigables</a>.
831+
* Checks related to [:Cross-Origin-Opener-Policy:] are re-performed during activation.
832+
833+
Also note that within this algorithm, |navigationParams| is not stored, so the value of |navigationParams|'s [=navigation params/navigable=] does not leak to the rest of the system. In particular, during activation a new [=navigation params=] is created by the [=create navigation params from a prefetch record=] algorithm, which contains the correct target navigable.
834+
</div>
835+
824836
1. If |navigationParams|'s [=navigation params/response=] does not [=support prefetch=], then set |navigationParams| to null.
825837
1. If |prefetchRecord|'s [=prefetch record/had conflicting credentials=] is true, then set |navigationParams| to null.
826838

0 commit comments

Comments
 (0)