[Fission] The 'load' event should wait for OOP-iframes to load
Categories
(Core :: DOM: Content Processes, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: jwatt, Assigned: jwatt)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
Apart from this being a bug, it also prevents the Fission web crawler from reliably being able to take screenshots of OOP-iframes so that we can try to automate the discovery of visual Fission breakage on the Web.
Comment 1•6 years ago
|
||
![]() |
Assignee | |
Updated•6 years ago
|
![]() |
Assignee | |
Comment 2•6 years ago
•
|
||
From what I can tell, the 'load' event that is dispatched for a document happens when nsDocLoader::DocLoaderIsEmpty is called. If mDocumentRequest is null, then the event is created and dispatched by that method itself. If it's not null, that method sends out a state change notification and the eLoad event is dispatched by nsDocumentViewer::LoadComplete under the stack:
nsDocumentViewer::LoadComplete
nsDocShell::EndPageLoad
nsDocShell::OnStateChange
nsDocLoader::DoFireOnStateChange
nsDocLoader::doStopDocumentLoad (sends STATE_STOP | STATE_IS_DOCUMENT)
nsDocLoader::DocLoaderIsEmpty
It's not obvious to me how to change things for OOP-iframes. For example, should the nsDocShell::EndPageLoad call be delayed, or just the event dispatch that nsDocumentViewer::LoadComplete does?
Smaug, do you have any advice on how this should all work when we have OOP-iframes?
Comment 3•6 years ago
|
||
Could iframe tell to its parent when it isn't loading anymore, and then IsBusy method in nsDocLoader would use that information. And then rest of this would just work.
DocLoader couldn't use the current mChildList to check loading state, but it would need to look at relevant BrowsingContexts.
![]() |
Assignee | |
Comment 4•6 years ago
|
||
Thanks, Olli.
I have been look into this so assigning to myself. That said, I'm about to go on PTO for a couple of weeks so in the unlikely event that someone from DOM has time to fix this, please feel free to take it!
Updated•6 years ago
|
![]() |
Assignee | |
Comment 6•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment hidden (Intermittent Failures Robot) |
Comment 8•5 years ago
|
||
Hey Jonathan, over on bug 1559592 I'm adding some new Wdspec tests for taking screenshots of OOP iframes. Those currently fail with fission enabled, and it would be great to verify your fix. Given that the revision has been reviewed what's blocking you from getting it landed?
Comment 9•5 years ago
|
||
Is there a test for this? I'm asking because I have applied the patch here, then run this test dom/bindings/test/test_crossOriginWindowSymbolAccess.html
where the iframe is instead http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html
, and then run it with Fission enabled, and the load event handler is run before the iframe has loaded, which doesn't seem expected to me, but maybe I'm doing something wrong.
![]() |
Assignee | |
Comment 10•5 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #8)
what's blocking you from getting it landed?
I discovered a few intermittent failures when I repeated some of my Try runs. Most of those are solved now but there is still one instance of a failure due to the embedding document not having a docShell when the BrowserBridgeChild is created for an iframe it contains. Anyone who's curious can see that here:
I'll wallpaper that and land for now and file a bug to follow-up on that issue since I think for most folks the patch should meet their needs.
![]() |
Assignee | |
Comment 11•5 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #9)
Is there a test for this?
The primary test that I've been using is this one:
https://sub1.jwatt.org/oop-iframe.html
That has an 'alert()' that will notify you when the document's 'load' event fires. It embeds a cross-origin document that never finishes loading, so the alert isn't put up until you cancel the load by hitting the Escape key, or Firefox times it out.
I'm asking because I have applied the patch here, then run this test
dom/bindings/test/test_crossOriginWindowSymbolAccess.html
where the iframe is insteadhttp://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html
, and then run it with Fission enabled, and the load event handler is run before the iframe has loaded, which doesn't seem expected to me, but maybe I'm doing something wrong.
I'm not sure offhand (it's late) exactly how that test should behave differently with/without the patch applied. Can you describe what indicates that the load event isn't waiting for the subdoc load?
Comment 12•5 years ago
|
||
Comment 13•5 years ago
|
||
bugherder |
Comment 14•5 years ago
|
||
Please note that also the cross-origin iframe tests for bug 1559592 still fail, with this patch in Nightly now. Not sure if this is related to your filed bug 1576296, or something still remaining to do. Could you please check?
Comment 15•5 years ago
|
||
(In reply to Jonathan Watt [:jwatt] from comment #11)
I'm asking because I have applied the patch here, then run this test
dom/bindings/test/test_crossOriginWindowSymbolAccess.html
where the iframe is insteadhttp://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html
, and then run it with Fission enabled, and the load event handler is run before the iframe has loaded, which doesn't seem expected to me, but maybe I'm doing something wrong.I'm not sure offhand (it's late) exactly how that test should behave differently with/without the patch applied. Can you describe what indicates that the load event isn't waiting for the subdoc load?
Maybe a better example would be these tests: https://searchfox.org/mozilla-central/search?q=1559841&path=
They have a loop that waits for a bit to give the OOP iframe a chance to load. The hope was that with this patch those loops can be deleted. I haven't actually tried out if this patch fixes that or not. I'll do that once I get a build.
Comment 16•5 years ago
|
||
I looked through the tests that refer to this bug. browser/base/content/test/permissions/browser_temporary_permissions.js fails with the loop labelled with the bug 1559841 comment removed, dom/base/test/test_bug590812.html and layout/svg/tests/test_filter_crossorigin.html pass. dom/base/test/test_x-frame-options.html was failing anyways.
Comment 17•5 years ago
|
||
Given the amount of regressions filed for this bug, shouldn't we consider a backout?
Comment 18•5 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #17)
Given the amount of regressions filed for this bug, shouldn't we consider a backout?
Given that it also doesn't seem to fix a lot of the cases we particularly care about, I think that may be a good idea.
Comment 19•5 years ago
|
||
Ok, I checked with the sheriffs, and they will get it backed out.
![]() |
||
Comment 20•5 years ago
|
||
Backed out for several fission regressions, e.g. Bug 1576413:
https://hg.mozilla.org/mozilla-central/rev/4c09da80722fcf62db02f19dc67f3f1a6b88f84d
![]() |
Assignee | |
Comment 21•5 years ago
|
||
The latest revision of this is getting pretty close now:
Probably good enough to be able to retest if you're keen.
Comment 22•5 years ago
|
||
(In reply to Jonathan Watt [:jwatt] from comment #21)
The latest revision of this is getting pretty close now:
Thanks Jonathan! In case of Marionette you would only have to run the Wd jobs with fission enabled. I triggered these jobs on the given try build.
Comment 23•5 years ago
|
||
The Wd2 job which includes the screenshot tests is still broken for OOP iframes. The screenshot is still blank (white):
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=266245573&repo=try&lineNumber=101270
Comment 24•5 years ago
|
||
Thanks. I'm at a team meetup and on PTO next week, but I'll check it out after that.
Comment 25•5 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #23)
The Wd2 job which includes the screenshot tests is still broken for OOP iframes. The screenshot is still blank (white):
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=266245573&repo=try&lineNumber=101270
Has the test been updated to use the new snapshot API? Using a canvas to draw a cross-process iframe from a child process is never going to work, so even if it's loaded, it will still appear blank in that case.
Comment 26•5 years ago
•
|
||
(In reply to Kris Maglione [:kmag] from comment #25)
Has the test been updated to use the new snapshot API? Using a canvas to draw a cross-process iframe from a child process is never going to work, so even if it's loaded, it will still appear blank in that case.
Yes, that was done about 2 weeks ago via bug 1559592. The tests can be made work when you add a sleep right after navigation, as such I'm 99% sure it's related to this bug. Note that those tests make use of data URLs, in case that this makes a difference.
Updated•5 years ago
|
Comment 27•5 years ago
|
||
Comment 28•5 years ago
|
||
bugherder |
Comment 29•5 years ago
|
||
Good news is that this fixes most of the Wdspec screenshot failures, and while the screenshots look identical they are still reported as different. I filed bug 1583462 to get this investigated.
Description
•