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

Re: Media Queries and optimizing what data gets transferred

From: Henri Sivonen <hsivonen@iki.fi>
Date: Mon, 28 Jan 2013 15:40:55 +0200
Message-ID: <CAJQvAudJf9FYK7qXyTKxsB9HiLKcisra5Vd7+nyYSpBP4DZyrQ@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Andy Davies <dajdavies@gmail.com>, www-style list <www-style@w3.org>, Ilya Grigorik <ilya@igvita.com>
On Fri, Jan 25, 2013 at 8:28 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> As Boris has explained, it's not performance issues, but rather author
> expectations.  The average author expects a CSSOM to exist for all the
> stylesheets in the page, and when the set of matched MQs changes, for
> the styles to change at the same time, not a network-roundtrip later.

Does the average author really expect anything about CSSOM? I would
guess that the average author doesn't use CSSOM beyond the sugaring
for the style attribute and maybe getComputedStyle() and even those
hidden behind a JavaScript library.

The use cases for fiddling with the style rules of external sheets in
the OM (beyond the immediate style attribute sugaring) don't seem that
common.

To me, optimizing the availability of inapplicable style sheet data in
the OM over what gets transferred seems totally backwards compared to
what the mythical average author wants.

> If any browser *did* defer them indefinitely by default, they'd get
> compat bugs.

This I can believe.

So could the problem be solved by adding an attribute on <link> that
turns off the ability to reach the OM of that stylesheet from scripts
(at least unless some async access request API is used first) and then
making browsers not load stylesheets until they are applicable (i.e.
making e.g. printing wait for additional stylesheets to be fetched)?

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/
Received on Monday, 28 January 2013 13:41:22 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:04 GMT