blob: c1276a16fa16780ebda57b7521d393d1d6c2f02f [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>CSS Test: page-break-after applies to blocks</title>
<link rel="author" href="mailto:tclancy@revenution.com" title="Tom Clancy">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props">
<link rel="help" href="http://www.w3.org/TR/css3-page/#pg-br-before-after">
<meta content="paged" name="flags">
<meta content="The 'page-break-after' property must be applied to block-level elements and may be applied to other elements." name="assert">
<style type="text/css">
p {page-break-after: always;}
p.noBreak {
display: inline;
}
</style>
<script src="../resources/paged-media-test-utils.js"></script>
<script>
if (window.testRunner)
testRunner.dumpAsText();
function test()
{
pageNumberForElementShouldBe('test1', 1);
// As of February 2010, CSS spec says user agents may apply
// page-break-* to inline boxes. Though we are using 1 as the
// expected page number, 2 should be also OK.
pageNumberForElementShouldBe('test2', 1);
}
</script>
</head>
<body onload="runPrintingTest(test)">
<p>This sentence must be on the first page.</p>
<p class="noBreak" id="test1">This sentence must be on the second page.</p>
<p id="test2">This sentence must be either on the second or on the third page.</p>
</body>
</html>