- From: Yoav Weiss <yoav@yoav.ws>
- Date: Fri, 27 Feb 2015 18:48:13 +0100
- To: Rune Lillesveen <rune@opera.com>
- Cc: "www-style@w3.org" <www-style@w3.org>, Brad Kemper <brad.kemper@gmail.com>, Kenneth Rohde Christiansen <kenneth.christiansen@gmail.com>, Florian Rivoal <florian@rivoal.net>, Matt Rakow <marakow@microsoft.com>, David Bokan <bokan@chromium.org>
- Message-ID: <CACj=BEhLaL-5RA9L-OGz1EtJ=tU7yB_5kxdP4WX0fXhysYsrTw@mail.gmail.com>
On Fri, Feb 27, 2015 at 11:39 AM, Rune Lillesveen <rune@opera.com> wrote: > On Thu, Feb 26, 2015 at 11:52 PM, Yoav Weiss <yoav@yoav.ws> wrote: > > On Thu, Feb 26, 2015 at 10:58 PM, Brad Kemper <brad.kemper@gmail.com> > wrote: > > >>> At that point, you would know which images to fetch. If you are > >>> pre-loading based on viewpoint assumptions, then just stop once the > >>> assumptions prove false. > >>> > >>> PS: the length of the vw, vh, etc. units don't need to be resolved > until > >>> after the cascade stage either. > >> > >> > >> That is far from being true. `vw` units are used in `sizes` in order to > >> determine the image density regardless of the external CSS downloaded. > >> > >> > >> So, they don't use the initial viewport for that? > > > > They do now. But once @viewport is supported, they should switch to the > > actual viewport, or they risk resulting in redundant downloads. > > I'm assuming you're referring to the Blink implementation of responsive > images. > I'm referring to the Blink and WebKit implementations. > > @viewport is no different than <meta name=viewport> when it comes to > affecting the actual viewport. Are you currently not taking meta > viewport into account? > My bad. Meta viewport should be currently taken into account. (I need to add more testing around that tho) > > The only differences between the meta tag and @viewport for this > discussion are: > > 1. The meta tag can only appear in the document itself (not restricted > to <head> in the implementation in Blink, afaict). Hmm, I assumed that it was. > If @viewport is > allowed in external style sheets, it's easier to trigger loading extra > resources and trigger unnecessary reflows. > > 2. Implementations typically wait for stylesheets to finish loading > before applying the style, while the viewport meta is typically > applied as encountered. There shouldn't be a problem collecting > @viewport rules from stylesheets to calculate the viewport size for > pre-loading images for instance. > I agree, assuming that @viewport is encountered before any images have already started fetching. The further down @viewport is in the external style, the probability for that shrinks. > > This is much of an implementation detail, I think. Bottom line, what > I'm trying to say is that whatever pre-scanning, threaded html parser, > or whatever optimizations you have today, the resource loading problem > is exactly the same with <meta viewport> today when put in the same > position in the document: > > <head> > <style>@viewport { ... }</style> > <meta name="viewport" content="..."> > </head> > > I agree, which is why I think we should limit that position for @viewport (and maybe also for <meta viewport>, if still feasible), to avoid/reduce that risk. > -- > Rune Lillesveen >
Received on Friday, 27 February 2015 17:48:41 UTC