1 description("Test for allowed page breaks");
5 // See CSS3: Paged Media 9.4. Allowed page breaks.
6 // http://dev.w3.org/csswg/css3-page/#allowed-pg-brk
7 createBlockWithRatioToPageHeight("page1", 0.8).style.pageBreakBefore = "always";
8 // We shoud break a page between block 'page1' and block 'page2' instead of
9 // breaking inside block 'page2' because there is no allowed page break points
10 // inside block 'page2'. Breaking at non-allowed position should be a last resort.
11 createBlockWithRatioToPageHeight("page2", 0.8);
13 createBlockWithRatioToPageHeight("page3-1", 0.6).style.pageBreakBefore = "always";
14 // We can break inside block 'page3-2' because page breaks may occur between
15 // line boxes inside a block box.
16 createBlockWithNumberOfLines("page3-2", 20);
18 pageNumberForElementShouldBe("page1", 1);
19 pageNumberForElementShouldBe("page2", 2);
20 pageNumberForElementShouldBe("page3-1", 3);
21 pageNumberForElementShouldBe("page3-2", 3);
23 document.body.removeChild(document.getElementById("sandbox"));
26 var successfullyParsed = true;