1 description("Test page-break-{before,after}:always for overflow:{visible,hidden,scroll,auto} elements.");
5 var overflowValues = ["visible", "hidden", "scroll", "auto"];
6 var pageBreakPositions = ["page-break-before", "page-break-after"];
9 for (var position = 0; position < pageBreakPositions.length; position++) {
10 for (var value = 0; value < overflowValues.length; value++) {
11 var overflowStyle = "overflow:" + overflowValues[value];
12 var pageBreakStyle = pageBreakPositions[position] + ":always";
13 var testId = 'test-' + pageBreakStyle + '-for-' + overflowStyle;
14 testHtml += '<div style="' + overflowStyle + '"><p id="' + testId + '" style="' + pageBreakStyle + '">' + overflowStyle + ', ' + pageBreakStyle + '</p></div>\n';
17 testHtml += '<p id="test-last-page">end</p>';
18 document.getElementById("sandbox").innerHTML = testHtml;
20 var expectedValues = [
21 // page-break-{before,after}:always should take effect regardless of overflow value.
22 ['test-page-break-before:always-for-overflow:visible', 1],
23 ['test-page-break-before:always-for-overflow:hidden', 2],
24 ['test-page-break-before:always-for-overflow:scroll', 3],
25 ['test-page-break-before:always-for-overflow:auto', 4],
26 ['test-page-break-after:always-for-overflow:visible', 4],
27 ['test-page-break-after:always-for-overflow:hidden', 5],
28 ['test-page-break-after:always-for-overflow:scroll', 6],
29 ['test-page-break-after:always-for-overflow:auto', 7],
33 for (var i = 0; i < expectedValues.length; i++)
34 pageNumberForElementShouldBe(expectedValues[i][0], expectedValues[i][1]);
36 document.body.removeChild(document.getElementById("sandbox"));
39 var successfullyParsed = true;