# CSS2.1 Test Suite

## Paged media (91 tests)

Test | Refs | Flags | Info
--- | --- | --- | ---
+ 13.1 Introduction to paged media
abspos-paged-001 |  | P | Positioning in paged media: Initial containing block
abspos-paged-002 |  | P | Positioning in paged media: Positioning multiple pages
+ 13.2 Page boxes: the @page rule
at-page-rule-001 |  | I P | Ignoring at-rules inside declaration blocks At-rules inside @page blocks are parsed as invalid at-rule statements.
page-container-000 |  | P | Paged Media root container For a single-page document, the containing box for the root element is the page area.
page-container-001 |  | P | paged media abspos containing block For a single-page document, the containing box for positioned content with no positioned ancestor is the page area.
page-container-002 |  | P | paged media root percent height A percentage height on the root element is relative to the page area height.
page-container-003 |  | P | paged media position fixed Elements with 'position: fixed' are positioned relative to the page area and are rendered on every page of the printed document.
page-container-004 |  | M P | Paged Media root container (float) The root element when floated abuts the left or right edge of the page area.
page-container-005 |  | G P | Paged content The page area includes the boxes laid out on that page. The content of the document is flowed into the page area of one or more page sheets.
page-container-006 |  | P | Paged media - percent on root A percentage width on the root element is relative to the page area width.
page-container-010 |  | P | Paged Media Height (percent) For HTML documents in paged media, when the HTML and BODY elements have heights of 100%, a percentage height on a child of BODY is relative to the page area height.
page-selectors-001 |  | P | An @page rule consists of the keyword '@page', followed by an optional page selector, followed by a block of declarations.
+ 13.2.1 Page margins
at-page-rule-002-a |  | P | @page margins on top and right using percentages A percentage right margin in the @page context applies to the page box and is relative to the width of the page box. A percentage top margin in the @page context applies to the page box and is relative to the height of the page box.
at-page-rule-002-c |  | P | Page Margins: bottom and left (percent) A margin declaration within the @page context applies to the page box. Percentage values on right and left margins are relative to the page box width. Percentage values on top and bottom margins are relative to the page box height.
page-margin-000 |  | P | @page margins shorthand using fixed physical units A margin declaration within the @page context applies to the page box.
page-margin-001 |  | P | @page margins on top and right using percentages A percentage right margin in the @page context applies to the page box and is relative to the width of the page box. A percentage top margin in the @page context applies to the page box and is relative to the height of the page box.
page-margin-002 |  | P | @page margins on bottom and left using percentages A margin declaration within the @page context applies to the page box.
page-props-100-a |  | P | Unqualified Page Contexts (first, right) A margin declaration within a page context which is not qualified by a pseudo-class (or, for css3, a named page identifier) sets the margins for every page of the document which doesn't match a page context with a :first, :right, or :left pseudoclass (or, for css3, a named page identifier).
page-props-100-b |  | P | Unqualified Page Contexts (first, left) A margin declaration within a page context which is not qualified by a pseudo-class (or, for css3, a named page identifier) sets the margins for every page of the document which doesn't match a page context with a :first, :right, or :left pseudoclass (or, for css3, a named page identifier).
+ 13.2.1.1 Rendering page boxes that do not fit a target sheet
+ 13.2.1.2 Positioning the page box on the sheet
+ 13.2.2 Page selectors: selecting left, right, and first pages
first-page-selectors-001 |  | P | Page Selectors - First Page in LTR The first page of a left-to-right document is a :right page.
first-page-selectors-002 |  | P | Page Selectors - First Page in RTL The first page of a right-to-left document is a :left page.
first-page-selectors-003 |  | P | Page Selectors - First Page in LTR Forced :left The first page of a left-to-right document can be forced as :left by inserting a page break.
first-page-selectors-004 |  | P | Page Selectors - First Page in RTL Forced :right The first page of a right-to-left document can be forced as :right by inserting a page break.
page-grammar-002 |  | P | pseudo_page grammar (white space before) A pseudo-page specifier within a page context may or may not be followed by white space.
page-props-100-a |  | P | Unqualified Page Contexts (first, right) A margin declaration within a page context which is not qualified by a pseudo-class (or, for css3, a named page identifier) sets the margins for every page of the document which doesn't match a page context with a :first, :right, or :left pseudoclass (or, for css3, a named page identifier).
page-props-100-b |  | P | Unqualified Page Contexts (first, left) A margin declaration within a page context which is not qualified by a pseudo-class (or, for css3, a named page identifier) sets the margins for every page of the document which doesn't match a page context with a :first, :right, or :left pseudoclass (or, for css3, a named page identifier).
page-props-101 |  | P | Right and Left Pages (page area equal) The right and left pages of a document may use differing margin styles that yield equivalent page area heights.
page-props-102 |  | P | Right and Left Pages (page area equal) The right and left pages of a document may use differing margin styles that yield different page area widths, but the UA may adjust the margins such that the page area widths are the same.
page-props-103 |  | P | Right and Left Pages (page area equal) The right and left pages of a document may use differing margin styles that yield different page area heights.
page-selectors-002 |  | P | Page Selectors: first, right, and left pages In CSS 2.1, page selectors may designate the first page, all left pages, or all right pages.
page-selectors-003 |  | P | Page cascade (right/left) Properties specified in a :left or :right @page rule override those specified in an @page rule that has no pseudo-class specified.
page-selectors-004 |  | P | Page cascade (first trumps right) Properties specified in a :first @page context override those specified in :right @page contexts.
page-selectors-006 |  | P | Page cascade (first trumps no pseudo-class) Properties specified in a :first @page rule override those specified in an @page rule with no pseudo-class specified.
+ 13.2.3 Content outside the page box
page-box-000 |  | P R | Page bleed Content should be allowed slightly beyond the page box to allow pages to 'bleed'.
+ 13.3 Page breaks
+ 13.3.1 Page break properties: 'page-break-before', 'page-break-after', 'page-break-inside'
allowed-page-breaks-001a |  | P | allowed page breaks between blocks Breaking in the vertical margin between block boxes (or rows in a table) is allowed only if the 'page-break-after' and 'page-break-before' properties of all the elements generating boxes that meet at this margin allow it, which is when at least one of them has the value 'always', 'left', or 'right', or when all of them are 'auto' and the nearest common ancestor of all the elements does not have a 'page-break-inside' value of 'avoid'.
allowed-page-breaks-001b |  | M P | allowed page break margin handling (table rows) Breaking in the vertical margin between table rows is allowed only if the 'page-break-after' and 'page-break-before' properties of the rows that meet at this margin allow it, which is when at least one of them has the value 'always', 'left', or 'right', or when all of them are 'auto' and the nearest common ancestor of all the elements does not have a 'page-break-inside' value of 'avoid'.
allowed-page-breaks-001c |  | M P | allowed page break margin handling inside table rows Breaking in the vertical margin between block boxes inside rows in a table is allowed only if the 'page-break-after' and 'page-break-before' properties of all the elements generating boxes that meet at this margin allow it, which is when at least one of them has the value 'always', 'left', or 'right', or when all of them are 'auto' and the parent table row does not have a 'page-break-inside' value of 'avoid'.
allowed-page-breaks-002 |  | P | allowed page break - line box breaking Breaking between line boxes is allowed only if the number of line boxes between the break and the start of the enclosing block box is the value of 'orphans' or more, and the number of line boxes between the break and the end of the box is the value of 'widows' or more and the value of the 'page-break-inside' property is 'auto'.
allowed-page-breaks-003 |  | P | allowed page break - dropping page-break-* restrictions If the standard restrictions do not provide enough break points to keep content from overflowing the page boxes, then the restrictions imposed by 'avoid' on the 'page-break-*' properties are dropped.
allowed-page-breaks-004 |  | P | allowed page break - dropping widows and orphans restrictions If the standard restrictions do not provide enough break points to keep content from overflowing the page boxes after dropping the restrictions imposed by 'avoid' on the 'page-break-*' properties then the restrictions due to 'windows' and 'orphans' are dropped as well.
forced-page-breaks-000 |  | P | 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'.
forced-page-breaks-001 |  | P | multiple forced page breaks case When multiple 'page-break-before' and/or 'page-break-after' properties with values of 'always', 'left' or 'right' apply at a margin, only one of them generates page breaks.
forced-page-breaks-002 |  | P | forced page breaks for different page values A page break MUST 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'.
page-break-after-000 |  | P | page-break-after: always The 'always' value of the 'page-break-after' property forces a page break after the box.
page-break-after-001 |  | P | page-break-after: auto The 'always' value of the 'page-break-after' property forces a page break after the box.
page-break-after-002 |  | P | page-break-after applies to blocks The 'page-break-after' property must be applied to block-level elements and may be applied to other elements.
page-break-after-003 |  | P | page-break-after (no inherit) The 'page-break-after' property is not inherited.
page-break-after-004 |  | I P | page-break-after (invalid syntax) The syntax of the 'page-break-after' property is auto | always | avoid | left | right.
page-break-after-005 |  | P | page-break-after: initial value The initial value of the 'page-break-after' property is 'auto'.
page-break-after-006 |  |  | page-break-after applies to paged media The 'page-break-after' property applies to paged media only
page-break-after-007 |  | P | page-break-after: auto The 'auto' value of the 'page-break-after' property neither forces nor forbids a page break after the box.
page-break-after-008 |  | P | page-break-after: right The 'right' value of the 'page-break-after' property forces one or two page breaks before the box so that the page after the break is formatted as a right page
page-break-after-009 |  |  | page-break-after: avoid The 'avoid' value of the 'page-break-after' property inhibits a page break after the element when possible.
page-break-after-010 |  | P | page-break-after: left The 'left' value of the 'page-break-after' property forces one or two page breaks before the box so that the page after the break is formatted as a left page
page-break-before-000 |  | P | page-break-before: always The 'always' value of the 'page-break-before' property forces a page break before the box.
page-break-before-001 |  | P | page-break-before :auto The 'auto' value of the 'page-break-before' property neither forces nor forbids a page break before the box.
page-break-before-002 |  | P | page-break-before inline elements The 'page-break-before' property applies to block-level elements only.
page-break-before-003 |  | P | page-break-before: left - The 'left' value of the 'page-break-before' property forces one or two page breaks before the box so that the page after the break is formatted as a left page.
page-break-before-004 |  | P | page-break-before (no inherit) The 'page-break-before' property is not inherited.
page-break-before-005 |  | P | page-break-before: right - The 'right' value of the 'page-break-before' property forces one or two page breaks before the box so that the page after the break is formatted as a right page.
page-break-before-006 |  | I P | page-break-before (invalid syntax) The syntax of the 'page-break-before' property is auto | always | avoid | left | right.
page-break-before-007 |  | P | page-break-before initial value The initial value of the 'page-break-before' property is 'auto', which neither forces nor forbids a page break before boxes.
page-break-before-007-b |  | P | page-break-before explicit auto test The initial value of the 'page-break-before' property is 'auto'.
page-break-before-008 |  | P | page-break-before paged media The 'page-break-before' property applies to paged media only
page-break-before-009 |  |  | page-break-before avoid The 'avoid' value of the 'page-break-before' property prevents a page break before the element when possible
page-break-before-010 |  | P | page-break-before :auto The 'auto' value of the 'page-break-before' property neither forces nor forbids a page break before the box.
page-break-before-011 |  | P | page-break-before initial value The initial value of the 'page-break-before' property is 'auto', which neither forces nor forbids a page break before boxes.
page-break-before-020 |  | P | Paged media - percent on root The 'page-break-before' property applies to floated block-level elements in normal flow.
page-break-inside-000 |  | P | page-break-inside:auto The 'auto' value of the 'page-break-inside' property neither forces nor forbids a page break inside the box.
page-break-inside-001 |  | P | page-break-inside: avoid (basic) The 'avoid' value of the 'page-break-inside' property causes the UA to avoid breaking inside the element.
page-break-inside-002 |  | P | page-break-inside (inline elements) The 'page-break-inside' property applies to block-level elements only.
page-break-inside-003 |  | I P | @page page-break-inside invalid syntax The syntax of the 'page-break-inside' property is auto | avoid.
page-break-inside-004 |  | P | @page page-break-inside:auto The initial value of the 'page-break-inside' property is 'auto'.
page-break-inside-006 |  | P | page-break-inside: paged media The 'page-break-inside' property applies to paged media only.
page-break-margins-002 |  | P | allowed page break margin handling When a page break occurs in the vertical margin between sibling block boxes (or rows in a table), the used values of the adjoining 'margin-bottom' and 'margin-top' properties are set to '0'.
page-break-margins-003 |  | P | page break margin handling When a page break occurs in the vertical margin between sibling block boxes, the used values of the adjoining 'margin-bottom' and 'margin-top' properties are set to '0'.
page-break-margins-004 |  | P | page break margin handling When a page break occurs in the vertical margin between sibling block boxes, the used values of the adjoining 'margin-top' property is set to '0'.
+ 13.3.2 Breaks inside elements: 'orphans', 'widows'
orphans-001 |  | P | breaks inside elements: orphans initial value The initial value of the 'orphans' property is 2.
orphans-002 |  | P | breaks inside elements: orphans - block-level only The 'orphans' property is only applied to block-level elements.
orphans-003 |  | P | breaks inside elements: orphans - inheritance The 'orphans' property is inherited.
orphans-004a |  | I P | orphans property syntax - integer The syntax of the 'orphans' property is integer.
orphans-004b |  | I P | orphans property syntax - invalid decimal The syntax of the 'orphans' property is integer.
orphans-004c |  | I P | orphans property syntax - invalid negative The syntax of the 'orphans' property is integer.
widows-001 |  | P | breaks inside elements: widows - initial value The initial value of the 'widows' property is 2.
widows-002 |  | P | breaks inside elements: orphans - block-level only The 'widows' property is only applied to block-level elements.
widows-003 |  | P | breaks inside elements: widows - inheritance The 'widows' property is inherited.
widows-004a |  | P | widows property syntax - integer The syntax of the 'widows' property is integer.
widows-004b |  | I P | widows syntax - invalid decimal The syntax of the 'widows' property is integer.
widows-004c |  | I P | widows property syntax - invalid negative The syntax of the 'widows' property is integer. Negative values for the 'widows' property are ignored.
+ 13.3.3 Allowed page breaks
page-breaks-100 |  | P | Page breaks: clearing bottom margin When an element would span a page break solely to satisfy a descendant's bottom margin, that margin is instead truncated and the element does not span pages.
page-breaks-101 |  | P | Page Breaks and Bottom Margin (with bg/border) When an element would span a page break solely to render a bottom margin, that margin is instead truncated and the element does not span pages (even when the element has a background or border).
+ 13.3.4 Forced page breaks
+ 13.3.5 "Best" page breaks
+ 13.4 Cascading in the page context