summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/CSS2/pagination
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/CSS2/pagination
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/CSS2/pagination')
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-001a.xht101
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-001b.xht76
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-001c.xht121
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-002.xht79
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-003.xht48
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-004.xht60
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-005.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-006.xht45
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-007a.xht36
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-007b.xht38
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-1-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-10-print.html20
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-11-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-12-print.html22
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-13-print.html23
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-14-print-ref.html20
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-14-print.html22
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-15-print-ref.html20
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-15-print.html22
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-2-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-3-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-4-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-5-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-6-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-7-print.html22
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-8-print-ref.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-8-print.html23
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-9-print.html22
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-print-ref.html19
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-1-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-2-print-ref.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-2-print.html22
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-3-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-4-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-5-print-ref.html33
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-5-print.html35
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-6-print-ref.html17
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-6-print.html19
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-7-print-ref.html25
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-7-print.html28
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-8-print-ref.html26
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-8-print.html28
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-9-print-ref.html30
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-9-print.html33
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/forced-page-breaks-000.xht46
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/forced-page-breaks-001.xht24
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/inline-page-break-inside-avoid-1-print-ref.html19
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/inline-page-break-inside-avoid-1-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/orphans-001.xht48
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/orphans-002.xht54
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/orphans-003.xht53
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/orphans-004a.xht56
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/orphans-004b.xht50
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-after-000.xht24
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-after-001.xht21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-after-002.xht23
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-after-003.xht27
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-after-004.xht35
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-after-005.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-after-006.xht20
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-after-007.xht34
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-after-008.xht27
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-after-009.xht57
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-after-010.xht34
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-before-000.xht23
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-before-001.xht23
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-before-002.xht23
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-before-003.xht40
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-before-004.xht22
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-before-005.xht40
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-before-006.xht48
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-before-007-b.xht37
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-before-007.xht36
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-before-008.xht21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-before-009.xht58
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-before-010.xht41
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-before-011.xht49
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-before-020.xht26
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-inside-000.xht49
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-inside-001.xht36
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-inside-002.xht39
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-inside-003.xht37
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-inside-004.xht49
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-inside-005.xht53
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-inside-006.xht45
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-margins-001.xht37
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-margins-002.xht21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-margins-003.xht52
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-break-margins-004.xht41
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-breaks-100.xht23
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/page-breaks-101.xht34
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/row-page-break-inside-avoid-1-print.html23
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/row-page-break-inside-avoid-2-print.html24
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-1-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-2-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-3-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-4-print-ref.html22
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-4-print.html24
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-5-print-ref.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-5-print.html23
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-6-print.html24
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-7-print-ref.html24
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-7-print.html26
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-8-print-ref.html25
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-8-print.html27
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/1x1-green.pngbin0 -> 135 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/1x1-lime.pngbin0 -> 135 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/1x1-maroon.pngbin0 -> 109 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/1x1-navy.pngbin0 -> 109 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/1x1-red.pngbin0 -> 135 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/1x1-white.pngbin0 -> 109 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/60x60-gg-rr.pngbin0 -> 224 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/60x60-green.pngbin0 -> 218 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/a-green.css1
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/b-green.css1
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/blue15x15.pngbin0 -> 185 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/c-red.css1
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/cat.pngbin0 -> 1883 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/diamond.pngbin0 -> 188 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/green15x15.pngbin0 -> 170 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/pattern-grg-rrg-rgg.pngbin0 -> 231 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/pattern-tr.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/ring.pngbin0 -> 715 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/square-purple.pngbin0 -> 92 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/square-teal.pngbin0 -> 92 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/square-white.pngbin0 -> 78 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/swatch-green.pngbin0 -> 84 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/swatch-lime.pngbin0 -> 84 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/swatch-orange.pngbin0 -> 84 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/swatch-red.pngbin0 -> 84 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/swatch-white.pngbin0 -> 85 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/swatch-yellow.pngbin0 -> 84 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/test-bl.pngbin0 -> 1368 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/test-br.pngbin0 -> 1045 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/test-outer.pngbin0 -> 2412 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/test-tl.pngbin0 -> 1025 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/support/test-tr.pngbin0 -> 1235 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-1-print.html21
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-2-print-ref.html27
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-2-print.html29
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-3-print-ref.html28
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-3-print.html30
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-4-print-ref.html19
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-4-print.html22
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-5-print-ref.html23
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-5-print.html25
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-6-print-ref.html15
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-6-print.html18
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-7-print-ref.html17
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-7-print.html19
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-8-print.html18
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-print-ref.html19
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/widows-001.xht49
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/widows-002.xht54
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/widows-003.xht53
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/widows-004a.xht62
-rw-r--r--testing/web-platform/tests/css/CSS2/pagination/widows-004b.xht50
157 files changed, 4078 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-001a.xht b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-001a.xht
new file mode 100644
index 0000000000..fe36bc2a49
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-001a.xht
@@ -0,0 +1,101 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: allowed page breaks between blocks</title>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<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/#allowed-pg-brk"/>
+<meta name="assert" content="Unforced breaking in the vertical margin between
+ sibling block boxes is allowed only if the 'page-break-after' and
+ 'page-break-before' properties of all the elements generating boxes
+ that meet at this margin are 'auto' and the common ancestors of all
+ the elements do not have a 'page-break-inside' value of 'avoid'."/>
+<meta name="flags" content="paged" />
+<style type="text/css">
+ html, body { height: 100%; line-height: 1; font-size: 20px; margin: 0; padding: 0; }
+ .spacer { height: 50%; }
+ .backup { margin-top: -1em; }
+ .start { page-break-before: always; }
+
+ p {
+ margin: 0;
+ color: blue;
+ }
+
+ .avoidBefore { page-break-before: avoid; }
+ .avoidAfter { page-break-after: avoid; }
+ .avoidInside { page-break-inside: avoid; }
+ .allowInside { page-break-inside: auto; }
+</style>
+</head>
+<body>
+ <div class="spacer">
+ Lines A-Z must appear on the 18 pages of this test. The blue text
+ must accurately describe the page numbers.
+ </div><div class="spacer backup"></div>
+ <div class="avoidInside">
+ <p>Page&nbsp;2&nbsp;Line&nbsp;A</p>
+ <p>Page&nbsp;2&nbsp;Line&nbsp;B</p>
+ </div>
+
+ <div class="spacer start">
+ <p>Page&nbsp;3&nbsp;Line&nbsp;C</p>
+ </div><div class="spacer backup"></div>
+ <div class="avoidInside"><div><div><div><div><div><div class="allowInside">
+ <p>Page&nbsp;4&nbsp;Line&nbsp;D</p>
+ <p>Page&nbsp;4&nbsp;Line&nbsp;E</p>
+ </div></div></div></div></div></div></div>
+
+ <div class="spacer start">
+ <p>Page&nbsp;5&nbsp;Line&nbsp;F</p>
+ </div><div class="spacer backup"></div>
+ <div class="allowInside">
+ <p>Page&nbsp;5&nbsp;Line&nbsp;G</p>
+ <p>Page&nbsp;6&nbsp;Line&nbsp;H</p>
+ </div>
+
+ <div class="spacer start">
+ <p>Page&nbsp;7&nbsp;Line&nbsp;I</p>
+ </div><div class="spacer backup"></div>
+ <p class="avoidAfter">Page&nbsp;8&nbsp;Line&nbsp;J</p>
+ <p>Page&nbsp;8&nbsp;Line&nbsp;K</p>
+
+ <div class="spacer start">
+ <p>Page&nbsp;9&nbsp;Line&nbsp;L</p>
+ </div><div class="spacer backup"></div>
+ <p>Page&nbsp;10&nbsp;Line&nbsp;M</p>
+ <p class="avoidBefore">Page&nbsp;10&nbsp;Line&nbsp;N</p>
+
+ <div class="spacer start">
+ <p>Page&nbsp;11&nbsp;Line&nbsp;O</p>
+ </div><div class="spacer backup"></div>
+ <div class="avoidAfter"><div>
+ <p>Page&nbsp;12&nbsp;Line&nbsp;P</p>
+ </div></div>
+ <p>Page&nbsp;12&nbsp;Line&nbsp;Q</p>
+
+ <div class="spacer start">
+ <p>Page&nbsp;13&nbsp;Line&nbsp;R</p>
+ </div><div class="spacer backup"></div>
+ <p>Page&nbsp;14&nbsp;Line&nbsp;S</p>
+ <div class="avoidBefore"><div>
+ <p>Page&nbsp;14&nbsp;Line&nbsp;T</p>
+ </div></div>
+
+ <div class="spacer start">
+ <p>Page&nbsp;15&nbsp;Line&nbsp;U</p>
+ </div><div class="spacer backup"></div>
+ <div><div>
+ <p class="avoidAfter">Page&nbsp;16&nbsp;Line&nbsp;V</p>
+ </div></div>
+ <p>Page&nbsp;16&nbsp;Line&nbsp;W</p>
+
+ <div class="spacer start">
+ <p>Page&nbsp;17&nbsp;Line&nbsp;X</p>
+ </div><div class="spacer backup"></div>
+ <p>Page&nbsp;18&nbsp;Line&nbsp;Y</p>
+ <div><div>
+ <p class="avoidBefore">Page&nbsp;18&nbsp;Line&nbsp;Z</p>
+ </div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-001b.xht b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-001b.xht
new file mode 100644
index 0000000000..c041b92bec
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-001b.xht
@@ -0,0 +1,76 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: allowed page breaks between table rows</title>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<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/#allowed-pg-brk"/>
+<meta name="assert" content="Unforced breaking in the vertical margin between
+ sibling table rows is allowed only if the 'page-break-after' and
+ 'page-break-before' properties of all the elements generating boxes
+ that meet at this margin are 'auto' and the common ancestors of all
+ the elements do not have a 'page-break-inside' value of 'avoid'."/>
+<meta name="flags" content="may paged" />
+<style type="text/css">
+ html, body { height: 100%; line-height: 1; font-size: 20px; margin: 0; padding: 0; }
+ .spacer { height: 50%; }
+ .backup { margin-top: -1em; }
+ .start { page-break-before: always; }
+
+ .avoidBefore { page-break-before: avoid; }
+ .avoidAfter { page-break-after: avoid; }
+ .avoidInside { page-break-inside: avoid; }
+ .allowInside { page-break-inside: auto; }
+
+ table, tbody, tr, td {
+ border-collapse: collapse;
+ margin: 0; padding: 0;
+ border-spacing: 0;
+ color: blue;
+ }
+ table, tbody { page-break-inside: avoid; /* override any UA settings */ }
+</style>
+</head>
+<body>
+ <div class="spacer">
+ Lines A-N must appear on the 10 pages of this test. The blue text
+ must accurately describe the page numbers.
+ </div><div class="spacer backup"></div>
+ <table><tbody class="avoidInside">
+ <tr><td>Page&nbsp;2&nbsp;Line&nbsp;A</td></tr>
+ <tr><td>Page&nbsp;2&nbsp;Line&nbsp;B</td></tr>
+ </tbody></table>
+
+ <div class="spacer start">
+ <tr><td>Page&nbsp;3&nbsp;Line&nbsp;C</td></tr>
+ </div><div class="spacer backup"></div>
+ <div class="avoidInside"><div><div><div><div><table><tbody class="allowInside">
+ <tr><td>Page&nbsp;4&nbsp;Line&nbsp;D</td></tr>
+ <tr><td>Page&nbsp;4&nbsp;Line&nbsp;E</td></tr>
+ </tbody></table></div></div></div></div></div>
+
+ <div class="spacer start">
+ <tr><td>Page&nbsp;5&nbsp;Line&nbsp;F</td></tr>
+ </div><div class="spacer backup"></div>
+ <table><tbody class="allowInside">
+ <tr><td>Page&nbsp;5&nbsp;Line&nbsp;G</td></tr>
+ <tr><td>Page&nbsp;6&nbsp;Line&nbsp;H</td></tr>
+ </tbody></table>
+
+ <div class="spacer start">
+ <tr><td>Page&nbsp;7&nbsp;Line&nbsp;I</td></tr>
+ </div><div class="spacer backup"></div>
+ <table><tbody>
+ <tr class="avoidAfter"><td>Page&nbsp;8&nbsp;Line&nbsp;J</td></tr>
+ <tr><td>Page&nbsp;8&nbsp;Line&nbsp;K</td></tr>
+ </tbody></table>
+
+ <div class="spacer start">
+ <tr><td>Page&nbsp;9&nbsp;Line&nbsp;L</td></tr>
+ </div><div class="spacer backup"></div>
+ <table><tbody>
+ <tr><td>Page&nbsp;10&nbsp;Line&nbsp;M</td></tr>
+ <tr class="avoidBefore"><td>Page&nbsp;10&nbsp;Line&nbsp;N</td></tr>
+ </tbody></table>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-001c.xht b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-001c.xht
new file mode 100644
index 0000000000..fe2d342bf6
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-001c.xht
@@ -0,0 +1,121 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: allowed page breaks between blocks within table cells</title>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<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/#allowed-pg-brk"/>
+<meta name="assert" content="Unforced breaking in the vertical margin between
+ sibling block boxes is allowed only if the 'page-break-after' and
+ 'page-break-before' properties of all the elements generating boxes
+ that meet at this margin are 'auto' and the common ancestors of all
+ the elements do not have a 'page-break-inside' value of 'avoid'."/>
+<meta name="flags" content="may paged" />
+<style type="text/css">
+ html, body { height: 100%; line-height: 1; font-size: 20px; margin: 0; padding: 0; }
+ .spacer { height: 50%; }
+ .backup { margin-top: -1em; }
+ .start { page-break-before: always; }
+
+ p {
+ margin: 0;
+ color: blue;
+ }
+
+ .avoidBefore { page-break-before: avoid; }
+ .avoidAfter { page-break-after: avoid; }
+ .avoidInside { page-break-inside: avoid; }
+ .allowInside { page-break-inside: auto; }
+
+
+ table, tbody, tr, td {
+ border-collapse: collapse;
+ margin: 0; padding: 0;
+ border-spacing: 0;
+ color: blue;
+ }
+</style>
+</head>
+<body>
+ <div class="spacer">
+ Lines A-T must appear on the 18 pages of this test. The blue text
+ must accurately describe the page numbers.
+ </div><div class="spacer backup"></div>
+ <table><tbody><tr class="avoidInside">
+ <p>Page&nbsp;2&nbsp;Line&nbsp;A</p>
+ <p>Page&nbsp;2&nbsp;Line&nbsp;B</p>
+ </tr></tbody></table>
+
+ <div class="spacer start">
+ <p>Page&nbsp;3&nbsp;Line&nbsp;C</p>
+ </div><div class="spacer backup"></div>
+ <div class="avoidInside"><div><div><div><table><tbody><tr><td class="allowInside">
+ <p>Page&nbsp;4&nbsp;Line&nbsp;D</p>
+ <p>Page&nbsp;4&nbsp;Line&nbsp;E</p>
+ </td></tr></tbody></table></div></div></div></div>
+
+ <div class="spacer start">
+ <p>Page&nbsp;5&nbsp;Line&nbsp;F</p>
+ </div><div class="spacer backup"></div>
+ <table><tbody><tr><td class="allowInside">
+ <p>Page&nbsp;5&nbsp;Line&nbsp;G</p>
+ <p>Page&nbsp;6&nbsp;Line&nbsp;H</p>
+ </td></tr></tbody></table>
+
+ <div class="spacer start">
+ <p>Page&nbsp;7&nbsp;Line&nbsp;I</p>
+ </div><div class="spacer backup"></div>
+ <table><tbody><tr><td>
+ <p class="avoidAfter">Page&nbsp;8&nbsp;Line&nbsp;J</p>
+ <p>Page&nbsp;8&nbsp;Line&nbsp;K</p>
+ </td></tr></tbody></table>
+
+ <div class="spacer start">
+ <p>Page&nbsp;9&nbsp;Line&nbsp;L</p>
+ </div><div class="spacer backup"></div>
+ <table><tbody><tr><td>
+ <p>Page&nbsp;10&nbsp;Line&nbsp;M</p>
+ <p class="avoidBefore">Page&nbsp;10&nbsp;Line&nbsp;N</p>
+ </td></tr></tbody></table>
+
+ <div class="spacer start">
+ <p>Page&nbsp;11&nbsp;Line&nbsp;O</p>
+ </div><div class="spacer backup"></div>
+ <table><tbody><tr><td>
+ <div class="avoidAfter"><div>
+ <p>Page&nbsp;12&nbsp;Line&nbsp;P</p>
+ </div></div>
+ <p>Page&nbsp;12&nbsp;Line&nbsp;Q</p>
+ </td></tr></tbody></table>
+
+ <div class="spacer start">
+ <p>Page&nbsp;13&nbsp;Line&nbsp;R</p>
+ </div><div class="spacer backup"></div>
+ <table><tbody><tr><td>
+ <p>Page&nbsp;14&nbsp;Line&nbsp;S</p>
+ <div class="avoidBefore"><div>
+ <p>Page&nbsp;14&nbsp;Line&nbsp;T</p>
+ </div></div>
+ </td></tr></tbody></table>
+
+ <div class="spacer start">
+ <p>Page&nbsp;15&nbsp;Line&nbsp;O</p>
+ </div><div class="spacer backup"></div>
+ <table><tbody><tr><td>
+ <div><div>
+ <p class="avoidAfter">Page&nbsp;16&nbsp;Line&nbsp;P</p>
+ </div></div>
+ <p>Page&nbsp;16&nbsp;Line&nbsp;Q</p>
+ </td></tr></tbody></table>
+
+ <div class="spacer start">
+ <p>Page&nbsp;17&nbsp;Line&nbsp;R</p>
+ </div><div class="spacer backup"></div>
+ <table><tbody><tr><td>
+ <p>Page&nbsp;18&nbsp;Line&nbsp;S</p>
+ <div><div>
+ <p class="avoidBefore">Page&nbsp;18&nbsp;Line&nbsp;T</p>
+ </div></div>
+ </td></tr></tbody></table>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-002.xht b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-002.xht
new file mode 100644
index 0000000000..9a3ae93886
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-002.xht
@@ -0,0 +1,79 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: allowed page break - line box breaking</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="assert" content="Breaking between line boxes is allowed only if the number of line boxes between the break and the start of the enclosing block box is the value of 'orphans' or more, and the number of line boxes between the break and the end of the box is the value of 'widows' or more and the value of the 'page-break-inside' property is 'auto'."/>
+<meta name="flags" content="paged" />
+<style type="text/css">
+ html, body { height: 100%; line-height: 1; font-size: 20px; margin: 0; padding: 0; }
+
+ * {page-break-inside: auto;}
+ div.spacer {
+ height: 50%;
+ }
+ div.backup {
+ margin-top: -3em;
+ }
+ div.dummy {
+ width: 0;
+ page-break-after: always;
+ color: blue;
+ }
+
+ div {
+ widows: 1;
+ orphans: 1;
+ }
+ div#second {orphans: 4;}
+ div#third {widows: 4;}
+ div#fourth {page-break-inside: avoid; page-break-after: auto; }
+</style>
+</head>
+<body>
+ <div class="spacer">This test requires 8 pages. The blue text must
+ denote accurate page numbers. Lines A-C must appear on this page;
+ lines D-F must appear on the next page.</div>
+ <div class="spacer backup"></div>
+ <div class="dummy">
+ Page&nbsp;1&nbsp;Line&nbsp;A
+ Page&nbsp;1&nbsp;Line&nbsp;B
+ Page&nbsp;1&nbsp;Line&nbsp;C
+ Page&nbsp;2&nbsp;Line&nbsp;D
+ Page&nbsp;2&nbsp;Line&nbsp;E
+ Page&nbsp;2&nbsp;Line&nbsp;F
+ </div>
+ <div class="spacer">Lines G-L must appear on the next page.</div>
+ <div class="spacer backup"></div>
+ <div class="dummy" id="second">
+ Page&nbsp;4&nbsp;Line&nbsp;G
+ Page&nbsp;4&nbsp;Line&nbsp;H
+ Page&nbsp;4&nbsp;Line&nbsp;I
+ Page&nbsp;4&nbsp;Line&nbsp;J
+ Page&nbsp;4&nbsp;Line&nbsp;K
+ Page&nbsp;4&nbsp;Line&nbsp;L
+ </div>
+ <div class="spacer">Lines M-N must appear on this page; lines O-R on the next page.</div>
+ <div class="spacer backup"></div>
+ <div class="dummy" id="third">
+ Page&nbsp;5&nbsp;Line&nbsp;M
+ Page&nbsp;5&nbsp;Line&nbsp;N
+ Page&nbsp;6&nbsp;Line&nbsp;O
+ Page&nbsp;6&nbsp;Line&nbsp;P
+ Page&nbsp;6&nbsp;Line&nbsp;Q
+ Page&nbsp;6&nbsp;Line&nbsp;R
+ </div>
+ <div class="spacer">Lines S-X must appear on the next page.</div>
+ <div class="spacer backup"></div>
+ <div class="dummy" id="fourth">
+ Page&nbsp;8&nbsp;Line&nbsp;S
+ Page&nbsp;8&nbsp;Line&nbsp;T
+ Page&nbsp;8&nbsp;Line&nbsp;U
+ Page&nbsp;8&nbsp;Line&nbsp;V
+ Page&nbsp;8&nbsp;Line&nbsp;W
+ Page&nbsp;8&nbsp;Line&nbsp;X
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-003.xht b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-003.xht
new file mode 100644
index 0000000000..5f014f33a2
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-003.xht
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: allowed page break - dropping page-break-* restrictions</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="assert" content="If the standard restrictions do not provide enough break points to keep content from overflowing the page boxes, then the restrictions imposed by 'avoid' on the 'page-break-*' properties are dropped."/>
+<meta name="flags" content="paged" />
+<style type="text/css">
+ html, body { height: 100%; line-height: 1; font-size: 20px; margin: 0; padding: 0; }
+ div.spacer {
+ height: 25%;
+ }
+ div.backup {
+ margin-top: -3em;
+ }
+
+ div#wrapper {
+ height: 200%;
+ page-break-inside: avoid;
+ widows: 3;
+ orphans: 3;
+ }
+
+ p {
+ margin: 0;
+ color: blue;
+ }
+ p, #wrapper div {
+ page-break-before: avoid;
+ page-break-after: avoid;
+ }
+</style>
+</head>
+<body>
+ <div id="wrapper">
+ <div class="spacer">This test requires two pages. Lines D-F must be on the second.</div>
+ <div class="spacer backup"></div>
+ <p>Page&nbsp;1&nbsp;Line&nbsp;A</p>
+ <p>Page&nbsp;1&nbsp;Line&nbsp;B</p>
+ <p>Page&nbsp;1&nbsp;Line&nbsp;C</p>
+ <p>Page&nbsp;2&nbsp;Line&nbsp;D</p>
+ <p>Page&nbsp;2&nbsp;Line&nbsp;E</p>
+ <p>Page&nbsp;2&nbsp;Line&nbsp;F</p>
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-004.xht b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-004.xht
new file mode 100644
index 0000000000..e956b54e7d
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-004.xht
@@ -0,0 +1,60 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: allowed page break - dropping widows and orphans restrictions</title>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="assert" content="If the standard restrictions do not provide enough break points to keep content from overflowing the page boxes after dropping the restrictions imposed by 'avoid' on the 'page-break-*' properties then the restrictions due to 'windows' and 'orphans' are dropped as well."/>
+<meta name="flags" content="paged" />
+<style type="text/css">
+ html, body { line-height: 1; margin: 0; padding: 0; }
+ pre {
+ margin: 0; padding: 0;
+ font: inherit;
+ font-size: 12pt;
+ white-space: pre;
+ page-break-before: avoid;
+ page-break-after: avoid;
+ page-break-inside: avoid;
+ widows: 30;
+ orphans: 30;
+ font-size:
+ }
+ span {
+ font-size: 1in;
+ }
+</style>
+</head>
+<body>
+<pre id="wrapper">This test assumes pages &lt; 26in tall.
+Lines A-Z must all appear in order,
+filling each page until Z on the last.
+<span>Line A
+Line B
+Line C
+Line D
+Line E
+Line F
+Line G
+Line H
+Line I
+Line J
+Line K
+Line L
+Line M
+Line N
+Line O
+Line P
+Line Q
+Line R
+Line S
+Line T
+Line U
+Line V
+Line W
+Line X
+Line Y
+Line Z</span></pre>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-005.xht b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-005.xht
new file mode 100644
index 0000000000..7b8acb8b11
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-005.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Allowed Page Breaks - Between Blocks</title>
+ <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#spacing-props"/>
+ <meta name="flags" content="paged"/>
+ <meta name="assert" content="Page breaks can occur between block boxes."/>
+ <style type="text/css">
+ /* Most permissible breaking possible */
+ * { widows: 1; orphans: 1; widows: 0; orphans: 0; }
+
+ /* Leave 4em at bottom to play with, independent of page size. */
+ html, body {
+ height: 100%;
+ line-height: 1;
+ }
+ .spacer1 {
+ height: 70%;
+ }
+ .spacer2 {
+ height: 30%;
+ margin-top: -4em;
+ }
+
+ /* Test CSS */
+ .first, .second { /* Each border box is 1.5em; margin box is 2.5em. */
+ white-space: nowrap;
+ border: 0.25em solid blue;
+ margin: 0.5em;
+ /* Make test text more visible */
+ color: blue;
+ font-weight: bold;
+ }
+</style>
+</head>
+<body>
+ <div class="spacer1">This test requires 2 pages. Box A must appear on the first page and Box B on the second.</div>
+ <div class="spacer2"></div>
+ <div class="first">Page 1 Box A</div>
+ <div class="second">Page 2 Box B</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-006.xht b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-006.xht
new file mode 100644
index 0000000000..0de8a7b47a
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-006.xht
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Allowed Page Breaks - Between Line Boxes</title>
+ <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#spacing-props"/>
+ <meta name="flags" content="paged"/>
+ <meta name="assert" content="Page breaks can occur between line boxes."/>
+ <style type="text/css">
+ /* Most permissible breaking possible */
+ * { widows: 1; orphans: 1; widows: 0; orphans: 0; }
+
+ /* Leave 2.5 lines at bottom to play with, independent of page size. */
+ html, body {
+ height: 100%;
+ line-height: 1;
+ }
+ .spacer1 {
+ height: 70%;
+ }
+ .spacer2 {
+ height: 30%;
+ margin-top: -2.5em;
+ }
+
+ .test {
+ white-space: pre;
+ /* Make test text more visible */
+ color: blue;
+ font-weight: bold;
+ }
+</style>
+</head>
+<body>
+ <div class="spacer1">This test requires 2 pages. Lines A and B must appear
+ on the first page, lines C and D on the second.</div>
+ <div class="spacer2"></div>
+ <div class="test"> Page 1 Line A
+ Page 1 Line B
+ Page 2 Line C
+ Page 2 Line D
+ </div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-007a.xht b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-007a.xht
new file mode 100644
index 0000000000..cbe2e73690
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-007a.xht
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Allowed Page Breaks - Between Line Box and Content Edge</title>
+ <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#spacing-props"/>
+ <meta name="flags" content="paged"/>
+ <meta name="assert" content="Page breaks can occur between the content edge
+ of a block box and the outer edges of its child line boxes."/>
+ <style type="text/css">
+ /* Most permissible breaking possible */
+ * { widows: 1; orphans: 1; widows: 0; orphans: 0; }
+
+ html, body {
+ height: 100%;
+ line-height: 1;
+ }
+
+ .first, .second {
+ /* Make test text more visible */
+ color: blue;
+ font-weight: bold;
+ }
+ .first {
+ height: 120%;
+ }
+</style>
+</head>
+<body>
+ <div>This test requires 2 pages. Line A must appear
+ on the first page, Line B on the second.</div>
+ <div class="first">Page 1 Line A</div>
+ <div class="second">Page 2 Line B</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-007b.xht b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-007b.xht
new file mode 100644
index 0000000000..20c67573ad
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/allowed-page-breaks-007b.xht
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Allowed Page Breaks - Between Block-level Box and Content Edge</title>
+ <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#spacing-props"/>
+ <meta name="flags" content="paged"/>
+ <meta name="assert" content="Page breaks can occur between the content edge
+ of a block box and the outer edges of its child block-level boxes."/>
+ <style type="text/css">
+ /* Most permissible breaking possible */
+ * { widows: 1; orphans: 1; widows: 0; orphans: 0; }
+
+ html, body {
+ height: 100%;
+ line-height: 1;
+ }
+
+ .first, .second {
+ /* Make test text more visible */
+ color: blue;
+ font-weight: bold;
+ }
+ .first {
+ height: 120%;
+ }
+</style>
+</head>
+<body>
+ <div>This test requires 2 pages. Line A must appear
+ on the first page, Line B on the second.</div>
+ <div class="first">
+ <div>Page 1 Line A</div>
+ </div>
+ <div class="second">Page 2 Line B</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-1-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-1-print.html
new file mode 100644
index 0000000000..abfe11fd3e
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-1-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; page-break-before:always; }
+</style>
+</head>
+<body>
+<p>1</p>
+<div class="test"><p>2</p><p>3</p></div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-10-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-10-print.html
new file mode 100644
index 0000000000..b29e72fc37
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-10-print.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<p>1</p>
+<div class="test"><div style="page-break-inside:auto"><p>2</p><p>3</p></div></div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-11-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-11-print.html
new file mode 100644
index 0000000000..64409156ec
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-11-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<p>1</p>
+<div class="test"><table cellpadding="0" cellspacing="0"><tr><td><p>2</p><p>3</p></td></tr></table></div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-12-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-12-print.html
new file mode 100644
index 0000000000..1f132e8d73
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-12-print.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<div class="test">
+<p>1</p>
+<div class="test"><p>2</p><p>3</p></div>
+</div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-13-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-13-print.html
new file mode 100644
index 0000000000..3d3765fddb
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-13-print.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-8-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+Text
+<div class="test">
+<p>1</p>
+<div class="test"><p>2</p><p>3</p></div>
+</div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-14-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-14-print-ref.html
new file mode 100644
index 0000000000..434ecac945
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-14-print-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-before:always; height:1.5in; }
+</style>
+</head>
+<body>
+<p>1</p>
+<p class="test">2</p>
+<p class="test">3</p>
+</div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-14-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-14-print.html
new file mode 100644
index 0000000000..f3b57e0d06
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-14-print.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-14-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; height:1.5in; }
+</style>
+</head>
+<body>
+<p>1</p>
+<p class="test">2</p>
+<p class="test">3</p>
+</div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-15-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-15-print-ref.html
new file mode 100644
index 0000000000..b46ea73e77
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-15-print-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-before:always; height:2.5in; }
+</style>
+</head>
+<body>
+<p>1</p>
+<p class="test">2</p>
+<p class="test">4</p>
+</div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-15-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-15-print.html
new file mode 100644
index 0000000000..655f70c39a
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-15-print.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-15-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; height:2.5in; }
+</style>
+</head>
+<body>
+<p>1</p>
+<p class="test">2</p>
+<p class="test">4</p>
+</div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-2-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-2-print.html
new file mode 100644
index 0000000000..3a32a357ad
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-2-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<div class="test"><p>1</p></div>
+<div class="test"><p>2</p><p>3</p></div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-3-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-3-print.html
new file mode 100644
index 0000000000..8469e8acdb
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-3-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<div class="test"><p>1</p></div>
+<div class="test"><div><div><div><p>2</p><p>3</p></div></div></div></div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-4-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-4-print.html
new file mode 100644
index 0000000000..a9566672e5
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-4-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<div class="test"><p>1</p></div>
+<div><div><div class="test"><p>2</p><p>3</p></div></div></div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-5-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-5-print.html
new file mode 100644
index 0000000000..f525cf01dc
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-5-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<div class="test"><p>1</p></div>
+<div class="test"><div class="test"><div class="test"><p>2</p><p>3</p></div></div></div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-6-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-6-print.html
new file mode 100644
index 0000000000..dc0ce68755
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-6-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; overflow:hidden; }
+</style>
+</head>
+<body>
+<p>1</p>
+<div class="test"><p>2</p><p>3</p></div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-7-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-7-print.html
new file mode 100644
index 0000000000..0100b508fa
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-7-print.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; overflow:hidden; }
+</style>
+</head>
+<body>
+<div class="test">
+<p>1</p>
+<div class="test"><p>2</p><p>3</p></div>
+</div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-8-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-8-print-ref.html
new file mode 100644
index 0000000000..6c47d6af76
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-8-print-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+
+</style>
+</head>
+<body>
+Text
+<div>
+<p style="page-break-before:always">1</p>
+<div style="page-break-before:always"><p>2</p><p>3</p></div>
+</div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-8-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-8-print.html
new file mode 100644
index 0000000000..ad67b69ab5
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-8-print.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-8-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; overflow:hidden; }
+</style>
+</head>
+<body>
+Text
+<div class="test">
+<p>1</p>
+<div class="test"><p>2</p><p>3</p></div>
+</div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-9-print.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-9-print.html
new file mode 100644
index 0000000000..d6774410da
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-9-print.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<div class="test">
+<p>1</p>
+<div style="page-break-before:always"><p>2</p><p>3</p></div>
+</div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-print-ref.html
new file mode 100644
index 0000000000..7dfe3f126b
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/block-page-break-inside-avoid-print-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-after:always; }
+</style>
+</head>
+<body>
+<div class="test"><p>1</p></div>
+<p>2</p><p>3</p>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-1-print.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-1-print.html
new file mode 100644
index 0000000000..b932b38ee8
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-1-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="table-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; float:left; }
+</style>
+</head>
+<body>
+<p>1</p>
+<table class="test"><tr><td><p>2</p><p>3</p></td></tr></table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-2-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-2-print-ref.html
new file mode 100644
index 0000000000..50ea2df7bf
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-2-print-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+body { margin: 0 }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { float:left; }
+</style>
+</head>
+<body>
+<div class="test"><p>1</p></div>
+<div class="test"><p>2</p><p>3</p></div>
+<div class="test" style="page-break-before:always;clear:both"><p>4</p></div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-2-print.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-2-print.html
new file mode 100644
index 0000000000..45b5c8b23c
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-2-print.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="float-page-break-inside-avoid-2-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+body { margin: 0 }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { float:left; page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<div class="test"><p>1</p></div>
+<div class="test"><p>2</p><p>3</p><p>4</p></div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-3-print.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-3-print.html
new file mode 100644
index 0000000000..56be8379f7
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-3-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { float:left; page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<div style="clear:both"><p>1</p></div>
+<div class="test"><p>2</p><p>3</p></div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-4-print.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-4-print.html
new file mode 100644
index 0000000000..e3793170bd
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-4-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="block-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { float:left; page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<div style="clear:both"><p>1</p></div>
+<div class="test"><div class="test"><p>2</p><p>3</p></div></div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-5-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-5-print-ref.html
new file mode 100644
index 0000000000..0da2e292f1
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-5-print-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+ html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0;
+ }
+p { height: 0.5in; width: 1in; margin:0; background-color:blue; float:left; }
+.test { float:left; clear:left; width:3.3in; }
+</style>
+</head>
+<body>
+<br style="clear:both">
+<div class="test">
+<p>1</p><p>2</p><p>3</p>
+<p>4</p><p>5</p><p>6</p>
+</div>
+<div class="test" style="page-break-before:always">
+<p>1</p><p>2</p><p>3</p>
+<p>4</p><p>5</p><p>6</p>
+</div>
+<div class="test">
+<p>1</p><p>2</p><p>3</p>
+<p>4</p><p>5</p><p>6</p>
+</div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-5-print.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-5-print.html
new file mode 100644
index 0000000000..c818c9165b
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-5-print.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="float-page-break-inside-avoid-5-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+ html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0;
+ }
+p { height: 0.5in; width: 1in; margin:0; background-color:blue; float:left; }
+.test { float:left; clear:left; page-break-inside:avoid; width:3.3in; }
+</style>
+</head>
+<body>
+<br style="clear:both">
+<div class="test">
+<p>1</p><p>2</p><p>3</p>
+<p>4</p><p>5</p><p>6</p>
+</div>
+<div class="test">
+<p>1</p><p>2</p><p>3</p>
+<p>4</p><p>5</p><p>6</p>
+</div>
+<div class="test">
+<p>1</p><p>2</p><p>3</p>
+<p>4</p><p>5</p><p>6</p>
+</div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-6-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-6-print-ref.html
new file mode 100644
index 0000000000..5f45af72e0
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-6-print-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
+}
+p { height:60%; width:90%; margin:0; background-color:blue; border:1px solid black; }
+.test { page-break-before:always; float:left; }
+</style>
+</head>
+<body><p>1</p><p class="test">2</p></body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-6-print.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-6-print.html
new file mode 100644
index 0000000000..1b53472ba8
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-6-print.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="float-page-break-inside-avoid-6-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
+}
+p { height:60%; width:90%; margin:0; background-color:blue; border:1px solid black; }
+.test { page-break-inside:avoid; float:left; }
+</style>
+</head>
+<body><p>1</p><p class="test">2</p></body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-7-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-7-print-ref.html
new file mode 100644
index 0000000000..9698e5018d
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-7-print-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged"><style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
+}
+
+.test {
+ height:60%;
+ float:left;
+ clear:left;
+ background-color:blue;
+}
+</style>
+</head>
+<body>
+<br style="clear:both">
+<div class="test">1</div>X
+<div class="test" style="page-break-before:always">2</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-7-print.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-7-print.html
new file mode 100644
index 0000000000..595a3aca45
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-7-print.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="float-page-break-inside-avoid-7-print-ref.html">
+ <meta name="flags" content="paged"><style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
+}
+
+.test {
+ page-break-inside:avoid;
+ height:60%;
+ float:left;
+ clear:left;
+ background-color:blue;
+}
+</style>
+</head>
+<body>
+<br style="clear:both">
+<div class="test">1</div>
+<div class="test">2</div>X
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-8-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-8-print-ref.html
new file mode 100644
index 0000000000..d80fc4b0b6
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-8-print-ref.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged"><style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
+}
+
+.test {
+ height:60%;
+ float:left;
+ clear:left;
+ background-color:blue;
+}
+</style>
+</head>
+<body>
+<br style="clear:both">
+<div class="test">1</div>
+<div style="clear:both;">X<br>Y</div>
+<div class="test" style="page-break-before:always">2</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-8-print.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-8-print.html
new file mode 100644
index 0000000000..45c19878f9
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-8-print.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="float-page-break-inside-avoid-8-print-ref.html">
+ <meta name="flags" content="paged"><style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
+}
+
+.test {
+ page-break-inside:avoid;
+ height:60%;
+ float:left;
+ clear:left;
+ background-color:blue;
+}
+</style>
+</head>
+<body>
+<br style="clear:both">
+<div class="test">1</div>
+<div style="height:60%;clear:both;"><div class="test" style="height:100%;">2</div>X<br>Y</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-9-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-9-print-ref.html
new file mode 100644
index 0000000000..69e213c876
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-9-print-ref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged"><style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
+}
+
+.test {
+ height:60%;
+ float:left;
+ clear:left;
+ background-color:blue;
+}
+.ib {
+ display:inline-block;
+ height:100%;
+ width:1px;
+}
+</style>
+</head>
+<body>
+<br style="clear:both">
+<div class="test" style="page-break-after:always">1</div>
+<div style="height:60%;clear:both;">A<div class="test" style="height:100%;">2</div><span>X<span class="ib"></span><br>Y</span></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-9-print.html b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-9-print.html
new file mode 100644
index 0000000000..c32597bb21
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/float-page-break-inside-avoid-9-print.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="float-page-break-inside-avoid-9-print-ref.html">
+ <meta name="flags" content="paged"><style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
+}
+
+.test {
+ page-break-inside:avoid;
+ height:60%;
+ float:left;
+ clear:left;
+ background-color:blue;
+}
+.ib {
+ display:inline-block;
+ height:100%;
+ width:1px;
+}
+</style>
+</head>
+<body>
+<br style="clear:both">
+<div class="test">1</div>
+<div style="height:60%;clear:both;">A<div class="test" style="height:100%;">2</div><span>X<span class="ib"></span><br>Y</span></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/forced-page-breaks-000.xht b/testing/web-platform/tests/css/CSS2/pagination/forced-page-breaks-000.xht
new file mode 100644
index 0000000000..2be45421c8
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/forced-page-breaks-000.xht
@@ -0,0 +1,46 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: forced page breaks</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="assert" content="A page break MUST occur in the vertical margin between block boxes if, among the 'page-break-after' and 'page-break-before' properties of all the elements generating boxes that meet at this margin, there is at least one with the value 'always', 'left', or 'right'."/>
+<meta name="flags" content="paged" />
+<style type="text/css">
+ @page {
+ counter-increment: page;
+ margin: 7%;
+ @top-right {
+ content: content: "Page " counter(page);
+ }
+ }
+ @page :first {
+ @top-center {
+ content: "This test requires 7 pages";
+ }
+ }
+
+ .breakBefore {page-break-before: always;}
+ .breakAfter {page-break-after: always;}
+
+ .breakBeforeLeft {page-break-before: left;}
+ .breakBeforeRight {page-break-before: right;}
+
+ .avoidBefore { page-break-before: avoid; }
+ .avoidAfter { page-break-after: avoid; }
+ .avoidInside { page-break-inside: avoid; }
+</style>
+</head>
+<body>
+<div class="avoidInside avoidAfter">
+ <p>This test requires 7 pages.</p>
+ <p class="breakBeforeLeft avoidAfter">When printed, this sentence should appear by itself on page 2.</p>
+</div>
+ <p class="breakBefore breakAfter">This sentence should appear by itself on page 3.</p>
+ <p class="breakBefore">This sentence should appear on page 4.</p>
+ <p class="breakAfter">This sentence should also appear on page 4.</p>
+ <p class="avoidBefore avoidAfter">This sentence should appear by itself on page 5.</p>
+ <p class="breakBeforeRight">This sentence should appear by itself on page 7. (Page 6 must be blank.)</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/forced-page-breaks-001.xht b/testing/web-platform/tests/css/CSS2/pagination/forced-page-breaks-001.xht
new file mode 100644
index 0000000000..b3ad584748
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/forced-page-breaks-001.xht
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: multiple forced page breaks case</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="assert" content="When multiple 'page-break-before' and/or 'page-break-after' properties with values of 'always', 'left' or 'right' apply at a margin, only one of them generates page breaks."/>
+<meta name="flags" content="paged" />
+<style type="text/css">
+ @page :left {
+ @top-center
+ {
+ content: "[This page intentionally left blank]";
+ }
+ }
+ p {page-break-after: always;}
+ div {page-break-before: right;}
+</style>
+</head>
+<body>
+ <p>This test requires three pages. This must be on the first page.</p>
+ <div>This must be on the third page. There must be a blank page (and only one blank page) before this sentence.</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/inline-page-break-inside-avoid-1-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/inline-page-break-inside-avoid-1-print-ref.html
new file mode 100644
index 0000000000..ac129c03aa
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/inline-page-break-inside-avoid-1-print-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+
+</style>
+</head>
+<body>
+<div class="test"><p>1</p></div>
+<div class="test" style="display:inline"><p>2</p><p>3</p></div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/inline-page-break-inside-avoid-1-print.html b/testing/web-platform/tests/css/CSS2/pagination/inline-page-break-inside-avoid-1-print.html
new file mode 100644
index 0000000000..a7555890b8
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/inline-page-break-inside-avoid-1-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="inline-page-break-inside-avoid-1-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<div class="test"><p>1</p></div>
+<div class="test" style="display:inline"><p>2</p><p>3</p></div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/orphans-001.xht b/testing/web-platform/tests/css/CSS2/pagination/orphans-001.xht
new file mode 100644
index 0000000000..3770d019b3
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/orphans-001.xht
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: breaks inside elements: orphans initial value</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#break-inside"/>
+<link rel="help" href="http://www.w3.org/TR/css3-page/#breaks-inside"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The initial value of the 'orphans' property is 2."/>
+<style type="text/css">
+ html, body {
+ height: 100%;
+ line-height: 1;
+ font-size: 20px;
+ }
+ * {
+ margin:0;
+ padding:0;
+ }
+ div.spacer {
+ height:50%;
+ }
+ div.backup {
+ margin-top: -1em;
+ }
+
+ .test {
+ color: blue;
+ width: 1em;
+ }
+
+</style>
+</head>
+<body>
+ <div class="spacer">This test requires 2 pages. The blue text must
+ denote accurate page numbers. Lines A-E must appear on the next page.</div>
+
+ <div class="spacer backup"></div>
+ <div class="test">
+ Page&nbsp;2&nbsp;Line&nbsp;A
+ Page&nbsp;2&nbsp;Line&nbsp;B
+ Page&nbsp;2&nbsp;Line&nbsp;C
+ Page&nbsp;2&nbsp;Line&nbsp;D
+ Page&nbsp;2&nbsp;Line&nbsp;E
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/orphans-002.xht b/testing/web-platform/tests/css/CSS2/pagination/orphans-002.xht
new file mode 100644
index 0000000000..209ffb9bf6
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/orphans-002.xht
@@ -0,0 +1,54 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: breaks inside elements: orphans - block-level only</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#break-inside"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The 'orphans' property is only applied to block-level elements."/>
+<style type="text/css">
+ html, body {
+ height: 100%;
+ line-height: 1;
+ font-size: 20px;
+ }
+ * {
+ margin:0;
+ padding:0;
+ }
+ div.spacer {
+ height:50%;
+ }
+ div.backup {
+ margin-top: -4em;
+ }
+
+ .test {
+ color: blue;
+ width: 1em;
+ orphans: 5;
+ }
+ .test span {
+ orphans: 2;
+ }
+
+</style>
+</head>
+<body>
+ <div class="spacer">This test requires 2 pages. The blue text must
+ denote accurate page numbers. Lines A-G must appear on the next
+ page.</div>
+
+ <div class="spacer backup"></div>
+ <div class="test"><span>
+ Page&nbsp;2&nbsp;Line&nbsp;A
+ Page&nbsp;2&nbsp;Line&nbsp;B
+ Page&nbsp;2&nbsp;Line&nbsp;C
+ Page&nbsp;2&nbsp;Line&nbsp;D
+ Page&nbsp;2&nbsp;Line&nbsp;E
+ Page&nbsp;2&nbsp;Line&nbsp;F
+ Page&nbsp;2&nbsp;Line&nbsp;G
+ </span></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/orphans-003.xht b/testing/web-platform/tests/css/CSS2/pagination/orphans-003.xht
new file mode 100644
index 0000000000..a57cf110f1
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/orphans-003.xht
@@ -0,0 +1,53 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: breaks inside elements: orphans - inheritance</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#break-inside"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The 'orphans' property is inherited."/>
+<style type="text/css">
+ html, body {
+ height: 100%;
+ line-height: 1;
+ font-size: 20px;
+ }
+ * {
+ margin:0;
+ padding:0;
+ }
+ div.spacer {
+ height:50%;
+ }
+ div.backup {
+ margin-top: -4em;
+ }
+
+ .test {
+ color: blue;
+ width: 1em;
+ }
+ html {
+ orphans: 5;
+ }
+
+</style>
+</head>
+<body>
+ <div class="spacer">This test requires 2 pages. The blue text must
+ denote accurate page numbers. Lines A-G must appear on the next
+ page.</div>
+
+ <div class="spacer backup"></div>
+ <div class="test">
+ Page&nbsp;2&nbsp;Line&nbsp;A
+ Page&nbsp;2&nbsp;Line&nbsp;B
+ Page&nbsp;2&nbsp;Line&nbsp;C
+ Page&nbsp;2&nbsp;Line&nbsp;D
+ Page&nbsp;2&nbsp;Line&nbsp;E
+ Page&nbsp;2&nbsp;Line&nbsp;F
+ Page&nbsp;2&nbsp;Line&nbsp;G
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/orphans-004a.xht b/testing/web-platform/tests/css/CSS2/pagination/orphans-004a.xht
new file mode 100644
index 0000000000..945c8fe4b3
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/orphans-004a.xht
@@ -0,0 +1,56 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: orphans property syntax - integer</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#break-inside"/>
+<link rel="help" href="http://www.w3.org/TR/css3-page/#breaks-inside"/>
+<meta name="flags" content="invalid paged" />
+<meta name="assert" content="The syntax of the 'orphans' property is integer."/>
+<style type="text/css">
+ html, body {
+ height: 100%;
+ line-height: 1;
+ font-size: 20px;
+ }
+ * {
+ margin:0;
+ padding:0;
+ }
+ div.spacer {
+ height:50%;
+ }
+ div.backup {
+ margin-top: -5em;
+ }
+
+ .test {
+ color: blue;
+ width: 1em;
+ orphans: 5;
+ orphans: 2.0;
+ orphans: 2em;
+ orphans: -2;
+ orphans: 0;
+ }
+
+</style>
+</head>
+<body>
+ <div class="spacer">This test requires 2 pages. The blue text must
+ denote accurate page numbers. Lines F-G must appear on the next
+ page.</div>
+
+ <div class="spacer backup"></div>
+ <div class="test">
+ Page&nbsp;1&nbsp;Line&nbsp;A
+ Page&nbsp;1&nbsp;Line&nbsp;B
+ Page&nbsp;1&nbsp;Line&nbsp;C
+ Page&nbsp;1&nbsp;Line&nbsp;D
+ Page&nbsp;1&nbsp;Line&nbsp;E
+ Page&nbsp;2&nbsp;Line&nbsp;F
+ Page&nbsp;2&nbsp;Line&nbsp;G
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/orphans-004b.xht b/testing/web-platform/tests/css/CSS2/pagination/orphans-004b.xht
new file mode 100644
index 0000000000..ae2a2c4899
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/orphans-004b.xht
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: orphans property syntax - one</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#break-inside"/>
+<link rel="help" href="http://www.w3.org/TR/css3-page/#breaks-inside"/>
+<meta name="flags" content="invalid paged" />
+<meta name="assert" content="The 'orphans' property accepts the integer one."/>
+<style type="text/css">
+ html, body {
+ height: 100%;
+ line-height: 1;
+ font-size: 20px;
+ }
+ * {
+ margin:0;
+ padding:0;
+ }
+ div.spacer {
+ height:50%;
+ }
+ div.backup {
+ margin-top: -1.5em;
+ }
+
+ .test {
+ color: blue;
+ width: 1em;
+ orphans: 2;
+ orphans: 01;
+ }
+
+</style>
+</head>
+<body>
+ <div class="spacer">This test requires 2 pages. The blue text must
+ denote accurate page numbers. Line A must appear on this page;
+ lines B-D on the next.</div>
+
+ <div class="spacer backup"></div>
+ <div class="test">
+ Page&nbsp;1&nbsp;Line&nbsp;A
+ Page&nbsp;2&nbsp;Line&nbsp;B
+ Page&nbsp;2&nbsp;Line&nbsp;C
+ Page&nbsp;2&nbsp;Line&nbsp;D
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-after-000.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-000.xht
new file mode 100644
index 0000000000..dc005df007
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-000.xht
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-after: always</title>
+<link rel="author" title="Michael Turnwall" href="mailto:mturnwall@revenution.com"/>
+<link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The 'always' value of the 'page-break-after' property forces a page break after the box."/>
+<style type="text/css">
+
+ div.break {
+ page-break-after:always;
+ }
+
+</style>
+</head>
+<body>
+ <div class="break">There must be a page break after this paragraph, followed by another line of content. This test should produce two pages of output.</div>
+ <div>
+ This text should be at the top of the second and final page.
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-after-001.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-001.xht
new file mode 100644
index 0000000000..8d8a399ec5
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-001.xht
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-after: auto</title>
+<link rel="author" title="Michael Turnwall" href="mailto:mturnwall@revenution.com"/>
+<link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The 'always' value of the 'page-break-after' property forces a page break after the box."/>
+<style type="text/css">
+ div.noBreak {
+ page-break-after:always;
+ page-break-after:auto;
+ }
+</style>
+</head>
+<body>
+ <div class="noBreak">There must <strong>not</strong> be a page break after this line of text.</div>
+ <div>This test should produce only one page of output.</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-after-002.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-002.xht
new file mode 100644
index 0000000000..a3964b1d34
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-002.xht
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-after applies to blocks</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="flags" content="paged" />
+<meta name="assert" content="The 'page-break-after' property must be applied to block-level elements and may be applied to other elements."/>
+<style type="text/css">
+ p {page-break-after: always;}
+ p.noBreak {
+ display: inline;
+ }
+</style>
+</head>
+<body>
+ <p>This sentence must be on the first page.</p>
+ <p class="noBreak">This sentence must be on the second page.</p>
+ <p>This sentence must be either on the second or on the third page.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-after-003.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-003.xht
new file mode 100644
index 0000000000..4e0f64a746
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-003.xht
@@ -0,0 +1,27 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-after (no inherit)</title>
+<link rel="author" title="Michael Turnwall" href="mailto:mturnwall@revenution.com"/>
+<link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The 'page-break-after' property is not inherited."/>
+<style type="text/css">
+
+ div {
+ page-break-after:always;
+ }
+
+</style>
+</head>
+<body>
+ <div>
+ <p>There must <strong>not</strong> be a page break after this line of text.</p>
+ <span>This test should produce two pages of output.</span>
+ </div>
+ <div>
+ This text should be at the top of the second and final page.
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-after-004.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-004.xht
new file mode 100644
index 0000000000..aad7571493
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-004.xht
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-after (invalid syntax)</title>
+<link rel="author" title="Michael Turnwall" href="mailto:mturnwall@revenution.com"/>
+<link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="flags" content="paged invalid" />
+<meta name="assert" content="The syntax of the 'page-break-after' property is auto | always | avoid | left | right."/>
+<style type="text/css">
+
+ div.noBreakAuto {
+ page-break-after:always;
+ page-break-after:auto auto;
+ }
+ div.noBreakLeft {
+ page-break-after:auto;
+ page-break-after:left always;
+ }
+ div.noBreakAlways {
+ page-break-after:always always;
+ }
+ .dummy {
+ color:gray;
+ }
+
+</style>
+</head>
+<body>
+ <div class="noBreakAuto">This test must produce two pages of output. This sentence must be on the first page.</div>
+ <div class="noBreakLeft">This sentence must be at the top of the second page.</div>
+ <div class="noBreakAlways dummy">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</div>
+ <p>This must be the last sentence on the second and final page.</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-after-005.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-005.xht
new file mode 100644
index 0000000000..be7b4b2e7d
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-005.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-after: initial value</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="flags" content="paged" />
+<meta name="assert" content="The initial value of the 'page-break-after' property is 'auto'."/>
+<style type="text/css">
+ html, body {
+ height:100%;
+ line-height:1;
+ }
+ * {
+ margin:0;
+ padding:0;
+ page-break-after: inherit;
+ }
+ div {
+ height: 100%;
+ margin-bottom: -6em;
+ }
+</style>
+</head>
+<body>
+ <div>This test requires two pages. The dummy text below this will flow onto a second page.</div>
+
+ <p>
+ dummy <br />
+ dummy <br />
+ dummy <br />
+ dummy <br />
+ dummy <br />
+ dummy <br />
+ dummy <br />
+ dummy <br />
+ dummy <br />
+ dummy <br />
+ dummy <br />
+ dummy <br />
+ </p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-after-006.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-006.xht
new file mode 100644
index 0000000000..460c24e10f
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-006.xht
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-after applies to paged media</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="assert" content="The 'page-break-after' property applies to paged media only"/>
+<style type="text/css">
+ div {
+ page-break-after: always;
+ }
+</style>
+</head>
+<body>
+ <div>When viewed on paged media, the next line must appear on a second page.</div>
+
+ <div>On continuous media, however, this line must appear directly below the line above.</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-after-007.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-007.xht
new file mode 100644
index 0000000000..e3aec8da3e
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-007.xht
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-after: auto</title>
+<link rel="author" title="Melinda Grant" href="mailto:melinda.grant@hp.com"/>
+<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 name="flags" content="paged" />
+<meta name="assert" content="The 'auto' value of the 'page-break-after' property neither forces nor forbids a page break after the box."/>
+<style type="text/css">
+ html, body {
+ height:100%;
+ line-height:1;
+ margin: 0;
+ padding: 0;
+ }
+ div {
+ page-break-after: auto;
+ }
+ div#first {height: 50%;}
+ div#second {
+ height: 50%;
+ margin-bottom: -4em;
+ }
+ div#third {width: 0;}
+</style>
+</head>
+<body>
+ <div id="first">This test produces two pages. The next paragraph should appear on the same page as this one.</div>
+
+ <div id="second">The letters 'a', 'b', 'c', and 'd' may appear below or on the next page. The letters 'e' and 'f' must appear on the next page.</div>
+ <div id="third">a b c d e f</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-after-008.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-008.xht
new file mode 100644
index 0000000000..cf5e72e5bb
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-008.xht
@@ -0,0 +1,27 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-after: right</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="assert" content="The 'right' value of the 'page-break-after' property forces one or two page breaks before the box so that the page after the break is formatted as a right page"/>
+<meta name="flags" content="paged" />
+<style type="text/css">
+ @page {margin: 7%;}
+ @page :left {
+ @top-center
+ {
+ content: "[This page intentionally left blank]";
+ }
+ }
+ p {
+ page-break-after: right;
+ }
+</style>
+</head>
+<body>
+ <p>When printed, this test requires two or three pages. There may be a blank page after this sentence.</p>
+ <p>If there was a blank page, this content should appear on the third page.</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-after-009.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-009.xht
new file mode 100644
index 0000000000..5adb7a5a37
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-009.xht
@@ -0,0 +1,57 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-after: avoid</title>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="assert" content="The 'avoid' value of the 'page-break-after' property inhibits a page break after the element when possible."/>
+<meta name="flags" content="paged"/>
+<style type="text/css">
+ html, body { height: 100%; line-height: 1; font-size: 20px; margin: 0; padding: 0; }
+ .spacer { height: 50%; }
+ .backup { margin-top: -3em; }
+ .start { page-break-before: always; }
+
+ p {
+ margin: 0;
+ color: blue;
+ orphans: 1;
+ widows: 1;
+ white-space: pre;
+ }
+
+ .avoidAfter {
+ page-break-after: avoid;
+ }
+ .avoidInside {
+ page-break-inside: avoid;
+ widows: 3;
+ orphans: 3;
+ }
+</style>
+</head>
+<body>
+ <div class="spacer">
+ Lines A-L must appear on the 6 pages of this test. The blue text
+ must accurately describe the page numbers.
+ </div><div class="spacer backup"></div>
+ <p class="avoidAfter">Page&nbsp;1&nbsp;Line&nbsp;A</p>
+ <p>Page&nbsp;1&nbsp;Line&nbsp;B
+Page&nbsp;1&nbsp;Line&nbsp;C
+Page&nbsp;2&nbsp;Line&nbsp;D</p>
+
+ <div class="spacer start"></div><div class="spacer backup"></div>
+ <p class="avoidAfter">Page&nbsp;3&nbsp;Line&nbsp;E
+Page&nbsp;3&nbsp;Line&nbsp;F
+Page&nbsp;4&nbsp;Line&nbsp;G</p>
+ <p>Page&nbsp;4&nbsp;Line&nbsp;H</p>
+
+ <div class="spacer start">[page 5]</div><div class="spacer backup"></div>
+ <p class="avoidInside avoidAfter">Page&nbsp;6&nbsp;Line&nbsp;I
+Page&nbsp;6&nbsp;Line&nbsp;J
+Page&nbsp;6&nbsp;Line&nbsp;K</p>
+ <p>Page&nbsp;6&nbsp;Line&nbsp;L</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-after-010.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-010.xht
new file mode 100644
index 0000000000..db3ad892b9
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-after-010.xht
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-after: left</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="assert" content="The 'left' value of the 'page-break-after' property forces one or two page breaks before the box so that the page after the break is formatted as a left page"/>
+<meta name="flags" content="paged" />
+<style type="text/css">
+ @page {margin: 7%;}
+ @page :right {
+ @top-center
+ {
+ content: "[This page intentionally left blank]";
+ }
+ }
+ @page :first {
+ @top-center
+ {
+ content: "";
+ }
+ }
+ p {
+ page-break-after: left;
+ }
+</style>
+</head>
+<body>
+ <p>When printed, this test produces 4 or 5 pages of output. The next page may or may not be blank.</p>
+ <p>If the previous page was not blank, there should be a blank page after this sentence.</p>
+ <p>This content should appear on the fourth page.</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-before-000.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-000.xht
new file mode 100644
index 0000000000..e12e665084
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-000.xht
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-before: always</title>
+<link rel="author" title="Michael Turnwall" href="mailto:mturnwall@revenution.com"/>
+<link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/>
+<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 name="flags" content="paged" />
+<meta name="assert" content="The 'always' value of the 'page-break-before' property forces a page break before the box."/>
+<style type="text/css">
+
+ div.break {
+ page-break-before:always;
+ }
+
+</style>
+</head>
+<body>
+ <div>This test should produce two pages of output. This text should be at the top of the first page.</div>
+ <div class="break">This text should be at the top of the second and final page.</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-before-001.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-001.xht
new file mode 100644
index 0000000000..01c6a98dae
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-001.xht
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-before :auto</title>
+<link rel="author" title="Michael Turnwall" href="mailto:mturnwall@revenution.com"/>
+<link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The 'auto' value of the 'page-break-before' property neither forces nor forbids a page break before the box."/>
+<style type="text/css">
+
+ div.noBreak {
+ page-break-before:always;
+ page-break-before:auto;
+ }
+
+</style>
+</head>
+<body>
+ <div>There must <strong>not</strong> be a page break after this line of text.</div>
+ <div class="noBreak">This test should produce only one page of output.</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-before-002.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-002.xht
new file mode 100644
index 0000000000..d47f4c354d
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-002.xht
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-before inline elements</title>
+<link rel="author" title="Michael Turnwall" href="mailto:mturnwall@revenution.com"/>
+<link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The 'page-break-before' property applies to block-level elements only."/>
+<style type="text/css">
+
+ div.noBreak {
+ page-break-before:always;
+ display:inline;
+ }
+
+</style>
+</head>
+<body>
+ <div>There must <strong>not</strong> be a page break after this line of text.</div>
+ <div class="noBreak">This test should produce only one page of output.</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-before-003.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-003.xht
new file mode 100644
index 0000000000..d33a80175c
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-003.xht
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-before: left</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="flags" content="paged" />
+<meta name="assert" content=" - The 'left' value of the 'page-break-before' property forces one or two page breaks before the box so that the page after the break is formatted as a left page."/>
+<style type="text/css">
+ @page {margin: 7%;}
+ @page :left {
+ margin-right: 50%;
+ }
+ @page :right {
+ margin-left: 50%;
+ @top-center {
+ content: "[This page intentionally left blank]"
+ }
+ }
+ @page :first {
+ @top-center {
+ content: ""
+ }
+ border: 1em solid blue;
+ margin: 7%;
+ }
+ p.spacer {page-break-after: always;}
+ p.goLeft {
+ page-break-before: left;
+ }
+</style>
+</head>
+<body>
+ <p class="spacer">When printed, this test produces 4 or 5 pages of output. The next page may or may not be blank. This content must appear inside a blue box.</p>
+ <p class="spacer goLeft">When printed, this content should be on the left side of the page. The next page should be blank.</p>
+ <p class="goLeft">When printed, this content should appear on the fourth or fifth page. All content should be on the left side of the page.</p>
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam diam erat, convallis fermentum, volutpat a, dignissim a, est. Proin vel lacus.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-before-004.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-004.xht
new file mode 100644
index 0000000000..674ed0b4b9
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-004.xht
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-before (no inherit)</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="flags" content="paged" />
+<meta name="assert" content="The 'page-break-before' property is not inherited."/>
+<style type="text/css">
+ div.kidsIgnoreMe {
+ page-break-before: always;
+ }
+</style>
+</head>
+<body>
+<div class="kidsIgnoreMe">
+ <div>This test produces one or two pages of output on paged media. This sentence must be on the same page as the next sentence.</div>
+ <p>This sentence must appear on the same page as the text above.</p>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-before-005.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-005.xht
new file mode 100644
index 0000000000..7ad6974232
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-005.xht
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-before: right</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="flags" content="paged" />
+<meta name="assert" content=" - The 'right' value of the 'page-break-before' property forces one or two page breaks before the box so that the page after the break is formatted as a right page."/>
+<style type="text/css">
+ @page {margin: 7%;}
+ @page :left {
+ margin-right: 50%;
+ }
+ @page :right {
+ margin-left: 50%;
+ }
+ @page :first {
+ @top-center {
+ content: ""
+ }
+ border: 1em solid blue;
+ margin: 7%;
+ }
+ p.spacer {page-break-after: always;}
+ p.goRight {
+ page-break-before: right;
+ }
+</style>
+</head>
+<body>
+ <!-- Right & 1 blank left page -->
+ <p class="spacer">When printed, this test produces 4 or 5 pages of output. The next page may or may not be blank. This content must appear inside a blue box.</p>
+ <!-- Right page -->
+ <p class="goRight spacer">When printed, this content should be on the right side of the third page.</p>
+ <p class="spacer">When printed, this content should be on the left side of the page.</p>
+ <p class="goRight">When printed, this content should appear on the right side of the page.</p>
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam diam erat, convallis fermentum, volutpat a, dignissim a, est. Proin vel lacus. Quisque sit amet neque ac quam lacinia varius. In hac habitasse platea dictumst. Phasellus sodales velit vel metus. Ut in tortor dignissim libero elementum mattis. Proin rutrum vehicula lacus. Nunc mi ante, auctor id, vulputate sit amet, lobortis egestas, diam. Phasellus nibh elit, ultricies vitae, dignissim eu, vulputate ut, ante. Praesent interdum, ipsum eget fermentum luctus, enim ligula porttitor erat, id nonummy urna augue non eros. Morbi auctor pharetra tortor. Quisque eu lorem ut ipsum suscipit sollicitudin. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse potenti. Pellentesque in nisl vitae leo cursus adipiscing. Cras risus nisi, fermentum vulputate, consectetuer a, porttitor et, nibh. Integer vel enim. Donec euismod.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-before-006.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-006.xht
new file mode 100644
index 0000000000..43d1cec312
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-006.xht
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-before (invalid syntax)</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="flags" content="paged invalid" />
+<meta name="assert" content="The syntax of the 'page-break-before' property is auto | always | avoid | left | right."/>
+<style type="text/css">
+ p.noBreakAuto {
+ page-break-before: always;
+ page-break-before: auto auto;
+ }
+ p.noBreakLeft {
+ page-break-before: auto;
+ page-break-before: left always;
+ }
+ p.noBreakAlways {
+ page-break-before: true;
+ }
+ p.breakRight {
+ page-break-before: right;
+ page-break-before: 2;
+ }
+ p.breakLeft {
+ page-break-before: left;
+ page-break-before: avoid always;
+ }
+ p.noBreak {
+ page-break-before: avoid;
+ page-break-before: always always;
+ }
+
+</style>
+</head>
+<body>
+ <p>When printed, this test requires 4 pages. Page one contains only this
+ paragraph.</p>
+ <p class="noBreakAuto">This text is at the top of page two.</p>
+ <p class="noBreakLeft">This text is also on page two.</p>
+ <p class="noBreakAlways">And this text is on page two as well.</p>
+
+ <p class="breakRight">This paragraph is on page three. A page break follows.</p>
+ <p class="breakLeft">This text is at the top of page four.</p>
+ <p class="noBreak">This last paragraph is also on page four.</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-before-007-b.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-007-b.xht
new file mode 100644
index 0000000000..4059db1ec4
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-007-b.xht
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-before explicit auto test</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="flags" content="paged" />
+<meta name="assert" content="The initial value of the 'page-break-before' property is 'auto'."/>
+<style type="text/css">
+ @page {
+ margin: 7%;
+ }
+ html, body {
+ height:100%;
+ line-height:1;
+ }
+ * {
+ margin:0;
+ padding:0;
+ page-break-before: always;
+ page-break-before: auto;
+ }
+ div#one {height: 20%;}
+ div#two {
+ height: 80%;
+ margin-bottom: -4em;
+ }
+ p {width: 1em;}
+</style>
+</head>
+<body>
+ <div id="one">This test requires two pages.</div>
+ <div id="two">This text must appear on the same page as the line above it. The dummy text below this will flow onto a second page.</div>
+ <p>a b c d e</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-before-007.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-007.xht
new file mode 100644
index 0000000000..3ffe0b98d8
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-007.xht
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-before initial value</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="flags" content="paged" />
+<meta name="assert" content="The initial value of the 'page-break-before' property is 'auto', which neither forces nor forbids a page break before boxes."/>
+<style type="text/css">
+ @page {
+ margin: 7%;
+ }
+ html, body {
+ height:100%;
+ line-height:1;
+ }
+ * {
+ margin:0;
+ padding:0;
+ page-break-before: inherit;
+ }
+ div#one {height: 20%;}
+ div#two {
+ height: 80%;
+ margin-bottom: -4em;
+ }
+ p {width: 1em;}
+</style>
+</head>
+<body>
+ <div id="one">This test requires two pages.</div>
+ <div id="two">This text must appear on the same page as the line above it. The dummy text below this will flow onto a second page.</div>
+ <p>a b c d e</p>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-before-008.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-008.xht
new file mode 100644
index 0000000000..e394e074ac
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-008.xht
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-before paged media</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="assert" content="The 'page-break-before' property applies to paged media only"/>
+<meta name="flags" content="paged" />
+<style type="text/css">
+ div {
+ page-break-before: always;
+ border: 2pt solid black;
+ }
+</style>
+</head>
+<body>
+ <div>On screen, the next sentence must appear directly below this one.</div>
+ <div>When printed, however, this sentence must appear at the top of the next page.</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-before-009.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-009.xht
new file mode 100644
index 0000000000..50a1731e3d
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-009.xht
@@ -0,0 +1,58 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-before avoid</title>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="assert" content="The 'avoid' value of the 'page-break-before' property prevents a page break before the element when possible"/>
+<meta name="flags" content="paged"/>
+<style type="text/css">
+ html, body { height: 100%; line-height: 1; font-size: 20px; margin: 0; padding: 0; }
+ .spacer { height: 50%; }
+ .backup { margin-top: -3em; }
+ .start { page-break-before: always; }
+
+ p {
+ margin: 0;
+ color: blue;
+ orphans: 1;
+ widows: 1;
+ white-space: pre;
+ }
+
+ .avoidBefore {
+ page-break-before: avoid;
+ }
+ .avoidInside {
+ page-break-inside: avoid;
+ widows: 3;
+ orphans: 3;
+ }
+
+</style>
+</head>
+<body>
+ <div class="spacer">
+ Lines A-L must appear on the 6 pages of this test. The blue text
+ must accurately describe the page numbers.
+ </div><div class="spacer backup"></div>
+ <p>Page&nbsp;1&nbsp;Line&nbsp;A</p>
+ <p class="avoidBefore">Page&nbsp;1&nbsp;Line&nbsp;B
+Page&nbsp;1&nbsp;Line&nbsp;C
+Page&nbsp;2&nbsp;Line&nbsp;D</p>
+
+ <div class="spacer start"></div><div class="spacer backup"></div>
+ <p>Page&nbsp;3&nbsp;Line&nbsp;E
+Page&nbsp;3&nbsp;Line&nbsp;F
+Page&nbsp;4&nbsp;Line&nbsp;G</p>
+ <p class="avoidBefore">Page&nbsp;4&nbsp;Line&nbsp;H</p>
+
+ <div class="spacer start">[page 5]</div><div class="spacer backup"></div>
+ <p class="avoidInside">Page&nbsp;6&nbsp;Line&nbsp;I
+Page&nbsp;6&nbsp;Line&nbsp;J
+Page&nbsp;6&nbsp;Line&nbsp;K</p>
+ <p class="avoidBefore">Page&nbsp;6&nbsp;Line&nbsp;L</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-before-010.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-010.xht
new file mode 100644
index 0000000000..5266141ec2
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-010.xht
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-before :auto</title>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<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 name="flags" content="paged" />
+<meta name="assert" content="The 'auto' value of the 'page-break-before' property neither forces nor forbids a page break before the box."/>
+<style type="text/css">
+ html, body { height: 100%; line-height: 1; font-size: 20px; margin: 0; padding: 0; }
+ .spacer { height: 50%; }
+ .backup { margin-top: -2em; }
+ .start { page-break-before: always; }
+
+ p {
+ margin: 0;
+ color: blue;
+ orphans: 1;
+ widows: 1;
+ white-space: pre;
+ }
+
+ .avoidAuto { page-break-before: auto; }
+</style>
+</head>
+<body>
+ <div class="spacer">
+ Lines A-F must appear on the 4 pages of this test. The blue text
+ must accurately describe the page numbers.
+ </div><div class="spacer backup"></div>
+ <p>Page&nbsp;1&nbsp;Line&nbsp;A</p>
+ <p class="avoidAuto">Page&nbsp;1&nbsp;Line&nbsp;B
+Page&nbsp;2&nbsp;Line&nbsp;C</p>
+
+ <div class="spacer start"></div><div class="spacer backup"></div>
+ <p>Page&nbsp;3&nbsp;Line&nbsp;D
+Page&nbsp;3&nbsp;Line&nbsp;E</p>
+ <p class="avoidAuto">Page&nbsp;4&nbsp;Line&nbsp;F</p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-before-011.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-011.xht
new file mode 100644
index 0000000000..f93486f173
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-011.xht
@@ -0,0 +1,49 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-before initial value</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="flags" content="paged" />
+<meta name="assert" content="The initial value of the 'page-break-before' property is 'auto', which neither forces nor forbids a page break before boxes."/>
+<style type="text/css">
+ @page {
+ margin: 7%;
+ }
+ html, body {
+ height:100%;
+ line-height:1;
+ }
+ * {
+ margin:0;
+ padding:0;
+ page-break-before: inherit;
+ }
+ div#one {height: 20%;}
+ div#two {
+ height: 80%;
+ margin-bottom: -4em;
+ }
+ p {
+ width: 1em;
+ color: gray;
+ }
+</style>
+</head>
+<body>
+ <div id="one">This test produces two pages on paged media.</div>
+ <div id="two">This text appears on the first page.
+ <!-- Thus proving that a page break is not forced between boxes -->
+ The dummy text below this will flow onto a second page.</div>
+ <!-- Thus proving that a page break is not forbidden before boxes -->
+ <p>aaa<br />
+ bbb<br />
+ ccc<br />
+ ddd<br />
+ eee<br />
+ fff<br />
+ ggg<br />
+ </p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-before-020.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-020.xht
new file mode 100644
index 0000000000..c410fb69e1
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-before-020.xht
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Paged media - page-break-before on floats</title>
+ <link rel="author" title="Melinda Grant" href="mailto:melinda.grant@hp.com" />
+ <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 name="flags" content="paged" />
+ <meta name="assert" content="The 'page-break-before' property applies to floated block-level elements in normal flow." />
+ <style type="text/css">
+
+ #floated {
+ float: right;
+ page-break-before: always;
+ width: 50%;
+ }
+
+ </style>
+ </head>
+ <body>
+ <div>
+ <p>This test produces two pages when displayed on paged media. This paragraph is the only content on page one.</p>
+ <div id="floated">This paragraph is on page two and is entirely on the right side of the page.</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-000.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-000.xht
new file mode 100644
index 0000000000..ed60f38868
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-000.xht
@@ -0,0 +1,49 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-inside:auto</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#the-height-property"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The 'auto' value of the 'page-break-inside' property neither forces nor forbids a page break inside the box."/>
+<style type="text/css">
+ html,body {
+ font-size:12pt;
+ line-height:1;
+ height:100%;
+ margin:0;
+ }
+ .marginDiv1, .marginDiv2 {
+ height:50%;
+ }
+ .marginDiv2 {
+ margin-top:-5em;
+ }
+ div.break {
+ page-break-inside:auto;
+ width:4em;
+ }
+</style>
+</head>
+<body>
+ <div class="marginDiv1"></div>
+ <div class="marginDiv2"></div>
+ <div>There must be a page break below between "FIRST" and "LAST"</div>
+ <div class="break">
+ FIRST
+ dummy
+ dummy
+ dummy
+ dummy
+ dummy
+ dummy
+ dummy
+ dummy
+ dummy
+ LAST
+ </div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-001.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-001.xht
new file mode 100644
index 0000000000..bab6fafaea
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-001.xht
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-inside: avoid (basic)</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="flags" content="paged" />
+<meta name="assert" content="The 'avoid' value of the 'page-break-inside' property causes the UA to avoid breaking inside the element."/>
+<style type="text/css">
+ * {
+ margin: 0;
+ padding: 0;
+ orphans: 1;
+ widows: 1;
+ }
+ html, body {
+ height:100%;
+ line-height: 1;
+ }
+ div.spacer {
+ height: 100%;
+ margin-bottom: -2em;
+ }
+ div#noBreak {
+ page-break-inside: avoid;
+ width: 0;
+ }
+
+</style>
+</head>
+<body>
+ <div class="spacer">This paragraph must be the only content on this page. The letters a, b, and c are displayed on the next page.</div>
+ <div id="noBreak">a b c</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-002.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-002.xht
new file mode 100644
index 0000000000..e0f788cdd5
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-002.xht
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-inside (inline elements)</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The 'page-break-inside' property applies to block-level elements only."/>
+<style type="text/css">
+ * {
+ margin: 0;
+ padding: 0;
+ orphans: 1;
+ widows: 1;
+ }
+ html, body {
+ height:100%;
+ line-height: 1;
+ font-size: 20px;
+ }
+ div.spacers {
+ height: 50%;
+ }
+ div#backUp {margin-top: -2em;}
+ div.break {
+ width: 0;
+ }
+ span {page-break-inside: avoid;}
+
+</style>
+</head>
+<body>
+ <div class="spacers">&nbsp;</div>
+ <div class="spacers" id="backUp">The text below should break onto two pages, with only the letter 'c' appearing on the second page.</div>
+ <div class="break">
+ <span>a b c</span>
+ </div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-003.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-003.xht
new file mode 100644
index 0000000000..5534b12c52
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-003.xht
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: @page page-break-inside invalid syntax</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="flags" content="paged invalid" />
+<meta name="assert" content="The syntax of the 'page-break-inside' property is auto | avoid."/>
+<style type="text/css">
+ * {
+ margin: 0;
+ padding: 0;
+ orphans: 1;
+ widows: 1;
+ }
+ html, body {
+ height:100%;
+ line-height: 1;
+ font-size: 20px;
+ }
+ div.spacers {
+ height: 50%;
+ }
+ div#backUp {margin-top: -2em;}
+ div#noBreak {
+ page-break-inside: false;
+ width: 0;
+ }
+
+</style>
+</head>
+<body>
+ <div class="spacers">The text below should span two pages.</div>
+ <div class="spacers" id="backUp"></div>
+ <div id="noBreak">a b c</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-004.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-004.xht
new file mode 100644
index 0000000000..c10df1b89c
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-004.xht
@@ -0,0 +1,49 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: @page page-break-inside:auto</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<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 name="flags" content="paged" />
+<meta name="assert" content="The initial value of the 'page-break-inside' property is 'auto'."/>
+<style type="text/css">
+ * {
+ margin: 0;
+ padding: 0;
+ orphans: 1;
+ widows: 1;
+ }
+ html, body {
+ height:100%;
+ line-height: 1;
+ font-size: 20px;
+ }
+ div.spacers {
+ height: 50%;
+ }
+ div#takeTwo {page-break-before: always}
+ div.backUp {margin-top: -4em;}
+ div#break2 {
+ page-break-inside: avoid;
+ page-break-inside: auto;
+ }
+ .breaker {
+ width: 0;
+ font-weight: bold;
+ color: blue;
+ }
+</style>
+</head>
+<body>
+ <div class="spacers">
+ <p>This test produces four pages of output. The blue numbers must correspond to the page number they appear on.</p>
+ </div>
+ <div class="spacers backUp"></div>
+ <div class="breaker" id="break1">1 1 1 1 2 2 2 2</div>
+
+ <div class="spacers backup" id="takeTwo"></div>
+ <div class="spacers backUp"></div>
+ <div class="breaker" id="break2">3 3 3 3 4 4 4 4</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-005.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-005.xht
new file mode 100644
index 0000000000..facd24d53d
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-005.xht
@@ -0,0 +1,53 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: page-break-inside inheritance</title>
+ <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#spacing-props"/>
+ <meta name="flags" content="paged"/>
+ <meta name="assert" content="'page-break-inside' does not inherit."/>
+ <style type="text/css">
+ /* Most permissible breaking possible */
+ * { widows: 1; orphans: 1; widows: 0; orphans: 0; }
+
+ /* Leave 2.5 lines at bottom to play with, independent of page size. */
+ html, body {
+ height: 100%;
+ margin: 0;
+ line-height: 1;
+ }
+ .spacer1 {
+ height: 35%;
+ }
+ .spacer2 {
+ height: 15%;
+ margin-top: -2.5em;
+ }
+
+ .avoid {
+ page-break-inside: avoid;
+ height: 200%;
+ }
+ .test div {
+ white-space: pre;
+ /* Make test text more visible */
+ color: blue;
+ font-weight: bold;
+ }
+</style>
+</head>
+<body>
+ <div class="avoid">
+ <div class="spacer1">This test requires 2 pages. Lines A and B must appear
+ on the first page, lines C and D on the second.</div>
+ <div class="spacer2"></div>
+ <div class="test">
+<div> Page 1 Line A
+ Page 1 Line B
+ Page 2 Line C</div>
+<div> Page 2 Line D</div>
+ </div>
+ </div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-006.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-006.xht
new file mode 100644
index 0000000000..aa67922342
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-inside-006.xht
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page-break-inside: paged media</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The 'page-break-inside' property applies to paged media only."/>
+<style type="text/css">
+ @page {margin: 7%;}
+ html, body {
+ height: 100%;
+ line-height: 1;
+ font-size: 20px;
+ }
+ * {
+ margin: 0;
+ padding: 0;
+ }
+ div {
+ height: 100%;
+ }
+ #pusher {
+ height: 100%;
+ margin-bottom: -2em;
+ }
+ #test {
+ page-break-inside: avoid;
+ font-weight: bold;
+ color: blue;
+ }
+</style>
+</head>
+<body>
+ <div>
+ <p id="pusher">On screen, only 'Line&nbsp;C' below this sentence must be hidden until you scroll, but, when paginated, all three lines should appear together on the second page.</p>
+ <div id="test">
+ <p>Line&nbsp;A</p>
+ <p>Line&nbsp;B</p>
+ <p>Line&nbsp;C</p>
+ </div>
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-margins-001.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-margins-001.xht
new file mode 100644
index 0000000000..29673c6acb
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-margins-001.xht
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Margin at the start of document</title>
+ <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#spacing-props"/>
+ <meta name="flags" content="may paged"/>
+ <meta name="assert" content="The UA may preserve the margin after a forced
+ page break."/>
+ <style type="text/css">
+ .test {
+ line-height: 1em;
+ margin-top: 4em;
+ position: relative;
+ color: blue;
+ page-break-before: always;
+ }
+ .margin {
+ position: relative;
+ bottom: 6em;
+ }
+ </style>
+</head>
+<body>
+ <div>This test requires 2 pages. Test passes if lines A through E appear
+ in order on the second page.</div>
+
+ <div class="test">
+ <div>Page 2 Line D</div>
+ <div>Page 2 Line E</div>
+ <div class="margin">Page 2 Line A</div>
+ <div class="margin">Page 2 Line B</div>
+ <div class="margin">Page 2 Line C</div>
+ </div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-margins-002.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-margins-002.xht
new file mode 100644
index 0000000000..f7bd8f8227
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-margins-002.xht
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: allowed page break margin handling</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/>
+<meta name="assert" content="When a page break occurs in the vertical margin between sibling block boxes (or rows in a table), the used values of the adjoining 'margin-bottom' and 'margin-top' properties are set to '0'."/>
+<meta name="flags" content="paged" />
+<style type="text/css">
+ p {
+ page-break-after: always;
+ margin-bottom: 100in;
+ }
+ div {margin-top: 100in;}
+</style>
+</head>
+<body>
+ <p>When printed, this test requires two pages.</p>
+ <div>This sentence must appear at the top of the second page.</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-margins-003.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-margins-003.xht
new file mode 100644
index 0000000000..502a200d18
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-margins-003.xht
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page break margin handling</title>
+<link rel="author" title="Melinda Grant" href="mailto:melinda.grant@hp.com"/>
+<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/#allowed-pg-brk" />
+<meta name="assert" content="When a page break occurs in the vertical margin between sibling block boxes, the used values of the adjoining 'margin-bottom' and 'margin-top' properties are set to '0'."/>
+<!-- The portion of this assertion relative to the top margin is also tested by allowed-breaks-000-b. This test uses a tight layout to attempt to prove the bottom margin portion of the assertion and that may mask some defects exposed by allowed-breaks-000-b.
+-->
+<meta name="flags" content="paged" />
+<style type="text/css">
+ html, body {
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ }
+ body {
+ background: red;
+ }
+ div {
+ background: white;
+ }
+ #top {
+ height: 100%;
+ margin-bottom: -2in;
+ }
+ div.one {
+ page-break-before: avoid;
+ page-break-after: always;
+ background: white;
+ height: 2in;
+ margin-bottom: 2in;
+ }
+ div.two {
+ background: white;
+ margin: 2in 0 0 0;
+ height: 100%;
+}
+
+</style>
+</head>
+<body>
+
+ <div id="top">When printed, this test produces two pages of output. The text below must be displayed on the bottom half of the page. </div>
+
+ <div class="one">There must be a page break after this paragraph. There must be no red on the page.</div>
+ <div class="two">This text must be at the top of the second page (right below the top margin, not 2 inches below the top margin). There must be no red on this page.</div>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-break-margins-004.xht b/testing/web-platform/tests/css/CSS2/pagination/page-break-margins-004.xht
new file mode 100644
index 0000000000..1c2949693b
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-break-margins-004.xht
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: page break margin handling</title>
+<link rel="author" title="Melinda Grant" href="mailto:melinda.grant@hp.com"/>
+<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/#allowed-pg-brk" />
+<meta name="assert" content="When a page break occurs in the vertical margin between sibling block boxes, the used values of the adjoining 'margin-top' property is set to '0'."/>
+<!-- This test targets just the top margin after the break; allowed-breaks-000-a also tests this, using a tight layout. This test approach using a looser layout shows defects not revealed by allowed-breaks-000-a.
+-->
+<meta name="flags" content="paged" />
+<style type="text/css">
+ div {
+ background: yellow;
+ border: 1px white solid;
+ }
+ p.test {
+ page-break-after: always;
+ background: white;
+ margin-top: 0;
+ margin-bottom: .5in;
+ }
+ div.topper {
+ margin: 1in 0 0 0;
+ background: white;
+ }
+
+</style>
+</head>
+<body>
+
+ <p>When displayed in paged media, this test produces two pages of output.</p>
+
+ <div>
+ <p class="test">There must be a page break after this paragraph. There may or may not be a yellow background below;
+ however, there must <em>not</em> be a one half inch tall yellow bar below.</p>
+ <div class="topper">There must be no yellow on this second page.</div>
+ </div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-breaks-100.xht b/testing/web-platform/tests/css/CSS2/pagination/page-breaks-100.xht
new file mode 100644
index 0000000000..b4043a82c2
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-breaks-100.xht
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Page breaks: clearing bottom margin</title>
+ <link rel="author" title="Melinda Grant" href="mailto:melinda.grant@hp.com" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#allowed-page-breaks" />
+ <link rel="help" href="http://www.w3.org/TR/css3-page/#allowed-pg-brk" />
+ <meta name="flags" content="paged" />
+ <meta name="assert" content="When an element would span a page break solely to satisfy a descendant's bottom margin, that margin is instead truncated and the element does not span pages." />
+ <style type="text/css">
+
+ p {
+ margin-bottom: 12in;
+ }
+
+ </style>
+ </head>
+ <body>
+ <div>
+ <p>This test produces only one page on paged media, containing only this paragraph.</p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/page-breaks-101.xht b/testing/web-platform/tests/css/CSS2/pagination/page-breaks-101.xht
new file mode 100644
index 0000000000..813cbe7e04
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/page-breaks-101.xht
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Page Breaks and Bottom Margin (with bg/border)</title>
+ <link rel="author" title="Melinda Grant" href="mailto:melinda.grant@hp.com" />
+ <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#allowed-page-breaks" />
+ <link rel="help" href="http://www.w3.org/TR/css3-page/#allowed-pg-brk" />
+ <meta name="flags" content="paged" />
+ <meta name="assert" content="Page breaks are not allowed between the last child of a block and its parent." />
+ <style type="text/css">
+
+ div {
+ background: #eee;
+ border: thick solid orange;
+ }
+ p {
+ margin-bottom: 15in;
+ white-space: nowrap;
+ color: blue;
+ }
+
+ </style>
+ </head>
+ <body>
+ <div>
+ This test produces multiple pages on paged media. The words
+ SECOND PAGE TOP below must appear at the top of the second page.
+ <p>
+ SECOND PAGE TOP
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/row-page-break-inside-avoid-1-print.html b/testing/web-platform/tests/css/CSS2/pagination/row-page-break-inside-avoid-1-print.html
new file mode 100644
index 0000000000..ba84330bd5
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/row-page-break-inside-avoid-1-print.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="rowgroup-page-break-inside-avoid-5-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<table border="1">
+<thead><tr><td><p>1</p></td></tr></thead>
+<tbody><tr class="test"><td><p>2</p><p>3</p></td></tr></tbody>
+</table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/row-page-break-inside-avoid-2-print.html b/testing/web-platform/tests/css/CSS2/pagination/row-page-break-inside-avoid-2-print.html
new file mode 100644
index 0000000000..1f4b24e4fb
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/row-page-break-inside-avoid-2-print.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="rowgroup-page-break-inside-avoid-5-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<table border="1">
+<tbody>
+<tr><td><p>1</p></td></tr>
+<tr class="test"><td><p>2</p><p>3</p></td></tr></tbody>
+</table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-1-print.html b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-1-print.html
new file mode 100644
index 0000000000..b13bf2e623
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-1-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="table-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<p>1</p>
+<table><thead class="test"><tr><td><p>2</p><p>3</p></td></tr></thead></table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-2-print.html b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-2-print.html
new file mode 100644
index 0000000000..947412d0d0
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-2-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="table-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<p>1</p>
+<table><tbody class="test"><tr><td><p>2</p><p>3</p></td></tr></tbody></table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-3-print.html b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-3-print.html
new file mode 100644
index 0000000000..5efba525ff
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-3-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="table-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<p>1</p>
+<table><tfoot class="test"><tr><td><p>2</p><p>3</p></td></tr></tfoot></table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-4-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-4-print-ref.html
new file mode 100644
index 0000000000..c7c0abdf19
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-4-print-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+
+</style>
+</head>
+<body>
+<table border="1">
+<tfoot><tr><td><p>3</p></td></tr></tfoot>
+<thead><tr><td><p>1</p></td></tr></thead>
+<tbody style="page-break-before:always"><tr><td><p>2</p><p>2</p></td></tr></tbody>
+</table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-4-print.html b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-4-print.html
new file mode 100644
index 0000000000..38290b0f27
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-4-print.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="rowgroup-page-break-inside-avoid-4-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<table border="1">
+<tfoot><tr><td><p>3</p></td></tr></tfoot>
+<thead><tr><td><p>1</p></td></tr></thead>
+<tbody class="test"><tr><td><p>2</p><p>2</p></td></tr></tbody>
+</table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-5-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-5-print-ref.html
new file mode 100644
index 0000000000..c08a376bfa
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-5-print-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+thead { page-break-after:always; }
+</style>
+</head>
+<body>
+<table border="1">
+<thead><tr><td><p>1</p></td></tr></thead>
+<tbody><tr><td><p>2</p><p>3</p></td></tr></tbody>
+</table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-5-print.html b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-5-print.html
new file mode 100644
index 0000000000..ea6e722b9d
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-5-print.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="rowgroup-page-break-inside-avoid-5-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<table border="1">
+<thead><tr><td><p>1</p></td></tr></thead>
+<tbody class="test"><tr><td><p>2</p><p>3</p></td></tr></tbody>
+</table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-6-print.html b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-6-print.html
new file mode 100644
index 0000000000..41e6d477f3
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-6-print.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="rowgroup-page-break-inside-avoid-5-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+.bb { page-break-before:always; }
+</style>
+</head>
+<body>
+<table border="1">
+<thead><tr><td><p>1</p></td></tr></thead>
+<tbody class="test"><tr class="bb"><td><p>2</p><p>3</p></td></tr></tbody>
+</table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-7-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-7-print-ref.html
new file mode 100644
index 0000000000..e425f034ac
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-7-print-ref.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.bb { page-break-before:always; }
+</style>
+</head>
+<body>
+1
+<table border="1" class="bb">
+<tbody>
+<tr><td><p>2</p></td></tr>
+<tr><td><p>2</p><p>3</p></td></tr>
+</tbody>
+</table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-7-print.html b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-7-print.html
new file mode 100644
index 0000000000..4a6bba180b
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-7-print.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="rowgroup-page-break-inside-avoid-7-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+1
+<table border="1">
+<tbody class="test">
+<tr><td><p>2</p></td></tr>
+<tr><td><p>2</p><p>3</p></td></tr>
+</tbody>
+</table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-8-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-8-print-ref.html
new file mode 100644
index 0000000000..0ff37fc97e
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-8-print-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+
+.bb { page-break-before:always; }
+</style>
+</head>
+<body>
+1
+<table border="1">
+<tbody>
+<tr><td><p>1</p></td></tr>
+<tr class="bb"><td><p>2</p><p>2</p></td></tr>
+</tbody>
+</table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-8-print.html b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-8-print.html
new file mode 100644
index 0000000000..fbb8a1218c
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/rowgroup-page-break-inside-avoid-8-print.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="rowgroup-page-break-inside-avoid-8-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+.bb { page-break-before:always; }
+</style>
+</head>
+<body>
+1
+<table border="1">
+<tbody class="test">
+<tr><td><p>1</p></td></tr>
+<tr class="bb"><td><p>2</p><p>2</p></td></tr>
+</tbody>
+</table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/1x1-green.png b/testing/web-platform/tests/css/CSS2/pagination/support/1x1-green.png
new file mode 100644
index 0000000000..b98ca0ba0a
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/1x1-green.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/1x1-lime.png b/testing/web-platform/tests/css/CSS2/pagination/support/1x1-lime.png
new file mode 100644
index 0000000000..cb397fb090
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/1x1-lime.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/1x1-maroon.png b/testing/web-platform/tests/css/CSS2/pagination/support/1x1-maroon.png
new file mode 100644
index 0000000000..3f86b07219
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/1x1-maroon.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/1x1-navy.png b/testing/web-platform/tests/css/CSS2/pagination/support/1x1-navy.png
new file mode 100644
index 0000000000..9b9a03955b
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/1x1-navy.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/1x1-red.png b/testing/web-platform/tests/css/CSS2/pagination/support/1x1-red.png
new file mode 100644
index 0000000000..6bd73ac101
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/1x1-red.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/1x1-white.png b/testing/web-platform/tests/css/CSS2/pagination/support/1x1-white.png
new file mode 100644
index 0000000000..dd43faec54
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/1x1-white.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/60x60-gg-rr.png b/testing/web-platform/tests/css/CSS2/pagination/support/60x60-gg-rr.png
new file mode 100644
index 0000000000..84f5b2a4f1
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/60x60-gg-rr.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/60x60-green.png b/testing/web-platform/tests/css/CSS2/pagination/support/60x60-green.png
new file mode 100644
index 0000000000..b3c8cf3eb4
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/60x60-green.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/a-green.css b/testing/web-platform/tests/css/CSS2/pagination/support/a-green.css
new file mode 100644
index 0000000000..b0dbb071d5
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/a-green.css
@@ -0,0 +1 @@
+.a { color: green; }
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/b-green.css b/testing/web-platform/tests/css/CSS2/pagination/support/b-green.css
new file mode 100644
index 0000000000..a0473f5ca2
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/b-green.css
@@ -0,0 +1 @@
+.b { color: green; } \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/blue15x15.png b/testing/web-platform/tests/css/CSS2/pagination/support/blue15x15.png
new file mode 100644
index 0000000000..89de32fdb8
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/blue15x15.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/c-red.css b/testing/web-platform/tests/css/CSS2/pagination/support/c-red.css
new file mode 100644
index 0000000000..d4ba5c64e9
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/c-red.css
@@ -0,0 +1 @@
+.c { color: red; } \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/cat.png b/testing/web-platform/tests/css/CSS2/pagination/support/cat.png
new file mode 100644
index 0000000000..85dd732481
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/cat.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/diamond.png b/testing/web-platform/tests/css/CSS2/pagination/support/diamond.png
new file mode 100644
index 0000000000..51112efc7c
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/diamond.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/green15x15.png b/testing/web-platform/tests/css/CSS2/pagination/support/green15x15.png
new file mode 100644
index 0000000000..51741584a0
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/green15x15.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/pattern-grg-rrg-rgg.png b/testing/web-platform/tests/css/CSS2/pagination/support/pattern-grg-rrg-rgg.png
new file mode 100644
index 0000000000..fcf4f3fd7d
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/pattern-grg-rrg-rgg.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/pattern-tr.png b/testing/web-platform/tests/css/CSS2/pagination/support/pattern-tr.png
new file mode 100644
index 0000000000..8b4b25364e
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/pattern-tr.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/ring.png b/testing/web-platform/tests/css/CSS2/pagination/support/ring.png
new file mode 100644
index 0000000000..061bb94eba
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/ring.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/square-purple.png b/testing/web-platform/tests/css/CSS2/pagination/support/square-purple.png
new file mode 100644
index 0000000000..0f522d7872
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/square-purple.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/square-teal.png b/testing/web-platform/tests/css/CSS2/pagination/support/square-teal.png
new file mode 100644
index 0000000000..e567f51b91
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/square-teal.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/square-white.png b/testing/web-platform/tests/css/CSS2/pagination/support/square-white.png
new file mode 100644
index 0000000000..5853cbb238
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/square-white.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/swatch-green.png b/testing/web-platform/tests/css/CSS2/pagination/support/swatch-green.png
new file mode 100644
index 0000000000..0aa79b0c86
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/swatch-green.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/swatch-lime.png b/testing/web-platform/tests/css/CSS2/pagination/support/swatch-lime.png
new file mode 100644
index 0000000000..55fd7fdaed
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/swatch-lime.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/swatch-orange.png b/testing/web-platform/tests/css/CSS2/pagination/support/swatch-orange.png
new file mode 100644
index 0000000000..d3cd498b52
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/swatch-orange.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/swatch-red.png b/testing/web-platform/tests/css/CSS2/pagination/support/swatch-red.png
new file mode 100644
index 0000000000..1caf25c992
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/swatch-red.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/swatch-white.png b/testing/web-platform/tests/css/CSS2/pagination/support/swatch-white.png
new file mode 100644
index 0000000000..1a7d4323d7
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/swatch-white.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/swatch-yellow.png b/testing/web-platform/tests/css/CSS2/pagination/support/swatch-yellow.png
new file mode 100644
index 0000000000..1591aa0e2e
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/swatch-yellow.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/test-bl.png b/testing/web-platform/tests/css/CSS2/pagination/support/test-bl.png
new file mode 100644
index 0000000000..904e24e996
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/test-bl.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/test-br.png b/testing/web-platform/tests/css/CSS2/pagination/support/test-br.png
new file mode 100644
index 0000000000..f413ff5c1a
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/test-br.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/test-outer.png b/testing/web-platform/tests/css/CSS2/pagination/support/test-outer.png
new file mode 100644
index 0000000000..82eeace7fc
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/test-outer.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/test-tl.png b/testing/web-platform/tests/css/CSS2/pagination/support/test-tl.png
new file mode 100644
index 0000000000..f6ac0ef7e8
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/test-tl.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/support/test-tr.png b/testing/web-platform/tests/css/CSS2/pagination/support/test-tr.png
new file mode 100644
index 0000000000..59843ae54b
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/support/test-tr.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-1-print.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-1-print.html
new file mode 100644
index 0000000000..f5a2e43ff6
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-1-print.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="table-page-break-inside-avoid-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<p>1</p>
+<table class="test"><tr><td><p>2</p><p>3</p></td></tr></table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-2-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-2-print-ref.html
new file mode 100644
index 0000000000..61f1c9735b
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-2-print-ref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+
+</style>
+</head>
+<body>
+<table border="1">
+<tbody>
+<tr><td><p>1</p></td></tr>
+</tbody>
+</table>
+<div style= "page-break-after: always"></div>
+<table border="1">
+<tbody></tbody>
+<tbody>
+<tr><td><p>2</p><p>3</p></td></tr>
+</tbody>
+</table>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-2-print.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-2-print.html
new file mode 100644
index 0000000000..418561d904
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-2-print.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="table-page-break-inside-avoid-2-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<table border="1">
+<tbody>
+<tr><td><p>1</p></td></tr>
+</tbody>
+</table>
+<div style= "page-break-after: always"></div>
+<table border="1" class="test">
+<tbody></tbody>
+<tbody>
+<tr><td><p>2</p><p>3</p></td></tr>
+</tbody>
+</table>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-3-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-3-print-ref.html
new file mode 100644
index 0000000000..19b0c40b20
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-3-print-ref.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+
+table { display:inline-table; }
+</style>
+</head>
+<body>
+<table border="1">
+<tbody>
+<tr><td><p>1</p></td></tr>
+</tbody>
+</table>
+<div style= "page-break-after: always"></div>
+<table border="1">
+<tbody></tbody>
+<tbody>
+<tr><td><p>2</p><p>3</p><p>4</p></td></tr>
+</tbody>
+</table>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-3-print.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-3-print.html
new file mode 100644
index 0000000000..c5a6be6bf1
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-3-print.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="table-page-break-inside-avoid-3-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+table { display:inline-table; }
+</style>
+</head>
+<body>
+<table border="1">
+<tbody>
+<tr><td><p>1</p></td></tr>
+</tbody>
+</table>
+<div style="page-break-after: always"></div>
+<table border="1" class="test">
+<tbody></tbody>
+<tbody>
+<tr><td><p>2</p><p>3</p><p>4</p></td></tr>
+</tbody>
+</table>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-4-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-4-print-ref.html
new file mode 100644
index 0000000000..87abef8541
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-4-print-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+table { display:inline-table; }
+</style>
+</head>
+<body>
+<p style="page-break-after:always">1</p>
+text<table class="test"><tr><td><p>2</p><p>3</p><p>4</p></td></tr></table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-4-print.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-4-print.html
new file mode 100644
index 0000000000..8836b10068
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-4-print.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="table-page-break-inside-avoid-4-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+table { display:inline-table; }
+</style>
+</head>
+<body>
+<p>1</p>
+text<table class="test"><tr><td><p>2</p><p>3</p><p>4</p></td></tr></table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-5-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-5-print-ref.html
new file mode 100644
index 0000000000..ddb23f6f44
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-5-print-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+
+tr,table { page-break-before:always; }
+</style>
+</head>
+<body>
+<p>1</p>
+<table class="test" border="1">
+<tr><td>I have page-break-after: always</td></tr>
+<tr><td>I have page-break-after: always</td></tr>
+<tr><td>I have page-break-after: always</td></tr>
+</table>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-5-print.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-5-print.html
new file mode 100644
index 0000000000..dd3d2c42f7
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-5-print.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="table-page-break-inside-avoid-5-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+tr { page-break-before:always; }
+</style>
+</head>
+<body>
+<p>1</p>
+<table class="test" border="1">
+<tr><td>I have page-break-after: always</td></tr>
+<tr><td>I have page-break-after: always</td></tr>
+<tr><td>I have page-break-after: always</td></tr>
+</table>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-6-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-6-print-ref.html
new file mode 100644
index 0000000000..b9adb9082f
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-6-print-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+</style>
+</head>
+<body>
+<table cellspacing="0" cellpadding="0"><caption><p>1</p></caption><tr><td><p>1</p><p>2</p></td></tr></table>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-6-print.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-6-print.html
new file mode 100644
index 0000000000..3d327d9d00
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-6-print.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="table-page-break-inside-avoid-6-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<table cellspacing="0" cellpadding="0" class="test"><caption><p>1</p></caption><tr><td><p>1</p><p>2</p></td></tr></table>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-7-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-7-print-ref.html
new file mode 100644
index 0000000000..46b41fb0c1
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-7-print-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+div { page-break-after: always; }
+</style>
+</head>
+<body>
+<div>Text</div>
+<table cellspacing="0" cellpadding="0"><caption><p>1</p></caption><tr><td><p>1</p><p>2</p></td></tr></table>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-7-print.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-7-print.html
new file mode 100644
index 0000000000..bb85d62ce8
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-7-print.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="table-page-break-inside-avoid-7-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<div>Text</div>
+<table cellspacing="0" cellpadding="0" class="test"><caption><p>1</p></caption><tr><td><p>1</p><p>2</p></td></tr></table>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-8-print.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-8-print.html
new file mode 100644
index 0000000000..f100a1b50a
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-8-print.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+ <link rel="match" href="table-page-break-inside-avoid-6-print-ref.html">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+.test { page-break-inside:avoid; }
+</style>
+</head>
+<body>
+<table cellspacing="0" cellpadding="0"><caption><p>1</p></caption><tbody class="test"><tr><td><p>1</p><p>2</p></td></tr></tbody></table>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-print-ref.html b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-print-ref.html
new file mode 100644
index 0000000000..afbaf992cf
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/table-page-break-inside-avoid-print-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
+ <meta name="flags" content="paged">
+<style type="text/css">
+@page { size:5in 3in; margin:0.5in; }
+p { height: 1in; width: 1in; margin:0; background-color:blue; }
+
+</style>
+</head>
+<body>
+<p style="page-break-after:always">1</p>
+<table><tr><td><p>2</p><p>3</p></td></tr></table>
+
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/widows-001.xht b/testing/web-platform/tests/css/CSS2/pagination/widows-001.xht
new file mode 100644
index 0000000000..4e2827317f
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/widows-001.xht
@@ -0,0 +1,49 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: breaks inside elements: widows - initial value</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#break-inside"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The initial value of the 'widows' property is 2."/>
+<style type="text/css">
+ html, body {
+ height: 100%;
+ line-height: 1;
+ font-size: 20px;
+ }
+ * {
+ margin:0;
+ padding:0;
+ }
+ div.spacer {
+ height:50%;
+ }
+ div.backup {
+ margin-top:-4em;
+ }
+
+ .test {
+ color: blue;
+ width: 1em;
+ }
+
+</style>
+</head>
+<body>
+ <div class="spacer">This test requires 2 pages. The blue text must
+ denote accurate page numbers. Lines A-C must appear on this page;
+ lines D-E must appear on the next page.</div>
+
+ <div class="spacer backup"></div>
+ <div class="test">
+ Page&nbsp;1&nbsp;Line&nbsp;A
+ Page&nbsp;1&nbsp;Line&nbsp;B
+ Page&nbsp;1&nbsp;Line&nbsp;C
+ Page&nbsp;2&nbsp;Line&nbsp;D
+ Page&nbsp;2&nbsp;Line&nbsp;E
+ </div>
+
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/widows-002.xht b/testing/web-platform/tests/css/CSS2/pagination/widows-002.xht
new file mode 100644
index 0000000000..1313c0df3b
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/widows-002.xht
@@ -0,0 +1,54 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: breaks inside elements: orphans - block-level only</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#break-inside"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The 'widows' property is only applied to block-level elements."/>
+<style type="text/css">
+ html, body {
+ height: 100%;
+ line-height: 1;
+ font-size: 20px;
+ }
+ * {
+ margin:0;
+ padding:0;
+ }
+ div.spacer {
+ height:50%;
+ }
+ div.backup {
+ margin-top:-5em;
+ }
+
+ .test {
+ color: blue;
+ width: 1em;
+ widows: 5;
+ }
+ .test span {
+ widows: 2;
+ }
+
+</style>
+</head>
+<body>
+ <div class="spacer">This test requires 2 pages. The blue text must
+ denote accurate page numbers. Lines A-B must appear on this page;
+ lines C-G must appear on the next page.</div>
+
+ <div class="spacer backup"></div>
+ <div class="test"><span>
+ Page&nbsp;1&nbsp;Line&nbsp;A
+ Page&nbsp;1&nbsp;Line&nbsp;B
+ Page&nbsp;2&nbsp;Line&nbsp;C
+ Page&nbsp;2&nbsp;Line&nbsp;D
+ Page&nbsp;2&nbsp;Line&nbsp;E
+ Page&nbsp;2&nbsp;Line&nbsp;F
+ Page&nbsp;2&nbsp;Line&nbsp;G
+ </span></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/widows-003.xht b/testing/web-platform/tests/css/CSS2/pagination/widows-003.xht
new file mode 100644
index 0000000000..290d8cc345
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/widows-003.xht
@@ -0,0 +1,53 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: breaks inside elements: widows - inheritance</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#break-inside"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The 'widows' property is inherited."/>
+<style type="text/css">
+ html, body {
+ height: 100%;
+ line-height: 1;
+ font-size: 20px;
+ }
+ * {
+ margin:0;
+ padding:0;
+ }
+ div.spacer {
+ height:50%;
+ }
+ div.backup {
+ margin-top:-5em;
+ }
+
+ .test {
+ color: blue;
+ width: 1em;
+ }
+ html {
+ widows: 5;
+ }
+
+</style>
+</head>
+<body>
+ <div class="spacer">This test requires 2 pages. The blue text must
+ denote accurate page numbers. Lines A-B must appear on this page;
+ lines C-G must appear on the next page.</div>
+
+ <div class="spacer backup"></div>
+ <div class="test">
+ Page&nbsp;1&nbsp;Line&nbsp;A
+ Page&nbsp;1&nbsp;Line&nbsp;B
+ Page&nbsp;2&nbsp;Line&nbsp;C
+ Page&nbsp;2&nbsp;Line&nbsp;D
+ Page&nbsp;2&nbsp;Line&nbsp;E
+ Page&nbsp;2&nbsp;Line&nbsp;F
+ Page&nbsp;2&nbsp;Line&nbsp;G
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/widows-004a.xht b/testing/web-platform/tests/css/CSS2/pagination/widows-004a.xht
new file mode 100644
index 0000000000..955b461b24
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/widows-004a.xht
@@ -0,0 +1,62 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: widows property syntax - positive integer</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<!--
+ Credits should go to
+ kawakubo_toru
+ for fixing this test.
+-->
+<link rel="reviewer" title="GĂ©rard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2017-03-03 -->
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#break-inside"/>
+<link rel="help" href="http://www.w3.org/TR/css3-page/#breaks-inside"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The syntax of the 'widows' property is positive integer."/>
+<style type="text/css">
+ html, body {
+ height: 100%;
+ line-height: 1;
+ font-size: 20px;
+ }
+ * {
+ margin:0;
+ padding:0;
+ }
+ div.spacer {
+ height:50%;
+ }
+ div.backup {
+ margin-top:-5em;
+ }
+
+ .test {
+ color: blue;
+ width: 1em;
+ widows: 5; /* valid */
+ widows: 2.0; /* invalid: real and not integer */
+ widows: 2em; /* invalid: length and not integer */
+ widows: -2; /* invalid: negative integer */
+ widows: 0; /* invalid: zero is not a positive integer */
+ }
+
+</style>
+</head>
+<body>
+ <div class="spacer">This test requires 2 pages. The blue text must
+ denote accurate page numbers. Lines A-B must appear on this page;
+ lines C-G must appear on the next page.</div>
+
+ <div class="spacer backup"></div>
+ <div class="test">
+ Page&nbsp;1&nbsp;Line&nbsp;A
+ Page&nbsp;1&nbsp;Line&nbsp;B
+ Page&nbsp;2&nbsp;Line&nbsp;C
+ Page&nbsp;2&nbsp;Line&nbsp;D
+ Page&nbsp;2&nbsp;Line&nbsp;E
+ Page&nbsp;2&nbsp;Line&nbsp;F
+ Page&nbsp;2&nbsp;Line&nbsp;G
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/pagination/widows-004b.xht b/testing/web-platform/tests/css/CSS2/pagination/widows-004b.xht
new file mode 100644
index 0000000000..5a89509393
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/pagination/widows-004b.xht
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Test: widows property syntax - one</title>
+<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/>
+<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#break-inside"/>
+<link rel="help" href="http://www.w3.org/TR/css3-page/#breaks-inside"/>
+<meta name="flags" content="paged" />
+<meta name="assert" content="The 'widows' property accepts the integer one."/>
+<style type="text/css">
+ html, body {
+ height: 100%;
+ line-height: 1;
+ font-size: 20px;
+ }
+ * {
+ margin:0;
+ padding:0;
+ }
+ div.spacer {
+ height:50%;
+ }
+ div.backup {
+ margin-top:-3.5em;
+ }
+
+ .test {
+ color: blue;
+ width: 1em;
+ widows: 2;
+ widows: 01;
+ }
+
+</style>
+</head>
+<body>
+ <div class="spacer">This test requires 2 pages. The blue text must
+ denote accurate page numbers. Lines A-C must appear on this page;
+ line D must appear on the next page.</div>
+
+ <div class="spacer backup"></div>
+ <div class="test">
+ Page&nbsp;1&nbsp;Line&nbsp;A
+ Page&nbsp;1&nbsp;Line&nbsp;B
+ Page&nbsp;1&nbsp;Line&nbsp;C
+ Page&nbsp;2&nbsp;Line&nbsp;D
+ </div>
+</body>
+</html>