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

Re: [whatwg] Avoiding synchronous iframe load

From: Ryosuke Niwa <rniwa@apple.com>
Date: Thu, 17 Oct 2013 01:04:19 -0700
Message-id: <2DE47EF1-9571-40BA-AA3E-A5B4A7519CB9@apple.com>
To: whatwg <whatwg@lists.whatwg.org>
On Oct 15, 2013, at 7:02 PM, Ryosuke Niwa <rniwa@apple.com> wrote:
> 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>

I’ll add that Firefox and Internet Explorer both load about:blank asynchronously.

e.g. the first alert in
<script> var a = false; </script>
<iframe src=“about:blink" onload="a = true"></iframe>
<script> alert(a); /* or even setTimeout(function(){alert(a);},0); */ setTimeout(function(){alert(a);},10) </script>
will say “false” in both browsers whereas it says “true” on Safari and Chrome.

- R. Niwa
Received on Thursday, 17 October 2013 08:04:43 UTC

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