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

Ian Hickson ian at hixie.ch
Fri Jul 12 12:39:41 PDT 2013


On Fri, 5 Apr 2013, Boris Zbarsky wrote:
>
> The session history algorithm in the spec navigates to urls.

That wasn't the intent. I've tried to clarify it.


> As far as I can tell, on the face of it, this means that this testcase:
> 
>   <iframe name="x" srcdoc="aaa"></iframe>
>   <a target="x" href="http://web.mit.edu">
>     Click me, then later hit back
>   </a>
> 
> should fail to go back.

It should load the original resource.


> Again, as far as I can tell; actually telling anything for sure about 
> the navigation/shistory part of the spec is impossible.  :(

You know, it's disheartening to work on something and have you continually 
insult it like this. Please stick to positive feedback, which you are 
quite good at providing, and avoid the non-constructive negative commentary.

Thanks.


On Sat, 22 Jun 2013, Adam Barth wrote:
> 
> One tricky case here is what happens if you modify the srcdoc attribute:
> 
> <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 that in WebKit 
> and Blink, you'll get "bbb".  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.

If I'm not mistaken, the spec requires it to be "aaa", since that's what 
resource was loaded for the first session history item.

I don't see anything in the spec that allows "bbb" to be shown.


On Sun, 23 Jun 2013, Adam Barth wrote:
> 
> I guess it depends on what you mean by "rely".  We just treat the 
> about:srcdoc URL as something that, when fetched, retrieves the value 
> currently stored in the srcdoc attribute.

That doesn't seem defensible per the spec. In fact, the spec explicitly 
says that about:srcdoc is "unresolvable".

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list