1 description("Test for orphans");
5 createBlockWithRatioToPageHeight("page1-1", 0.5).style.pageBreakBefore = "always";
6 // Here about 10 lines are avaliable at the bottom of the current page.
7 createBlockWithNumberOfLines("page1-2", 15).style.orphans = 8;
9 createBlockWithRatioToPageHeight("page3", 0.5).style.pageBreakBefore = "always";
10 // we should put 'page4' block in the next page because of orphans.
11 createBlockWithNumberOfLines("page4", 15).style.orphans = 12;
13 createBlockWithRatioToPageHeight("page5-1", 0.5).style.pageBreakBefore = "always";
14 // '-1' is acceptable as a value of orphans. But it should have no effect.
15 createBlockWithNumberOfLines("page5-2", 20).style.orphans = -1;
17 pageNumberForElementShouldBe("page1-1", 1);
18 pageNumberForElementShouldBe("page1-2", 1);
20 pageNumberForElementShouldBe("page3", 3);
21 pageNumberForElementShouldBe("page4", 4);
23 pageNumberForElementShouldBe("page5-1", 5);
24 pageNumberForElementShouldBe("page5-2", 5);
26 document.body.removeChild(document.getElementById("sandbox"));
29 var successfullyParsed = true;