Re: [css-device-adaptation] Progress?

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.

@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?

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). 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.

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>

-- 
Rune Lillesveen

Received on Friday, 27 February 2015 10:39:28 UTC