load event not raise for nested iframes without src
Categories
(Core :: DOM: Navigation, defect, P3)
Tracking
()
People
(Reporter: miherlosev, Unassigned)
References
(Depends on 1 open bug)
Details
Attachments
(1 file)
570 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 Build ID: 20151029151421 Steps to reproduce: 1)Create a page with the following markup: <html> <body> <h1>Top level document</h1> <script> var iframe = document.createElement('iframe'); iframe.id = 'iframe1'; iframe.addEventListener('load', function () { var iframeDocument = this.contentDocument; var nestedIframe = iframeDocument.createElement('iframe'); nestedIframe.id = 'iframe2'; nestedIframe.addEventListener('load', function () { alert('nested iframe load event'); }); iframeDocument.body.appendChild(nestedIframe); }); document.body.appendChild(iframe); </script> </body> </html> 2)Open it in browser Actual results: Alert with text 'nested iframe load event' didn't show Expected results: I expect the alert with text 'nested iframe load event'
Comment 1•9 years ago
|
||
Confirmation: I also fail to see an alert display. Is this desired behavior or should an alert display? 20151029151421 Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:42.0) Gecko/20100101 Firefox/42.0
Updated•9 years ago
|
Comment 2•9 years ago
|
||
The relevant spec bit starts at https://html.spec.whatwg.org/#the-iframe-element:process-the-iframe-attributes I believe. What that will do is jump to https://html.spec.whatwg.org/#process-the-iframe-attributes and land in the Otherwise, if the element has no src attribute specified, and the user agent is processing the iframe's attributes for the "first time" case, which is in fact supposed to queue up a load event. In our case the problem is that we do the frame recursion check before we create the child browsing context, iirc, so we never perform the about:blank load in this case (because the parent document has the same URI) and we don't have a special-case for firing onload manually in the no-src case, because we depend on the about:blank load to do that. Fixing this probably requires sorting out 543435 and company and in general aligning closer with the spec in terms of about:blank handling for iframes... Michelle, note that this is not a layout issue; load events are not dependent on layout. One way to tell in general whether something is a layout issue or not, by the way, is whether doing all the same things in a display:none subtree shows the same problem.
Comment 4•8 years ago
|
||
Note that this is conceptually similar to bug 473396 and that when I tried to just skip the recursion check for about:blank in that bug things _still_ did not work, precisely because of the non-sync about:blank issues.
Attaching testcase from comment 0 to make it easier to run.
This looks like it works as expected now. Since this not my wheelhouse, :neha, would you know who would be suitable to confirm this is fixed (and add a automated test if needed)?
Comment 7•4 years ago
|
||
Kris, can you confirm this and add a test, if we don't already have one?
Comment 8•4 years ago
|
||
The attached test case shows that this is now working but we should find out why this is now working. Did we accidentally break something else?
Comment 9•4 years ago
|
||
I bisected the fix for this:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=b3158d143d833ec52c938e5235c1f86409fb764b&tochange=df860e79a6a3cc41712cfd86ffbd18cf84fce626
Probably: Bug 1497126 - Firefox fails to load nested equal iframes
Comment 10•3 years ago
|
||
This isn't fixed, strictly speaking. It just works when there's one level of nesting now. If someone tries to create two levels of nested about:blank iframes, it will still fail.
I think we probably need to update the recursion check to ignore either about:blank or an empty src attribute, since those will always start out empty, and can't lead to static infinite recursion.
Comment 11•3 years ago
|
||
Assigning to kmag to get back to, after the current Fission work is done.
Comment 12•2 years ago
|
||
AFAICT, this already works without fixing bug 543435. Am I missing something?
Updated•2 years ago
|
Comment 13•5 months ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Description
•