Re: [csswg-drafts] [css-device-adapt] @viewport is preloader-hostile

What @jacobrossi said. Also, the problem is particularly bad for 
images, but it also applies to any link element with a `media` 
attribute, including external styles, `preload`, and to some extent 
`preconnect`.

With `@viewport` you cannot *know* the dimensions of the viewport 
until you finished parsing (or at least tokenizing) all your HTML, 
found all external styles, downloaded all of them in their entirety 
and parsed them. If you also have blocking scripts before any one of 
your external styles, guess what? You have to wait on them as well** .
 Only then can you start downloading your responsive assets.

Otherwise, on the deployability front, browsers will have to continue 
to support `<meta viewport>` forever  and authors would have to 
continue sending down `<meta viewport>` for years to come. So IMO, we 
have to properly spec what it does, and we might as well try to extend
 it in a backwards compatible way to support the use-cases that it 
doesn't cover today.

I very much support @ChumpChief's proposal to start with the use-cases
 that need handling and work our way from there.

** The script part can be optimized away by creating a CSS preloader 
that looks for `@viewport` tokens, but that'd definitely add 
complexity for no good reason other than `@viewport`'s design.

-- 
GitHub Notification of comment by yoavweiss
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/258#issuecomment-230051099 
using your GitHub account

Received on Friday, 1 July 2016 21:27:59 UTC