Make initial about:blank loading into iframe not get overwritten by an async channel load
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
Webcompat Priority | P2 |
People
(Reporter: hsivonen, Assigned: hsivonen, NeedInfo)
References
(Depends on 2 open bugs, Blocks 15 open bugs, )
Details
(Keywords: html5)
Attachments
(1 file, 12 obsolete files)
(deleted),
text/x-phabricator-request
|
Details |
Deferred from bug 533381 to move this away from the critical path of HTML5 parser default enablement on the trunk. Steps to reproduce: 1) Load http://hsivonen.iki.fi/test/moz/about-blank-load.html Actual results: Gecko generates an initial about:blank document into the iframe and then loads another about:blank document into the iframe asynchronously. Expected results: Opera loads about:blank synchronously once and fires an async load event. WebKit and IE8 load the about:blank synchronously and fire a sync load event. HTML5 (currently) says to generate the about:blank DOM synchronously and not to fire a load event at all. Since all browsers fire a load event currently, not firing it at all scares me. However, firing sync events while the parser is on the call stack isn't nice, either, so I suggest doing what Opera does. Attaching a patch that makes many Mochitests fail. I expect this patch to need tweaking in terms of the initial history item in the iframe. In any case, changing anything here is likely to require changes to existing test cases.
Assignee | ||
Updated•15 years ago
|
Assignee | ||
Comment 1•13 years ago
|
||
bz, is there an important performance reason why the creation of the initial about:blank is created lazily? If not, I'd like to make new content viewer creation create the initial about:blank eagerly.
Comment 2•13 years ago
|
||
I don't know, offhand. I think nowadays we always end up creating it, basically, so I doubt there is one.
Assignee | ||
Comment 3•13 years ago
|
||
Does this look like something that's worthy of starting the test case adjustment effort? Note that this doesn't handle non-initial navigation to about:blank in a special way. I haven't yet done the research to see what's needed in that case.
Assignee | ||
Comment 4•13 years ago
|
||
The right patch this time.
Assignee | ||
Updated•13 years ago
|
Assignee | ||
Comment 5•13 years ago
|
||
Does this look like an acceptable approach? This patch yields the results I was after for the purposes of Web content and doesn't break the browser UI (at least not in obvious ways).
Assignee | ||
Comment 6•13 years ago
|
||
Assignee | ||
Comment 7•13 years ago
|
||
Quoting bug 372964 comment #31: > IsInitialDocument is the first document ever loaded in the window, and in > particular one whose inner window might need to be persisted across document > loads. This used to be about:blank in some cases... but with your changes we > might have more than one initial document, depending on how they are done. :( As far as I can tell, about:blank needs to be the initial document until it fires its load event at which point it becomes no longer initial in order to get the same effect as a parsed about:blank loading on top of a generated about:blank previously.
Assignee | ||
Comment 8•13 years ago
|
||
So I'm trying to get the load event fired by calling loadGroup->RemoveRequest(mChannel, nsnull, NS_OK); from a runnable. This makes the window.open()ed window in dom/tests/mochitest/general/test_bug631440.html never fire its load event. (That is, putting printfs in the code that's supposed to dispatch the event doesn't run. ) I have trouble figuring out why the code doesn't work in this case. Should I try firing the load event for the generated about blank completely manually (creating the event object and firing it)?
Assignee | ||
Comment 9•13 years ago
|
||
(In reply to comment #8) > I have trouble figuring out why the code doesn't work in this case. loadGroup->RemoveRequest ends up firing the load event for a different docshell/viewer/doc combination. bz, any ideas how this could happen? I'm guessing another document somehow ends up in the same load group, but I can't tell where that could happen.
Assignee | ||
Comment 10•13 years ago
|
||
(In reply to comment #9) > (In reply to comment #8) > > I have trouble figuring out why the code doesn't work in this case. > > loadGroup->RemoveRequest ends up firing the load event for a different > docshell/viewer/doc combination. Turns out it end up firing the load event for the opener but not for the openee.
Assignee | ||
Comment 11•13 years ago
|
||
Progress! I needed to reset mEODForCurrentDocument at the right moment.
Assignee | ||
Comment 12•13 years ago
|
||
Still chrome mochitests failing...
Assignee | ||
Comment 13•13 years ago
|
||
With proper principal in some cases.
Comment 14•13 years ago
|
||
http://hg.mozilla.org/try/rev/57ec25cc3a3d 10.204 + nsCOMPtr<nsIInterfaceRequestor> requestor = do_QueryInterface(mShell); 10.205 + 10.206 + nsCOMPtr<nsILoadGroup> loadGroup; 10.207 + 10.208 + nsresult rv = requestor->GetInterface(NS_GET_IID(nsILoadGroup), 10.209 + getter_AddRefs(loadGroup)); could be written nsCOMPtr<nsILoadGroup> loadGroup = do_GetInterface(mShell, &rv);
Assignee | ||
Comment 15•13 years ago
|
||
(In reply to comment #14) > could be written > > nsCOMPtr<nsILoadGroup> loadGroup = do_GetInterface(mShell, &rv); Thanks. I've made that change. (Aside: Is there any reason other than "legacy" for the interface requestor pattern exist in the code base now that we are no longer pretending that interfaces are frozen forever and we aren't expecting random third parties to swap out implementations from behind contract ids and interfaces?)
Comment 16•13 years ago
|
||
> and we aren't expecting random third parties to swap out implementations
For some contracts, we still are.
Assignee | ||
Comment 17•13 years ago
|
||
Assignee | ||
Comment 18•12 years ago
|
||
Still orange but works for dog food.
Assignee | ||
Updated•12 years ago
|
Assignee | ||
Updated•6 years ago
|
Updated•5 years ago
|
Updated•4 years ago
|
Comment 23•4 years ago
|
||
Assignee | ||
Comment 25•3 years ago
|
||
Assignee | ||
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:blank
s to go through the normal parsing path.
Let's see how orange everything goes:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d9e3d6f45aed9cbc21178d092069ce25e0e7bc45
Assignee | ||
Comment 27•3 years ago
|
||
Assignee | ||
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.
Assignee | ||
Comment 29•3 years ago
|
||
Assignee | ||
Comment 30•3 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #26)
but also changes later
about:blank
s 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
Assignee | ||
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
|
Updated•3 years ago
|
Assignee | ||
Comment 32•3 years ago
|
||
Rebased on top of latest trunk and bug 1736570:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=8d8b5150f41e95e17d3415ef420e99849dfa3471
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
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•2 years ago
|
Assignee | ||
Comment 35•2 years ago
|
||
Assignee | ||
Comment 36•2 years ago
|
||
Assignee | ||
Comment 37•2 years ago
|
||
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 38•2 years ago
|
||
Assignee | ||
Comment 39•2 years ago
|
||
Assignee | ||
Comment 40•2 years ago
|
||
Looks like I broke window.open()
.
Assignee | ||
Comment 41•2 years ago
|
||
Assignee | ||
Comment 42•2 years ago
|
||
Experimenting with undoing bug 472260:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=458f50c2fef05f011c625e1c9eeee56b9d7c0865
Assignee | ||
Comment 43•2 years ago
|
||
Assignee | ||
Comment 44•2 years ago
|
||
Assignee | ||
Comment 45•2 years ago
|
||
Assignee | ||
Comment 46•2 years ago
|
||
Assignee | ||
Comment 47•2 years ago
|
||
Assignee | ||
Comment 48•2 years ago
|
||
Assignee | ||
Comment 49•2 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
Assignee | ||
Comment 50•2 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
Assignee | ||
Comment 51•2 years ago
|
||
Assignee | ||
Comment 52•2 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.html
Also ./testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-event-iframe-element.html
nsDocShell::UpdateURLAndHistory
Assignee | ||
Comment 53•2 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
Assignee | ||
Comment 54•2 years ago
|
||
Assignee | ||
Comment 55•2 years ago
|
||
Assignee | ||
Comment 56•2 years ago
|
||
Assignee | ||
Comment 57•2 years ago
|
||
Primarily a rebase (also removed some failure expectations):
https://treeherder.mozilla.org/jobs?repo=try&revision=e8b94c3f9bee564acef045780af3a87ca7293cfa
Assignee | ||
Comment 58•2 years ago
|
||
Assignee | ||
Comment 59•2 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.
Assignee | ||
Comment 60•2 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.
Assignee | ||
Comment 61•2 years ago
|
||
Assignee | ||
Comment 62•2 years ago
|
||
Assignee | ||
Comment 63•2 years ago
|
||
Assignee | ||
Comment 64•2 years ago
|
||
Assignee | ||
Comment 65•2 years ago
|
||
Performance baseline for comparison with the try run in the previous comment:
https://treeherder.mozilla.org/jobs?repo=try&revision=8770e66af1ae220309b46a30608653ac27b8f2eb
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 66•2 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
Assignee | ||
Comment 67•2 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
Assignee | ||
Comment 68•2 years ago
|
||
Assignee | ||
Comment 69•2 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•2 years ago
|
Assignee | ||
Comment 70•2 years ago
|
||
Assignee | ||
Comment 71•2 years ago
|
||
Comment 72•2 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.
Assignee | ||
Comment 73•2 years ago
|
||
Try run with built-in WebExtensions hopefully disabled:
https://treeherder.mozilla.org/jobs?repo=try&revision=a59a4399a38d4611c72e2a33ce7a023a1e53a1bd
Comment 74•2 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.
Assignee | ||
Comment 75•2 years ago
|
||
Try run with built-in WebExtensions hopefully disabled for real this time:
https://treeherder.mozilla.org/jobs?repo=try&revision=4f2ba9c8c1178a8477046f1d1f689d3623823a35
Assignee | ||
Comment 76•2 years ago
|
||
Assignee | ||
Comment 77•2 years ago
|
||
Assignee | ||
Comment 78•2 years ago
|
||
Assignee | ||
Comment 79•2 years ago
|
||
Assignee | ||
Comment 80•2 years ago
|
||
Assignee | ||
Comment 81•2 years ago
|
||
Assignee | ||
Comment 82•2 years ago
|
||
Assignee | ||
Comment 83•2 years ago
|
||
Assignee | ||
Comment 84•2 years ago
|
||
Assignee | ||
Comment 85•2 years ago
|
||
Assignee | ||
Comment 86•2 years ago
|
||
Assignee | ||
Comment 87•2 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".
Assignee | ||
Comment 88•2 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.
Assignee | ||
Comment 89•2 years ago
|
||
Assignee | ||
Comment 90•2 years ago
|
||
Assignee | ||
Comment 91•2 years ago
|
||
Assignee | ||
Comment 92•2 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.
Assignee | ||
Comment 93•2 years ago
|
||
Assignee | ||
Comment 94•2 years ago
|
||
Assignee | ||
Comment 95•1 year ago
|
||
Assignee | ||
Comment 96•1 year ago
|
||
Assignee | ||
Comment 97•1 year ago
|
||
Assignee | ||
Comment 98•1 year ago
|
||
At least one of the about:blank ServiceWorker WPTs should go green:
https://treeherder.mozilla.org/jobs?repo=try&revision=2f75aa80c9592adf14c40d943ace1f3aea18891d
Assignee | ||
Comment 99•1 year ago
|
||
/html/anonymous-iframe/local-storage-initial-empty-document.tentative.https.window.html seems to fail without the patch, too.
Assignee | ||
Comment 100•1 year ago
|
||
Failures in /html/browsers/history/the-history-interface/004.html are known intermittents and the test also intermittently passes with the patch.
Assignee | ||
Comment 101•1 year 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.
Assignee | ||
Comment 102•1 year ago
|
||
browser_windowPrompt.js
Oops, wrong test. I meant toolkit/components/cookiebanners/test/browser/browser_cookieinjector.js
Assignee | ||
Comment 103•1 year ago
|
||
Assignee | ||
Comment 104•1 year ago
|
||
Assignee | ||
Comment 105•1 year ago
|
||
Assignee | ||
Comment 106•1 year ago
|
||
test_ext_webrequest_filter.html superficially looks like another case of failure to inherit the ServiceWorker controller across window.open
.
Assignee | ||
Comment 107•1 year ago
|
||
Try to inherit the controller for ServiceWorkers from the opener:
https://treeherder.mozilla.org/jobs?repo=try&revision=cd3e8619ff3d77c2eb1e6e441145914cc387930b
Assignee | ||
Comment 108•1 year ago
|
||
Should fix dev tool failures:
https://treeherder.mozilla.org/jobs?repo=try&revision=b5a9b63116ae8ce7d67c3ac4a76dfdebd06a7632
Assignee | ||
Comment 109•1 year ago
|
||
Trying to make add_task
tests not execute on about:blank:
https://treeherder.mozilla.org/jobs?repo=try&revision=f27ceea826880c0a78e7ba0cb2d1417b1802311b
Assignee | ||
Comment 110•1 year ago
|
||
Assignee | ||
Comment 111•1 year ago
|
||
Assignee | ||
Comment 112•1 year ago
|
||
Assignee | ||
Comment 113•1 year ago
|
||
Assignee | ||
Comment 114•11 months ago
|
||
Sigh. Lots of new orange after rebase:
https://treeherder.mozilla.org/jobs?repo=try&revision=a77b2dfdbe2b5312bd927e025430c7b78e7fad2d
Description
•