CSS3 Paged Media Module
Testable Assertions

This document contains a table of testable assertions extracted from the CSS3 Paged Media Module, W3C Last Call Working Draft 10 October 2006 specification, and, for each assertion, a list of associated tests.

The table below is arranged into four columns:

  1. the assertion identifier,
  2. a link to the section of the specification that the assertion was extracted from,
  3. a list of tests for the assertion, and
  4. the text of the assertion, excerpted from the specification
ID Section Tests Quote/Description
3. Page Boxes: the @page Rule As for other boxes, a page box consists of margin, border, padding, and content areas.
3. Page Boxes: the @page Rule The edges of the page area on the first page establish the rectangle that is the initial containing block of the document.
3. Page Boxes: the @page Rule The margin area of a page box is divided into 16 margin boxes.
3. Page Boxes: the @page Rule Each margin box has its own margin, border, padding and content areas.
3. Page Boxes: the @page Rule the 'width' and 'height' properties do not apply to a page box.
3.1. Page terminology The width and height of the page box are determined by the size property.
3.1. Page terminology The page area acts as a container for all the boxes laid out within a given page box.
3.1. Page terminology Page layouts for documents using a left-to-right major writing direction have the earlier of the facing pages on the left.
3.1. Page terminology A first page can be either a left page or a right page but a UA MUST apply any rules defined for a first page in preference to those defined on a left page or a right page.
  3.2. Page types   If the UA supports the 'direction' property from CSS2 or the CSS 3 Text Module it MUST determine [the major writing direction for the document] using the value of that property on the root element
  3.3.1. Page size: the size property   [...] where one page box is rendered onto one page sheet, the 'size' property also indicates the size of the destination page sheet.
  3.3.1. Page size: the size property  
auto
The page box will be set to the size and orientation of the page sheet chosen by the UA.
  3.3.1. Page size: the size property  
landscape
Specifies that the page's content be printed in landscape orientation. The page box is the same size as the page, and the longer sides are horizontal.
  3.3.1. Page size: the size property  
portrait
Specifies that the page's content be printed in portrait orientation. The page box is the same size as the page, and the shorter sides are horizontal.
  3.3.1. Page size: the size property   When possible, output should be rendered on the media size indicated;
  3.3.1. Page size: the size property   if [the indicated media size is] not available, a larger size should be used
  3.3.1. Page size: the size property   if [both the indicated media size and a larger size are] not available, the contents of the page box should be scaled down to fit the smaller page sheet.
  3.3.1. Page size: the size property  
<length>
The page box will be set to the given absolute length.
  3.3.1. Page size: the size property   If only one length value is specified, it sets both the width and height of the page box (i.e., the box is a square).
  3.3.1. Page size: the size property   The page context has a font associated with it either by an explicit use of the 'font-family' and 'font-size' properties or from the UA's default style sheet. Therefore, values in units of 'em' and 'ex' refer to the page context's font.
  3.3.1. Page size: the size property  
A5
The page box SHOULD be set to the size of ISO A5 media: 148mm wide and 210 mm high.
  3.3.1. Page size: the size property  
A4
The page box SHOULD be set to the size of IS0 A4 media: 210 mm wide and 297 mm high.
  3.3.1. Page size: the size property  
A3
The page box SHOULD be set to the size of ISO A3 media: 297mm wide and 420mm high.
  3.3.1. Page size: the size property  
B5
The page box SHOULD be set to the size of ISO B3 media: 176mm wide by 250mm high.
  3.3.1. Page size: the size property  
B4
The page box SHOULD be set to the size of ISO B4 media: 250mm wide by 353mm high.
  3.3.1. Page size: the size property  
letter
The page box SHOULD be set to the size of North American letter media: 8.5 inches wide and 11 inches high
  3.3.1. Page size: the size property  
legal
The page box SHOULD be set to the size of North American legal: 8.5 inches wide by 14 inches high.
  3.3.1. Page size: the size property  
ledger
The page box SHOULD be set to the size of North American ledger: 11 inches wide by 17 inches high.
  3.3.1. Page size: the size property   These media size names can be used in conjunction with 'landscape' or 'portrait' to indicate size and orientation.
  3.3.1. Page size: the size property   User agents SHOULD also support Media Size Self-Describing Names as defined in Section 5 of [PWGMSN].
  3.4.1. Page selector grammar   fudge: I stopped here. Someone else made a first pass at this, based on the 2004 version.  So the rest of what's here may or may not still match the spec, and we may or may not agree with their assertions.  ;-)
  3.4.1. Page selector grammar   The syntax for a page selector is a specialization of the generic at-rule and MUST adhere to the following (more strict) grammar...
  3.4.1. Page selector grammar   A CSS Keyword used as a page name MUST be treated as a syntax error
  3.6. Left, right, and first pages   If different declarations have been given for left and right pages, the user agent MUST honor these declarations
  4.2. Maximum Dimension of margin boxes   The right edge of the containing box for the 'top-left-corner' and 'bottom-left-corner' margin boxes MUST line up with the left border edge of the page box.
  4.2. Maximum Dimension of margin boxes   the left edge of the containing box for margin boxes 'top-right-corner' and 'bottom-right-corner' MUST line up with the right border edge of the page box.
  4.2. Maximum Dimension of margin boxes   If the 'top-center' margin box is not empty, that is, it has content, it MUST be horizontally aligned with the middle of the page box content area, and the 'top-left' and 'top-right' MUST have the same width.
  4.2. Maximum Dimension of margin boxes   If the 'bottom-center' margin box is not empty, that is, it has content, it MUST be horizontally aligned with the middle of the page box content area, and the 'bottom-left' and 'bottom-right' MUST have the same width.
  4.2. Maximum Dimension of margin boxes   If the 'left-middle' margin box is not empty, that is, it has content, it MUST be vertically aligned with the middle of the page box content area, and the 'left-top' and 'left-bottom' margin boxes MUST have the same height
  4.2. Maximum Dimension of margin boxes   If the 'right-middle' margin box is not empty, that is, it has content, it MUST be vertically aligned with the middle of the page box content area, and the 'right-top' and 'right-bottom' margin boxes MUST have the same height.
  4.2. Maximum Dimension of margin boxes   If a margin box is empty, that is, it doesn't have any content, and its 'width' or height is set to 'auto', it MUST act as if it were not there, except ... When the 'top-center' and 'top-left' margin boxes are not empty and the 'top-right' box is empty, then its 'width' MUST be the same as the 'top-left' margin box, but its 'margin', 'border', and 'padding' properties do not apply.
  4.2. Maximum Dimension of margin boxes   If a margin box is empty, that is, it doesn't have any content, and its 'width' or height is set to 'auto', it MUST act as if it were not there, except ... When the 'top-center' and 'top-right' margin boxes are not empty and the 'top-left' box is empty, then its 'width' MUST be the same as the 'top-right' margin box, but its 'margin', 'border', and 'padding' properties do not apply.
  4.2. Maximum Dimension of margin boxes   If a margin box is empty, that is, it doesn't have any content, and its 'width' or height is set to 'auto', it MUST act as if it were not there, except ... When the 'bottom-center' and 'bottom-left' margin boxes are not empty and the 'bottom-right' box is empty, then its 'width' MUST be the same as the 'bottom-left' margin box, but its 'margin', 'border', and 'padding' properties do not apply.
  4.2. Maximum Dimension of margin boxes   If a margin box is empty, that is, it doesn't have any content, and its 'width' or height is set to 'auto', it MUST act as if it were not there, except ... When the 'bottom-center' and 'bottom-right' margin boxes are not empty and the 'bottom-left' box is empty, then its 'width' MUST be the same as the 'bottom-right' margin box, but its 'margin', 'border', and 'padding' properties do not apply.
  4.2. Maximum Dimension of margin boxes   If a margin box is empty, that is, it doesn't have any content, and its 'width' or height is set to 'auto', it MUST act as if it were not there, except ... When the 'left-middle' and 'left-top' margin boxes are not empty and the 'left-bottom' margin box is empty, then its 'height' MUST be the same as the 'left-top' margin box, but its 'margin', 'border', and 'padding' properties do not apply.
  4.2. Maximum Dimension of margin boxes   If a margin box is empty, that is, it doesn't have any content, and its 'width' or height is set to 'auto', it MUST act as if it were not there, except ... When the 'left-middle' and 'left-bottom' margin boxes are not empty and the 'left-top' margin box is empty, then its 'height' MUST be the same as the 'left-bottom' margin box, but its 'margin', 'border', and 'padding' properties do not apply.
  4.2. Maximum Dimension of margin boxes   If a margin box is empty, that is, it doesn't have any content, and its 'width' or height is set to 'auto', it MUST act as if it were not there, except ... When the 'right-middle' and 'right-top' margin boxes are not empty and the 'right-bottom' margin box is empty, then its 'height' MUST be the same as the 'right-top' margin box, but its 'margin', 'border', and 'padding' properties do not apply.
  4.2. Maximum Dimension of margin boxes   If a margin box is empty, that is, it doesn't have any content, and its 'width' or height is set to 'auto', it MUST act as if it were not there, except ... When the 'right-middle' and 'right-bottom' margin boxes are not empty and the 'right-top' margin box is empty, then its 'height' MUST be the same as the 'right-bottom' margin box, but its 'margin', 'border', and 'padding' properties do not apply.
  4.2. Maximum Dimension of margin boxes   Values of the 'width', 'height', 'padding', 'margin', and 'border' properties for these boxes that result in a value larger than the maximum [width or height for the containing box of the margin box] MUST be ignored from the outside in ...
  4.2. Maximum Dimension of margin boxes   If, after ignoring margin, border, and padding, the width (or height) [of a margin box] is too large, the maximum value [of the margin box's containing box] MUST be used. instead
  5.3. Breaks inside elements: 'orphans', 'widows'   The 'orphans' property specifies the minimum number of lines of a paragraph that MUST be left at the bottom of a page.
  5.3. Breaks inside elements: 'orphans', 'widows'   The 'widows' property specifies the minimum number of lines of a paragraph that MUST be left at the top of a page
  5.5.Forced page breaks   A page break MUST occur [in the vertical margin between block boxes (or rows in a table)] if, among the 'page-break-after' and 'page-break-before' properties of all the elements generating boxes that meet at this margin, there is at least one with the value 'always', 'left', or 'right'.
  5.5.Forced page breaks   A page break MUST also occur [in the vertical margin between block boxes (or rows in a table)] if the last line box above this margin and the first one below it do not have the same value for 'page'.
  6.2. Determining which counter or string-set value to use: the 'page-policy' property   if the counter-reset property is used in the same context, the 'page-policy' MUST be used to determine when a counter or string value is reset.
  6.3. Number of pages - 'pages' counter   A UA MUST act as if there was a counter with the name of 'pages' and its initial value was set to the total number of pages
  6.3. Number of pages - 'pages' counter   A UA that doesn't support 'pages' SHALL ignore any 'content' property that uses the 'pages' counter.
  8. Orienting an image on the page   A positive value MUST rotate the image around its center, to the right (in a clockwise direction), by the given number of degrees, radians or grads. Negative values MUST  perform the same rotation, but to the left or counter-clockwise direction.