W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2013

Re: [whatwg] <imgset> responsive imgs proposition (Re: The src-N proposal)

From: John Mellor <johnme@google.com>
Date: Fri, 15 Nov 2013 17:19:34 +0000
Message-ID: <CAG_kaUbc_S4n0HUdFYjPH0tafQwzj_vsTCOiiKg1enW9pDctKg@mail.gmail.com>
To: shane@shanehudson.net
Cc: Markus Ernst <derernst@gmx.ch>, Yoav Weiss <yoav@yoav.ws>, "Tab Atkins Jr." <jackalmage@gmail.com>, Ryosuke Niwa <rniwa@apple.com>, whatwg <whatwg@lists.whatwg.org>, Markus Lanthaler <markus.lanthaler@gmx.net>, "Jukka K. Korpela" <jkorpela@cs.tut.fi>, Adam Barth <w3c@adambarth.com>
On Fri, Nov 15, 2013 at 5:12 PM, Shane Hudson <mail@shanehudson.net> wrote:

> Could I just please clarify, since its been hard to follow the
> conversation, that having the style internal means that the prefetcher can
> still handle the images properly?

Yes, *but* only if you use a limited subset of CSS. Adam suggested earlier
(quoted below), that the preparser would only be able to match simple
selectors (like class and id), but not selectors that need to understand
the structure of the DOM tree (e.g. descendant or sibling selectors).
Personally, I suspect authors would trip up on this quite a bit.

On Tue, Nov 12, 2013 at 6:49 PM, Adam Barth <w3c@adambarth.com> wrote:
> The hard part is deciding what to put in the optimized subset.  We
> already parse media queries in the preload scanner to find imported
> stylesheets to load.  We probably won't be able to support every media
> query under the sun, but we could support maybe min-width, min-height,
> and min-device-pixel-ratio (or whatever you think is best along these
> lines).
> For selector matching, we wouldn't be able to support anything that
> needs to understand the structure of the tree (e.g., descendant
> selectors or sibling selectors).  I'd probably start with just single
> class and id selectors.
> In case it wasn't clear from the above, we wouldn't preload the image
> until we'd encountered the div with the appropriate class name.  When
> scanning that start tag token, we'd simulate CSS selector matching in
> the preload scanner to see if we've understood any rules that match.
> None of the above is all that difficult, and it's probably something
> we should do anyway to improve image preloading across the whole web.
> Adam
Received on Friday, 15 November 2013 17:20:16 UTC

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