Closed Bug 2004407 Opened 1 month ago Closed 27 days ago

Base URI of initial about:blank is incorrectly about:blank

Categories

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

defect

Tracking

()

RESOLVED FIXED
148 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox145 --- unaffected
firefox146 --- unaffected
firefox147 --- disabled
firefox148 --- fixed

People

(Reporter: vhilla, Assigned: vhilla)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

STR:

  • Go to some page like https://example.com, ensure you have user activation and execute the following code
  • console.log(window.open("about:blank").document.baseURI)

Expectation: https://example.com
Actual: about:blank

Cause: I expect nsWindowWatcher::OpenWindowInternal has to set openWindowInfo->mBaseUriToInheritForAboutBlank. But I'm unsure based on what conditions that should happen.

Blocks: doc-pip-api
Keywords: regression
Regressed by: sync-about-blank

Set release status flags based on info from the regressing bug 543435

Vincent, could you set a severity please?

Flags: needinfo?(vhilla)
Assignee: nobody → vhilla
Severity: -- → S3
Flags: needinfo?(vhilla)
Priority: -- → P1

For web compat, it suffices to have the right base URI once the initial
document is being loaded. This means we can match what would happen in
Document::Reset, instead of propagating the base URI via nsOpenWindowInfo.

Bug 543435 was reverted from Fx147. Updating the flags accordingly.

Attachment #9531469 - Attachment description: WIP: Bug 2004407 - Set base URI for initial about:blank. r=hsivonen,smaug → Bug 2004407 - Propagate base URI to initial top level about:blank. r=hsivonen,smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/56600 for changes under testing/web-platform/tests
Pushed by agoloman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/dd2c2ed3134e https://hg.mozilla.org/integration/autoland/rev/803b3a0fc050 Revert "Bug 2004407 - Propagate base URI to initial top level about:blank. r=smaug" for causing wpt failures @coep-blob-popup.https.html.
Upstream PR merged by moz-wptsync-bot

https://html.spec.whatwg.org/#following-hyperlinks-2 step 7 chooses a navigable with "subject's node navigable" as current navigable / creator. So for link clicks, OpenWindowInternal needs to use parentDoc.

https://html.spec.whatwg.org/#window-open-steps step 2, 13 on the other hand uses the entry global's navigable as creator. So for window.open, we want to use the entry global as my patch does.

Maybe we can try to use the entry global and otherwise fall back to parentDoc. Or we accept that window.open incorrectly uses the parent instead of entry global.

(In reply to Vincent Hilla [:vhilla] from comment #13)

Maybe we can try to use the entry global and otherwise fall back to parentDoc.

https://treeherder.mozilla.org/jobs?repo=try&landoCommitID=168263

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/56677 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 27 days ago
Resolution: --- → FIXED
Target Milestone: --- → 148 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: