W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2016

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

From: Jacob Rossi via GitHub <sysbot+gh@w3.org>
Date: Fri, 01 Jul 2016 20:43:35 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-230043273-1467405813-sysbot+gh@w3.org>
@bradkemper here's the issue, as I understand it:

When the parser loads the document, it may hit responsive images 
(srcset/<picture>). At that point, the parser wants to be able to kick
 off network requests for the right resource.  However, if there's an 
at-viewport rule in an external stylesheet (which, by definition, is 
async loaded) then you don't actually know what the final viewport 
settings will be. As such, the parser/preloader doesn't know which 
resource to go fetch. So either (a) you guess and may end up loading 
the wrong one (make 2 img request, waste data, and possibly flash of 
the wrong content), or (b) block and wait until you've loaded the 
external stylesheets (non-starter, PLT would get killed).

<meta> doesn't have this issue since it's inline in the HTML. 
Additionally, an inline style with at-viewport doesn't have the issue 
since it can be parsed synchronously.

-- 
GitHub Notification of comment by jacobrossi
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/258#issuecomment-230043273 
using your GitHub account
Received on Friday, 1 July 2016 20:43:51 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:00 UTC