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

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

From: Glenn Maynard <glenn@zewt.org>
Date: Fri, 5 Oct 2012 17:04:44 -0500
Message-ID: <CABirCh_XwhcCb=RKGQpcc_RsZjq96KrJ2y0Xo8cjjKWchbBp+A@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: whatwg@lists.whatwg.org
On Fri, Oct 5, 2012 at 4:15 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 10/5/12 4:09 PM, Anne van Kesteren wrote:
>
>> Yeah sure, I'm not opposed to that. But that seems like a somewhat
>> bigger change, no? E.g. then you would also change <a>.click() be a
>> no-op I suppose? Or <form>.submit().
>>
>
> Are they not already?
>

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.)

-- 
Glenn Maynard
Received on Friday, 5 October 2012 22:05:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:11 GMT