Re: [whatwg] Resource loading in browsing context-less Documents

On Fri, 5 Oct 2012, Glenn Maynard wrote:
> On Fri, Oct 5, 2012 at 5:04 PM, Glenn Maynard <glenn@zewt.org> wrote:
> > 
> > a.click() is definitely not a no-op when not in a document, at least in
> > WebKit.  I've used this in place of window.open, to use rel=noreferrer (
> > http://lists.w3.org/Archives/Public/public-whatwg-archive/2012Aug/0238.html
> > ).
> >
> > <script>var a = document.createElement("a"); a.href = "http://google.com";
> > a.click();</script>
> >
> > (This seems to not work in Firefox.  This code was iOS-specific--code
> > running inside an app--so testing in FF wasn't an issue at the time.)
> 
> followup: http://krijnhoetmer.nl/irc-logs/whatwg/20121006#l-8
> 
> (Not sure which of WebKit or FF are correct above--maybe that's worth 
> chasing down--but that's a separate issue.)

Looking at the spec and at browsers more carefully, it seems that this is 
actually per spec (i.e. the spec says to follow the link). IE and Firefox 
apparently don't, WebKit and Opera apparently do. I've left the spec as is 
since it seems harmless and half the browsers do it.

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

Received on Tuesday, 18 December 2012 23:25:56 UTC