W3C home > Mailing lists > Public > www-style@w3.org > January 2011

Re: Browsers downloaded linked files regardless of media type

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 26 Jan 2011 21:29:01 -0500
Message-ID: <4D40D86D.4010807@mit.edu>
To: Antony Kennedy <antony@silversquid.com>
CC: www-style@w3.org
On 1/26/11 8:59 PM, Antony Kennedy wrote:
> Dynamic changing of the media is of course possible, but it seems completely appropriate to choose not to download the file until it applies.

The problem is that downloading is asynchronous.  So this introduces races.

And again, the stylesheet is exposed to the CSSOM.  Not loading it means 
either not exposing it or lying about the objects or ... something.

> In fact, this would make it very easy to defer loading of stylesheets

Why would this be desirable?

> Should there not be a way to avoid this unnecessary download and the performance hit it implies?

Perhaps.  Would you trust authors not to misuse it?

I could live with an opt-in "don't load this sheet if you don't support 
its medium" attribute.  It would need some careful defining in the face 
of media queries...

> Why write a screen stylesheet and a handheld one for performance

I don't know.  Do people do that "for performance"?  Last I checked this 
was mostly done because the form factor is very different....

> Perhaps only download files as necessary

Define "necessary"?

-Boris
Received on Thursday, 27 January 2011 02:30:04 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:36 GMT