- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Sun, 23 Jun 2013 09:42:02 -0400
- 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 attribute. -Boris
Received on Sunday, 23 June 2013 13:42:30 UTC