History traversal started from an iframe uses a speculation-rules prefetch made by the parent document
Categories
(Core :: DOM: Networking, defect, P2)
Tracking
()
People
(Reporter: smayya, Assigned: helmut)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
Attachments
(1 external file)
speculation-rules/prefetch/prefetch-traverse-reload.sub.html fails with the patches for bug 2070841:
History's Document is used for traversal navigations: assert_equals: prefetch from different Document should not be used expected (undefined) undefined but got (string) "prefetch"
The top-level document prefetches the previous URL, then calls history.go(-1) from a child iframe's history. Per the traversal algorithm in the HTML spec, the source document is the one that owns History, here the iframe's document, so the parent's prefetch records shouldn't be considered. We activate the parent's prefetch anyway. DocumentLoadListener::TryActivateFromPrefetch looks up records on the browsing context's current window rather than on the document that started the traversal.
| Reporter | ||
Updated•2 months ago
|
| Assignee | ||
Comment 1•9 days ago
|
||
When nsHistory::DeltaTraverse runs on an iframe's History object the
traversal retargets to the top-level traversable, but the resulting
navigation still belongs to the iframe's Document. Thread that Document's
inner window id through ChildSHistory, HistoryGo and nsSHistory::
InitiateLoad so the loadState carries it as TriggeringWindowId, and
forward it on the content side from nsDocShell::LoadURI's session-history
branch into LoadHistoryEntry.
In DocumentLoadListener::TryActivateFromPrefetch, drop the prefetch
record when the initiator's inner window id does not match the current
Document, matching "traverse the history by a delta" using the History's
Document as the source.
Updated•9 days ago
|
Description
•