Skip to content

Specify browser UI-initiated navigations better #11250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

domenic
Copy link
Member

@domenic domenic commented Apr 23, 2025

In particular, they have a null sourceDocument. We need to handle that in various places in the specification.

Closes #9133.

In addition to @domfarolino and @noamr, review from @ADKaster or other Ladybird folks who might have run into this would be much appreciated.

  • At least two implementers are interested (and none opposed):
    • This matches all implementations, as far as I can tell.
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chromium: N/A
    • Gecko: N/A
    • WebKit: N/A
    • Deno (only for timers, structured clone, base64 utils, channel messaging, module resolution, web workers, and web storage): N/A
    • Node.js (only for timers, structured clone, base64 utils, channel messaging, and module resolution): N/A
  • Corresponding HTML AAM & ARIA in HTML issues & PRs: N/A
  • MDN issue is filed: N/A
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


/browsing-the-web.html ( diff )
/infrastructure.html ( diff )

In particular, they have a null sourceDocument. We need to handle that in various places in the specification.

Closes #9133.
@ADKaster
Copy link
Contributor

or other Ladybird folks who might have run into this would be much appreciated.

cc @trflynn89 @shannonbooth :)

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. This puts some pressure on Fetch getting its null client act together.

@domenic
Copy link
Member Author

domenic commented Apr 25, 2025

I will hold off on merging this until we have agreement that whatwg/fetch#1820 is the right way to fix the request's window. (For example, we might instead prefer callers to set it.)

@ADKaster
Copy link
Contributor

Implementation musings:

Implementing this in LadybirdBrowser/ladybird#4515 caused one of my tests for the state of window.navigation.canGoBack after a BrowserUI initiated navigation to fail -- the current entry index got reset to 0. I think that's... correct? Because our test runner does this:

load(about:blank)
load(test file url)
<wait for test to complete>
load(about:blank)
load(test file url)
<wait for test to complete>

Though navigating to about:blank causing all previous state to go kaput seems odd, it's not like anyone who isn't trying to stress test the browser would do that during normal operation, right? ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Navigation sourceDocument for browser-initiated navigations
3 participants