W3C home > Mailing lists > Public > www-style@w3.org > December 2008

Re: [css3-mediaqueries] Width/Height Clarifications

From: L. David Baron <dbaron@dbaron.org>
Date: Tue, 2 Dec 2008 17:45:55 -0800
To: fantasai <fantasai.lists@inkedblade.net>
Cc: "Grant, Melinda" <melinda.grant@hp.com>, Anne van Kesteren <annevk@opera.com>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <20081203014555.GA14464@pickering.dbaron.org>

On Thursday 2008-06-05 12:20 -0700, fantasai wrote:
> Grant, Melinda wrote:
>> I agree with fantasai: The width/height should be defined to map to the
>> window size and device-width/device-height should be mapped to the screen
>> size.  Both in my opinion should map to the page box for paged media.
>> (We really don't care if my monitor has speakers on the sides that make
>> it twice as wide as the display surface or if I'm using a laser printer
>> that's twice as tall as your inkjet printer -- the overall device
>> height/width is irrelevant.)
>> Maybe:
>>   + The 'height' media feature describes the height of the targeted
>>     display area of the output device. For continuous media, this is
>>     the height of the viewport. For paged media, this is the height
>>     of the page box.
>>   + The 'device-height' media feature describes the height of the
>>     rendering surface of the output device. For continuous media,
>>     this is typically the screen size. For paged media, this is the
>>     height of the page box.
>> (and analogous for 'width'/'device-width.)
> Actually, I think the device-width/height should refer to the page sheet
> size, not the page box. That's more analogous to the screen size, since
> it's the physical medium size. (The page box could be smaller than the page
> sheet, just like the viewport is smaller than the screen size.)
> That's the conclusion we reached in Medford, anyway.

So this is what the spec now says, and I'm currently trying to
understand what it means.  (What it says is that for paged media,
'width', 'height', and 'aspect-ratio' are based on the "page box"
and 'device-width', 'device-height', and 'device-aspect-ratio' are
based on the "page sheet size".)

After reading CSS 2.1, sections 13.1 and 13.2
( http://www.w3.org/TR/CSS21/page.html#page-intro ), the only cases
where these seem to differ are things like 2-up printing where two
pages are printed on a single sheet or tiling where a page is spread
over multiple sheets, and printing to a file which in turn is
printed to sheets of a different paper size (or somehow getting
confused about what the actual paper size is, in which case we're
not going to suddenly get it right for media queries).

I'm not entirely sure how to implement this distinction in a
browser, because when we're printing to a file or doing print
preview, we don't necessarily know anything about the sheet size,
only the page box size.  (The spec also perhaps even implies that
for print preview, we should be using the screen dimensions, which I
think is wrong.)

So I'm tempted to implement this by making them be the same all the
time (which is what Melinda had originally proposed above).

Yet above, you seemed to be saying that behavior is incorrect.  Why
do you think it should be incorrect, and what should we be doing


L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Wednesday, 3 December 2008 01:46:58 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:32 UTC