W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2014

Re: [whatwg] Fetch Objects and scripts/stylesheets

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 28 Jul 2014 17:07:56 +0000 (UTC)
To: Anne van Kesteren <annevk@annevk.nl>
Message-ID: <alpine.DEB.2.00.1407281707240.8748@ps20323.dreamhostps.com>
Cc: "whatwg@lists.whatwg.org" <whatwg@lists.whatwg.org>, Boris Zbarsky <bzbarsky@mit.edu>, William Chan (Dz) <willchan@chromium.org>, Ben Maurer <ben.maurer@gmail.com>
On Mon, 28 Jul 2014, Anne van Kesteren wrote:
> On Wed, Jul 23, 2014 at 2:33 AM, Ian Hickson <ian@hixie.ch> wrote:
> > Why not:
> >
> >    var mystyle = E('link', { rel: 'stylesheet', href: 'my.css', whenneeded: true });
> >    document.body.appendChild(mystyle);
> >    var myfetch = mystyle.fetch;
> >    ...
> >
> > ...where "E()" is some mechanism to easily create new elements (we need
> > one of those regardless), and "whenneeded" is some attribute that controls
> > the load policy (and in this case, tells it to not load yet, since I
> > presume that's what you're going to do next with the "myfetch" variable)?
> 
> Because that does not give you access to the additional parameters of
> Fetch: http://fetch.spec.whatwg.org/#requestinit (And this will grow
> with parameters such as omitReferrer.)

Why would you not be able to set them on the "myfetch" variable in the 
snippet above?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 28 July 2014 17:08:20 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:22 UTC