W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2013

[whatwg] Avoiding synchronous iframe load

From: Ryosuke Niwa <rniwa@apple.com>
Date: Tue, 15 Oct 2013 19:02:49 -0700
Message-id: <5ABABEFB-73A9-40F0-BA79-05CECF9BF0A1@apple.com>
To: whatwg <whatwg@lists.whatwg.org>

I'm trying to make page loads on iframe always asynchronous in WebKit.  However, the current specification appears to indicate that the navigation happens synchronously.

Namely, in the following example, the first alert should be "true" as far as I read the specification.

<script> var a = false; </script>
<iframe src="javascript:a=true" onload="a = true"></iframe>
<script> alert(a); /* or even setTimeout(function(){alert(a);},0); */ setTimeout(function(){alert(a);},10) </script>

On the other hand, Firefox and Internet Explorer do not synchronously load iframes, and the first alert in the example above yields "false" although it yields "true" on WebKit and Blink.

Am I reading the specification wrong/missing something?  If not, could you amend the specification to make page loads on an iframe always asynchronous?

- R. Niwa
Received on Wednesday, 16 October 2013 02:03:14 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:12 UTC