Revision control

1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<script src="../resources/js-test-pre.js"></script>
5
<script src="resources/paged-media-test-utils.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
<div id="sandbox"></div>
11
<script>
12
description("Test for allowed page breaks");
13
14
function test()
15
{
16
// See CSS3: Paged Media 9.4. Allowed page breaks.
18
createBlockWithRatioToPageHeight("page1", 0.8).style.breakBefore = "page";
19
// We shoud break a page between block 'page1' and block 'page2' instead of
20
// breaking inside block 'page2' because there is no allowed page break points
21
// inside block 'page2'. Breaking at non-allowed position should be a last resort.
22
createBlockWithRatioToPageHeight("page2", 0.8);
23
24
createBlockWithRatioToPageHeight("page3-1", 0.6).style.breakBefore = "page";
25
// We can break inside block 'page3-2' because page breaks may occur between
26
// line boxes inside a block box.
27
createBlockWithNumberOfLines("page3-2", 20);
28
29
pageNumberForElementShouldBe("page1", 1);
30
pageNumberForElementShouldBe("page2", 2);
31
pageNumberForElementShouldBe("page3-1", 3);
32
pageNumberForElementShouldBe("page3-2", 3);
33
34
document.body.removeChild(document.getElementById("sandbox"));
35
}
36
37
var successfullyParsed = true;
38
</script>
39
<script>runPrintingTest(test);</script>
40
<script src="../resources/js-test-post.js"></script>
41
</body>
42
</html>