Closed Bug 1922327 Opened 23 days ago Closed 16 days ago

Wrong navigation id in browsingContext.load if the page performs a fragment or same-document navigation

Categories

(Remote Protocol :: WebDriver BiDi, defect, P2)

defect
Points:
2

Tracking

(firefox133 fixed)

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes, NeedInfo)

References

()

Details

(Whiteboard: [webdriver:m13], [wptsync upstream])

Attachments

(2 files)

See https://github.com/puppeteer/puppeteer/issues/13041#issuecomment-2389033038

Potentially regressed by Bug 1879163, but overall the navigation manager is storing the latest navigation id in a map, and this is used by various events (eg domContentLoaded, load etc...) in order to know to which navigation they are linked.

What happens in this scenario, loading google.com is:

  • navigate command sent
  • navigationStarted event with id A
  • same document navigation detected for google.com with id B
  • domContentLoaded emitted with navigation id B
  • load emitted with navigation id B

It is relatively easy to align Firefox on Chrome's behavior here. The overall idea is that a fragment or same-document navigation should not override the ongoing navigation id of a regular navigation. Those "instant" navigations don't really relate to the upcoming domContentLoaded/load events, so we should just avoid storing them if there is already an ongoing navigation.

Fragment and same-document navigations could override an ongoing navigation and lead browsing
context events such as load and domContentLoaded events to no longer be linked to the expected navigation
id.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

File a spec issue to check the correctness

Severity: -- → S3
Points: --- → 2
Flags: needinfo?(jdescottes)
Priority: -- → P2
Whiteboard: [webdriver:m13]
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9b87f575c8d1 [bidi] Do not override ongoing navigations with fragment or same document navigation ids r=webdriver-reviewers,Sasha https://hg.mozilla.org/integration/autoland/rev/eb9f5edc1307 [wdspec] Add test for load event after early same document navigation r=webdriver-reviewers,Sasha
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/48537 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m13] → [webdriver:m13], [wptsync upstream]
Status: ASSIGNED → RESOLVED
Closed: 16 days ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch
Upstream PR merged by moz-wptsync-bot

(In reply to Julian Descottes [:jdescottes] from comment #4)

File a spec issue to check the correctness

Hi Julian, I assume this spec issue still needs to be filed?

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: