Open Bug 2001322 Opened 9 months ago Updated 9 months ago

Navigating a cross-origin iframe races with load-blocking the parent

Categories

(Core :: DOM: Navigation, defect, P3)

defect

Tracking

()

People

(Reporter: vhilla, Unassigned)

References

Details

See intermittent bug 1775609. When the test failed, my logging indicated that the top level browser_sessionStorage.html finishes loading before the iframe does for where it is navigated to dynamically. What comes together here is that the iframe is navigated to a cross-origin URL and that the page is restored from session history via duplicateTab.

I think what is happening is that browser_sessionStorage.js duplicates a tab that has loaded browser_sessionStorage.html. This document contains a cross-origin iframe. When being duplicated, that iframe immediately starts out as cross-origin and loads an about:blank. During the top-level load, the document navigates the iframe to a cross-origin URL. The top level document's load should be delayed till the iframe loads, but adding that blocker probably involves IPC and introduces a race.

That would fit with bug 543435 increasing the frequency of that intermittent. The iframe finishes its about:blank load quicker and there is a larger window where it doesn't block the top level document's load.

:smaug pointed out the relevant part of the spec: https://html.spec.whatwg.org/#beginning-navigation:delaying-load-events-mode

Pernosco trace of the test PASSING (perhaps to reconstruct where load blocking occurs): https://pernos.co/debug/k1KWaqmufLthqRqIKy3JHA/index.html

See Also: → 1775609

This is quite an edge case but could have real-world impact in perhaps less obvious, flaky ways when restoring tabs.

Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.