[css-grid] Scroll reset position when updating inner html on content
[WebKit-https.git] / LayoutTests / printing / page-break-orphans.html
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 orphans");
13
14 function test()
15 {
16     createBlockWithRatioToPageHeight("page1-1", 0.5).style.pageBreakBefore = "always";
17     // Here about 10 lines are avaliable at the bottom of the current page.
18     createBlockWithNumberOfLines("page1-2", 15).style.orphans = 8;
19
20     createBlockWithRatioToPageHeight("page3", 0.5).style.pageBreakBefore = "always";
21     // we should put 'page4' block in the next page because of orphans.
22     createBlockWithNumberOfLines("page4", 15).style.orphans = 12;
23
24     createBlockWithRatioToPageHeight("page5-1", 0.5).style.pageBreakBefore = "always";
25     // '-1' is acceptable as a value of orphans. But it should have no effect.
26     createBlockWithNumberOfLines("page5-2", 20).style.orphans = -1;
27
28     pageNumberForElementShouldBe("page1-1", 1);
29     pageNumberForElementShouldBe("page1-2", 1);
30
31     pageNumberForElementShouldBe("page3", 3);
32     pageNumberForElementShouldBe("page4", 4);
33
34     pageNumberForElementShouldBe("page5-1", 5);
35     pageNumberForElementShouldBe("page5-2", 5);
36
37     document.body.removeChild(document.getElementById("sandbox"));
38 }
39
40 var successfullyParsed = true;
41 </script>
42 <script>runPrintingTest(test);</script>
43 <script src="../resources/js-test-post.js"></script>
44 </body>
45 </html>