CSS2.1 Test Suite

Paged media (89 tests)

Test Refs Flags Info
+ 13.1 Introduction to paged media
abspos-paged-001 Paged Positioning in paged media: Initial containing block
abspos-paged-002 Paged Positioning in paged media: Positioning multiple pages
+ 13.2 Page boxes: the @page rule
at-page-rule-001 InvalidPaged Ignoring at-rules inside declaration blocks
  • At-rules inside @page blocks are parsed as invalid at-rule statements.
page-container-000 Paged Paged Media root container
  • For a single-page document, the containing box for the root element is the page area.
page-container-001 Paged 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 Paged paged media root percent height
  • A percentage height on the root element is relative to the page area height.
page-container-003 Paged 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 OptionalPaged Paged Media root container (float)
  • The root element when floated abuts the left or right edge of the page area.
page-container-005 BitmapsPaged 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 Paged Paged media - percent on root
  • A percentage width on the root element is relative to the page area width.
page-container-010 Paged 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-grammar-001 Paged @page grammar: white space allowed around pseudo
  • White space before and after a pseudo-page selector is allowed.
page-grammar-002 Paged @page grammar: white space not required around pseudo
  • White space before and after a pseudo-page selector is not required.
page-selectors-001 Paged page selector is optional in @page rules
  • 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 Paged @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 Paged 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 Paged @page margins shorthand using fixed physical units
  • A margin declaration within the @page context applies to the page box.
page-margin-001 Paged @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 Paged @page margins on bottom and left using percentages
  • A margin declaration within the @page context applies to the page box.
page-props-100-a Paged 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 Paged 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 Paged Page Selectors - First Page in LTR
  • The first page of a left-to-right document is a :right page.
first-page-selectors-002 Paged Page Selectors - First Page in RTL
  • The first page of a right-to-left document is a :left page.
first-page-selectors-003 OptionalPaged 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 OptionalPaged 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-props-100-a Paged 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 Paged 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 Paged 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 Paged 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 Paged 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 Paged 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 Paged 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 Paged Page cascade (first trumps right)
  • Properties specified in a :first @page context override those specified in :right @page contexts.
page-selectors-006 Paged 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 PagedRecommend 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 Paged allowed page breaks between blocks
  • Unforced breaking in the vertical margin between sibling block boxes is allowed only if the 'page-break-after' and 'page-break-before' properties of all the elements generating boxes that meet at this margin are 'auto' and the common ancestors of all the elements do not have a 'page-break-inside' value of 'avoid'.
allowed-page-breaks-001b OptionalPaged allowed page breaks between table rows
  • Unforced breaking in the vertical margin between sibling table rows is allowed only if the 'page-break-after' and 'page-break-before' properties of all the elements generating boxes that meet at this margin are 'auto' and the common ancestors of all the elements do not have a 'page-break-inside' value of 'avoid'.
allowed-page-breaks-001c OptionalPaged allowed page breaks between blocks within table cells
  • Unforced breaking in the vertical margin between sibling block boxes is allowed only if the 'page-break-after' and 'page-break-before' properties of all the elements generating boxes that meet at this margin are 'auto' and the common ancestors of all the elements do not have a 'page-break-inside' value of 'avoid'.
allowed-page-breaks-002 Paged 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 Paged 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 Paged 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 Paged forced page breaks
  • A page break MUST occur in the vertical margin between block boxes 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 Paged 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.
page-break-after-000 Paged page-break-after: always
  • The 'always' value of the 'page-break-after' property forces a page break after the box.
page-break-after-001 Paged page-break-after: auto
  • The 'always' value of the 'page-break-after' property forces a page break after the box.
page-break-after-002 Paged 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 Paged page-break-after (no inherit)
  • The 'page-break-after' property is not inherited.
page-break-after-004 InvalidPaged page-break-after (invalid syntax)
  • The syntax of the 'page-break-after' property is auto | always | avoid | left | right.
page-break-after-005 Paged page-break-after: initial value
  • The initial value of the 'page-break-after' property is 'auto'.
page-break-after-006 Paged page-break-after applies to paged media
  • The 'page-break-after' property applies to paged media only
page-break-after-007 Paged 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 Paged 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 Paged 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 Paged 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 Paged page-break-before: always
  • The 'always' value of the 'page-break-before' property forces a page break before the box.
page-break-before-001 Paged 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 Paged page-break-before inline elements
  • The 'page-break-before' property applies to block-level elements only.
page-break-before-003 Paged 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 Paged page-break-before (no inherit)
  • The 'page-break-before' property is not inherited.
page-break-before-005 Paged 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 InvalidPaged page-break-before (invalid syntax)
  • The syntax of the 'page-break-before' property is auto | always | avoid | left | right.
page-break-before-007 Paged 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 Paged page-break-before explicit auto test
  • The initial value of the 'page-break-before' property is 'auto'.
page-break-before-008 Paged page-break-before paged media
  • The 'page-break-before' property applies to paged media only
page-break-before-009 Paged 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 Paged 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 Paged 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 Paged Paged media - page-break-before on floats
  • The 'page-break-before' property applies to floated block-level elements in normal flow.
page-break-inside-000 Paged 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 Paged 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 Paged page-break-inside (inline elements)
  • The 'page-break-inside' property applies to block-level elements only.
page-break-inside-003 InvalidPaged @page page-break-inside invalid syntax
  • The syntax of the 'page-break-inside' property is auto | avoid.
page-break-inside-004 Paged @page page-break-inside:auto
  • The initial value of the 'page-break-inside' property is 'auto'.
page-break-inside-006 page-break-inside: paged media
  • The 'page-break-inside' property applies to paged media only.
page-break-margins-002 Paged 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 Paged 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 Paged 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 Paged breaks inside elements: orphans initial value
  • The initial value of the 'orphans' property is 2.
orphans-002 Paged breaks inside elements: orphans - block-level only
  • The 'orphans' property is only applied to block-level elements.
orphans-003 Paged breaks inside elements: orphans - inheritance
  • The 'orphans' property is inherited.
orphans-004a InvalidPaged orphans property syntax - integer
  • The syntax of the 'orphans' property is integer.
orphans-004b InvalidPaged orphans property syntax - one
  • The 'orphans' property accepts the integer one.
widows-001 Paged breaks inside elements: widows - initial value
  • The initial value of the 'widows' property is 2.
widows-002 Paged breaks inside elements: orphans - block-level only
  • The 'widows' property is only applied to block-level elements.
widows-003 Paged breaks inside elements: widows - inheritance
  • The 'widows' property is inherited.
widows-004a Paged widows property syntax - positive integer
  • The syntax of the 'widows' property is positive integer.
widows-004b Paged widows property syntax - one
  • The 'widows' property accepts the integer one.
+ 13.3.3 Allowed page breaks
page-breaks-100 Paged 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 Paged Page Breaks and Bottom Margin (with bg/border)
  • Page breaks are not allowed between the last child of a block and its parent.
+ 13.3.4 Forced page breaks
+ 13.3.5 "Best" page breaks
+ 13.4 Cascading in the page context