W3C home > Mailing lists > Public > www-style@w3.org > February 2015

Re: [css-device-adaptation] Progress?

From: Rune Lillesveen <rune@opera.com>
Date: Fri, 27 Feb 2015 11:39:00 +0100
Message-ID: <CANz6XvRJu80JG3O0SrQ3E9KQSK9Vk64tGxzSs22a-7UyLe_nkA@mail.gmail.com>
To: Yoav Weiss <yoav@yoav.ws>, "www-style@w3.org" <www-style@w3.org>
Cc: 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>
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:01 UTC