W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2020

Re: [csswg-drafts] [css-mediaqueries] [css-page] Viewport units / media queries interaction in print documents. (#5437)

From: Mike Bremford via GitHub <sysbot+gh@w3.org>
Date: Tue, 18 Aug 2020 14:22:32 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-675508732-1597760551-sysbot+gh@w3.org>
> > Media queries do not honor size: they assume the paper size that would be chosen if no @page rules were specified

> I don't get why that would be problematic? The user should be able to choose a page size, and this allows the website to react to that.

Well I suppose when you put it like that :-) Sure. But this means the user is the only one that can choose the page size used for media query matching, and it's done by some out-of-band method rather than adding a @page to a user stylesheet. Put another way, media queries would only be used by authors to query the user's requested page size - a user couldn't use one in a user stylesheet to query the page size chosen by the author. 

On rereading this paragraph, it doesn't really sound like it's a big deal. So not, not really problematic. The first-pass scan for unqualified @page rules is neater and a bit more CSS-y, but certainly it's more work. Of course, as it is now with the value being basically undefined, a UA could do that and still be in compliance...

> I would expect device-width to be the full page size, and width to match viewport units

Whoops. I forgot about `device-width`. The [PDFReactor example](https://www.pdfreactor.com/product/doc_html/index.html#MediaQueries) shows this. PrinceXML doesn't mention `device-width`, but a bit of digging found [this post](https://www.princexml.com/forum/topic/4434/media-query-does-not-trigger-when-expected?p=1#22182) which makes it look like`width` is the same as 100vw, exactly as you suggest. Your CSS example makes sense, so yes I agree on device-width.

>  so they just compute to auto? Get parsed as auto? They don't get parsed? Something else? 

As of right now it falls back to `size: auto` for us. I agree it should be defined, although I don't think it makes much difference if it's invalid at parse or compute time.

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 18 August 2020 14:22:34 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:13 UTC