When can we fire "load" events on iframes async from "load" firing on the window inside?
Categories
(Core :: DOM: Core & HTML, enhancement, P2)
Tracking
()
People
(Reporter: bzbarsky, Unassigned)
References
Details
Attachments
(3 files)
Reporter | ||
Comment 1•7 years ago
|
||
Reporter | ||
Comment 2•7 years ago
|
||
Reporter | ||
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
Reporter | ||
Updated•7 years ago
|
Reporter | ||
Comment 5•7 years ago
|
||
Reporter | ||
Updated•7 years ago
|
Comment 6•7 years ago
|
||
Updated•7 years ago
|
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 8•6 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:bzbarsky, could you have a look please?
Reporter | ||
Comment 9•6 years ago
|
||
This is blocked on another bug which is not landed, no?
Comment 10•6 years ago
|
||
Yeah but it is hard for the bot to know that.
Maybe the bot should not do that when there is a "depends on".
Calixte, what do you think?
Reporter | ||
Comment 11•6 years ago
|
||
Maybe the bot should not do that when there is a "depends on".
That is my point, yes, if the "depends on" is open...
Updated•6 years ago
|
Comment 13•5 years ago
|
||
Boris, can we land this behind a pref until we get the consensus on the spec issue?
Reporter | ||
Comment 14•5 years ago
|
||
We can. I'd need to check whether you get a green try run without bug 1440754, but if we're just wanting this for testing, and off by default, then it might not matter.
Reporter | ||
Comment 15•5 years ago
|
||
Reporter | ||
Comment 16•5 years ago
|
||
Behind a pref for now.
Reporter | ||
Comment 17•5 years ago
|
||
OK, I merged the patch to tip. With the pref turned off, things are fine, so we can land that way: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1de1c9a6587b18e3c356f7327fdfb1f869211e15
With the pref turned on, there are various oranges: https://treeherder.mozilla.org/#/jobs?repo=try&revision=918935e9b236faf8917bd79e7fd9806dc8fb3aa9
It's probably worth debugging those oranges, but I definitely won't have time for that until Monday.
Reporter | ||
Comment 18•5 years ago
|
||
Ah, right. dom/security/test/csp/test_iframe_sandbox.html
is failing because it more or less hits bug 1440754, which is why that "depends on" is there. That said, I just filed a clearer spec issue on that: https://github.com/whatwg/html/issues/4730
The toolkit/mozapps/extensions/test/browser/browser_CTP_plugins.js
failure is because toolkit/mozapps/extensions/content/extensions.xul
has markup sort of like this:
<browser id="html-view-browser" type="content" flex="1" disablehistory="true"/>
which queues up a load event on the <browser>
with this new change (and I think per spec that's the right behavior, fwiw). Then before that load event has a chance to fire the code in toolkit/mozapps/extensions/content/extensions.js
does:
htmlBrowser.loadURI("chrome://mozapps/content/extensions/aboutaddons.html", {
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
});
htmlBrowserLoaded = new Promise(
resolve => htmlBrowser.addEventListener("load", resolve, {once: true})
).then(() => htmlBrowser.contentWindow.initialize(htmlViewOpts));
which gets the about:blank
load event that's already queued up, thinks it got the "aboutaddons.html" load event and gets an exception because htmlBrowser.contentWindow.initialize
is undefined... Of course it would be even worse if it actually had an out-of-process thing there for that <browser type="content">
, like it really probably should. That type="content"
is why the about:blank is different-origin and hence is affected by these changes. Mark, do you know why the setup here is the way it is?
browser/components/extensions/test/browser/test-oop-extensions/browser_ext_runtime_openOptionsPage.js
, browser/base/content/test/webextensions/browser_extension_sideloading.js
, browser/components/extensions/test/browser/browser_ext_runtime_openOptionsPage.js
are all that same aboutaddons failure.
The html/browsers/the-window-object/named-access-on-the-window-object/navigated-named-objects.window.html
web-platform test goes from intermittent to perma-unexpected-pass. That's because if I recall correctly we do some async teardown stuff that the test expects to happen before it gets load events or something. And now we're firing load events a bit later, to the teardown gets a chance to actually happen....
Comment 19•5 years ago
|
||
(answering for Mark because he is out and asked me to answer if possible)
I'm not sure why there is type="content"
on the #html-view-browser
. I removed it (and also from the #shortcuts-view
browser in extensions.xul, which has similar logic), and all tests in toolkit/mozapps/extensions/test/browser/
still pass. type="content"
might have been cargo-culted from the #discover-browser
, which does actually load remote content (but has been obsoleted by bug 1546248 and will be removed soon as part of bug 1558982).
The #html-view-browser
and #shortcuts-view
browser elements both load chrome:-documents, so removing type="content"
from them should be fine.
If switching to type="content"
does not solve your problem, then I can also work on bug 1546711, which would remove the dependency on the "load" event from #html-view-browser
(by relying on a message / function call from a script in the browser to know that the content has loaded).
In Firefox 70, the #html-view-browser
will probably be gone anyway as part of bug 1558982, so you don't need to go out of your way to support this code path.
Reporter | ||
Comment 20•5 years ago
|
||
Thank you!
Comment 21•5 years ago
|
||
Given comment 18 and 19, this is probably not a good candidate for Fission M4. I'll put this in Future bucket for now.
Comment 22•5 years ago
|
||
Comment 23•5 years ago
|
||
Comment 24•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9640fec6a8ee
https://hg.mozilla.org/mozilla-central/rev/7cfecff122d2
Reporter | ||
Comment 25•5 years ago
|
||
Reopening, because part 2 got backed out...
Updated•5 years ago
|
Updated•5 years ago
|
Updated•2 years ago
|
Description
•