Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / printing / script-tests / page-break-avoid.js
blob647d8d34a5b799f9852599c0478e93b69218aef7
1 description("Test for combined page-break-{before,after,inside}:avoid");
3 function test()
5     var block;
6     createBlockWithRatioToPageHeight("page1-1", 0.4).style.pageBreakBefore = "always";
7     // A block 'page2-1' must move to the next page because we cannot find any
8     // allowed page breaks till the end of block page2-8.
9     createBlockWithRatioToPageHeight("page2-1", 0.1).style.pageBreakAfter = "avoid";
10     createBlockWithRatioToPageHeight("page2-2", 0.1);
11     createBlockWithRatioToPageHeight("page2-3", 0.1).style.pageBreakBefore = "avoid";
12     createBlockWithRatioToPageHeight("page2-4", 0.1).style.pageBreakBefore = "avoid";
14     block = createBlockWithRatioToPageHeight("page2-5", 0.1);
15     block.style.pageBreakBefore = "avoid";
16     block.style.pageBreakAfter = "avoid";
18     createBlockWithRatioToPageHeight("page2-6", 0.1);
20     block = createBlockWithNumberOfLines("page2-7", 4);
21     block.style.pageBreakBefore = "avoid";
22     block.style.pageBreakAfter = "avoid";
23     block.style.pageBreakInside = "avoid";
25     createBlockWithRatioToPageHeight("page2-8", 0.1).style.pageBreakBefore = "avoid";
27     pageNumberForElementShouldBe("page1-1", 1);
28     pageNumberForElementShouldBe("page2-1", 2);
29     // Omit tests for intermediate blocks.
30     pageNumberForElementShouldBe("page2-8", 2);
32     document.body.removeChild(document.getElementById("sandbox"));
35 var successfullyParsed = true;