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

RE: [css3-mediaqueries] Width/Height Clarifications

From: Grant, Melinda <melinda.grant@hp.com>
Date: Wed, 4 Jun 2008 17:33:00 +0000
To: Brad Kemper <brkemper@comcast.net>, Anne van Kesteren <annevk@opera.com>
CC: fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <763AE400FE923441B74861D534DF254943F4392AFB@GVW0433EXB.americas.hpqcorp.net>

Brad said:
  >> fantasai said:
 > >> Opera's 'projection' mode is in some sense both paged and
> continuous.
> >> In this case you would want to use the viewport size, not the page
> >> box size (which depends on the content).
> Does it really? I thought that the reason "The size of a page
> box cannot be specified in CSS 2.1" is because it really ends
> up being the sheet size minus the page margins. The spec says
> that "[t]he page area includes the boxes laid out on that
> page", but it does not say that the page area size equals the
> total size of the boxes laid out on the page. An ocean can
> "include" fish, but the volume of the ocean is bigger than
> the total volume of the fish in it.

I agree that the page box size does not depend on the page content.  But the page box and the page area are not the same thing.  From http://dev.w3.org/csswg/css3-page/#page-box-page-rule,
        * The page box is a specialized CSS box that maps to a rectangular print media surface, such as a
        * page of paper. It is roughly analogous to the viewport.  As with other boxes, a page box consists
        * of margin, border, padding, and content areas.

That is, the page box does indeed contain the page margins.  The page area is synonymous with the content area of the page box.

> Thus, it seems to me that page box size is really the sheet
> size minus the page margins. So Opera's "projection" mode, if
> it has a page box size, that size would be equal to the
> screen size minus the page margins. If no page margins then
> it equals the screen size, which is also the viewport size
> because Opera sets the viewport to fill the screen.

So Opera's "projection mode" could use a page box size or a viewport size.  They should be analogous.

Fantasai said:
> >> In print media also the page box size can change: all even
> pages can
> >> be one size, all odd pages another, for instance.
> >> So Media Queries should not be referring to the page box.
> >> I'd suggest the terms "paper size" or "page size".

I'm not following this logic.  Yes, the page box size can change, but so can the viewport size.  In normal processing (that is, when the specified media size is used), the page box and the "paper size" or "page size" will be equivalent.  Assuming 'width' maps to the initial viewport width, it should likewise map to the initial page box size.

Brad said:
> But it is really the page box size that we care about. If the
> sheet is 8.5" wide, but the margins are all 3 inches wide,
> then only looking at the sheet size does not tell me what I
> need to know. Maybe min-page- box is the thing to look at
> (the smallest page box of a series of sheets).

I'm not getting this either.  (I think it really *is* the page box size we want, and not the page box minus margins.) The designer has control of the margin size, so why wouldn't you care about the size including margins?  What is it you need to know?  (The unprintable region?)  Or are you suggesting that what's really needed is content width rather than viewport or page box width?

Fantasai said:
> >> (The
> >> interaction of media queries and the 'size' property is a horrible
> >> mess, but I'm hoping we can deal with that in the Paged
> Media spec.)

Here I believe fantasai is referring to a situation where a declaration block inside a qualifying media query declares a page size which violates the qualifying media query.
        @media (max-width: 4in) {
          @page { size: letter;}
I believe an upcoming modification to css3-page will specify that, in such cases, the page size declaration is to be ignored.

Anne said:
> > FWIW, as far as I can tell these are the only issues that
> are holding
> > us back from moving
> >
> >  http://dev.w3.org/csswg/css3-mediaqueries/
> >
> > to Last Call again (for the last time hopefully!). I can look into
> > making some changes, but I'd appreciate input if you have
> any concrete
> > ideas.

When HP implemented Media Queries some years back, we could find no useful distinction in paged media between 'width' and 'device-width' or 'height' and 'device-height'.

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.)

  + 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.)

Best wishes,

Received on Wednesday, 4 June 2008 17:34:48 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:37 UTC