NEW 7161
<iframe src=""> load event is dispatched synchronously unlike Chrome Canary and Firefox
https://bugs.webkit.org/show_bug.cgi?id=7161
Summary <iframe src=""> load event is dispatched synchronously unlike Chrome Canary a...
Alexey Proskuryakov
Reported 2006-02-09 11:30:32 PST
See the attached test case (which works as expected in Firefox and WinIE). The document body has an element: <p id=console>FAILURE</p> For whatever reason, document.getElementById("console") returns null if called from an IFrame onload handler.
Attachments
test case (513 bytes, text/html)
2006-02-09 11:31 PST, Alexey Proskuryakov
no flags
Alexey Proskuryakov
Comment 1 2006-02-09 11:31:07 PST
Created attachment 6367 [details] test case
Alexey Proskuryakov
Comment 2 2006-02-09 11:45:19 PST
Starts to work if the iframe is moved below <p>. "onclick handler" in the alert was supposed to be "onload handler", of course. It is there to indicate that the handler is called at all (didn't fire before, bug 3609).
Ahmad Saleem
Comment 3 2022-07-30 05:49:35 PDT
I am able to reproduce this bug in Safari 15.6 on macOS 12.5 using attached test case and Safari is only browser - which shows "FAILURE" while all other browsers return "SUCCESS" on this test case. I tested it in "Private Window" to avoid any cache issue as well. Just wanted to share updated test results. Thanks!
Ahmad Saleem
Comment 4 2022-07-30 05:50:04 PDT
Other browsers which show "SUCCESS" - Chrome Canary 106 and Firefox Nightly 105. Forgot to add them.
Ryosuke Niwa
Comment 5 2022-07-30 13:36:25 PDT
Ah, this is an issue of when load event is fired. Safari is loading iframe synchronously before p element has been inserted into the document.
Radar WebKit Bug Importer
Comment 6 2022-07-30 13:43:27 PDT
Ryosuke Niwa
Comment 7 2022-07-31 01:01:31 PDT
Hm... Chrome stable (103.0.5060.134) also fails the test. I suppose Chrome changed its behavior very recently.
Ahmad Saleem
Comment 8 2022-07-31 02:18:20 PDT
So I just tested this in Chrome Beta (104.0.5112.65) and Chrome Dev (105.0.5195.10) and both also show "FAILURE" for this test case, so indeed, it is something which got fixed in Chrome just in Canary branch. I tried to also look for some such iframe related bugs and only came across following (This is just guess work - so ignore, if irrelevant): -> Fixed just 19 days ago: https://chromium.googlesource.com/chromium/src/+/cf2f72ac8431c836b7ecb92a87018ee7f3c2db64
Ahmad Saleem
Comment 9 2023-08-18 11:33:37 PDT
Is this code segment in question: https://searchfox.org/wubkat/source/Source/WebCore/loader/PolicyChecker.cpp#259 // We ignore the response from the client for initial empty document loads and proceed with the load synchronously.
Note You need to log in before you can comment on or make changes to this bug.