Make initial about:blank loading into iframe not get overwritten by an async channel load
Categories
(Core :: DOM: Navigation, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox147 | --- | fixed |
People
(Reporter: hsivonen, Assigned: vhilla)
References
(Depends on 2 open bugs, Blocks 24 open bugs, Regressed 15 open bugs, )
Details
(Keywords: html5, webcompat:platform-bug)
User Story
platform-scheduled:2025-09-30 user-impact-score:460
Attachments
(3 files, 15 obsolete files)
| Reporter | ||
Updated•15 years ago
|
| Reporter | ||
Comment 1•14 years ago
|
||
Comment 2•14 years ago
|
||
| Reporter | ||
Comment 3•14 years ago
|
||
| Reporter | ||
Comment 4•14 years ago
|
||
| Reporter | ||
Updated•14 years ago
|
| Reporter | ||
Comment 5•14 years ago
|
||
| Reporter | ||
Comment 6•14 years ago
|
||
| Reporter | ||
Comment 7•14 years ago
|
||
| Reporter | ||
Comment 8•14 years ago
|
||
| Reporter | ||
Comment 9•14 years ago
|
||
| Reporter | ||
Comment 10•14 years ago
|
||
| Reporter | ||
Comment 11•14 years ago
|
||
| Reporter | ||
Comment 12•14 years ago
|
||
| Reporter | ||
Comment 13•14 years ago
|
||
Comment 14•14 years ago
|
||
| Reporter | ||
Comment 15•14 years ago
|
||
Comment 16•14 years ago
|
||
| Reporter | ||
Comment 17•14 years ago
|
||
| Reporter | ||
Comment 18•13 years ago
|
||
| Reporter | ||
Updated•12 years ago
|
| Reporter | ||
Updated•7 years ago
|
Updated•5 years ago
|
Comment 23•5 years ago
|
||
| Reporter | ||
Comment 25•3 years ago
|
||
| Reporter | ||
Comment 26•3 years ago
|
||
Please don't get excited about the patch at this point. It's a dirty hack, and we don't yet know how the test suite tolerates it.
Note that the patch not only changes how channel loads of the initial about:blank work but also changes later about:blanks to go through the normal parsing path.
Let's see how orange everything goes:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d9e3d6f45aed9cbc21178d092069ce25e0e7bc45
| Reporter | ||
Comment 27•3 years ago
|
||
| Reporter | ||
Comment 28•3 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #27)
https://treeherder.mozilla.org/#/jobs?repo=try&revision=c171e7501d3789374b89ccac1d023dfaa5a9d1a5
It's rather encouraging how little in WPT breaks even if Gecko-specific tests are very orange.
| Reporter | ||
Comment 29•3 years ago
|
||
| Reporter | ||
Comment 30•3 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #26)
but also changes later
about:blanks to go through the normal parsing path.
The latest patch rolls back this change. Also, the try run includes the patch from bug 1736570 to turn off DocumentChannel for the initial about:blank.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=982764965be9e1af0a9869209ed6321cbb234b29
| Reporter | ||
Comment 31•3 years ago
|
||
OK, now it's slightly encouraging that there are lots of failures where the log line implicates about:blank directly, which suggests it isn't now an "everything is broken" situation.
Updated•3 years ago
|
| Reporter | ||
Comment 32•3 years ago
|
||
Rebased on top of latest trunk and bug 1736570:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=8d8b5150f41e95e17d3415ef420e99849dfa3471
| Reporter | ||
Updated•3 years ago
|
Updated•3 years ago
|
| Reporter | ||
Comment 33•3 years ago
|
||
FWIW, things go very orange if calling the lazy EnsureContentViewer eagerly upon docshell initialization:
https://treeherder.mozilla.org/jobs?repo=try&revision=dec017d45932941e5b088dd398c3e0404b0e3434
It's not a great sign that we implicitly depend on the lazy creation running somewhat later.
Comment 34•3 years ago
|
||
That doesn't look very orange to me :)
Many of the failures are there more than once and usually an orange in a test group seems to be about just one or two test failing.
I'd assume debugging and fixing some failure might fix also many other failures. (crossing fingers)
Updated•3 years ago
|
| Reporter | ||
Comment 35•3 years ago
|
||
| Reporter | ||
Comment 36•3 years ago
|
||
| Reporter | ||
Comment 37•3 years ago
|
||
| Reporter | ||
Updated•3 years ago
|
| Reporter | ||
Comment 38•3 years ago
|
||
| Reporter | ||
Comment 39•3 years ago
|
||
| Reporter | ||
Comment 40•3 years ago
|
||
Looks like I broke window.open().
| Reporter | ||
Comment 41•3 years ago
|
||
| Reporter | ||
Comment 42•3 years ago
|
||
Experimenting with undoing bug 472260:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=458f50c2fef05f011c625e1c9eeee56b9d7c0865
| Reporter | ||
Comment 43•3 years ago
|
||
| Reporter | ||
Comment 44•3 years ago
|
||
| Reporter | ||
Comment 45•3 years ago
|
||
| Reporter | ||
Comment 46•3 years ago
|
||
| Reporter | ||
Comment 47•3 years ago
|
||
| Reporter | ||
Comment 48•3 years ago
|
||
| Reporter | ||
Comment 49•3 years ago
|
||
Note to self: Revisit the query string versions of
./mach wpt /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/initial-content-replacement.html
| Reporter | ||
Comment 50•3 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #49)
Note to self: Revisit the query string versions of
./mach wpt /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/initial-content-replacement.html
Also ./testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-event-iframe-element.html
| Reporter | ||
Comment 51•3 years ago
|
||
| Reporter | ||
Comment 52•3 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #50)
(In reply to Henri Sivonen (:hsivonen) from comment #49)
Note to self: Revisit the query string versions of
./mach wpt /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/initial-content-replacement.htmlAlso ./testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-event-iframe-element.html
nsDocShell::UpdateURLAndHistory
| Reporter | ||
Comment 53•3 years ago
|
||
Let's see if this disconnects too many event targets upon inner window reuse:
https://treeherder.mozilla.org/jobs?repo=try&revision=57c25730a11089bfa87f4f6edb65b147434f074e
| Reporter | ||
Comment 54•3 years ago
|
||
| Reporter | ||
Comment 55•3 years ago
|
||
| Reporter | ||
Comment 56•3 years ago
|
||
| Reporter | ||
Comment 57•3 years ago
|
||
Primarily a rebase (also removed some failure expectations):
https://treeherder.mozilla.org/jobs?repo=try&revision=e8b94c3f9bee564acef045780af3a87ca7293cfa
| Reporter | ||
Comment 58•3 years ago
|
||
| Reporter | ||
Comment 59•3 years ago
|
||
The failures in test_bug346659.html might not be bugs. It would be worthwhile to port the non-SpecialPowers parts of that test to WPT to see what other browsers do.
| Reporter | ||
Comment 60•3 years ago
|
||
In the case of toolkit/components/extensions/test/mochitest/test_ext_storage_cleanup.html , the parent process tries to get the message manager from the outer window for moz-extension://43973589-61d5-49d1-8144-18b51a210399/_generated_background_page.html and the message manager is null.
| Reporter | ||
Comment 61•3 years ago
|
||
| Reporter | ||
Comment 62•3 years ago
|
||
| Reporter | ||
Comment 63•3 years ago
|
||
| Reporter | ||
Comment 64•3 years ago
|
||
| Reporter | ||
Comment 65•3 years ago
|
||
Performance baseline for comparison with the try run in the previous comment:
https://treeherder.mozilla.org/jobs?repo=try&revision=8770e66af1ae220309b46a30608653ac27b8f2eb
| Reporter | ||
Comment 66•3 years ago
|
||
Browsertime with patch:
https://treeherder.mozilla.org/jobs?repo=try&revision=45bfe8c5dfcaa7444cd9d2614940cd4acb2812c0
Browser time for base rev without patch:
https://treeherder.mozilla.org/jobs?repo=try&revision=08b8c9ae9e92ae11f3b0cf31fd7899327c668780
| Reporter | ||
Comment 67•3 years ago
|
||
Browsertime times 10 with rebased patch:
https://treeherder.mozilla.org/jobs?repo=try&revision=0ce9a4f66e1a5107120dbe2f85ca5227fb9c824e
Baseline times 10 without the patch:
https://treeherder.mozilla.org/jobs?repo=try&revision=e5ee069e09d2bca0833feb0e08514b237070b7fc
| Reporter | ||
Comment 68•3 years ago
|
||
| Reporter | ||
Comment 69•3 years ago
|
||
kmag, what should I conclude from https://searchfox.org/mozilla-central/source/js/xpconnect/tests/unit/test_nuke_webextension_wrappers.js still returning bar instead of something matching "dead object"?
AFAICT, docShell.createAboutBlankContentViewer(principal, principal); replaces the initial about:blank with another synthetic about:blank with custom principal.
Updated•3 years ago
|
| Reporter | ||
Comment 70•3 years ago
|
||
| Reporter | ||
Comment 71•3 years ago
|
||
Comment 72•3 years ago
|
||
The severity field for this bug is relatively low, S3. However, the bug has 5 duplicates and 11 votes.
:hsivonen, could you consider increasing the bug severity?
For more information, please visit auto_nag documentation.
| Reporter | ||
Comment 73•3 years ago
|
||
Try run with built-in WebExtensions hopefully disabled:
https://treeherder.mozilla.org/jobs?repo=try&revision=a59a4399a38d4611c72e2a33ce7a023a1e53a1bd
Comment 74•3 years ago
|
||
The last needinfo from me was triggered in error by recent activity on the bug. I'm clearing the needinfo since this is a very old bug and I don't know if it's still relevant.
| Reporter | ||
Comment 75•3 years ago
|
||
Try run with built-in WebExtensions hopefully disabled for real this time:
https://treeherder.mozilla.org/jobs?repo=try&revision=4f2ba9c8c1178a8477046f1d1f689d3623823a35
| Reporter | ||
Comment 76•3 years ago
|
||
| Reporter | ||
Comment 77•3 years ago
|
||
| Reporter | ||
Comment 78•3 years ago
|
||
| Reporter | ||
Comment 79•3 years ago
|
||
| Reporter | ||
Comment 80•3 years ago
|
||
| Reporter | ||
Comment 81•3 years ago
|
||
| Reporter | ||
Comment 82•3 years ago
|
||
| Reporter | ||
Comment 83•3 years ago
|
||
| Reporter | ||
Comment 84•3 years ago
|
||
| Reporter | ||
Comment 85•3 years ago
|
||
| Reporter | ||
Comment 86•3 years ago
|
||
| Reporter | ||
Comment 87•3 years ago
|
||
accessible/tests/mochitest/treeupdate/test_doc.html runs into principal inheritance changes. The patch makes the system principal inherit into about:blank in some system contexts. One option would be to try what would happen if we never inherited the system principal in to about:blank. If it needs to inherit in some conditions but not others, it would be important to be able to articulate a rule in a better way than "whatever happened with the previous more ad hoc code".
| Reporter | ||
Comment 88•3 years ago
|
||
M(4, 5) Failures with _ext_ in the test name are about bug 1792685, AFAICT.
M(6) Various scrolling-related failures seem to be pre-existing brittleness in the scrolling test harness. At least spot checking suggests that there problems that look like timing issues instead of having clearer reasons.
Major rework of how onload fires:
https://treeherder.mozilla.org/jobs?repo=try&revision=1b2f299e99e15a44d92f3c98da38c26b5e86fcba
This runs much more onload-adjacent code than the patch did previously. This should address problems with windows opened with window.open("about:blank") never getting focus.
| Reporter | ||
Comment 89•3 years ago
|
||
| Reporter | ||
Comment 90•3 years ago
|
||
| Reporter | ||
Comment 91•3 years ago
|
||
| Reporter | ||
Comment 92•3 years ago
|
||
testing/web-platform/tests/service-workers/service-worker/resources/nested-iframe-parent.html change is a hack that really needs a follow-up.
| Reporter | ||
Comment 93•3 years ago
|
||
| Reporter | ||
Comment 94•3 years ago
|
||
| Reporter | ||
Comment 95•2 years ago
|
||
| Reporter | ||
Comment 96•2 years ago
|
||
| Reporter | ||
Comment 97•2 years ago
|
||
| Reporter | ||
Comment 98•2 years ago
|
||
At least one of the about:blank ServiceWorker WPTs should go green:
https://treeherder.mozilla.org/jobs?repo=try&revision=2f75aa80c9592adf14c40d943ace1f3aea18891d
| Reporter | ||
Comment 99•2 years ago
|
||
/html/anonymous-iframe/local-storage-initial-empty-document.tentative.https.window.html seems to fail without the patch, too.
| Reporter | ||
Comment 100•2 years ago
|
||
Failures in /html/browsers/history/the-history-interface/004.html are known intermittents and the test also intermittently passes with the patch.
| Reporter | ||
Comment 101•2 years ago
|
||
browser_windowPrompt.js passes if I use data:text/html, in place of about:blank in the argument for addTab. It's possible that this isn't about synchronicity but about whether the inner window is reused for whatever is loaded next. (For u2f tests, it seems that the issue was reusing an inner window created before the u2f-enabled pref had taken effect.)
In the case of accessible/tests/browser/e10s/browser_caching_document_props.js, it appears that the accessibility code sees the CanonicalBrowsingContext's creation-time URL instead of seeing the situation after receiving an update from a content process.
| Reporter | ||
Comment 102•2 years ago
|
||
browser_windowPrompt.js
Oops, wrong test. I meant toolkit/components/cookiebanners/test/browser/browser_cookieinjector.js
| Reporter | ||
Comment 103•2 years ago
|
||
| Reporter | ||
Comment 104•2 years ago
|
||
| Reporter | ||
Comment 105•2 years ago
|
||
| Reporter | ||
Comment 106•2 years ago
|
||
test_ext_webrequest_filter.html superficially looks like another case of failure to inherit the ServiceWorker controller across window.open.
| Reporter | ||
Comment 107•2 years ago
|
||
Try to inherit the controller for ServiceWorkers from the opener:
https://treeherder.mozilla.org/jobs?repo=try&revision=cd3e8619ff3d77c2eb1e6e441145914cc387930b
| Reporter | ||
Comment 108•2 years ago
|
||
Should fix dev tool failures:
https://treeherder.mozilla.org/jobs?repo=try&revision=b5a9b63116ae8ce7d67c3ac4a76dfdebd06a7632
| Reporter | ||
Comment 109•2 years ago
|
||
Trying to make add_task tests not execute on about:blank:
https://treeherder.mozilla.org/jobs?repo=try&revision=f27ceea826880c0a78e7ba0cb2d1417b1802311b
| Reporter | ||
Comment 110•2 years ago
|
||
| Reporter | ||
Comment 111•2 years ago
|
||
| Reporter | ||
Comment 112•2 years ago
|
||
| Reporter | ||
Comment 113•2 years ago
|
||
| Reporter | ||
Comment 114•2 years ago
|
||
Sigh. Lots of new orange after rebase:
https://treeherder.mozilla.org/jobs?repo=try&revision=a77b2dfdbe2b5312bd927e025430c7b78e7fad2d
| Reporter | ||
Comment 115•2 years ago
|
||
| Reporter | ||
Comment 116•2 years ago
|
||
Fixed COEP inheritance to window.open():
https://treeherder.mozilla.org/jobs?repo=try&revision=361477e5da457f8fc7b62a230be3a89dfca03881
| Reporter | ||
Comment 117•2 years ago
|
||
Fix bad rebase around form submission:
https://treeherder.mozilla.org/jobs?repo=try&revision=a6fcc6ce5dba0c48905a7a5d4e3f2773b880af9e
| Reporter | ||
Comment 118•2 years ago
|
||
| Reporter | ||
Comment 119•2 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #69)
kmag, what should I conclude from https://searchfox.org/mozilla-central/source/js/xpconnect/tests/unit/test_nuke_webextension_wrappers.js still returning
barinstead of something matching "dead object"?AFAICT,
docShell.createAboutBlankContentViewer(principal, principal);replaces the initial about:blank with another synthetic about:blank with custom principal.
Findings so far:
Without the patch, the real initial about:blank is lazy and hasn't actually been created by the time of the call to docShell.createAboutBlankContentViewer(principal, principal);. Therefore, the inner window resulting from that call is the only inner window that has occupied the outer window.
With the patch, by the time docShell.createAboutBlankContentViewer(principal, principal); is called, the inner window for the initial about:blank has already been created eagerly and this call dooms it.
I think the test jumps the gun by awaiting for the nuking of first inner window. However, trying to await for the nuking of the right inner window (either by awaiting twice or by filtering on the inner window id) times out.
I don't understand why the test can't observe the notification of the nuking of the right inner window.
| Reporter | ||
Comment 120•2 years ago
|
||
| Reporter | ||
Comment 121•2 years ago
|
||
| Reporter | ||
Comment 122•2 years ago
|
||
Comment out waiting for browser-delayed-startup-finished in test harness:
https://treeherder.mozilla.org/jobs?repo=try&revision=f82ef82ca310def0e6bb54200392be9aea2a1bc5
| Reporter | ||
Comment 123•2 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #122)
Comment out waiting for
browser-delayed-startup-finishedin test harness:
This appears to have been a bad idea. New run with waiting for browser-delayed-startup-finished restored:
https://treeherder.mozilla.org/jobs?repo=try&revision=1a1afc289ee597809b6dfbb9035b2031d80958fd
Updated•2 years ago
|
| Reporter | ||
Comment 124•2 years ago
|
||
| Reporter | ||
Comment 125•2 years ago
|
||
| Reporter | ||
Comment 126•2 years ago
|
||
toolkit/components/antitracking/test/browser/browser_fpiServiceWorkers_fingerprinting.js and wpt /service-workers/service-worker/about-blank-replacement.https.html have conflicting requirements for whether the effective storage principal for the initial about:blank should be the node principal or the partitioned principal.
| Reporter | ||
Comment 127•2 years ago
|
||
Revisit dom/base/test/test_bug1730284.html after bug 1829594.
| Reporter | ||
Comment 128•2 years ago
|
||
| Reporter | ||
Comment 129•2 years ago
|
||
| Reporter | ||
Comment 130•2 years ago
|
||
| Reporter | ||
Comment 131•2 years ago
|
||
| Reporter | ||
Comment 132•2 years ago
|
||
| Reporter | ||
Comment 133•2 years ago
|
||
| Reporter | ||
Comment 134•2 years ago
|
||
Notable change to getting the UI react correctly when about:blank is the document that a newly-opened content window stays at:
https://treeherder.mozilla.org/jobs?repo=try&revision=4096e62d56883a0329ffc71ca6108e01289f9e98
| Reporter | ||
Comment 135•2 years ago
|
||
| Reporter | ||
Comment 136•2 years ago
|
||
| Reporter | ||
Comment 137•2 years ago
|
||
| Reporter | ||
Comment 138•2 years ago
|
||
Adding a script blocker around docshell initialization didn't work, because top-level SetCurrentURI asserts that there isn't a blocker:
https://treeherder.mozilla.org/jobs?repo=try&revision=798f73af9039d2717f2bc17ebacc23d00916cca6
Moving the offending notification to later without a script blocker:
https://treeherder.mozilla.org/jobs?repo=try&revision=e1a78954c45e69eef3324c5a56d3a652e3110529
Consistently not firing onLocationChange at initial about:blank creation time (even top-level) and only firing it for the initial about:blank if that ends up being the actual first navigation destination:
https://treeherder.mozilla.org/jobs?repo=try&revision=a63276942a16b7daf728bceb98108997129d358b
| Reporter | ||
Comment 139•2 years ago
|
||
Check for contentness of HTML iframes in the parent process for the purpose of principal inheritance:
https://treeherder.mozilla.org/jobs?repo=try&revision=64c3f2a714c6be7091bd711295cb6e1f3f39ee60
| Reporter | ||
Comment 140•2 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #139)
Check for contentness of HTML iframes in the parent process for the purpose of principal inheritance:
https://treeherder.mozilla.org/jobs?repo=try&revision=64c3f2a714c6be7091bd711295cb6e1f3f39ee60
And inherit the origin attributes from the BrowsingContext when not inheriting the principal:
https://treeherder.mozilla.org/jobs?repo=try&revision=614dc5b81fbec76ff51bed7a28dc9107208999a3
| Reporter | ||
Comment 141•2 years ago
|
||
| Reporter | ||
Comment 142•2 years ago
|
||
| Reporter | ||
Comment 143•2 years ago
|
||
Rebase and more platforms:
https://treeherder.mozilla.org/jobs?repo=try&revision=44b70cf634a5df652f13977a6cba1fa198b058e4
| Reporter | ||
Comment 144•2 years ago
|
||
| Reporter | ||
Comment 145•2 years ago
|
||
Trying to delay about:blank painting:
https://treeherder.mozilla.org/jobs?repo=try&revision=70a6c51d1eb15388c71b1adc6bc1776a6aa8cbef
| Reporter | ||
Comment 146•2 years ago
|
||
Make dev tools deal with the new-style about:blank:
https://treeherder.mozilla.org/jobs?repo=try&revision=4a9bbb7212f64cdb7bad5e2821302be10ffa1e90
| Reporter | ||
Comment 147•2 years ago
|
||
Introduce an isUncommittedInitialDocument flag that is true if isInitialDocument and the browsing context hasn't started navigation to about:blank. This enables various filtering to not filter out initial documents that end up remaining in the browsing context.
https://treeherder.mozilla.org/jobs?repo=try&revision=c8524aa8459ba0f6abdcc7f45638086d10e1cfdc
| Reporter | ||
Comment 148•2 years ago
|
||
The isInitialDocument changes were probably too much for the "remote" test set:
https://treeherder.mozilla.org/jobs?repo=try&revision=f3d866993d5dca50aca476cccd08ed15d7598b68
| Reporter | ||
Comment 149•2 years ago
|
||
Updated•2 years ago
|
| Reporter | ||
Comment 150•2 years ago
|
||
Comment 151•2 years ago
|
||
Redirect a needinfo that is pending on an inactive user to the triage owner.
:farre, since the bug has recent activity, could you have a look please?
For more information, please visit BugBot documentation.
| Reporter | ||
Comment 152•2 years ago
|
||
| Reporter | ||
Comment 153•2 years ago
|
||
| Reporter | ||
Comment 154•2 years ago
|
||
Rebase and remove a couple of redundant-looking createAboutBlankContentViewer() calls:
https://treeherder.mozilla.org/jobs?repo=try&revision=fe10bb9e4addde99f9c8c4daceae72e3862d7466
| Reporter | ||
Comment 155•2 years ago
|
||
| Reporter | ||
Comment 156•2 years ago
|
||
| Reporter | ||
Comment 157•2 years ago
|
||
| Reporter | ||
Comment 158•2 years ago
|
||
| Reporter | ||
Comment 159•2 years ago
|
||
| Reporter | ||
Comment 160•2 years ago
|
||
| Reporter | ||
Comment 161•2 years ago
|
||
| Reporter | ||
Comment 162•2 years ago
|
||
Try to prevent treatment of an about:blank load as an initial about:blank load in some cases, especially when continuing a cross-process redirect:
https://treeherder.mozilla.org/jobs?repo=try&revision=2379c26fa772262689de9691166b52efc994e8bb
| Reporter | ||
Comment 163•2 years ago
|
||
All/all run with Navigate.sys.mjs reverted:
https://treeherder.mozilla.org/jobs?repo=try&revision=e94433b4430cba5d3df282435325098178913ca6
| Reporter | ||
Comment 164•2 years ago
|
||
| Reporter | ||
Comment 165•2 years ago
|
||
This move the initial client source creation to between connecting the document viewer and firing the location change events:
https://treeherder.mozilla.org/jobs?repo=try&revision=f8271fca8f9e9ab0845ac34eef466549aae0a03f
| Reporter | ||
Comment 166•2 years ago
|
||
| Reporter | ||
Comment 167•2 years ago
|
||
Move the initial client source creation back:
https://treeherder.mozilla.org/jobs?repo=try&revision=f81201d6b20d4afbc7d457453c6efd8b7a3d0538
| Reporter | ||
Comment 168•2 years ago
|
||
| Reporter | ||
Comment 169•2 years ago
|
||
| Reporter | ||
Comment 170•2 years ago
|
||
| Reporter | ||
Comment 171•1 year ago
|
||
Omit the initial viewer for new tabs that don't have an opener.
https://treeherder.mozilla.org/jobs?repo=try&revision=8709dc18c2636bcca68145f4c7435de5945e6bad
| Reporter | ||
Comment 172•1 year ago
|
||
Rebase (the base patch that doesn't try to omit the initial viewer):
https://treeherder.mozilla.org/jobs?repo=try&revision=8b511df083a851f11c3829ee869adf090f49644e
| Reporter | ||
Comment 173•1 year ago
|
||
Omit the initial viewer also:
https://treeherder.mozilla.org/jobs?repo=try&revision=459b1ff8f048030d4fdce1a5dabd641962cdb83b
| Reporter | ||
Comment 174•1 year ago
•
|
||
Rebase and also revert towards the old behavior for top-level content browsing contexts that don't have an opener in order to (hopefully) break fewer frontend tests.
https://treeherder.mozilla.org/jobs?repo=try&revision=00d5351e4d988ec660edcf71f77a2f099213ccd3
| Reporter | ||
Comment 175•1 year ago
|
||
Only the rebase without the hack:
https://treeherder.mozilla.org/jobs?repo=try&revision=e1d3b27626187260bf24997c9451b8e2d0e3b80f
| Reporter | ||
Comment 176•1 year ago
|
||
Try to make upgrade insecure requests on the initial about:blank work:
https://treeherder.mozilla.org/jobs?repo=try&revision=5b19acb308c73fa6dd8ba7df9f7b7ea7b5baa707
Comment 177•1 year ago
|
||
Verified this issue and still reproduces on Firefox Nightly. Accessing: https://hsivonen.com/test/moz/about-blank-load.html returns different results when viewing the returned text order (for example, History length: 2 is the last entry in Firefox)
Tested with:
Browser / Version: Firefox Nightly 128.0a1 (2024-05-21) (64-bit)
Operating System: Windows 10 PRO x64
Updated•1 year ago
|
Updated•11 months ago
|
Updated•11 months ago
|
Comment 178•11 months ago
|
||
| Assignee | ||
Comment 179•11 months ago
|
||
| Assignee | ||
Comment 180•10 months ago
|
||
Here is a summary of the wpt failures I looked at so far. I'll highlight the more interesting / still relevant parts.
eval-blocked-in-about-blank-iframe
A call to Document::InitCSP is missing for an about:blank document.
- We write code to an
about:blankiframe. This code callsevaland listens for thesecuritypolicyviolationevent. If the event is received, a message is sent to the parent document, which is awaiting this message. - But the event is incorrectly fired on the parent document, instead of iframe.
- In Gecko,
evalleads tonsCSPContext::FireViolationEvent, where the event target is set tomLoadingContext.- With this patch, this context stems from
InitFromOtherhere innsDocShell::CreateAboutBlankDocumentViewer, which is reached fromnsDocShell::InternalLoad. The iframe inherits the parent documents CSP and the request context is set to the parent document. - Without this patch,
InitFromOtheris called in the same way. But the async channel load calls intoDocument::InitCSPviaDocument::StartDocumentLoad, which sets the request context to the iframe document.
- With this patch, this context stems from
We could invoke cspToInherit->SetRequestContextWithDocument(blankDoc) after InitFromOther in CreateAboutBlankDocumentViewer. This fixes the test, but I'm unsure if other initialization tasks from StartDocumentLoad are also missing.
declarative-shadow-dom-write-to-iframe
DSD was implemented in Bug 1712140 and put behind a pref in D194846. This pref is used in nsContentDLF::CreateDocument to initialize doc->SetAllowDeclarativeShadowRoots. For about:blank documents in nsContentDLF::CreateBlankDocument, this does not happen and the parser ignores DSD. We can probably just add the same call to CreateBlankDocument.
iframe-loading-lazy-nav-link-click-fragment
- We have an
<iframe src=... loading=lazy hidden>and an<a target=iframe href=about:blank#fragment>. We click the link, then show the iframe. - Clicking the link calls into
InternalLoadviaPerformRetargetingandnsDocShell::OnLinkClickSync.- Without the patch
IsSameDocumentNavigationreturns false asmCurrentURIis null. We reachDoURILoadwhere weCancelLazyLoadingand perform an asyncabout:blankload. - With the patch,
mCurrentURIisabout:blankandInternalLoadearly-returns withHandleSameDocumentNavigation. No load event is fired, lazy loading is not canceled. When the iframe is shown, we lazy loadsrc.mCurrentURIis set due to the patch fromEnsureDocumentViewerinnsDocShell::Initialize.
- Without the patch
Considering the spec, I think we should cancel lazy loading already in InternalLoad before HandleSameDocumentNavigation. To navigate a navigable, we cancel lazy loading in step 10 before 'navigate a fragment' in step 13. This makes the test time out as we never fire an about:blank load event, same as in Blink.
I'm unsure what the spec says on the interaction of lazy loading and about:blank. For once, when clicking the link and navigating the iframe, what should the 'active session history entry' be? Gecko and Blink behave as if it's 'about:blank' then 'navigate a fragment' and never fire a load event. If the iframe doesn't have a 'src' attribute but remains lazy and hidden, Blink fires a sync 'about:blank' load on binding, Gecko still never fires a load event.
| Reporter | ||
Comment 181•10 months ago
|
||
(In reply to Vincent Hilla [:vhilla] from comment #180)
We could invoke
cspToInherit->SetRequestContextWithDocument(blankDoc)afterInitFromOtherinCreateAboutBlankDocumentViewer. This fixes the test,
It makes sense to do this.
but I'm unsure if other initialization tasks from
StartDocumentLoadare also missing.
tschuster, can you give advice about this?
DSD was implemented in Bug 1712140 and put behind a pref in D194846. This pref is used in
nsContentDLF::CreateDocumentto initializedoc->SetAllowDeclarativeShadowRoots. Forabout:blankdocuments innsContentDLF::CreateBlankDocument, this does not happen and the parser ignores DSD. We can probably just add the same call toCreateBlankDocument.
Makes sense.
I'm unsure what the spec says on the interaction of lazy loading and about:blank.
It probably makes sense to do the closest to what Blink does and then to file a spec bug.
Comment 182•10 months ago
|
||
Document::InitCSP does all kinds of initialization besides SetRequestContextWithDocument, I don't see how we could skip it. Some things like handling the HTTP Content-Security-Policy header presumably don't apply. Other stuff like the call to Document::ApplySettingsFromCSP seems quite necessary. Not sure about handling of the sandbox flag.
| Assignee | ||
Comment 183•10 months ago
•
|
||
Two more tests
iframe-blank-inherit.meta/upgrade/iframe-tag
I didn't get into the details of what the test does, as it uses several utility functions making it difficult to isolate a single, short testcase.
The test is for the upgrade-insecure-requests CSP. With the about:blank patch, we no longer call loadInfo->SetUpgradeInsecureRequests nor Document::ApplySettingsFromCSP via InitCSP, as :tschuster noted. Before ApplySettingsFromCSP would be called, there is also mUpgradeInsecureRequests = loadInfo->GetUpgradeInsecureRequests() in StartDocumentLoad.
I see that this patch introduces ApplyCspFromLoadInfo, which does mUpgradeInsecureRequests = loadInfo->GetUpgradeInsecureRequests() for about:blank where StartDocumentLoad doesn't happen. But that loadInfo is created a few lines before without ever invoking SetUpgradeInsecureRequests. So it doesn't help. I tried replicating loadInfo->SetUpgradeInsecureRequests from here in DoURILoad, but that didn't help either.
What would fix the test is doing doc->ApplySettingsFromCSP(false) in DoURILoad within the isAboutBlankLoadOntoInitialAboutBlank branch. I'm concerned that I'm cherry picking lines from StartDocumentLoad till tests work, but other things might still be missing.
document-base-url-window-initiator-is-not-opener
Edit: this test uses window.open() without specifying about:blank which appears to be broken. Fixing this first might change how this test behaves. I'm thinking that the navigation to a different base url shouldn't actually lead to the sync about:blank handling.
The problem is that when setting location.href=about:blank on an about:blank page, we don't fire pagehide nor change the baseURI. Secondary to fixing the test, there might be web interop problems here, as we fire a second sync load event, unlike Blink.
In the test, we have some document with baseURI A that opens an about:blank popup. It also contains an iframe with a different baseURI B. When the iframe is loaded, it initiates a navigation via location.href = about:blank on the popup. The test expects that the popup changes to baseURI B and fires a pagehide. The test allows for this to happen async and doesn't consider whether there should be a second load event. Blink changes baseURI sync, fires pagehide async, then changes baseURI and fires no load (or clears the load listener beforehand?).
We can also consider two similar cases: the iframe has the same baseURI as the parent or the parent itself does location.href=about:blank. In both cases, Blink will fire pagehide and change the baseURI from about:blank to the parent document's URI. For Gecko with the about:blank patch, nothing happens in the latter case while the former case only triggers a sync load event.
Regarding the cause for this test failure. Without this patch, the baseURI is set in Document::Reset, reached via Document::StartDocumentLoad from the async channel load. pagehide is fired from FirePageHideNotification during nsDocShell:CreateDocumentViewer, also caused by the channel load.
I tried to reconstruct what the spec says. Navigate a navigable step 22.5.2 sets 'about base URL' in parallel and fires the pagehide much later in unloading-documents via applying the history step. I understand this so that the baseURI should be changed async. I didn't find under which conditions navigate a navigable causes a load event.
I don't really know how to fix the test. Always firing pagehide for about:blank from DoURILoad causes the browser to become blank. Calling Document::Reset(aboutBlankChannel) causes a crash and wouldn't fix the test anyway, as baseURI was null here for the aboutBlankChannel. Both nsIURI and nsINestedURI don't support getting the baseURI so I wouldn't really know how to obtain it any other way without directly depending on nsNestedAboutURI.
Perhaps interesting, but less relevant are how browsers differ if we were to have a second iframe with baseURI C causing a second navigation of the popup. Blink will then block access to the popup due to cross-origin.
| Assignee | ||
Comment 184•10 months ago
|
||
window.open() doesn't lead to nsDocShell::DoURILoad while window.open('about:blank') does and this causes multiple test failures. There was a merge conflict that I didn't know how to resolve and now I see why the conflicting code was needed.
Per the spec window-open-steps, we determine whether target leads to a new window in step 13 and consume user activation. In step 15.3, we then make an empty url correspond to about:blank iff target leads to a new window.
From my understanding, we consume user activation here in nsGlobalWindowOuter::OpenInternal due to Bug 1901139. Later in nsWindowWatcher::OpenWindowInternal we determine whether target leads to a new window as indiciated by windowIsNew. Per :edgars change in Bug 1901139, we want to create the load state before use activation is consumed. But we need the URI to create the load state and for an empty URL, we'll only have it later in OpenWindowInternal.
From the patch in nsWindowWatcher.cpp line 1317 in OpenWindowInternal
if (windowIsNew && !uriToLoad && aNavigate && !loadState) {
NS_NewURI(getter_AddRefs(uriToLoad), "about:blank"_ns);
// create loadState
}
and from Bug 1901139 in nsGlobalWindowOuter.cpp line 6808 in OpenInternal
RefPtr<nsDocShellLoadState> loadState = aLoadState;
if (!loadState && aNavigate && uri) {
loadState = nsWindowWatcher::CreateLoadState(uri, this);
}
:edgar you authored Bug 1901139 and particularly, moved load state creation to nsGlobalWindowOuter here. Can you give advice?
Updated•10 months ago
|
| Assignee | ||
Comment 185•10 months ago
•
|
||
I'm a bit stuck on browser_firstPartyIsolation_js_uri.js. This test loads javascript:0; but browser_firstPartyIsolation_aboutPages.js is also failing with about:blank.
:smaug do you have some idea what to do? With this patch, the firstPartyOrigin origin attribute is not set on about:blank pages. I guess we either have to change the document principal of the initial document, or set firstPartyDomain for the initial principal created during ConstructBrowser.
I looked at the javascript:0; case with pernosco.
- Before this patch, loading this URI leads to
RecvLoadURIin the content process. We create a new null principal innsDocShellLoadState::SetupInheritingPrincipaland setfirstPartyDomainon the origin attributes. During the following channel load,Document::Resetsets the document principal to this null principal. - With the patch, we still create the null principal during
RecvLoadURI. ButnsDocShell::DoURILoadearly-returns due to the syncabout:blankhandling and the document principal doesn't get updated. When the test later checks the document origin, it finds the one created duringRecvConstructBrowser, which doesn't have afirstPartyDomainset (it's empty).
I cannot call Document::Reset or Document::SetPrincipal in DoURILoad during the sync about:blank handling, as this fails AssertDocGroupMatchesKey.
Comment 186•10 months ago
|
||
(In reply to Vincent Hilla [:vhilla] from comment #184)
:edgar you authored Bug 1901139 and particularly, moved load state creation to
nsGlobalWindowOuterhere. Can you give advice?
I responded to this in https://phabricator.services.mozilla.com/D155376#8106563.
| Assignee | ||
Comment 187•10 months ago
•
|
||
(In reply to Vincent Hilla [:vhilla] from comment #185)
I'm a bit stuck on browser_firstPartyIsolation_js_uri.js. This test loads
javascript:0;but browser_firstPartyIsolation_aboutPages.js is also failing withabout:blank.
This seems related to browser_hwconcurrency_popups_aboutblank.js. The test is a bit lengthy, but I got a simplified version. In a page exempted from RFP, open an about:blank popup and eval(navigator.hardwareConcurrency). With this patch, it's incorrectly spoofed. From pernosco, Document::mShouldResistFingerprinting is incorrectly true as we don't call RecomputeResistFingerprinting during the sync about:blank load, or update the principal at all.
Edit: hwconcurrency fixed by doing Document::SetContainer slightly earlier.
Comment 188•10 months ago
•
|
||
(In reply to Vincent Hilla [:vhilla] from comment #185)
or set
firstPartyDomainfor the initial principal created duringConstructBrowser.
That would be better. Documents should have the right principal from the beginning if just possible.
I looked at the
javascript:0;case with pernosco.
- Before this patch, loading this URI leads to
RecvLoadURIin the content process. We create a new null principal innsDocShellLoadState::SetupInheritingPrincipaland setfirstPartyDomainon the origin attributes. During the following channel load,Document::Resetsets the document principal to this null principal.- With the patch, we still create the null principal during
RecvLoadURI. ButnsDocShell::DoURILoadearly-returns due to the syncabout:blankhandling and the document principal doesn't get updated. When the test later checks the document origin, it finds the one created duringRecvConstructBrowser, which doesn't have afirstPartyDomainset.
Hmm, it would be best if we could get firstPartyDomain from the beginning.
I guess you mean that we don't get it as part of https://searchfox.org/mozilla-central/rev/a9824b3ffc2efea7a317f114bc3192ccdffa0ef7/dom/ipc/WindowGlobalTypes.ipdlh#20,26 ? Or is the principal created later?
(I'm still trying to figure out when first party should be true. )
Updated•10 months ago
|
| Assignee | ||
Comment 189•10 months ago
|
||
According to the spec, canceling lazy loading should happen before
navigating to a fragment. If we cancel lazy loading in DoURILoad,
we won't cancel for same document navigation.
To my knowledge, this hasn't been an issue. But with sync-about-blank,
this would break wpt iframe-loading-lazy-nav-link-click-fragment.html.
Updated•10 months ago
|
| Assignee | ||
Comment 190•10 months ago
•
|
||
(In reply to Olli Pettay [:smaug][bugs@pettay.fi] from comment #188)
I guess you mean that we don't get it as part of https://searchfox.org/mozilla-central/rev/a9824b3ffc2efea7a317f114bc3192ccdffa0ef7/dom/ipc/WindowGlobalTypes.ipdlh#20,26 ?
Right.
CreateBrowser sets aWindowInit.principal() to nsOpenWindowInfo::PrincipalToInheritForAboutBlank(), which is sent to the child and thereby cloned. For this principal, the firstPartyDomain is empty and const.
From RecvConstructBrowser, we call BrowserChild::Init, nsWebBrowser::Create, nsDocShell::InitWindow, Initialize, EnsureDocumentViewer, CreateAboutBlankDocumentViewer, nsContentDLF::CreateBlankDocument, nsHTMLDocument::ResetToURI, Document::ResetToURI, and finally Document::SetPrincipals.
From what I see, the firstPartyDomain is usually set up in nsDocShellLoadState::SetupInheritingPrincipal() and needs an URI, which we don't have during browser construction. But at the end of browser creation, the Document principal is set, so this is where we would have to create a new principal.
Forward the ni? to Tim for Vincent's questions in comment 185 and comment 187
Comment 192•10 months ago
|
||
So the question is that in which cases should firstPartyDomain be set when dealing with about:blank documents, and what the value should be?
Comment 193•10 months ago
|
||
We have a unique firstPartyDomain for the about URLs that aren't loaded with the system principal. The unique firstPartyDomain is used if the given URI is an about URL when setting the firstPartyDomain to OriginAttributes. So, I think we should set the firstPartyDomain as soon as we know the URL is an about:blank page that doesn't inherit any principal.
| Assignee | ||
Comment 194•9 months ago
|
||
(In reply to Tim Huang[:timhuang] from comment #193)
We have a unique firstPartyDomain for the about URLs that aren't loaded with the system principal. The unique firstPartyDomain is used if the given URI is an about URL when setting the firstPartyDomain to OriginAttributes. So, I think we should set the firstPartyDomain as soon as we know the URL is an about:blank page that doesn't inherit any principal.
For the test browser_firstPartyIsolation_aboutPages.js test_remote_window_open_aboutBlank, the origin was previously e.g. moz-nullprincipal:{3f4920fe-8d1d-4e11-9032-c66ca5aa8bff}^firstPartyDomain=3f4920fe-8d1d-4e11-9032-c66ca5aa8bff.mozilla, which is different from ABOUT_URI_FIRST_PARTY_DOMAIN. We got this one from here. The test appears as if it doesn't expect to see ABOUT_URI_FIRST_PARTY_DOMAIN, as there is also test_aboutURL explicitly testing about pages, except for about:blank.
I think we want to do something like
nsCOMPtr<nsIURI> nullPrincipalURI = NullPrincipal::CreateURI(nullptr);
OriginAttributes attrs(aBrowsingContext->OriginAttributesRef());
attrs.SetFirstPartyDomain(true, nullPrincipalURI);
nsCOMPtr<nsIPrincipal> initialPrincipal = NullPrincipal::Create(attrs, nullPrincipalURI);
in CreateBrowser. But then, this assert fails. Though the tests pass.
But assuming I do want to use ABOUT_URI_FIRST_PARTY_DOMAIN. With the sync-about-blank patch, our principal comes from CreateBrowser here. If I want to apply ABOUT_URI_FIRST_PARTY_DOMAIN and not hit above assert, I can set the firstPartyDomain e.g. here. But the test will still fail, as mOriginNoSuffix and firstPartyDomain won't match. I.e. I then have an origin moz-nullprincipal:{b81259fc-60c2-4052-8ccb-d8f9748a242b}^firstPartyDomain=about.ef2a7dd5-93bc-417f-a698-142c3116864f.mozilla.
Updated•7 months ago
|
Updated•7 months ago
|
Comment 195•7 months ago
|
||
Comment on attachment 9460170 [details]
Bug 543435 - Cancel lazy loading already in InternalLoad. r=#dom-core,sefeng
Revision D234665 was moved to bug 1962976. Setting attachment 9460170 [details] to obsolete.
Updated•6 months ago
|
| Assignee | ||
Comment 196•5 months ago
|
||
The _ConfigurationModule blocks the parser to perform some configuration tasks
on new documents. But parser blocking doesn't work anymore for the initial
about:blank document. This patch ensures that browsing_context.create doesn't
complete before configuration tasks are done.
Comment 197•5 months ago
|
||
Comment on attachment 9494402 [details]
Bug 543435 - Don't rely on parser blocking in webdriver for initial page load. r=jdescottes
Revision D253541 was moved to bug 1967705. Setting attachment 9494402 [details] to obsolete.
| Assignee | ||
Updated•5 months ago
|
| Assignee | ||
Updated•5 months ago
|
| Assignee | ||
Updated•4 months ago
|
| Assignee | ||
Updated•4 months ago
|
| Assignee | ||
Updated•4 months ago
|
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Comment 203•2 months ago
|
||
Updated•2 months ago
|
Updated•1 month ago
|
Updated•24 days ago
|
| Assignee | ||
Comment 205•8 days ago
|
||
| Assignee | ||
Comment 206•8 days ago
|
||
The conceptual change is small but it requires several test changes.
In principle, tests cannot open a new empty window, modify the global, then
load their target document and expect their modifications to stick. Only if the
target URI is opened directly, the synchronously available window is reused. So
either tests need to do that, or rely on messages.
Comment 210•6 days ago
|
||
| Assignee | ||
Comment 212•5 days ago
|
||
Updated•5 days ago
|
Comment 213•5 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/5f9e366c17fc
https://hg.mozilla.org/mozilla-central/rev/8972ceeb1559
https://hg.mozilla.org/mozilla-central/rev/86c4f03a4305
Description
•