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

Re: [whatwg] scrdoc and session history don't play along in the spec

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sun, 23 Jun 2013 09:42:02 -0400
Message-ID: <51C6FB2A.1010304@mit.edu>
To: Adam Barth <w3c@adambarth.com>
Cc: whatwg <whatwg@lists.whatwg.org>
On 6/23/13 1:15 AM, Adam Barth wrote:
> One tricky case here is what happens if you modify the srcdoc attribute:

Ah, indeed.

> <iframe id="foo" srcdoc="aaa"></iframe>
> <script>
> [...] // Wait for the iframe to finish loading.
> document.getElementById("foo").srcdoc = "bbb";
> [...] // Wait for the iframe to finish loading.
> document.getElementById("foo").contentWindow.document.body.innerHTML = "ccc";
> </script>
> What happens if you click the back button now?

I believe Gecko's upcoming implementation will show "aaa", but I haven't 
tested to make sure.

> That's because we navigated back
> in the history to "about:srcdoc", which then looked at the srcdoc
> property and saw "bbb" even though the srcdoc property had "aaa" when
> that history entry was created.

Ah, we're just storing the srcdoc text in the history entry for srcdoc 
loads, I think, precisely because you can't rely on the value of the 

Received on Sunday, 23 June 2013 13:42:30 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:22 UTC