| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../resources/js-test-pre.js"></script> |
| <script src="resources/paged-media-test-utils.js"></script> |
| </head> |
| <body> |
| <p id="description"></p> |
| <div id="console"></div> |
| <div id="sandbox"></div> |
| <script> |
| description("Test for page-break-before:always and page-break-after:always"); |
| |
| function test() |
| { |
| createBlockWithRatioToPageHeight("firstPage", 0.1); |
| createBlockWithRatioToPageHeight("secondPage1", 0.1).style.pageBreakBefore = "always"; |
| createBlockWithRatioToPageHeight("secondPage2", 0.1).style.pageBreakAfter = "always"; |
| createBlockWithRatioToPageHeight("thirdPage", 0.1).style.pageBreakBefore = "always"; |
| |
| pageNumberForElementShouldBe('firstPage', 0); |
| pageNumberForElementShouldBe('secondPage1', 1); |
| pageNumberForElementShouldBe('secondPage2', 1); |
| // There must be only one page break between 'page-break-after: always' and 'page-break-before: always' |
| pageNumberForElementShouldBe('thirdPage', 2); |
| |
| document.body.removeChild(document.getElementById("sandbox")); |
| } |
| |
| var successfullyParsed = true; |
| </script> |
| <script>runPrintingTest(test);</script> |
| <script src="../resources/js-test-post.js"></script> |
| </body> |
| </html> |