From beae8549ca1617d8e3ae187fcf84c1a1c8179ca4 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Wed, 15 Nov 2023 09:40:43 +0900 Subject: [PATCH] Change subframe traverse navigate event timing This fires navigate events for subframes during a traversal earlier, before the unload event and in parallel with any fetches that occur. This is more consistent with non-traverse navigate events, and with top-level traverse navigate events. https://github.com/WICG/navigation-api/issues/207 has some previous relevant discussion. This represents moving from that issue's "late" navigate events to "early-but-still-async". It turns out the complexity was not too bad, when we got around to it in Chromium, and was actually helpful in order to fix a bug where traverse navigate events weren't firing when pages were bfcached. --- source | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/source b/source index 958844201f8..d8a383c033a 100644 --- a/source +++ b/source @@ -100273,6 +100273,16 @@ location.href = '#foo'; data-x="she-document-state">document state's origin.

+
  • If navigable is not + traversable, and targetEntry is not navigable's current session history entry, and + oldOrigin is the same as navigable's + current session history entry's document state's origin, then fire a traverse navigate event given targetEntry and + userInvolvementForNavigateEvents.

  • +
  • If targetEntry's document is null, or targetEntry's document state's

  • -
  • If navigable is not - traversable, and targetEntry is not navigable's current session history entry, and - targetEntry's document state's origin is the same as - navigable's current session history - entry's document state's origin, then fire a traverse navigate event given targetEntry and - userInvolvementForNavigateEvents.

  • -
  • Let updateDocument be an algorithm step which performs update document for history step application given targetEntry's document, targetEntry,