W3C home > Mailing lists > Public > www-style@w3.org > November 2012

[css3-values] viewport units (vw/vh/vmin/vmax) and varying page size

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Mon, 12 Nov 2012 02:16:02 +0100
Message-ID: <50A04DD2.1030309@kozea.fr>
To: www-style@w3.org

Section 5.1.2 of css3-values ED (about vw/vh/vmin/vmax) says:

    # Note that Paged Media defines how the initial containing block
    # transforms across varying page widths. This also affects these
    # units.

The first sentence is just wrong. css3-page defines the ICB based on the 
first page only, even if subsequent pages have a different size.

The issue remains: which do we want?

(1) Viewport units are based on the first page. This is easiest for 
specs and implementations, but for authors it makes the units useless 
with varying page size.
(Iím fine with that. The units are kind of pointless anyway in 
WeasyPrint: the author always knows exactly the page size.)

(2) Viewport units are based on the current page, and get a potentially 
different value on the same element if it is fragmented across pages.

(2a) The computed value of <length> remains (as currently) absolute. 
This implies elements (not boxes!) having a potentially different set of 
computed values for each page. This is just crazy, letís not go there.

(2b) Viewport units are resolved in used values, not computed values. 
They are treated like eg. `width: <percentage>` (as they should, they 
are even called viewport-percentage units in the spec!)
This implies changing the "Computed value" line of *every* CSS property 
that accepts <length>.

Note that (2a) and (2b) give the same layout: 1vw is independent of the 
element it applies to or its containing block, so inheriting it as-is or 
its absolute value is the same. The difference might be detectable from 
JavaScript (?)

(2b) is the most work for us (working group) but the best for authors. 
It is also the intended behavior of css3-values, according to the note 
quoted above. If we go with that, we might want to review the concept of 
"initial containing block" in paged media.

Simon Sapin
Received on Monday, 12 November 2012 01:16:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:23 UTC