summaryrefslogtreecommitdiffstats
path: root/layout/reftests/w3c-css/submitted/css21
diff options
context:
space:
mode:
Diffstat (limited to 'layout/reftests/w3c-css/submitted/css21')
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-1.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-10.html20
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-11.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-12.html22
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-13.html23
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-14-ref.html20
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-14.html22
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-15-ref.html20
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-15.html22
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-2.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-3.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-4.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-5.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-6.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-7.html22
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-8-ref.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-8.html23
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-9.html22
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-ref.html19
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-1.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-2-ref.html20
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-2.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-3.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-4.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-5-ref.html33
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-5.html35
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-6-ref.html17
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-6.html19
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-7-ref.html25
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-7.html28
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-8-ref.html26
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-8.html28
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-9-ref.html30
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-9.html33
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-inline-page-break-inside-avoid-1-ref.html19
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-inline-page-break-inside-avoid-1.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-row-page-break-inside-avoid-1.html23
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-row-page-break-inside-avoid-2.html24
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-1.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-2.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-3.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-4-ref.html22
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-4.html24
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-5-ref.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-5.html23
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-6.html24
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-7-ref.html24
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-7.html26
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-8-ref.html25
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-8.html27
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-1.html21
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-2-ref.html27
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-2.html29
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-3-ref.html28
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-3.html30
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-4-ref.html19
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-4.html22
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-5-ref.html23
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-5.html25
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-6-ref.html15
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-6.html18
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-7-ref.html17
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-7.html19
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-8.html18
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-ref.html19
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/reftest-stylo.list46
-rw-r--r--layout/reftests/w3c-css/submitted/css21/pagination/reftest.list43
-rw-r--r--layout/reftests/w3c-css/submitted/css21/reftest-stylo.list3
-rw-r--r--layout/reftests/w3c-css/submitted/css21/reftest.list2
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/reftest-stylo.list10
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/reftest.list9
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-all-auto-ref.html33
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-all-auto.html30
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-height-20-ref.html33
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-height-20.html31
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-max-height-20.html31
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-max-width-40.html31
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-height-20.html31
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-height-40-ref.html33
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-height-40.html31
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-width-40.html31
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-width-80-ref.html33
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-width-80.html31
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-width-40-ref.html33
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-width-40.html31
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/height-25-no-ratio.svg3
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/height-25-ratio-2.svg3
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/height-25-width-50.svg3
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/no-ratio.svg3
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/ratio-2.svg3
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/width-50-no-ratio.svg3
-rw-r--r--layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/width-50-ratio-2.svg3
92 files changed, 2054 insertions, 0 deletions
diff --git a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-1.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-1.html
new file mode 100644
index 000000000..530a353c7
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-10.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-10.html
new file mode 100644
index 000000000..b096c9f74
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-10.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-11.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-11.html
new file mode 100644
index 000000000..ac867b276
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-11.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-12.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-12.html
new file mode 100644
index 000000000..96a190e95
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-12.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-13.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-13.html
new file mode 100644
index 000000000..bcd45e091
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-13.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-8-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-14-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-14-ref.html
new file mode 100644
index 000000000..12f2a3db6
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-14-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-14.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-14.html
new file mode 100644
index 000000000..ba5e5f175
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-14.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-14-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-15-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-15-ref.html
new file mode 100644
index 000000000..856c3fb50
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-15-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-15.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-15.html
new file mode 100644
index 000000000..7b8e95894
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-15.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-15-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-2.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-2.html
new file mode 100644
index 000000000..b5a8d0f92
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-3.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-3.html
new file mode 100644
index 000000000..f18a344e6
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-3.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-4.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-4.html
new file mode 100644
index 000000000..a69ea4cd6
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-4.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-5.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-5.html
new file mode 100644
index 000000000..944d3c12e
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-5.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-6.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-6.html
new file mode 100644
index 000000000..8108b444c
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-6.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-7.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-7.html
new file mode 100644
index 000000000..0f35edb7c
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-7.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-8-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-8-ref.html
new file mode 100644
index 000000000..bf31a0b71
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-8-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-8.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-8.html
new file mode 100644
index 000000000..77d9e3406
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-8.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-8-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-9.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-9.html
new file mode 100644
index 000000000..b2e9c9da0
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-9.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-ref.html
new file mode 100644
index 000000000..7ab7bb303
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-1.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-1.html
new file mode 100644
index 000000000..8f7d709f0
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-table-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-2-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-2-ref.html
new file mode 100644
index 000000000..e4df1dbc1
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-2-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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 { 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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-2.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-2.html
new file mode 100644
index 000000000..9cfc9bb35
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-float-page-break-inside-avoid-2-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 class="test"><p>1</p></div>
+<div class="test"><p>2</p><p>3</p><p>4</p></div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-3.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-3.html
new file mode 100644
index 000000000..dd61bde51
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-3.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-4.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-4.html
new file mode 100644
index 000000000..95f6a56e2
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-4.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-block-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-5-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-5-ref.html
new file mode 100644
index 000000000..e04ffcb60
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-5-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-5.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-5.html
new file mode 100644
index 000000000..c320d7744
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-5.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-float-page-break-inside-avoid-5-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-6-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-6-ref.html
new file mode 100644
index 000000000..f4b7529d7
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-6-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-6.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-6.html
new file mode 100644
index 000000000..505ccb263
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-6.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-float-page-break-inside-avoid-6-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-7-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-7-ref.html
new file mode 100644
index 000000000..06b197fa3
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-7-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-7.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-7.html
new file mode 100644
index 000000000..854a2dce3
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-7.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-float-page-break-inside-avoid-7-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-8-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-8-ref.html
new file mode 100644
index 000000000..b09e87f5c
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-8-ref.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-8.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-8.html
new file mode 100644
index 000000000..a4e119422
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-8.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-float-page-break-inside-avoid-8-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-9-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-9-ref.html
new file mode 100644
index 000000000..2c6bb0ed0
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-9-ref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-9.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-9.html
new file mode 100644
index 000000000..6c955a16b
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-9.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-float-page-break-inside-avoid-9-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-inline-page-break-inside-avoid-1-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-inline-page-break-inside-avoid-1-ref.html
new file mode 100644
index 000000000..1e8de0a46
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-inline-page-break-inside-avoid-1-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-inline-page-break-inside-avoid-1.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-inline-page-break-inside-avoid-1.html
new file mode 100644
index 000000000..0b7c6af14
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-inline-page-break-inside-avoid-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-inline-page-break-inside-avoid-1-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-row-page-break-inside-avoid-1.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-row-page-break-inside-avoid-1.html
new file mode 100644
index 000000000..f964fd7ca
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-row-page-break-inside-avoid-1.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-rowgroup-page-break-inside-avoid-5-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-row-page-break-inside-avoid-2.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-row-page-break-inside-avoid-2.html
new file mode 100644
index 000000000..a09e0f7a6
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-row-page-break-inside-avoid-2.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-rowgroup-page-break-inside-avoid-5-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-1.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-1.html
new file mode 100644
index 000000000..549f738bb
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-table-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-2.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-2.html
new file mode 100644
index 000000000..de8cf69cb
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-table-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-3.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-3.html
new file mode 100644
index 000000000..d5ed3e404
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-3.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-table-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-4-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-4-ref.html
new file mode 100644
index 000000000..155e2aa26
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-4-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-4.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-4.html
new file mode 100644
index 000000000..e6afb598b
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-4.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-rowgroup-page-break-inside-avoid-4-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-5-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-5-ref.html
new file mode 100644
index 000000000..88aae3708
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-5-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-5.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-5.html
new file mode 100644
index 000000000..94715fb47
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-5.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-rowgroup-page-break-inside-avoid-5-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-6.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-6.html
new file mode 100644
index 000000000..8ffb7f765
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-6.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-rowgroup-page-break-inside-avoid-5-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-7-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-7-ref.html
new file mode 100644
index 000000000..f52480080
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-7-ref.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-7.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-7.html
new file mode 100644
index 000000000..c130f84d4
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-7.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-rowgroup-page-break-inside-avoid-7-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-8-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-8-ref.html
new file mode 100644
index 000000000..71dbbab7c
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-8-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-8.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-8.html
new file mode 100644
index 000000000..4f814d486
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-8.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-rowgroup-page-break-inside-avoid-8-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-1.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-1.html
new file mode 100644
index 000000000..962c7ee28
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-table-page-break-inside-avoid-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-2-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-2-ref.html
new file mode 100644
index 000000000..a54708a70
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-2-ref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-2.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-2.html
new file mode 100644
index 000000000..c7fa2da41
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-2.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-table-page-break-inside-avoid-2-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-3-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-3-ref.html
new file mode 100644
index 000000000..1029d31e6
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-3-ref.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-3.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-3.html
new file mode 100644
index 000000000..794486c52
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-3.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-table-page-break-inside-avoid-3-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-4-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-4-ref.html
new file mode 100644
index 000000000..a9129f248
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-4-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-4.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-4.html
new file mode 100644
index 000000000..23c5b8c7a
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-4.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-table-page-break-inside-avoid-4-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-5-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-5-ref.html
new file mode 100644
index 000000000..6e62b79d8
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-5-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-5.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-5.html
new file mode 100644
index 000000000..7172f0dd6
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-5.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-table-page-break-inside-avoid-5-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-6-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-6-ref.html
new file mode 100644
index 000000000..0560667a4
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-6-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-6.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-6.html
new file mode 100644
index 000000000..d9a37071d
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-6.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-table-page-break-inside-avoid-6-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-7-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-7-ref.html
new file mode 100644
index 000000000..1a2d3d304
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-7-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-7.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-7.html
new file mode 100644
index 000000000..edf256183
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-7.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-table-page-break-inside-avoid-7-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-8.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-8.html
new file mode 100644
index 000000000..ea09ff93e
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-8.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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="moz-css21-table-page-break-inside-avoid-6-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/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-ref.html b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-ref.html
new file mode 100644
index 000000000..6cce765b3
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en-US" class="reftest-print">
+<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/layout/reftests/w3c-css/submitted/css21/pagination/reftest-stylo.list b/layout/reftests/w3c-css/submitted/css21/pagination/reftest-stylo.list
new file mode 100644
index 000000000..fd092b6fb
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/reftest-stylo.list
@@ -0,0 +1,46 @@
+# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
+== moz-css21-block-page-break-inside-avoid-1.html moz-css21-block-page-break-inside-avoid-1.html
+== moz-css21-block-page-break-inside-avoid-2.html moz-css21-block-page-break-inside-avoid-2.html
+== moz-css21-block-page-break-inside-avoid-3.html moz-css21-block-page-break-inside-avoid-3.html
+== moz-css21-block-page-break-inside-avoid-4.html moz-css21-block-page-break-inside-avoid-4.html
+== moz-css21-block-page-break-inside-avoid-5.html moz-css21-block-page-break-inside-avoid-5.html
+== moz-css21-block-page-break-inside-avoid-6.html moz-css21-block-page-break-inside-avoid-6.html
+skip == moz-css21-block-page-break-inside-avoid-7.html moz-css21-block-page-break-inside-avoid-7.html
+== moz-css21-block-page-break-inside-avoid-8.html moz-css21-block-page-break-inside-avoid-8.html
+== moz-css21-block-page-break-inside-avoid-9.html moz-css21-block-page-break-inside-avoid-9.html
+== moz-css21-block-page-break-inside-avoid-10.html moz-css21-block-page-break-inside-avoid-10.html
+== moz-css21-block-page-break-inside-avoid-11.html moz-css21-block-page-break-inside-avoid-11.html
+== moz-css21-block-page-break-inside-avoid-12.html moz-css21-block-page-break-inside-avoid-12.html
+== moz-css21-block-page-break-inside-avoid-13.html moz-css21-block-page-break-inside-avoid-13.html
+== moz-css21-block-page-break-inside-avoid-14.html moz-css21-block-page-break-inside-avoid-14.html
+== moz-css21-block-page-break-inside-avoid-15.html moz-css21-block-page-break-inside-avoid-15.html
+== moz-css21-table-page-break-inside-avoid-1.html moz-css21-table-page-break-inside-avoid-1.html
+== moz-css21-table-page-break-inside-avoid-2.html moz-css21-table-page-break-inside-avoid-2.html
+== moz-css21-table-page-break-inside-avoid-3.html moz-css21-table-page-break-inside-avoid-3.html
+== moz-css21-table-page-break-inside-avoid-4.html moz-css21-table-page-break-inside-avoid-4.html
+== moz-css21-table-page-break-inside-avoid-5.html moz-css21-table-page-break-inside-avoid-5.html
+== moz-css21-table-page-break-inside-avoid-6.html moz-css21-table-page-break-inside-avoid-6.html
+== moz-css21-table-page-break-inside-avoid-7.html moz-css21-table-page-break-inside-avoid-7.html
+== moz-css21-table-page-break-inside-avoid-8.html moz-css21-table-page-break-inside-avoid-8.html
+== moz-css21-float-page-break-inside-avoid-1.html moz-css21-float-page-break-inside-avoid-1.html
+fails-if(B2G||Mulet) == moz-css21-float-page-break-inside-avoid-2.html moz-css21-float-page-break-inside-avoid-2.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+== moz-css21-float-page-break-inside-avoid-3.html moz-css21-float-page-break-inside-avoid-3.html
+skip == moz-css21-float-page-break-inside-avoid-4.html moz-css21-float-page-break-inside-avoid-4.html
+== moz-css21-float-page-break-inside-avoid-5.html moz-css21-float-page-break-inside-avoid-5.html
+== moz-css21-float-page-break-inside-avoid-6.html moz-css21-float-page-break-inside-avoid-6.html
+== moz-css21-float-page-break-inside-avoid-7.html moz-css21-float-page-break-inside-avoid-7.html
+fails-if(B2G||Mulet) == moz-css21-float-page-break-inside-avoid-8.html moz-css21-float-page-break-inside-avoid-8.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+== moz-css21-float-page-break-inside-avoid-9.html moz-css21-float-page-break-inside-avoid-9.html
+== moz-css21-rowgroup-page-break-inside-avoid-1.html moz-css21-rowgroup-page-break-inside-avoid-1.html
+== moz-css21-rowgroup-page-break-inside-avoid-2.html moz-css21-rowgroup-page-break-inside-avoid-2.html
+== moz-css21-rowgroup-page-break-inside-avoid-3.html moz-css21-rowgroup-page-break-inside-avoid-3.html
+== moz-css21-rowgroup-page-break-inside-avoid-4.html moz-css21-rowgroup-page-break-inside-avoid-4.html
+== moz-css21-rowgroup-page-break-inside-avoid-5.html moz-css21-rowgroup-page-break-inside-avoid-5.html
+== moz-css21-rowgroup-page-break-inside-avoid-6.html moz-css21-rowgroup-page-break-inside-avoid-6.html
+== moz-css21-rowgroup-page-break-inside-avoid-7.html moz-css21-rowgroup-page-break-inside-avoid-7.html
+== moz-css21-rowgroup-page-break-inside-avoid-8.html moz-css21-rowgroup-page-break-inside-avoid-8.html
+== moz-css21-row-page-break-inside-avoid-1.html moz-css21-row-page-break-inside-avoid-1.html
+== moz-css21-row-page-break-inside-avoid-2.html moz-css21-row-page-break-inside-avoid-2.html
+== moz-css21-inline-page-break-inside-avoid-1.html moz-css21-inline-page-break-inside-avoid-1.html
diff --git a/layout/reftests/w3c-css/submitted/css21/pagination/reftest.list b/layout/reftests/w3c-css/submitted/css21/pagination/reftest.list
new file mode 100644
index 000000000..dee7aa242
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/reftest.list
@@ -0,0 +1,43 @@
+== moz-css21-block-page-break-inside-avoid-1.html moz-css21-block-page-break-inside-avoid-ref.html
+== moz-css21-block-page-break-inside-avoid-2.html moz-css21-block-page-break-inside-avoid-ref.html
+== moz-css21-block-page-break-inside-avoid-3.html moz-css21-block-page-break-inside-avoid-ref.html
+== moz-css21-block-page-break-inside-avoid-4.html moz-css21-block-page-break-inside-avoid-ref.html
+== moz-css21-block-page-break-inside-avoid-5.html moz-css21-block-page-break-inside-avoid-ref.html
+== moz-css21-block-page-break-inside-avoid-6.html moz-css21-block-page-break-inside-avoid-ref.html
+== moz-css21-block-page-break-inside-avoid-7.html moz-css21-block-page-break-inside-avoid-ref.html
+== moz-css21-block-page-break-inside-avoid-8.html moz-css21-block-page-break-inside-avoid-8-ref.html
+== moz-css21-block-page-break-inside-avoid-9.html moz-css21-block-page-break-inside-avoid-ref.html
+== moz-css21-block-page-break-inside-avoid-10.html moz-css21-block-page-break-inside-avoid-ref.html
+== moz-css21-block-page-break-inside-avoid-11.html moz-css21-block-page-break-inside-avoid-ref.html
+== moz-css21-block-page-break-inside-avoid-12.html moz-css21-block-page-break-inside-avoid-ref.html
+== moz-css21-block-page-break-inside-avoid-13.html moz-css21-block-page-break-inside-avoid-8-ref.html
+== moz-css21-block-page-break-inside-avoid-14.html moz-css21-block-page-break-inside-avoid-14-ref.html
+== moz-css21-block-page-break-inside-avoid-15.html moz-css21-block-page-break-inside-avoid-15-ref.html
+== moz-css21-table-page-break-inside-avoid-1.html moz-css21-table-page-break-inside-avoid-ref.html
+== moz-css21-table-page-break-inside-avoid-2.html moz-css21-table-page-break-inside-avoid-2-ref.html
+== moz-css21-table-page-break-inside-avoid-3.html moz-css21-table-page-break-inside-avoid-3-ref.html
+== moz-css21-table-page-break-inside-avoid-4.html moz-css21-table-page-break-inside-avoid-4-ref.html
+== moz-css21-table-page-break-inside-avoid-5.html moz-css21-table-page-break-inside-avoid-5-ref.html
+== moz-css21-table-page-break-inside-avoid-6.html moz-css21-table-page-break-inside-avoid-6-ref.html
+== moz-css21-table-page-break-inside-avoid-7.html moz-css21-table-page-break-inside-avoid-7-ref.html
+== moz-css21-table-page-break-inside-avoid-8.html moz-css21-table-page-break-inside-avoid-6-ref.html
+== moz-css21-float-page-break-inside-avoid-1.html moz-css21-table-page-break-inside-avoid-ref.html
+== moz-css21-float-page-break-inside-avoid-2.html moz-css21-float-page-break-inside-avoid-2-ref.html
+== moz-css21-float-page-break-inside-avoid-3.html moz-css21-block-page-break-inside-avoid-ref.html
+== moz-css21-float-page-break-inside-avoid-4.html moz-css21-block-page-break-inside-avoid-ref.html
+== moz-css21-float-page-break-inside-avoid-5.html moz-css21-float-page-break-inside-avoid-5-ref.html
+== moz-css21-float-page-break-inside-avoid-6.html moz-css21-float-page-break-inside-avoid-6-ref.html
+== moz-css21-float-page-break-inside-avoid-7.html moz-css21-float-page-break-inside-avoid-7-ref.html
+== moz-css21-float-page-break-inside-avoid-8.html moz-css21-float-page-break-inside-avoid-8-ref.html
+== moz-css21-float-page-break-inside-avoid-9.html moz-css21-float-page-break-inside-avoid-9-ref.html
+== moz-css21-rowgroup-page-break-inside-avoid-1.html moz-css21-table-page-break-inside-avoid-ref.html
+== moz-css21-rowgroup-page-break-inside-avoid-2.html moz-css21-table-page-break-inside-avoid-ref.html
+== moz-css21-rowgroup-page-break-inside-avoid-3.html moz-css21-table-page-break-inside-avoid-ref.html
+== moz-css21-rowgroup-page-break-inside-avoid-4.html moz-css21-rowgroup-page-break-inside-avoid-4-ref.html
+== moz-css21-rowgroup-page-break-inside-avoid-5.html moz-css21-rowgroup-page-break-inside-avoid-5-ref.html
+== moz-css21-rowgroup-page-break-inside-avoid-6.html moz-css21-rowgroup-page-break-inside-avoid-5-ref.html
+== moz-css21-rowgroup-page-break-inside-avoid-7.html moz-css21-rowgroup-page-break-inside-avoid-7-ref.html
+== moz-css21-rowgroup-page-break-inside-avoid-8.html moz-css21-rowgroup-page-break-inside-avoid-8-ref.html
+== moz-css21-row-page-break-inside-avoid-1.html moz-css21-rowgroup-page-break-inside-avoid-5-ref.html
+== moz-css21-row-page-break-inside-avoid-2.html moz-css21-rowgroup-page-break-inside-avoid-5-ref.html
+== moz-css21-inline-page-break-inside-avoid-1.html moz-css21-inline-page-break-inside-avoid-1-ref.html
diff --git a/layout/reftests/w3c-css/submitted/css21/reftest-stylo.list b/layout/reftests/w3c-css/submitted/css21/reftest-stylo.list
new file mode 100644
index 000000000..fea521a7a
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/reftest-stylo.list
@@ -0,0 +1,3 @@
+# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
+include pagination/reftest-stylo.list
+include replaced-sizing/reftest-stylo.list
diff --git a/layout/reftests/w3c-css/submitted/css21/reftest.list b/layout/reftests/w3c-css/submitted/css21/reftest.list
new file mode 100644
index 000000000..63e438aa9
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/reftest.list
@@ -0,0 +1,2 @@
+include pagination/reftest.list
+include replaced-sizing/reftest.list
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/reftest-stylo.list b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/reftest-stylo.list
new file mode 100644
index 000000000..54aaed9a7
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/reftest-stylo.list
@@ -0,0 +1,10 @@
+# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
+== replaced-elements-all-auto.html replaced-elements-all-auto.html
+== replaced-elements-height-20.html replaced-elements-height-20.html
+== replaced-elements-width-40.html replaced-elements-width-40.html
+== replaced-elements-min-height-20.html replaced-elements-min-height-20.html
+== replaced-elements-min-width-40.html replaced-elements-min-width-40.html
+== replaced-elements-min-height-40.html replaced-elements-min-height-40.html
+== replaced-elements-min-width-80.html replaced-elements-min-width-80.html
+== replaced-elements-max-height-20.html replaced-elements-max-height-20.html
+== replaced-elements-max-width-40.html replaced-elements-max-width-40.html
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/reftest.list b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/reftest.list
new file mode 100644
index 000000000..b2af4ad08
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/reftest.list
@@ -0,0 +1,9 @@
+== replaced-elements-all-auto.html replaced-elements-all-auto-ref.html
+== replaced-elements-height-20.html replaced-elements-height-20-ref.html
+== replaced-elements-width-40.html replaced-elements-width-40-ref.html
+== replaced-elements-min-height-20.html replaced-elements-all-auto-ref.html
+== replaced-elements-min-width-40.html replaced-elements-all-auto-ref.html
+== replaced-elements-min-height-40.html replaced-elements-min-height-40-ref.html
+== replaced-elements-min-width-80.html replaced-elements-min-width-80-ref.html
+== replaced-elements-max-height-20.html replaced-elements-height-20-ref.html
+== replaced-elements-max-width-40.html replaced-elements-width-40-ref.html
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-all-auto-ref.html b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-all-auto-ref.html
new file mode 100644
index 000000000..5a1df9485
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-all-auto-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Reference: CSS 2.1 replaced element sizing</title>
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/">
+ <meta name="flags" content="should"> <!-- undefinedness in 10.3.2 -->
+ <style type="text/css">
+
+ div { width: 200px }
+
+ span {
+ display: inline-block;
+ width: 50px;
+ height: 25px;
+ }
+
+ </style>
+</head>
+<body>
+
+<div>
+ <span style="background: black;"></span>, <!-- height-25-width-50 -->
+ <span style="background: fuchsia;"></span>, <!-- height-25-ratio-2 -->
+ <span style="background: silver;"></span>, <!-- width-50-ratio-2 -->
+ <span style="background: blue; width: 300px"></span>, <!-- height-25-no-ratio -->
+ <span style="background: orange; height: 150px"></span>, <!-- width-50-no-ratio -->
+ <span style="background: gray; width: 200px; height: 100px"></span>, <!-- ratio-2 -->
+ <span style="background: aqua; width: 300px; height: 150px"></span>. <!-- no-ratio -->
+
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-all-auto.html b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-all-auto.html
new file mode 100644
index 000000000..bc2b4593a
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-all-auto.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 replaced element sizing</title>
+ <link rel="match" href="replaced-elements-all-auto-ref.html">
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths">
+ <meta name="flags" content="should"> <!-- undefinedness in 10.3.2 -->
+ <style type="text/css">
+
+ div { width: 200px }
+
+ </style>
+</head>
+<body>
+
+<div>
+ <img src="support/height-25-width-50.svg">,
+ <img src="support/height-25-ratio-2.svg">,
+ <img src="support/width-50-ratio-2.svg">,
+ <img src="support/height-25-no-ratio.svg">,
+ <img src="support/width-50-no-ratio.svg">,
+ <img src="support/ratio-2.svg">,
+ <img src="support/no-ratio.svg">.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-height-20-ref.html b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-height-20-ref.html
new file mode 100644
index 000000000..503d83bd7
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-height-20-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Reference: CSS 2.1 replaced element sizing</title>
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/">
+ <meta name="flags" content="should"> <!-- undefinedness in 10.3.2 -->
+ <style type="text/css">
+
+ div { width: 200px }
+
+ span {
+ display: inline-block;
+ width: 40px;
+ height: 20px;
+ }
+
+ </style>
+</head>
+<body>
+
+<div>
+ <span style="background: black;"></span>, <!-- height-25-width-50 -->
+ <span style="background: fuchsia;"></span>, <!-- height-25-ratio-2 -->
+ <span style="background: silver;"></span>, <!-- width-50-ratio-2 -->
+ <span style="background: blue; width: 300px"></span>, <!-- height-25-no-ratio -->
+ <span style="background: orange; width: 50px"></span>, <!-- width-50-no-ratio -->
+ <span style="background: gray"></span>, <!-- ratio-2 -->
+ <span style="background: aqua; width: 300px"></span>. <!-- no-ratio -->
+
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-height-20.html b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-height-20.html
new file mode 100644
index 000000000..2ca34beff
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-height-20.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 replaced element sizing</title>
+ <link rel="match" href="replaced-elements-height-20-ref.html">
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths">
+ <meta name="flags" content="should"> <!-- undefinedness in 10.3.2 -->
+ <style type="text/css">
+
+ div { width: 200px }
+ img { height: 20px }
+
+ </style>
+</head>
+<body>
+
+<div>
+ <img src="support/height-25-width-50.svg">,
+ <img src="support/height-25-ratio-2.svg">,
+ <img src="support/width-50-ratio-2.svg">,
+ <img src="support/height-25-no-ratio.svg">,
+ <img src="support/width-50-no-ratio.svg">,
+ <img src="support/ratio-2.svg">,
+ <img src="support/no-ratio.svg">.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-max-height-20.html b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-max-height-20.html
new file mode 100644
index 000000000..eb2ee9844
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-max-height-20.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 replaced element sizing</title>
+ <link rel="match" href="replaced-elements-height-20-ref.html">
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths">
+ <meta name="flags" content="should"> <!-- undefinedness in 10.3.2 -->
+ <style type="text/css">
+
+ div { width: 200px }
+ img { max-height: 20px }
+
+ </style>
+</head>
+<body>
+
+<div>
+ <img src="support/height-25-width-50.svg">,
+ <img src="support/height-25-ratio-2.svg">,
+ <img src="support/width-50-ratio-2.svg">,
+ <img src="support/height-25-no-ratio.svg">,
+ <img src="support/width-50-no-ratio.svg">,
+ <img src="support/ratio-2.svg">,
+ <img src="support/no-ratio.svg">.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-max-width-40.html b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-max-width-40.html
new file mode 100644
index 000000000..9fb7aad4e
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-max-width-40.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 replaced element sizing</title>
+ <link rel="match" href="replaced-elements-width-40-ref.html">
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths">
+ <meta name="flags" content="should"> <!-- undefinedness in 10.3.2 -->
+ <style type="text/css">
+
+ div { width: 200px }
+ img { max-width: 40px }
+
+ </style>
+</head>
+<body>
+
+<div>
+ <img src="support/height-25-width-50.svg">,
+ <img src="support/height-25-ratio-2.svg">,
+ <img src="support/width-50-ratio-2.svg">,
+ <img src="support/height-25-no-ratio.svg">,
+ <img src="support/width-50-no-ratio.svg">,
+ <img src="support/ratio-2.svg">,
+ <img src="support/no-ratio.svg">.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-height-20.html b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-height-20.html
new file mode 100644
index 000000000..5294aadcb
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-height-20.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 replaced element sizing</title>
+ <link rel="match" href="replaced-elements-all-auto-ref.html">
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths">
+ <meta name="flags" content="should"> <!-- undefinedness in 10.3.2 -->
+ <style type="text/css">
+
+ div { width: 200px }
+ img { min-height: 20px }
+
+ </style>
+</head>
+<body>
+
+<div>
+ <img src="support/height-25-width-50.svg">,
+ <img src="support/height-25-ratio-2.svg">,
+ <img src="support/width-50-ratio-2.svg">,
+ <img src="support/height-25-no-ratio.svg">,
+ <img src="support/width-50-no-ratio.svg">,
+ <img src="support/ratio-2.svg">,
+ <img src="support/no-ratio.svg">.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-height-40-ref.html b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-height-40-ref.html
new file mode 100644
index 000000000..668be594f
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-height-40-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Reference: CSS 2.1 replaced element sizing</title>
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/">
+ <meta name="flags" content="should"> <!-- undefinedness in 10.3.2 -->
+ <style type="text/css">
+
+ div { width: 200px }
+
+ span {
+ display: inline-block;
+ width: 80px;
+ height: 40px;
+ }
+
+ </style>
+</head>
+<body>
+
+<div>
+ <span style="background: black;"></span>, <!-- height-25-width-50 -->
+ <span style="background: fuchsia;"></span>, <!-- height-25-ratio-2 -->
+ <span style="background: silver;"></span>, <!-- width-50-ratio-2 -->
+ <span style="background: blue; width: 300px"></span>, <!-- height-25-no-ratio -->
+ <span style="background: orange; width: 50px; height: 150px"></span>, <!-- width-50-no-ratio -->
+ <span style="background: gray; width: 200px; height: 100px"></span>, <!-- ratio-2 -->
+ <span style="background: aqua; width: 300px; height: 150px"></span>. <!-- no-ratio -->
+
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-height-40.html b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-height-40.html
new file mode 100644
index 000000000..700909ec5
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-height-40.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 replaced element sizing</title>
+ <link rel="match" href="replaced-elements-min-height-40-ref.html">
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths">
+ <meta name="flags" content="should"> <!-- undefinedness in 10.3.2 -->
+ <style type="text/css">
+
+ div { width: 200px }
+ img { min-height: 40px }
+
+ </style>
+</head>
+<body>
+
+<div>
+ <img src="support/height-25-width-50.svg">,
+ <img src="support/height-25-ratio-2.svg">,
+ <img src="support/width-50-ratio-2.svg">,
+ <img src="support/height-25-no-ratio.svg">,
+ <img src="support/width-50-no-ratio.svg">,
+ <img src="support/ratio-2.svg">,
+ <img src="support/no-ratio.svg">.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-width-40.html b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-width-40.html
new file mode 100644
index 000000000..03e6a9cba
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-width-40.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 replaced element sizing</title>
+ <link rel="match" href="replaced-elements-all-auto-ref.html">
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths">
+ <meta name="flags" content="should"> <!-- undefinedness in 10.3.2 -->
+ <style type="text/css">
+
+ div { width: 200px }
+ img { min-width: 40px }
+
+ </style>
+</head>
+<body>
+
+<div>
+ <img src="support/height-25-width-50.svg">,
+ <img src="support/height-25-ratio-2.svg">,
+ <img src="support/width-50-ratio-2.svg">,
+ <img src="support/height-25-no-ratio.svg">,
+ <img src="support/width-50-no-ratio.svg">,
+ <img src="support/ratio-2.svg">,
+ <img src="support/no-ratio.svg">.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-width-80-ref.html b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-width-80-ref.html
new file mode 100644
index 000000000..6caa1c480
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-width-80-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Reference: CSS 2.1 replaced element sizing</title>
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/">
+ <meta name="flags" content="should"> <!-- undefinedness in 10.3.2 -->
+ <style type="text/css">
+
+ div { width: 200px }
+
+ span {
+ display: inline-block;
+ width: 80px;
+ height: 40px;
+ }
+
+ </style>
+</head>
+<body>
+
+<div>
+ <span style="background: black;"></span>, <!-- height-25-width-50 -->
+ <span style="background: fuchsia;"></span>, <!-- height-25-ratio-2 -->
+ <span style="background: silver;"></span>, <!-- width-50-ratio-2 -->
+ <span style="background: blue; width: 300px; height: 25px"></span>, <!-- height-25-no-ratio -->
+ <span style="background: orange; height: 150px"></span>, <!-- width-50-no-ratio -->
+ <span style="background: gray; width: 200px; height: 100px"></span>, <!-- ratio-2 -->
+ <span style="background: aqua; width: 300px; height: 150px"></span>. <!-- no-ratio -->
+
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-width-80.html b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-width-80.html
new file mode 100644
index 000000000..852864aa1
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-min-width-80.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 replaced element sizing</title>
+ <link rel="match" href="replaced-elements-min-width-80-ref.html">
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths">
+ <meta name="flags" content="should"> <!-- undefinedness in 10.3.2 -->
+ <style type="text/css">
+
+ div { width: 200px }
+ img { min-width: 80px }
+
+ </style>
+</head>
+<body>
+
+<div>
+ <img src="support/height-25-width-50.svg">,
+ <img src="support/height-25-ratio-2.svg">,
+ <img src="support/width-50-ratio-2.svg">,
+ <img src="support/height-25-no-ratio.svg">,
+ <img src="support/width-50-no-ratio.svg">,
+ <img src="support/ratio-2.svg">,
+ <img src="support/no-ratio.svg">.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-width-40-ref.html b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-width-40-ref.html
new file mode 100644
index 000000000..c110910c4
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-width-40-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Reference: CSS 2.1 replaced element sizing</title>
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/">
+ <meta name="flags" content="should"> <!-- undefinedness in 10.3.2 -->
+ <style type="text/css">
+
+ div { width: 200px }
+
+ span {
+ display: inline-block;
+ width: 40px;
+ height: 20px;
+ }
+
+ </style>
+</head>
+<body>
+
+<div>
+ <span style="background: black;"></span>, <!-- height-25-width-50 -->
+ <span style="background: fuchsia;"></span>, <!-- height-25-ratio-2 -->
+ <span style="background: silver;"></span>, <!-- width-50-ratio-2 -->
+ <span style="background: blue; height: 25px"></span>, <!-- height-25-no-ratio -->
+ <span style="background: orange; height: 150px"></span>, <!-- width-50-no-ratio -->
+ <span style="background: gray"></span>, <!-- ratio-2 -->
+ <span style="background: aqua; height: 150px"></span>. <!-- no-ratio -->
+
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-width-40.html b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-width-40.html
new file mode 100644
index 000000000..4a8db48f6
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/replaced-elements-width-40.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+ <title>CSS Test: CSS 2.1 replaced element sizing</title>
+ <link rel="match" href="replaced-elements-width-40-ref.html">
+ <link rel="author" title="L. David Baron" href="https://dbaron.org/">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height">
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths">
+ <meta name="flags" content="should"> <!-- undefinedness in 10.3.2 -->
+ <style type="text/css">
+
+ div { width: 200px }
+ img { width: 40px }
+
+ </style>
+</head>
+<body>
+
+<div>
+ <img src="support/height-25-width-50.svg">,
+ <img src="support/height-25-ratio-2.svg">,
+ <img src="support/width-50-ratio-2.svg">,
+ <img src="support/height-25-no-ratio.svg">,
+ <img src="support/width-50-no-ratio.svg">,
+ <img src="support/ratio-2.svg">,
+ <img src="support/no-ratio.svg">.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/height-25-no-ratio.svg b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/height-25-no-ratio.svg
new file mode 100644
index 000000000..d04627229
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/height-25-no-ratio.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="25" preserveAspectRatio="none">
+ <rect fill="blue" x="0" y="0" width="100%" height="100%" />
+</svg>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/height-25-ratio-2.svg b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/height-25-ratio-2.svg
new file mode 100644
index 000000000..d6e71e31e
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/height-25-ratio-2.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 1000 500" height="25" preserveAspectRatio="none">
+ <rect fill="fuchsia" x="0" y="0" width="1000" height="500" />
+</svg>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/height-25-width-50.svg b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/height-25-width-50.svg
new file mode 100644
index 000000000..a45d7243c
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/height-25-width-50.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="25" width="50" viewBox="0 0 1000 1000" preserveAspectRatio="none">
+ <rect fill="black" x="0" y="0" width="1000" height="1000" />
+</svg>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/no-ratio.svg b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/no-ratio.svg
new file mode 100644
index 000000000..80429f1d1
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/no-ratio.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" preserveAspectRatio="none">
+ <rect fill="aqua" x="0" y="0" width="100%" height="100%" />
+</svg>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/ratio-2.svg b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/ratio-2.svg
new file mode 100644
index 000000000..fe4fe7016
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/ratio-2.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 1000 500" preserveAspectRatio="none">
+ <rect fill="gray" x="0" y="0" width="1000" height="500" />
+</svg>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/width-50-no-ratio.svg b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/width-50-no-ratio.svg
new file mode 100644
index 000000000..bf43cee7d
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/width-50-no-ratio.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="50" preserveAspectRatio="none">
+ <rect fill="orange" x="0" y="0" width="100%" height="100%" />
+</svg>
diff --git a/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/width-50-ratio-2.svg b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/width-50-ratio-2.svg
new file mode 100644
index 000000000..62fa3cb42
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/css21/replaced-sizing/support/width-50-ratio-2.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 1000 500" width="50" preserveAspectRatio="none">
+ <rect fill="silver" x="0" y="0" width="1000" height="500" />
+</svg>