summaryrefslogtreecommitdiffstats
path: root/layout/reftests/font-inflation
diff options
context:
space:
mode:
Diffstat (limited to 'layout/reftests/font-inflation')
-rw-r--r--layout/reftests/font-inflation/bug707855-innerFrame-ref.html0
-rw-r--r--layout/reftests/font-inflation/bug707855-innerFrame.html0
-rw-r--r--layout/reftests/font-inflation/bug707855-ref.html0
-rw-r--r--layout/reftests/font-inflation/bug707855.html0
-rw-r--r--layout/reftests/font-inflation/bullet-1-ref.html9
-rw-r--r--layout/reftests/font-inflation/bullet-1.html9
-rw-r--r--layout/reftests/font-inflation/consecutive-inline-ref.html31
-rw-r--r--layout/reftests/font-inflation/consecutive-inline.html31
-rw-r--r--layout/reftests/font-inflation/container-with-clamping-innerFrame-ref.html15
-rw-r--r--layout/reftests/font-inflation/container-with-clamping-innerFrame.html15
-rw-r--r--layout/reftests/font-inflation/container-with-clamping-ref.html16
-rw-r--r--layout/reftests/font-inflation/container-with-clamping.html12
-rw-r--r--layout/reftests/font-inflation/css-transform-1-ref.html6
-rw-r--r--layout/reftests/font-inflation/css-transform-1.html10
-rw-r--r--layout/reftests/font-inflation/css-transform-2-ref.html6
-rw-r--r--layout/reftests/font-inflation/css-transform-2.html10
-rw-r--r--layout/reftests/font-inflation/decoration-1-ref.html8
-rw-r--r--layout/reftests/font-inflation/decoration-1.html13
-rw-r--r--layout/reftests/font-inflation/disable-fontinfl-on-mobile-2.html20
-rw-r--r--layout/reftests/font-inflation/disable-fontinfl-on-mobile-3.html20
-rw-r--r--layout/reftests/font-inflation/disable-fontinfl-on-mobile-5.html18
-rw-r--r--layout/reftests/font-inflation/disable-fontinfl-on-mobile-ref.html19
-rw-r--r--layout/reftests/font-inflation/disable-fontinfl-on-mobile.html21
-rw-r--r--layout/reftests/font-inflation/fixed-height-body-child-ref.html34
-rw-r--r--layout/reftests/font-inflation/fixed-height-body-child.html34
-rw-r--r--layout/reftests/font-inflation/fixed-height-body-ref.html25
-rw-r--r--layout/reftests/font-inflation/fixed-height-body.html25
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-1-ref.html17
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-1.html17
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-2-ref.html17
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-2.html17
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-3-ref.html17
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-3.html17
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-4-ref.html20
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-4.html20
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-5-ref.html20
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-5.html20
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-6-ref.html16
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-6.html16
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-7-ref.html16
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-7.html16
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-8-ref.html20
-rw-r--r--layout/reftests/font-inflation/height-constraint-percent-8.html20
-rw-r--r--layout/reftests/font-inflation/input-checkbox.html15
-rw-r--r--layout/reftests/font-inflation/input-radio.html7
-rw-r--r--layout/reftests/font-inflation/input-text-1-height-ref.html11
-rw-r--r--layout/reftests/font-inflation/input-text-1-height.html11
-rw-r--r--layout/reftests/font-inflation/input-text-1-noheight-ref.html11
-rw-r--r--layout/reftests/font-inflation/input-text-1-noheight.html11
-rw-r--r--layout/reftests/font-inflation/input-text-2-height-ref.html11
-rw-r--r--layout/reftests/font-inflation/input-text-2-height.html11
-rw-r--r--layout/reftests/font-inflation/input-text-2-noheight-ref.html10
-rw-r--r--layout/reftests/font-inflation/input-text-2-noheight.html10
-rw-r--r--layout/reftests/font-inflation/input-text-3-height-ref.html11
-rw-r--r--layout/reftests/font-inflation/input-text-3-height.html11
-rw-r--r--layout/reftests/font-inflation/input-text-3-noheight-ref.html10
-rw-r--r--layout/reftests/font-inflation/input-text-3-noheight.html10
-rw-r--r--layout/reftests/font-inflation/intrinsic-fit-1a-ref.html17
-rw-r--r--layout/reftests/font-inflation/intrinsic-fit-1a.html17
-rw-r--r--layout/reftests/font-inflation/intrinsic-fit-1b-ref.html18
-rw-r--r--layout/reftests/font-inflation/intrinsic-fit-1b.html18
-rw-r--r--layout/reftests/font-inflation/intrinsic-fit-1c-ref.html18
-rw-r--r--layout/reftests/font-inflation/intrinsic-fit-1c.html18
-rw-r--r--layout/reftests/font-inflation/intrinsic-fit-2a.html18
-rw-r--r--layout/reftests/font-inflation/intrinsic-fit-2b.html19
-rw-r--r--layout/reftests/font-inflation/intrinsic-fit-2c.html19
-rw-r--r--layout/reftests/font-inflation/intrinsic-max-1-ref.html14
-rw-r--r--layout/reftests/font-inflation/intrinsic-max-1.html18
-rw-r--r--layout/reftests/font-inflation/intrinsic-min-1-ref.html17
-rw-r--r--layout/reftests/font-inflation/intrinsic-min-1.html14
-rw-r--r--layout/reftests/font-inflation/list-1-ref.html23
-rw-r--r--layout/reftests/font-inflation/list-1.html22
-rw-r--r--layout/reftests/font-inflation/maxRatio-1-ref.html13
-rw-r--r--layout/reftests/font-inflation/maxRatio-1.html13
-rw-r--r--layout/reftests/font-inflation/min-width-passes-1-ref.html23
-rw-r--r--layout/reftests/font-inflation/min-width-passes-1.html25
-rw-r--r--layout/reftests/font-inflation/preformatted-text-ref.html22
-rw-r--r--layout/reftests/font-inflation/preformatted-text.html22
-rw-r--r--layout/reftests/font-inflation/reftest-stylo.list121
-rw-r--r--layout/reftests/font-inflation/reftest.list111
-rw-r--r--layout/reftests/font-inflation/relevant-width-1-ref.html9
-rw-r--r--layout/reftests/font-inflation/relevant-width-1.html16
-rw-r--r--layout/reftests/font-inflation/relevant-width-overflow-1-ref.html9
-rw-r--r--layout/reftests/font-inflation/relevant-width-overflow-1.html16
-rw-r--r--layout/reftests/font-inflation/select-combobox-1-ref.html10
-rw-r--r--layout/reftests/font-inflation/select-combobox-1.html10
-rw-r--r--layout/reftests/font-inflation/select-combobox-2-ref.html21
-rw-r--r--layout/reftests/font-inflation/select-combobox-2.html21
-rw-r--r--layout/reftests/font-inflation/select-combobox-3-ref.html10
-rw-r--r--layout/reftests/font-inflation/select-combobox-3.html10
-rw-r--r--layout/reftests/font-inflation/select-listbox-1-ref.html10
-rw-r--r--layout/reftests/font-inflation/select-listbox-1.html10
-rw-r--r--layout/reftests/font-inflation/select-listbox-2-ref.html21
-rw-r--r--layout/reftests/font-inflation/select-listbox-2.html21
-rw-r--r--layout/reftests/font-inflation/text-1-ref.html6
-rw-r--r--layout/reftests/font-inflation/text-1.html10
-rw-r--r--layout/reftests/font-inflation/text-2-ref.html6
-rw-r--r--layout/reftests/font-inflation/text-2.html10
-rw-r--r--layout/reftests/font-inflation/text-3-ref.html7
-rw-r--r--layout/reftests/font-inflation/text-3.html11
-rw-r--r--layout/reftests/font-inflation/text-4-ref.html7
-rw-r--r--layout/reftests/font-inflation/text-4.html11
-rw-r--r--layout/reftests/font-inflation/textarea-1-ref.html11
-rw-r--r--layout/reftests/font-inflation/textarea-1.html11
-rw-r--r--layout/reftests/font-inflation/textarea-2-ref.html11
-rw-r--r--layout/reftests/font-inflation/textarea-2.html11
-rw-r--r--layout/reftests/font-inflation/textarea-3-ref.html11
-rw-r--r--layout/reftests/font-inflation/textarea-3.html11
-rw-r--r--layout/reftests/font-inflation/threshold-1a.html11
-rw-r--r--layout/reftests/font-inflation/threshold-1b-ref.html18
-rw-r--r--layout/reftests/font-inflation/threshold-1b.html18
-rw-r--r--layout/reftests/font-inflation/threshold-1c-ref.html18
-rw-r--r--layout/reftests/font-inflation/threshold-1c.html18
-rw-r--r--layout/reftests/font-inflation/threshold-2-ref.html18
-rw-r--r--layout/reftests/font-inflation/threshold-2.html18
-rw-r--r--layout/reftests/font-inflation/threshold-3-ref.html20
-rw-r--r--layout/reftests/font-inflation/threshold-3.html20
-rw-r--r--layout/reftests/font-inflation/threshold-input-text-contents-at-1-ref.html19
-rw-r--r--layout/reftests/font-inflation/threshold-input-text-contents-at-1.html19
-rw-r--r--layout/reftests/font-inflation/threshold-input-text-contents-at-2-ref.html19
-rw-r--r--layout/reftests/font-inflation/threshold-input-text-contents-at-2.html19
-rw-r--r--layout/reftests/font-inflation/threshold-input-text-contents-under-1.html19
-rw-r--r--layout/reftests/font-inflation/threshold-input-text-contents-under-2.html19
-rw-r--r--layout/reftests/font-inflation/threshold-scope-cell-1-ref.html31
-rw-r--r--layout/reftests/font-inflation/threshold-scope-cell-1.html31
-rw-r--r--layout/reftests/font-inflation/threshold-scope-cell-2-ref.html31
-rw-r--r--layout/reftests/font-inflation/threshold-scope-cell-2.html31
-rw-r--r--layout/reftests/font-inflation/threshold-scope-cell-3-ref.html29
-rw-r--r--layout/reftests/font-inflation/threshold-scope-cell-3.html29
-rw-r--r--layout/reftests/font-inflation/threshold-scope-float-1-ref.html23
-rw-r--r--layout/reftests/font-inflation/threshold-scope-float-1.html23
-rw-r--r--layout/reftests/font-inflation/threshold-scope-float-2-ref.html23
-rw-r--r--layout/reftests/font-inflation/threshold-scope-float-2.html23
-rw-r--r--layout/reftests/font-inflation/threshold-scope-float-overflow-1-ref.html23
-rw-r--r--layout/reftests/font-inflation/threshold-scope-float-overflow-1.html23
-rw-r--r--layout/reftests/font-inflation/threshold-scope-float-overflow-2-ref.html23
-rw-r--r--layout/reftests/font-inflation/threshold-scope-float-overflow-2.html23
-rw-r--r--layout/reftests/font-inflation/threshold-select-combobox-contents-at-1-ref.html23
-rw-r--r--layout/reftests/font-inflation/threshold-select-combobox-contents-at-1.html23
-rw-r--r--layout/reftests/font-inflation/threshold-select-combobox-contents-at-2-ref.html23
-rw-r--r--layout/reftests/font-inflation/threshold-select-combobox-contents-at-2.html23
-rw-r--r--layout/reftests/font-inflation/threshold-select-combobox-contents-under-1.html23
-rw-r--r--layout/reftests/font-inflation/threshold-select-combobox-contents-under-2.html23
-rw-r--r--layout/reftests/font-inflation/threshold-select-listbox-contents-at-1-ref.html23
-rw-r--r--layout/reftests/font-inflation/threshold-select-listbox-contents-at-1.html23
-rw-r--r--layout/reftests/font-inflation/threshold-select-listbox-contents-at-2-ref.html23
-rw-r--r--layout/reftests/font-inflation/threshold-select-listbox-contents-at-2.html23
-rw-r--r--layout/reftests/font-inflation/threshold-select-listbox-contents-under-1.html23
-rw-r--r--layout/reftests/font-inflation/threshold-select-listbox-contents-under-2.html23
-rw-r--r--layout/reftests/font-inflation/threshold-textarea-contents-at-1-ref.html21
-rw-r--r--layout/reftests/font-inflation/threshold-textarea-contents-at-1.html21
-rw-r--r--layout/reftests/font-inflation/threshold-textarea-contents-at-2-ref.html21
-rw-r--r--layout/reftests/font-inflation/threshold-textarea-contents-at-2.html21
-rw-r--r--layout/reftests/font-inflation/threshold-textarea-contents-under-1.html21
-rw-r--r--layout/reftests/font-inflation/threshold-textarea-contents-under-2.html21
-rw-r--r--layout/reftests/font-inflation/video-1.html2
-rw-r--r--layout/reftests/font-inflation/xul-reflow-1-ref.html18
-rw-r--r--layout/reftests/font-inflation/xul-reflow-1.html21
158 files changed, 2873 insertions, 0 deletions
diff --git a/layout/reftests/font-inflation/bug707855-innerFrame-ref.html b/layout/reftests/font-inflation/bug707855-innerFrame-ref.html
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/layout/reftests/font-inflation/bug707855-innerFrame-ref.html
diff --git a/layout/reftests/font-inflation/bug707855-innerFrame.html b/layout/reftests/font-inflation/bug707855-innerFrame.html
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/layout/reftests/font-inflation/bug707855-innerFrame.html
diff --git a/layout/reftests/font-inflation/bug707855-ref.html b/layout/reftests/font-inflation/bug707855-ref.html
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/layout/reftests/font-inflation/bug707855-ref.html
diff --git a/layout/reftests/font-inflation/bug707855.html b/layout/reftests/font-inflation/bug707855.html
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/layout/reftests/font-inflation/bug707855.html
diff --git a/layout/reftests/font-inflation/bullet-1-ref.html b/layout/reftests/font-inflation/bullet-1-ref.html
new file mode 100644
index 000000000..6f87b9407
--- /dev/null
+++ b/layout/reftests/font-inflation/bullet-1-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML>
+<style>
+ul, li { line-height: 1.0; font-size: 35px; }
+ul { width: 500px; margin: 0; padding: 0 }
+li { margin: 0 0 0 50px; padding: 0 }
+</style>
+<ul>
+ <li>item</li>
+</ul>
diff --git a/layout/reftests/font-inflation/bullet-1.html b/layout/reftests/font-inflation/bullet-1.html
new file mode 100644
index 000000000..6433753fd
--- /dev/null
+++ b/layout/reftests/font-inflation/bullet-1.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML>
+<style>
+ul, li { line-height: 1.0; font-size: 15px; }
+ul { width: 500px; margin: 0; padding: 0 }
+li { margin: 0 0 0 50px; padding: 0 }
+</style>
+<ul>
+ <li>item</li>
+</ul>
diff --git a/layout/reftests/font-inflation/consecutive-inline-ref.html b/layout/reftests/font-inflation/consecutive-inline-ref.html
new file mode 100644
index 000000000..9d5d163f0
--- /dev/null
+++ b/layout/reftests/font-inflation/consecutive-inline-ref.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<style>
+ div {
+ width: 450px;
+ font-size: 34px;
+ }
+
+ a {
+ font-weight: bold;
+ line-height: 1.1em;
+ color: blue;
+ }
+
+ a#first {
+ font-size: 34px;
+ font-style: italic;
+ }
+
+ a#second {
+ font-size: 40px;
+ }
+
+</style>
+<!--
+In a 450 px container, the minimum font size at 15em per line is 30px. This
+means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px and 30px
+gets mapped to 40px.
+-->
+<div>
+ <a id="first" href="">Hello</a><a id="second" href="">Worldz</a>
+</div>
diff --git a/layout/reftests/font-inflation/consecutive-inline.html b/layout/reftests/font-inflation/consecutive-inline.html
new file mode 100644
index 000000000..bb2e4b8c4
--- /dev/null
+++ b/layout/reftests/font-inflation/consecutive-inline.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<style>
+ div {
+ width: 450px;
+ font-size: 12px;
+ }
+
+ a {
+ font-weight: bold;
+ line-height: 1.1em;
+ color: blue;
+ }
+
+ a#first {
+ font-size: 12px;
+ font-style: italic;
+ }
+
+ a#second {
+ font-size: 30px;
+ }
+
+</style>
+<!--
+In a 450 px container, the minimum font size at 15em per line is 30px. This
+means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px and 30px
+gets mapped to 40px.
+-->
+<div>
+ <a id="first" href="">Hello</a><a id="second" href="">Worldz</a>
+</div>
diff --git a/layout/reftests/font-inflation/container-with-clamping-innerFrame-ref.html b/layout/reftests/font-inflation/container-with-clamping-innerFrame-ref.html
new file mode 100644
index 000000000..966612ec4
--- /dev/null
+++ b/layout/reftests/font-inflation/container-with-clamping-innerFrame-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML>
+<style>
+ div { background: yellow }
+ div { font-size: 20px; line-height: 1.0; width: 450px }
+</style>
+<!--
+Without the patch for bug 707855, we have a 450px container, and the minimum font size
+at 15em per line is 30px. This means we map 0px-45px into 30px-45px, so 12px gets mapped
+to 34px.
+
+With the patch, then we have a 240px container, so the minimum font size
+at 15 em per line is 16px. So, we map 0px-24px into 16px-24px, so 12px gets
+mapped to 20px.
+-->
+<div>Test to see if too large of a container causes a giant escalation of the font size when font inflation is enabled.</div>
diff --git a/layout/reftests/font-inflation/container-with-clamping-innerFrame.html b/layout/reftests/font-inflation/container-with-clamping-innerFrame.html
new file mode 100644
index 000000000..f6a0cec99
--- /dev/null
+++ b/layout/reftests/font-inflation/container-with-clamping-innerFrame.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML>
+<style>
+ div { background: yellow }
+ div { font-size: 12px; line-height: 1.0; width: 450px }
+</style>
+<!--
+Without the patch for bug 707855, we have a 450px container, and the minimum font size
+at 15em per line is 30px. This means we map 0px-45px into 30px-45px, so 12px gets mapped
+to 34px.
+
+With the patch, then we have a 240px container, so the minimum font size
+at 15 em per line is 16px. So, we map 0px-24px into 16px-24px, so 12px gets
+mapped to 20px.
+-->
+<div>Test to see if too large of a container causes a giant escalation of the font size when font inflation is enabled.</div>
diff --git a/layout/reftests/font-inflation/container-with-clamping-ref.html b/layout/reftests/font-inflation/container-with-clamping-ref.html
new file mode 100644
index 000000000..74e73798e
--- /dev/null
+++ b/layout/reftests/font-inflation/container-with-clamping-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<style>
+div { background: yellow }
+div { font-size: 12px; line-height: 1.0; width: 1200px }
+</style>
+<!--
+Without the patch for bug 707855, we have a 450px container, and the minimum font size
+at 15em per line is 30px. This means we map 0px-45px into 30px-45px, so 12px gets mapped
+to 34px.
+
+With the patch, then we have a 240px container, so the minimum font size
+at 15 em per line is 16px. So, we map 0px-24px into 16px-24px, so 12px gets
+mapped to 20px.
+-->
+<iframe src="container-with-clamping-innerFrame-ref.html" width="240" height="400">
+</iframe>
diff --git a/layout/reftests/font-inflation/container-with-clamping.html b/layout/reftests/font-inflation/container-with-clamping.html
new file mode 100644
index 000000000..69afa734e
--- /dev/null
+++ b/layout/reftests/font-inflation/container-with-clamping.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<!--
+Without the patch for bug 707855, we have a 450px container, and the minimum font size
+at 15em per line is 30px. This means we map 0px-45px into 30px-45px, so 12px gets mapped
+to 34px.
+
+With the patch, then we have a 240px container, so the minimum font size
+at 15 em per line is 16px. So, we map 0px-24px into 16px-24px, so 12px gets
+mapped to 20px.
+-->
+<iframe src="container-with-clamping-innerFrame.html" width="240" height="400">
+</iframe>
diff --git a/layout/reftests/font-inflation/css-transform-1-ref.html b/layout/reftests/font-inflation/css-transform-1-ref.html
new file mode 100644
index 000000000..36ea26615
--- /dev/null
+++ b/layout/reftests/font-inflation/css-transform-1-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 34px; width: 150px; line-height: 1.0; white-space: nowrap }
+span { -moz-transform-origin: 0 0; -moz-transform: scale(1.2); }
+</style>
+<div><span>Hello world</span></div>
diff --git a/layout/reftests/font-inflation/css-transform-1.html b/layout/reftests/font-inflation/css-transform-1.html
new file mode 100644
index 000000000..7fc0e8fe5
--- /dev/null
+++ b/layout/reftests/font-inflation/css-transform-1.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; width: 450px; line-height: 1.0 }
+span { -moz-transform-origin: 0 0; -moz-transform: scale(1.2); }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div><span>Hello world</span></div>
diff --git a/layout/reftests/font-inflation/css-transform-2-ref.html b/layout/reftests/font-inflation/css-transform-2-ref.html
new file mode 100644
index 000000000..b0916faad
--- /dev/null
+++ b/layout/reftests/font-inflation/css-transform-2-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 34px; width: 150px; line-height: 1.0; white-space: nowrap }
+p { -moz-transform-origin: 0 0; margin: 0; -moz-transform: scale(1.2); }
+</style>
+<div><p>Hello world</p></div>
diff --git a/layout/reftests/font-inflation/css-transform-2.html b/layout/reftests/font-inflation/css-transform-2.html
new file mode 100644
index 000000000..856ee8e2c
--- /dev/null
+++ b/layout/reftests/font-inflation/css-transform-2.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; width: 450px; line-height: 1.0 }
+p { -moz-transform-origin: 0 0; margin: 0; -moz-transform: scale(1.2); }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div><p>Hello world</p></div>
diff --git a/layout/reftests/font-inflation/decoration-1-ref.html b/layout/reftests/font-inflation/decoration-1-ref.html
new file mode 100644
index 000000000..ce2b0c0ef
--- /dev/null
+++ b/layout/reftests/font-inflation/decoration-1-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML>
+<style>
+div { background: yellow }
+div { font-size: 34px; line-height: 1.0; width: 450px }
+span { font-size: 36px }
+div { text-decoration: underline overline line-through }
+</style>
+<div>Hello <span>world</span></div>
diff --git a/layout/reftests/font-inflation/decoration-1.html b/layout/reftests/font-inflation/decoration-1.html
new file mode 100644
index 000000000..9392fafcd
--- /dev/null
+++ b/layout/reftests/font-inflation/decoration-1.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<style>
+div { background: yellow }
+div { font-size: 12px; line-height: 1.0; width: 450px }
+span { font-size: 18px }
+div { text-decoration: underline overline line-through }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px
+and 18px gets mapped to 36px.
+-->
+<div>Hello <span>world</span></div>
diff --git a/layout/reftests/font-inflation/disable-fontinfl-on-mobile-2.html b/layout/reftests/font-inflation/disable-fontinfl-on-mobile-2.html
new file mode 100644
index 000000000..d251decde
--- /dev/null
+++ b/layout/reftests/font-inflation/disable-fontinfl-on-mobile-2.html
@@ -0,0 +1,20 @@
+<!--
+Without the patch for bug 706198, this website should not show up as inflated. That means
+that with a 450px container, the minimum font size with 15em per line should be 30px.
+So, we map 0px-45px into 30px-45px, and thus 12px gets mapped to 34px.
+
+With the patch, the text should be uninflated, which means that 12px should still be
+12px.
+-->
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta content='True' name='HandheldFriendly' />
+ <style>
+ p { font-size: 12px; line-height: 1.0;}
+ </style>
+ <body>
+ <p>Some uninflated text.</p>
+ </body>
+ </head>
+</html>
diff --git a/layout/reftests/font-inflation/disable-fontinfl-on-mobile-3.html b/layout/reftests/font-inflation/disable-fontinfl-on-mobile-3.html
new file mode 100644
index 000000000..0bd4eaca7
--- /dev/null
+++ b/layout/reftests/font-inflation/disable-fontinfl-on-mobile-3.html
@@ -0,0 +1,20 @@
+<!--
+Without the patch for bug 706198, this website should not show up as inflated. That means
+that with a 450px container, the minimum font size with 15em per line should be 30px.
+So, we map 0px-45px into 30px-45px, and thus 12px gets mapped to 34px.
+
+With the patch, the text should be uninflated, which means that 12px should still be
+12px.
+-->
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
+ <style>
+ p { font-size: 12px; line-height: 1.0;}
+ </style>
+ <body>
+ <p>Some uninflated text.</p>
+ </body>
+ </head>
+</html>
diff --git a/layout/reftests/font-inflation/disable-fontinfl-on-mobile-5.html b/layout/reftests/font-inflation/disable-fontinfl-on-mobile-5.html
new file mode 100644
index 000000000..40149c9b5
--- /dev/null
+++ b/layout/reftests/font-inflation/disable-fontinfl-on-mobile-5.html
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
+
+<!--
+The <meta name="viewport"> tag takes precedence over the doctype, so this
+should *not* be treated as a "mobile" site (bug 783565).
+-->
+<html>
+ <head>
+ <meta name="viewport" content="width=10000">
+ <style>
+ p { font-size: 12px; line-height: 1.0;}
+ </style>
+ <body>
+ <p>Some uninflated text.</p>
+ </body>
+ </head>
+</html>
diff --git a/layout/reftests/font-inflation/disable-fontinfl-on-mobile-ref.html b/layout/reftests/font-inflation/disable-fontinfl-on-mobile-ref.html
new file mode 100644
index 000000000..ab35ad780
--- /dev/null
+++ b/layout/reftests/font-inflation/disable-fontinfl-on-mobile-ref.html
@@ -0,0 +1,19 @@
+<!--
+Without the patch for bug 706198, this website should not show up as inflated. That means
+that with a 450px container, the minimum font size with 15em per line should be 30px.
+So, we map 0px-45px into 30px-45px, and thus 12px gets mapped to 34px.
+
+With the patch, the text should be uninflated, which means that 12px should still be
+12px.
+-->
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ p { font-size: 12px; line-height: 1.0;}
+ </style>
+ <body>
+ <p>Some uninflated text.</p>
+ </body>
+ </head>
+</html>
diff --git a/layout/reftests/font-inflation/disable-fontinfl-on-mobile.html b/layout/reftests/font-inflation/disable-fontinfl-on-mobile.html
new file mode 100644
index 000000000..1e182b37f
--- /dev/null
+++ b/layout/reftests/font-inflation/disable-fontinfl-on-mobile.html
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
+
+<!--
+Without the patch for bug 706198, this website should not show up as inflated. That means
+that with a 450px container, the minimum font size with 15em per line should be 30px.
+So, we map 0px-45px into 30px-45px, and thus 12px gets mapped to 34px.
+
+With the patch, the text should be uninflated, which means that 12px should still be
+12px.
+-->
+<html>
+ <head>
+ <style>
+ p { font-size: 12px; line-height: 1.0;}
+ </style>
+ <body>
+ <p>Some uninflated text.</p>
+ </body>
+ </head>
+</html>
diff --git a/layout/reftests/font-inflation/fixed-height-body-child-ref.html b/layout/reftests/font-inflation/fixed-height-body-child-ref.html
new file mode 100644
index 000000000..1b492bf5c
--- /dev/null
+++ b/layout/reftests/font-inflation/fixed-height-body-child-ref.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<!--
+The minimum font size at 15em per line in a 450px container is 30px. This means we map 0px-45px
+into 30px-45px, so 12px gets mapped to 34px.
+-->
+<html>
+ <head>
+ <style>
+ body {
+ height: 100%;
+ /*
+ * We need overflow:hidden because we can't show a scrollbar due
+ * to https://bugzilla.mozilla.org/show_bug.cgi?id=743805 .
+ */
+ overflow: hidden;
+ }
+
+ div {
+ width: 450px;
+ }
+
+ p {
+ line-height: 1.1;
+ font-size: 34px;
+ margin: 0;
+ }
+ </style>
+ </head>
+ <body>
+ <div>
+ <p>Dorothy lived in the midst of the great Kansas prairies, with Uncle Henry, who was a farmer, and Aunt Em, who was the farmer's wife. Their house was small, for the lumber to build it had to be carried by wagon many miles. There were four walls, a floor and a roof, which made one room; and this room contained a rusty looking cookstove, a cupboard for the dishes, a table, three or four chairs, and the beds. Uncle Henry and Aunt Em had a big bed in one corner, and Dorothy a little bed in another corner. There was no garret at all, and no cellar--except a small hole dug in the ground, called a cyclone cellar, where the family could go in case one of those great whirlwinds arose, mighty enough to crush any building in its path. It was reached by a trap door in the middle of the floor, from which a ladder led down into the small, dark hole.</p>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/font-inflation/fixed-height-body-child.html b/layout/reftests/font-inflation/fixed-height-body-child.html
new file mode 100644
index 000000000..9efb02425
--- /dev/null
+++ b/layout/reftests/font-inflation/fixed-height-body-child.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<!--
+The minimum font size at 15em per line in a 450px container is 30px. This means we map 0px-45px
+into 30px-45px, so 12px gets mapped to 34px.
+-->
+<html>
+ <head>
+ <style>
+ body {
+ height: 100%;
+ /*
+ * We need overflow:hidden because we can't show a scrollbar due
+ * to https://bugzilla.mozilla.org/show_bug.cgi?id=743805 .
+ */
+ overflow: hidden;
+ }
+
+ div {
+ width: 450px;
+ }
+
+ p {
+ line-height: 1.1;
+ font-size: 12px;
+ margin: 0;
+ }
+ </style>
+ </head>
+ <body>
+ <div>
+ <p>Dorothy lived in the midst of the great Kansas prairies, with Uncle Henry, who was a farmer, and Aunt Em, who was the farmer's wife. Their house was small, for the lumber to build it had to be carried by wagon many miles. There were four walls, a floor and a roof, which made one room; and this room contained a rusty looking cookstove, a cupboard for the dishes, a table, three or four chairs, and the beds. Uncle Henry and Aunt Em had a big bed in one corner, and Dorothy a little bed in another corner. There was no garret at all, and no cellar--except a small hole dug in the ground, called a cyclone cellar, where the family could go in case one of those great whirlwinds arose, mighty enough to crush any building in its path. It was reached by a trap door in the middle of the floor, from which a ladder led down into the small, dark hole.</p>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/font-inflation/fixed-height-body-ref.html b/layout/reftests/font-inflation/fixed-height-body-ref.html
new file mode 100644
index 000000000..785c407b2
--- /dev/null
+++ b/layout/reftests/font-inflation/fixed-height-body-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<!--
+The minimum font size at 15em per line in a 450px container is 30px. This means we map 0px-45px
+into 30px-45px, so 12px gets mapped to 34px.
+-->
+<html>
+<head>
+ <style>
+ body {
+ height: 100%;
+ width: 450px;
+ line-height: 1.1;
+ font-size: 34px;
+ /*
+ * We need overflow:hidden because we can't show a scrollbar due
+ * to https://bugzilla.mozilla.org/show_bug.cgi?id=743805 .
+ */
+ overflow: hidden;
+ }
+ </style>
+</head>
+ <body>
+ Dorothy lived in the midst of the great Kansas prairies, with Uncle Henry, who was a farmer, and Aunt Em, who was the farmer's wife. Their house was small, for the lumber to build it had to be carried by wagon many miles. There were four walls, a floor and a roof, which made one room; and this room contained a rusty looking cookstove, a cupboard for the dishes, a table, three or four chairs, and the beds. Uncle Henry and Aunt Em had a big bed in one corner, and Dorothy a little bed in another corner. There was no garret at all, and no cellar--except a small hole dug in the ground, called a cyclone cellar, where the family could go in case one of those great whirlwinds arose, mighty enough to crush any building in its path. It was reached by a trap door in the middle of the floor, from which a ladder led down into the small, dark hole.
+ </body>
+</html>
diff --git a/layout/reftests/font-inflation/fixed-height-body.html b/layout/reftests/font-inflation/fixed-height-body.html
new file mode 100644
index 000000000..37919761a
--- /dev/null
+++ b/layout/reftests/font-inflation/fixed-height-body.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<!--
+The minimum font size at 15em per line in a 450px container is 30px. This means we map 0px-45px
+into 30px-45px, so 12px gets mapped to 34px.
+-->
+<html>
+<head>
+ <style>
+ body {
+ height: 100%;
+ width: 450px;
+ line-height: 1.1;
+ font-size: 12px;
+ /*
+ * We need overflow:hidden because we can't show a scrollbar due
+ * to https://bugzilla.mozilla.org/show_bug.cgi?id=743805 .
+ */
+ overflow: hidden;
+ }
+ </style>
+</head>
+ <body>
+ Dorothy lived in the midst of the great Kansas prairies, with Uncle Henry, who was a farmer, and Aunt Em, who was the farmer's wife. Their house was small, for the lumber to build it had to be carried by wagon many miles. There were four walls, a floor and a roof, which made one room; and this room contained a rusty looking cookstove, a cupboard for the dishes, a table, three or four chairs, and the beds. Uncle Henry and Aunt Em had a big bed in one corner, and Dorothy a little bed in another corner. There was no garret at all, and no cellar--except a small hole dug in the ground, called a cyclone cellar, where the family could go in case one of those great whirlwinds arose, mighty enough to crush any building in its path. It was reached by a trap door in the middle of the floor, from which a ladder led down into the small, dark hole.
+ </body>
+</html>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-1-ref.html b/layout/reftests/font-inflation/height-constraint-percent-1-ref.html
new file mode 100644
index 000000000..91993e60b
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-1-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 34px; width: 450px }
+#center-block { height: 80%;}
+#center-col { background: yellow; }
+p { margin-top: 0px; }
+
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div id="center-block">
+<div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-1.html b/layout/reftests/font-inflation/height-constraint-percent-1.html
new file mode 100644
index 000000000..bab127364
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-1.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<style>
+div { margin-top: 0; font-size: 12px; width: 450px }
+#center-block { height: 80%; }
+#center-col { background: yellow }
+p { margin-top: 0px; }
+
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div id="center-block">
+<div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-2-ref.html b/layout/reftests/font-inflation/height-constraint-percent-2-ref.html
new file mode 100644
index 000000000..ffee64c8a
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-2-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 34px; width: 450px }
+#center-block { max-height: 80%;}
+#center-col { background: yellow; }
+p { margin-top: 0px; }
+
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div id="center-block">
+<div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-2.html b/layout/reftests/font-inflation/height-constraint-percent-2.html
new file mode 100644
index 000000000..a54f68fb8
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-2.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<style>
+div { margin-top: 0; font-size: 12px; width: 450px }
+#center-block { max-height: 80%; }
+#center-col { background: yellow }
+p { margin-top: 0px; }
+
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div id="center-block">
+<div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-3-ref.html b/layout/reftests/font-inflation/height-constraint-percent-3-ref.html
new file mode 100644
index 000000000..1fc8f9e0a
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-3-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 34px; width: 450px }
+#center-block { height: -moz-calc(80% + 5%); }
+#center-col { background: yellow; }
+p { margin-top: 0px; }
+
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div id="center-block">
+<div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-3.html b/layout/reftests/font-inflation/height-constraint-percent-3.html
new file mode 100644
index 000000000..ff9d93d5e
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-3.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<style>
+div { margin-top: 0; font-size: 12px; width: 450px }
+#center-block { height: -moz-calc(80% + 5%); }
+#center-col { background: yellow }
+p { margin-top: 0px; }
+
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div id="center-block">
+<div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-4-ref.html b/layout/reftests/font-inflation/height-constraint-percent-4-ref.html
new file mode 100644
index 000000000..440bac443
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-4-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<style>
+div { margin-top: 0; font-size: 12px; width: 450px }
+#center-block { height: 80%; }
+#center-col { background: yellow }
+#containing-block { height: 800px; }
+p { margin-top: 0px; }
+
+</style>
+<!--
+Because the height of the containing block is constrained, the percent height should also
+be constrained, resulting in font inflation being disabled.
+-->
+<div id="containing-block">
+ <div id="center-block">
+ <div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-4.html b/layout/reftests/font-inflation/height-constraint-percent-4.html
new file mode 100644
index 000000000..440bac443
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-4.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<style>
+div { margin-top: 0; font-size: 12px; width: 450px }
+#center-block { height: 80%; }
+#center-col { background: yellow }
+#containing-block { height: 800px; }
+p { margin-top: 0px; }
+
+</style>
+<!--
+Because the height of the containing block is constrained, the percent height should also
+be constrained, resulting in font inflation being disabled.
+-->
+<div id="containing-block">
+ <div id="center-block">
+ <div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-5-ref.html b/layout/reftests/font-inflation/height-constraint-percent-5-ref.html
new file mode 100644
index 000000000..213b642dd
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-5-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<style>
+div { margin-top: 0; font-size: 12px; width: 450px }
+#center-block { height: 80%; }
+#center-col { background: yellow }
+#containing-block { height: -moz-calc(400px + 20px); }
+p { margin-top: 0px; }
+
+</style>
+<!--
+Because the height of the containing block is constrained, the percent height should also
+be constrained, resulting in font inflation being disabled.
+-->
+<div id="containing-block">
+ <div id="center-block">
+ <div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-5.html b/layout/reftests/font-inflation/height-constraint-percent-5.html
new file mode 100644
index 000000000..213b642dd
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-5.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<style>
+div { margin-top: 0; font-size: 12px; width: 450px }
+#center-block { height: 80%; }
+#center-col { background: yellow }
+#containing-block { height: -moz-calc(400px + 20px); }
+p { margin-top: 0px; }
+
+</style>
+<!--
+Because the height of the containing block is constrained, the percent height should also
+be constrained, resulting in font inflation being disabled.
+-->
+<div id="containing-block">
+ <div id="center-block">
+ <div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-6-ref.html b/layout/reftests/font-inflation/height-constraint-percent-6-ref.html
new file mode 100644
index 000000000..d770afd6e
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-6-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; width: 450px }
+#center-block { height: 400px; }
+#center-col { background: yellow; }
+p { margin-top: 0px; }
+
+</style>
+<!--
+Because the height is constrained, this should not be inflated.
+-->
+<div id="center-block">
+<div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-6.html b/layout/reftests/font-inflation/height-constraint-percent-6.html
new file mode 100644
index 000000000..cb241fda9
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-6.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<style>
+div { margin-top: 0; font-size: 12px; width: 450px }
+#center-block { height: 400px; }
+#center-col { background: yellow }
+p { margin-top: 0px; }
+
+</style>
+<!--
+Because the height is constrained, this should not be inflated.
+-->
+<div id="center-block">
+<div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-7-ref.html b/layout/reftests/font-inflation/height-constraint-percent-7-ref.html
new file mode 100644
index 000000000..6b74c83b1
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-7-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<style>
+div { margin-top: 0; font-size: 12px; width: 450px }
+#center-block { max-height: 400px; }
+#center-col { background: yellow }
+p { margin-top: 0px; }
+
+</style>
+<!--
+Because the max height is constrained, this should not be inflated.
+-->
+<div id="center-block">
+<div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-7.html b/layout/reftests/font-inflation/height-constraint-percent-7.html
new file mode 100644
index 000000000..6b74c83b1
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-7.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<style>
+div { margin-top: 0; font-size: 12px; width: 450px }
+#center-block { max-height: 400px; }
+#center-col { background: yellow }
+p { margin-top: 0px; }
+
+</style>
+<!--
+Because the max height is constrained, this should not be inflated.
+-->
+<div id="center-block">
+<div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-8-ref.html b/layout/reftests/font-inflation/height-constraint-percent-8-ref.html
new file mode 100644
index 000000000..9f71de00d
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-8-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<style>
+div { margin-top: 0; font-size: 34px; width: 450px }
+#center-block { height: 80%; }
+#containing-block { height: 80%; }
+#center-col { background: yellow }
+p { margin-top: 0px; }
+
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div id="containing-block">
+ <div id="center-block">
+ <div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/height-constraint-percent-8.html b/layout/reftests/font-inflation/height-constraint-percent-8.html
new file mode 100644
index 000000000..be5ec15d4
--- /dev/null
+++ b/layout/reftests/font-inflation/height-constraint-percent-8.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<style>
+div { margin-top: 0; font-size: 12px; width: 450px }
+#center-block { height: 80%; }
+#containing-block { height: 80%; }
+#center-col { background: yellow }
+p { margin-top: 0px; }
+
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div id="containing-block">
+ <div id="center-block">
+ <div id="center-col">
+ <p>Life and death, dreaming and wakefulness: stations for the perplexed soul. It traverses them by stage, taking signs and hints from things, groping about in the sea of darkness, clinging stubbornly to a hope that smilingly and mysteriously renews itself. Traveler, what are you searching for? What emotions rage in your heart?</p>
+ </div>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/input-checkbox.html b/layout/reftests/font-inflation/input-checkbox.html
new file mode 100644
index 000000000..8c2edc87a
--- /dev/null
+++ b/layout/reftests/font-inflation/input-checkbox.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML>
+<html><head>
+<!-- Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ -->
+<style>
+body { width: 450px }
+input { font-size: 12px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+</head>
+<body><input type="checkbox">I have a bike</body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/font-inflation/input-radio.html b/layout/reftests/font-inflation/input-radio.html
new file mode 100644
index 000000000..2ee3d2f14
--- /dev/null
+++ b/layout/reftests/font-inflation/input-radio.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; line-height: 1.0; width: 450px }
+input { font-size: 12px; }
+</style>
+<div><input type="radio">In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.</div> \ No newline at end of file
diff --git a/layout/reftests/font-inflation/input-text-1-height-ref.html b/layout/reftests/font-inflation/input-text-1-height-ref.html
new file mode 100644
index 000000000..7f5001001
--- /dev/null
+++ b/layout/reftests/font-inflation/input-text-1-height-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; line-height: 1.0; width: 450px }
+input { font-size: 12px; width: 200px }
+input { height: 50px }
+</style>
+<!--
+Because this input has a fixed height (and also a fixed-width), font
+inflation should be disabled.
+-->
+<div><input type="text" value="Hello world"></div>
diff --git a/layout/reftests/font-inflation/input-text-1-height.html b/layout/reftests/font-inflation/input-text-1-height.html
new file mode 100644
index 000000000..7f5001001
--- /dev/null
+++ b/layout/reftests/font-inflation/input-text-1-height.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; line-height: 1.0; width: 450px }
+input { font-size: 12px; width: 200px }
+input { height: 50px }
+</style>
+<!--
+Because this input has a fixed height (and also a fixed-width), font
+inflation should be disabled.
+-->
+<div><input type="text" value="Hello world"></div>
diff --git a/layout/reftests/font-inflation/input-text-1-noheight-ref.html b/layout/reftests/font-inflation/input-text-1-noheight-ref.html
new file mode 100644
index 000000000..52132e4f9
--- /dev/null
+++ b/layout/reftests/font-inflation/input-text-1-noheight-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 34px; line-height: 1.0; width: 450px }
+input { font-size: 12px; width: 200px }
+</style>
+<!--
+Because the width of the input element is constrained, font inflation
+should be disabled for the input element, but not the div containing
+it.
+-->
+<div>test<input type="text" value="Hello world"></div>
diff --git a/layout/reftests/font-inflation/input-text-1-noheight.html b/layout/reftests/font-inflation/input-text-1-noheight.html
new file mode 100644
index 000000000..8606b4eb9
--- /dev/null
+++ b/layout/reftests/font-inflation/input-text-1-noheight.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; line-height: 1.0; width: 450px }
+input { font-size: 12px; width: 200px }
+</style>
+<!--
+Because the width of the input element is constrained, font inflation
+should be disabled for the input element, but not the div containing
+it.
+-->
+<div>test<input type="text" value="Hello world"></div>
diff --git a/layout/reftests/font-inflation/input-text-2-height-ref.html b/layout/reftests/font-inflation/input-text-2-height-ref.html
new file mode 100644
index 000000000..055dd5c38
--- /dev/null
+++ b/layout/reftests/font-inflation/input-text-2-height-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; line-height: 1.0; width: 450px }
+input { font-size: 12px; }
+input { height: 50px }
+</style>
+<!--
+Because this input has a fixed height (and also a fixed width), font
+inflation should be disabled.
+-->
+<div><input type="text" value="Hello world" size="15"></div>
diff --git a/layout/reftests/font-inflation/input-text-2-height.html b/layout/reftests/font-inflation/input-text-2-height.html
new file mode 100644
index 000000000..055dd5c38
--- /dev/null
+++ b/layout/reftests/font-inflation/input-text-2-height.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; line-height: 1.0; width: 450px }
+input { font-size: 12px; }
+input { height: 50px }
+</style>
+<!--
+Because this input has a fixed height (and also a fixed width), font
+inflation should be disabled.
+-->
+<div><input type="text" value="Hello world" size="15"></div>
diff --git a/layout/reftests/font-inflation/input-text-2-noheight-ref.html b/layout/reftests/font-inflation/input-text-2-noheight-ref.html
new file mode 100644
index 000000000..f9f7335b9
--- /dev/null
+++ b/layout/reftests/font-inflation/input-text-2-noheight-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 34px; line-height: 1.0; width: 450px }
+input { font-size: 34px; }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div><input type="text" value="Hello world" size="15"></div>
diff --git a/layout/reftests/font-inflation/input-text-2-noheight.html b/layout/reftests/font-inflation/input-text-2-noheight.html
new file mode 100644
index 000000000..331401ef3
--- /dev/null
+++ b/layout/reftests/font-inflation/input-text-2-noheight.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; line-height: 1.0; width: 450px }
+input { font-size: 12px; }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div><input type="text" value="Hello world" size="15"></div>
diff --git a/layout/reftests/font-inflation/input-text-3-height-ref.html b/layout/reftests/font-inflation/input-text-3-height-ref.html
new file mode 100644
index 000000000..16a0877f1
--- /dev/null
+++ b/layout/reftests/font-inflation/input-text-3-height-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; line-height: 1.0; width: 450px }
+input { font-size: 12px; }
+input { height: 50px }
+</style>
+<!--
+Because this input has a fixed height (and also a fixed-width), font
+inflation should be disabled.
+-->
+<div><input type="text" value="Hello world"></div>
diff --git a/layout/reftests/font-inflation/input-text-3-height.html b/layout/reftests/font-inflation/input-text-3-height.html
new file mode 100644
index 000000000..16a0877f1
--- /dev/null
+++ b/layout/reftests/font-inflation/input-text-3-height.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; line-height: 1.0; width: 450px }
+input { font-size: 12px; }
+input { height: 50px }
+</style>
+<!--
+Because this input has a fixed height (and also a fixed-width), font
+inflation should be disabled.
+-->
+<div><input type="text" value="Hello world"></div>
diff --git a/layout/reftests/font-inflation/input-text-3-noheight-ref.html b/layout/reftests/font-inflation/input-text-3-noheight-ref.html
new file mode 100644
index 000000000..6ca0c03f2
--- /dev/null
+++ b/layout/reftests/font-inflation/input-text-3-noheight-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 34px; line-height: 1.0; width: 450px }
+input { font-size: 34px; }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div><input type="text" value="Hello world"></div>
diff --git a/layout/reftests/font-inflation/input-text-3-noheight.html b/layout/reftests/font-inflation/input-text-3-noheight.html
new file mode 100644
index 000000000..6e8c05535
--- /dev/null
+++ b/layout/reftests/font-inflation/input-text-3-noheight.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; line-height: 1.0; width: 450px }
+input { font-size: 12px; }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div><input type="text" value="Hello world"></div>
diff --git a/layout/reftests/font-inflation/intrinsic-fit-1a-ref.html b/layout/reftests/font-inflation/intrinsic-fit-1a-ref.html
new file mode 100644
index 000000000..389ac5828
--- /dev/null
+++ b/layout/reftests/font-inflation/intrinsic-fit-1a-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<style>
+@font-face { font-family: Ahem; src: url(../fonts/Ahem.ttf); }
+html, body { margin: 0; padding: 0; }
+body { width: 10px }
+p {
+ margin: 0;
+ background: yellow;
+ color: blue;
+ width: 60px;
+ font: 12px Ahem;
+}
+</style>
+<!--
+In a 60px container, the minimum font size at 15em per line is 4px.
+-->
+<p>This is tiny bit of text.</p>
diff --git a/layout/reftests/font-inflation/intrinsic-fit-1a.html b/layout/reftests/font-inflation/intrinsic-fit-1a.html
new file mode 100644
index 000000000..8f4a03dd0
--- /dev/null
+++ b/layout/reftests/font-inflation/intrinsic-fit-1a.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<style>
+@font-face { font-family: Ahem; src: url(../fonts/Ahem.ttf); }
+html, body { margin: 0; padding: 0; }
+body { width: 10px }
+p {
+ margin: 0;
+ background: yellow;
+ color: blue;
+ width: -moz-fit-content; /* computes to 60px */
+ font: 12px Ahem;
+}
+</style>
+<!--
+In a 60px container, the minimum font size at 15em per line is 4px.
+-->
+<p>This is tiny bit of text.</p>
diff --git a/layout/reftests/font-inflation/intrinsic-fit-1b-ref.html b/layout/reftests/font-inflation/intrinsic-fit-1b-ref.html
new file mode 100644
index 000000000..ee6a28c38
--- /dev/null
+++ b/layout/reftests/font-inflation/intrinsic-fit-1b-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<style>
+@font-face { font-family: Ahem; src: url(../fonts/Ahem.ttf); }
+html, body { margin: 0; padding: 0; }
+body { width: 450px }
+p {
+ margin: 0;
+ background: yellow;
+ color: blue;
+ width: 300px;
+ font: 24px Ahem;
+}
+</style>
+<!--
+In a 300px container, the minimum font size at 15em per line is 20px.
+This means we map 0px-30px into 20px-30px, so 12px gets mapped to 24px.
+-->
+<p>This is tiny bit of text.</p>
diff --git a/layout/reftests/font-inflation/intrinsic-fit-1b.html b/layout/reftests/font-inflation/intrinsic-fit-1b.html
new file mode 100644
index 000000000..ecd1bc649
--- /dev/null
+++ b/layout/reftests/font-inflation/intrinsic-fit-1b.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<style>
+@font-face { font-family: Ahem; src: url(../fonts/Ahem.ttf); }
+html, body { margin: 0; padding: 0; }
+body { width: 450px }
+p {
+ margin: 0;
+ background: yellow;
+ color: blue;
+ width: -moz-fit-content; /* computes to 300px */
+ font: 12px Ahem;
+}
+</style>
+<!--
+In a 300px container, the minimum font size at 15em per line is 20px.
+This means we map 0px-30px into 20px-30px, so 12px gets mapped to 24px.
+-->
+<p>This is tiny bit of text.</p>
diff --git a/layout/reftests/font-inflation/intrinsic-fit-1c-ref.html b/layout/reftests/font-inflation/intrinsic-fit-1c-ref.html
new file mode 100644
index 000000000..75bf2ef98
--- /dev/null
+++ b/layout/reftests/font-inflation/intrinsic-fit-1c-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<style>
+@font-face { font-family: Ahem; src: url(../fonts/Ahem.ttf); }
+html, body { margin: 0; padding: 0; }
+body { width: 150px }
+p {
+ margin: 0;
+ background: yellow;
+ color: blue;
+ width: 150px;
+ font: 14px Ahem;
+}
+</style>
+<!--
+In a 150px container, the minimum font size at 15em per line is 10px.
+This means we map 0px-15px into 10px-15px, so 12px gets mapped to 14px.
+-->
+<p>This is tiny bit of text.</p>
diff --git a/layout/reftests/font-inflation/intrinsic-fit-1c.html b/layout/reftests/font-inflation/intrinsic-fit-1c.html
new file mode 100644
index 000000000..7fdb9380b
--- /dev/null
+++ b/layout/reftests/font-inflation/intrinsic-fit-1c.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<style>
+@font-face { font-family: Ahem; src: url(../fonts/Ahem.ttf); }
+html, body { margin: 0; padding: 0; }
+body { width: 150px }
+p {
+ margin: 0;
+ background: yellow;
+ color: blue;
+ width: -moz-fit-content; /* computes to 150px */
+ font: 12px Ahem;
+}
+</style>
+<!--
+In a 150px container, the minimum font size at 15em per line is 10px.
+This means we map 0px-15px into 10px-15px, so 12px gets mapped to 14px.
+-->
+<p>This is tiny bit of text.</p>
diff --git a/layout/reftests/font-inflation/intrinsic-fit-2a.html b/layout/reftests/font-inflation/intrinsic-fit-2a.html
new file mode 100644
index 000000000..585bbcf82
--- /dev/null
+++ b/layout/reftests/font-inflation/intrinsic-fit-2a.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<style>
+@font-face { font-family: Ahem; src: url(../fonts/Ahem.ttf); }
+html, body { margin: 0; padding: 0; }
+body { width: 10px }
+p {
+ margin: 0;
+ background: yellow;
+ color: blue;
+ float: left;
+ width: auto; /* computes to 60px */
+ font: 12px Ahem;
+}
+</style>
+<!--
+In a 60px container, the minimum font size at 15em per line is 4px.
+-->
+<p>This is tiny bit of text.</p>
diff --git a/layout/reftests/font-inflation/intrinsic-fit-2b.html b/layout/reftests/font-inflation/intrinsic-fit-2b.html
new file mode 100644
index 000000000..5b121c81b
--- /dev/null
+++ b/layout/reftests/font-inflation/intrinsic-fit-2b.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<style>
+@font-face { font-family: Ahem; src: url(../fonts/Ahem.ttf); }
+html, body { margin: 0; padding: 0; }
+body { width: 450px }
+p {
+ margin: 0;
+ background: yellow;
+ color: blue;
+ float: left;
+ width: auto; /* computes to 300px */
+ font: 12px Ahem;
+}
+</style>
+<!--
+In a 300px container, the minimum font size at 15em per line is 20px.
+This means we map 0px-30px into 20px-30px, so 12px gets mapped to 24px.
+-->
+<p>This is tiny bit of text.</p>
diff --git a/layout/reftests/font-inflation/intrinsic-fit-2c.html b/layout/reftests/font-inflation/intrinsic-fit-2c.html
new file mode 100644
index 000000000..1614d893a
--- /dev/null
+++ b/layout/reftests/font-inflation/intrinsic-fit-2c.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<style>
+@font-face { font-family: Ahem; src: url(../fonts/Ahem.ttf); }
+html, body { margin: 0; padding: 0; }
+body { width: 150px }
+p {
+ margin: 0;
+ background: yellow;
+ color: blue;
+ float: left;
+ width: auto; /* computes to 150px */
+ font: 12px Ahem;
+}
+</style>
+<!--
+In a 150px container, the minimum font size at 15em per line is 10px.
+This means we map 0px-15px into 10px-15px, so 12px gets mapped to 14px.
+-->
+<p>This is tiny bit of text.</p>
diff --git a/layout/reftests/font-inflation/intrinsic-max-1-ref.html b/layout/reftests/font-inflation/intrinsic-max-1-ref.html
new file mode 100644
index 000000000..862b0e3f0
--- /dev/null
+++ b/layout/reftests/font-inflation/intrinsic-max-1-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML>
+<style>
+@font-face { font-family: Ahem; src: url(../fonts/Ahem.ttf); }
+html, body { margin: 0; padding: 0; }
+body { width: 450px }
+p {
+ margin: 0;
+ background: yellow;
+ color: blue;
+ width: 300px;
+ font: 24px Ahem;
+}
+</style>
+<p>This is tiny bit of text.</p>
diff --git a/layout/reftests/font-inflation/intrinsic-max-1.html b/layout/reftests/font-inflation/intrinsic-max-1.html
new file mode 100644
index 000000000..7cd4c5249
--- /dev/null
+++ b/layout/reftests/font-inflation/intrinsic-max-1.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<style>
+@font-face { font-family: Ahem; src: url(../fonts/Ahem.ttf); }
+html, body { margin: 0; padding: 0; }
+body { width: 450px }
+p {
+ margin: 0;
+ background: yellow;
+ color: blue;
+ width: -moz-max-content; /* computes to 300px */
+ font: 12px Ahem;
+}
+</style>
+<!--
+In a 300px container, the minimum font size at 15em per line is 20px.
+This means we map 0px-30px into 20px-30px, so 12px gets mapped to 24px.
+-->
+<p>This is tiny bit of text.</p>
diff --git a/layout/reftests/font-inflation/intrinsic-min-1-ref.html b/layout/reftests/font-inflation/intrinsic-min-1-ref.html
new file mode 100644
index 000000000..70a044637
--- /dev/null
+++ b/layout/reftests/font-inflation/intrinsic-min-1-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<style>
+@font-face { font-family: Ahem; src: url(../fonts/Ahem.ttf); }
+html, body { margin: 0; padding: 0; }
+body { width: 450px }
+p {
+ margin: 0;
+ background: yellow;
+ color: blue;
+ width: 60px;
+ font: 12px Ahem;
+}
+</style>
+<!--
+In a 60px container, the minimum font size at 15em per line is 4px.
+-->
+<p>This is some text.</p>
diff --git a/layout/reftests/font-inflation/intrinsic-min-1.html b/layout/reftests/font-inflation/intrinsic-min-1.html
new file mode 100644
index 000000000..a88640218
--- /dev/null
+++ b/layout/reftests/font-inflation/intrinsic-min-1.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML>
+<style>
+@font-face { font-family: Ahem; src: url(../fonts/Ahem.ttf); }
+html, body { margin: 0; padding: 0; }
+body { width: 450px }
+p {
+ margin: 0;
+ background: yellow;
+ color: blue;
+ width: -moz-min-content; /* computes to 60px */
+ font: 12px Ahem;
+}
+</style>
+<p>This is some text.</p>
diff --git a/layout/reftests/font-inflation/list-1-ref.html b/layout/reftests/font-inflation/list-1-ref.html
new file mode 100644
index 000000000..43e66ad90
--- /dev/null
+++ b/layout/reftests/font-inflation/list-1-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<head>
+<style>
+div { background: yellow; line-height: 1.0; font-size: 12px; width: 480px; border: 1px solid red; }
+ol { padding-left: 120px; width: 400px;}
+li { font-size: 36px; }
+</style>
+</head>
+<!--
+In a 480px container, the minimum font size at 15em per line is 32px.
+This means we map 0px-48px into 32px-48px, so 12px gets mapped to 36px.
+The margins will be a little bit screwy, since we're fiddling with them
+to make the list rendering better.
+-->
+<body>
+<div>
+ <ol>
+ <li>Separate interface design from internals</li>
+ <li>Enable multiple user-interface strategies</li>
+ <li>Enable multiple-platform support</li>
+ </ol>
+</div>
+</body>
diff --git a/layout/reftests/font-inflation/list-1.html b/layout/reftests/font-inflation/list-1.html
new file mode 100644
index 000000000..1c96f2d67
--- /dev/null
+++ b/layout/reftests/font-inflation/list-1.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<head>
+<link rel="stylesheet" type="text/css" href="ahem.css" />
+<style>
+div { background: yellow; line-height: 1.0; border: 1px solid red; font-size: 12px; width: 480px; }
+ol { width: 480px;}
+li { font-family: ahem; }
+</style>
+</head>
+<!--
+In a 480px container, the minimum font size at 15em per line is 32px.
+This means we map 0px-48px into 32px-48px, so 12px gets mapped to 36px.
+-->
+<body>
+<div>
+ <ol>
+ <li>Separate interface design from internals</li>
+ <li>Enable multiple user-interface strategies</li>
+ <li>Enable multiple-platform support</li>
+ </ol>
+</div>
+</body>
diff --git a/layout/reftests/font-inflation/maxRatio-1-ref.html b/layout/reftests/font-inflation/maxRatio-1-ref.html
new file mode 100644
index 000000000..dce6c6d8e
--- /dev/null
+++ b/layout/reftests/font-inflation/maxRatio-1-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<style>
+div { background: yellow }
+div { font-size: 24px; width: 450px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+However, because we've enabled the maxRatio at a value of 2.0, the mapping
+function, which would normally return 34px/12px, or about 2.83, now
+returns a ratio capped at 2.0, thus the actual font size is 24px.
+-->
+<div>Hello world</div>
diff --git a/layout/reftests/font-inflation/maxRatio-1.html b/layout/reftests/font-inflation/maxRatio-1.html
new file mode 100644
index 000000000..0cbc120ae
--- /dev/null
+++ b/layout/reftests/font-inflation/maxRatio-1.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<style>
+div { background: yellow }
+div { font-size: 12px; width: 450px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+However, because we've enabled the maxRatio at a value of 2.0, the mapping
+function, which would normally return 34px/12px, or about 2.83, now
+returns a ratio capped at 2.0, thus the actual font size is 24px.
+-->
+<div>Hello world</div>
diff --git a/layout/reftests/font-inflation/min-width-passes-1-ref.html b/layout/reftests/font-inflation/min-width-passes-1-ref.html
new file mode 100644
index 000000000..1027e29d9
--- /dev/null
+++ b/layout/reftests/font-inflation/min-width-passes-1-ref.html
@@ -0,0 +1,23 @@
+<html>
+<head>
+<title>Bug Reproduction</title>
+</head>
+<style type="text/css">
+html, body {
+ /*
+ * Work around bug 759755 / bug 757179. Setting overflow hidden
+ * avoids these bugs being triggered due to the hypothetical scrollbar
+ * reflows.
+ */
+ overflow: hidden;
+}
+table { width: 100% }
+body, table, tbody, tr, td {
+ margin: 0; border: none; padding: 0; border-spacing: 0;
+}
+</style>
+<body>
+ <h1 id="welcome">Welcome to Bugzilla</h1>
+ <input type="button" id="find" value="Quick Search"></input>
+</body>
+</html>
diff --git a/layout/reftests/font-inflation/min-width-passes-1.html b/layout/reftests/font-inflation/min-width-passes-1.html
new file mode 100644
index 000000000..0ab18996d
--- /dev/null
+++ b/layout/reftests/font-inflation/min-width-passes-1.html
@@ -0,0 +1,25 @@
+<html>
+<head>
+<title>Bug Reproduction</title>
+</head>
+<style type="text/css">
+html, body {
+ /*
+ * Work around bug 759755 / bug 757179. Setting overflow hidden
+ * avoids these bugs being triggered due to the hypothetical scrollbar
+ * reflows.
+ */
+ overflow: hidden;
+}
+table { width: 100% }
+body, table, tbody, tr, td {
+ margin: 0; border: none; padding: 0; border-spacing: 0;
+}
+</style>
+<body>
+<table><tr><td>
+ <h1 id="welcome">Welcome to Bugzilla</h1>
+ <input type="button" id="find" value="Quick Search"></input>
+</td></tr></table>
+</body>
+</html>
diff --git a/layout/reftests/font-inflation/preformatted-text-ref.html b/layout/reftests/font-inflation/preformatted-text-ref.html
new file mode 100644
index 000000000..0a847a806
--- /dev/null
+++ b/layout/reftests/font-inflation/preformatted-text-ref.html
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+
+<!--
+This text is in a preformatted block, and should therefore not be inflated with the fix for bug 705446.
+-->
+<html>
+ <head>
+ <style>
+ pre { font-size: 12px; line-height: 1.0;}
+ </style>
+ <body>
+ <div>
+ <pre>
+ <div class="line" id="line1"><span style="color: red">Firefox</span> is quite neat</div>
+ <div class="line" id="line2">It browses the web fluidly</div>
+ <div class="line" id="line3">With no cares at all</div>
+ </pre>
+ </div>
+ </body>
+ </head>
+</html>
diff --git a/layout/reftests/font-inflation/preformatted-text.html b/layout/reftests/font-inflation/preformatted-text.html
new file mode 100644
index 000000000..0a847a806
--- /dev/null
+++ b/layout/reftests/font-inflation/preformatted-text.html
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+
+<!--
+This text is in a preformatted block, and should therefore not be inflated with the fix for bug 705446.
+-->
+<html>
+ <head>
+ <style>
+ pre { font-size: 12px; line-height: 1.0;}
+ </style>
+ <body>
+ <div>
+ <pre>
+ <div class="line" id="line1"><span style="color: red">Firefox</span> is quite neat</div>
+ <div class="line" id="line2">It browses the web fluidly</div>
+ <div class="line" id="line3">With no cares at all</div>
+ </pre>
+ </div>
+ </body>
+ </head>
+</html>
diff --git a/layout/reftests/font-inflation/reftest-stylo.list b/layout/reftests/font-inflation/reftest-stylo.list
new file mode 100644
index 000000000..9f2b02a66
--- /dev/null
+++ b/layout/reftests/font-inflation/reftest-stylo.list
@@ -0,0 +1,121 @@
+# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
+# The following tests were written before
+# font.size.inflation.lineThreshold was implemented, and thus assumed
+# that there wasn't a threshold of text required for inflation. To run
+# them compatibly without having to rewrite all of them, we run them
+# with the lineThreshold preference explicitly set to zero. However,
+# newer tests should probably focus more on testing nonzero values of
+# that preference.
+
+# The font-inflation code uses the meta-viewport tag as one of its inputs
+# when determining if font-inflation needs to be applied, so enable it for
+# these tests.
+default-preferences pref(dom.meta-viewport.enabled,true)
+
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) test-pref(font.size.inflation.maxRatio,200) == maxRatio-1.html maxRatio-1.html
+skip == text-1.html text-1.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == text-2.html text-2.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == text-3.html text-3.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == text-4.html text-4.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-1.html height-constraint-percent-1.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-2.html height-constraint-percent-2.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-3.html height-constraint-percent-3.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-4.html height-constraint-percent-4.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-5.html height-constraint-percent-5.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-6.html height-constraint-percent-6.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-7.html height-constraint-percent-7.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-8.html height-constraint-percent-8.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == decoration-1.html decoration-1.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == bullet-1.html bullet-1.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == input-text-1-height.html input-text-1-height.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == input-text-1-noheight.html input-text-1-noheight.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == input-text-2-height.html input-text-2-height.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == input-text-2-noheight.html input-text-2-noheight.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == input-text-3-height.html input-text-3-height.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == input-text-3-noheight.html input-text-3-noheight.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == textarea-1.html textarea-1.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == textarea-2.html textarea-2.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == textarea-3.html textarea-3.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == css-transform-1.html css-transform-1.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == css-transform-2.html css-transform-2.html
+fails skip-if(B2G||Mulet) fuzzy-if(asyncPan&&!layersGPUAccelerated,102,1764) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == container-with-clamping.html container-with-clamping.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+skip test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) load video-1.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-min-1.html intrinsic-min-1.html
+fails skip-if(B2G||Mulet) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-max-1.html intrinsic-max-1.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+skip-if(B2G||Mulet) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-fit-1a.html intrinsic-fit-1a.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+fails skip-if(B2G||Mulet) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-fit-1b.html intrinsic-fit-1b.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-fit-1c.html intrinsic-fit-1c.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-fit-2a.html intrinsic-fit-2a.html
+fails skip-if(B2G||Mulet) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-fit-2b.html intrinsic-fit-2b.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+fails skip-if(B2G||Mulet) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-fit-2c.html intrinsic-fit-2c.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == select-listbox-1.html select-listbox-1.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == select-listbox-1.html select-listbox-1.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == select-combobox-1.html select-combobox-1.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == select-combobox-1.html select-combobox-1.html
+fails skip-if(B2G||Mulet) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == select-listbox-2.html select-listbox-2.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == select-listbox-2.html select-listbox-2.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == select-combobox-2.html select-combobox-2.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == select-combobox-2.html select-combobox-2.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == select-combobox-3.html select-combobox-3.html
+fails asserts-if(gtkWidget,0-4) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == input-checkbox.html input-checkbox.html
+fails asserts-if(gtkWidget,0-4) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == input-radio.html input-radio.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile.html disable-fontinfl-on-mobile.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-2.html disable-fontinfl-on-mobile-2.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-3.html disable-fontinfl-on-mobile-3.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-5.html disable-fontinfl-on-mobile-5.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == preformatted-text.html preformatted-text.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == fixed-height-body.html fixed-height-body.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == fixed-height-body-child.html fixed-height-body-child.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == consecutive-inline.html consecutive-inline.html
+
+# The tests below use nonzero values of the lineThreshold preference.
+skip == text-1.html text-1.html
+skip test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) HTTP(..) == list-1.html list-1.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-1a.html threshold-1a.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-1b.html threshold-1b.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-1c.html threshold-1c.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-2.html threshold-2.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-3.html threshold-3.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-float-1.html threshold-scope-float-1.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-float-2.html threshold-scope-float-2.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-float-overflow-1.html threshold-scope-float-overflow-1.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-float-overflow-2.html threshold-scope-float-overflow-2.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-cell-1.html threshold-scope-cell-1.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-cell-2.html threshold-scope-cell-2.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-cell-3.html threshold-scope-cell-3.html
+
+fuzzy-if(gtkWidget,1,10) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-textarea-contents-under-1.html threshold-textarea-contents-under-1.html
+skip-if(B2G||Mulet) fuzzy-if(gtkWidget,1,10) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-textarea-contents-under-2.html threshold-textarea-contents-under-2.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+skip == threshold-textarea-contents-at-1.html threshold-textarea-contents-at-1.html
+skip == threshold-textarea-contents-at-2.html threshold-textarea-contents-at-2.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+fuzzy-if(gtkWidget,1,10) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-input-text-contents-under-1.html threshold-input-text-contents-under-1.html
+fuzzy-if(gtkWidget,1,10) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-input-text-contents-under-2.html threshold-input-text-contents-under-2.html
+skip == threshold-input-text-contents-at-1.html threshold-input-text-contents-at-1.html
+skip == threshold-input-text-contents-at-2.html threshold-input-text-contents-at-2.html
+skip == threshold-select-listbox-contents-under-1.html threshold-select-listbox-contents-under-1.html
+skip == threshold-select-listbox-contents-under-2.html threshold-select-listbox-contents-under-2.html
+skip == threshold-select-listbox-contents-at-1.html threshold-select-listbox-contents-at-1.html
+skip == threshold-select-listbox-contents-at-2.html threshold-select-listbox-contents-at-2.html
+skip == threshold-select-combobox-contents-under-1.html threshold-select-combobox-contents-under-1.html
+skip == threshold-select-combobox-contents-under-2.html threshold-select-combobox-contents-under-2.html
+skip == threshold-select-combobox-contents-at-1.html threshold-select-combobox-contents-at-1.html
+skip == threshold-select-combobox-contents-at-2.html threshold-select-combobox-contents-at-2.html
+
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == relevant-width-1.html relevant-width-1.html
+fails test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == relevant-width-overflow-1.html relevant-width-overflow-1.html
+
+pref(font.size.inflation.emPerLine,15) pref(font.size.inflation.forceEnabled,true) pref(font.size.inflation.lineThreshold,0) == min-width-passes-1.html min-width-passes-1.html
+
+pref(font.size.inflation.emPerLine,15) pref(font.size.inflation.forceEnabled,true) == xul-reflow-1.html xul-reflow-1.html
+
+# reset the default preferences
+default-preferences
diff --git a/layout/reftests/font-inflation/reftest.list b/layout/reftests/font-inflation/reftest.list
new file mode 100644
index 000000000..0bce85253
--- /dev/null
+++ b/layout/reftests/font-inflation/reftest.list
@@ -0,0 +1,111 @@
+# The following tests were written before
+# font.size.inflation.lineThreshold was implemented, and thus assumed
+# that there wasn't a threshold of text required for inflation. To run
+# them compatibly without having to rewrite all of them, we run them
+# with the lineThreshold preference explicitly set to zero. However,
+# newer tests should probably focus more on testing nonzero values of
+# that preference.
+
+# The font-inflation code uses the meta-viewport tag as one of its inputs
+# when determining if font-inflation needs to be applied, so enable it for
+# these tests.
+default-preferences pref(dom.meta-viewport.enabled,true)
+
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) test-pref(font.size.inflation.maxRatio,200) == maxRatio-1.html maxRatio-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == text-1.html text-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == text-2.html text-2-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == text-3.html text-3-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == text-4.html text-4-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-1.html height-constraint-percent-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-2.html height-constraint-percent-2-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-3.html height-constraint-percent-3-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-4.html height-constraint-percent-4-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-5.html height-constraint-percent-5-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-6.html height-constraint-percent-6-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-7.html height-constraint-percent-7-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == height-constraint-percent-8.html height-constraint-percent-8-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == decoration-1.html decoration-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == bullet-1.html bullet-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == input-text-1-height.html input-text-1-height-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == input-text-1-noheight.html input-text-1-noheight-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == input-text-2-height.html input-text-2-height-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == input-text-2-noheight.html input-text-2-noheight-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == input-text-3-height.html input-text-3-height-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == input-text-3-noheight.html input-text-3-noheight-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == textarea-1.html textarea-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == textarea-2.html textarea-2-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == textarea-3.html textarea-3-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == css-transform-1.html css-transform-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == css-transform-2.html css-transform-2-ref.html
+fuzzy-if(asyncPan&&!layersGPUAccelerated,102,1764) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == container-with-clamping.html container-with-clamping-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) load video-1.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-min-1.html intrinsic-min-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-max-1.html intrinsic-max-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-fit-1a.html intrinsic-fit-1a-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-fit-1b.html intrinsic-fit-1b-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-fit-1c.html intrinsic-fit-1c-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-fit-2a.html intrinsic-fit-1a-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-fit-2b.html intrinsic-fit-1b-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) HTTP(..) == intrinsic-fit-2c.html intrinsic-fit-1c-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == select-listbox-1.html select-listbox-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) != select-listbox-1.html select-listbox-1.html
+fuzzy-if(skiaContent,4,2) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == select-combobox-1.html select-combobox-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) != select-combobox-1.html select-combobox-1.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == select-listbox-2.html select-listbox-2-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) != select-listbox-2.html select-listbox-2.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == select-combobox-2.html select-combobox-2-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) != select-combobox-2.html select-combobox-2.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == select-combobox-3.html select-combobox-3-ref.html
+asserts-if(gtkWidget,0-4) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) != input-checkbox.html input-checkbox.html
+asserts-if(gtkWidget,0-4) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) != input-radio.html input-radio.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile.html disable-fontinfl-on-mobile-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-2.html disable-fontinfl-on-mobile-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-3.html disable-fontinfl-on-mobile-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) != disable-fontinfl-on-mobile-5.html disable-fontinfl-on-mobile-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == preformatted-text.html preformatted-text-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == fixed-height-body.html fixed-height-body-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == fixed-height-body-child.html fixed-height-body-child-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == consecutive-inline.html consecutive-inline-ref.html
+
+# The tests below use nonzero values of the lineThreshold preference.
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == text-1.html text-1.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) HTTP(..) == list-1.html list-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-1a.html threshold-1a.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-1b.html threshold-1b-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-1c.html threshold-1c-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-2.html threshold-2-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-3.html threshold-3-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-float-1.html threshold-scope-float-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-float-2.html threshold-scope-float-2-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-float-overflow-1.html threshold-scope-float-overflow-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-float-overflow-2.html threshold-scope-float-overflow-2-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-cell-1.html threshold-scope-cell-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-cell-2.html threshold-scope-cell-2-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-cell-3.html threshold-scope-cell-3-ref.html
+
+fuzzy-if(gtkWidget,1,10) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-textarea-contents-under-1.html threshold-textarea-contents-under-1.html
+fuzzy-if(gtkWidget,1,10) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-textarea-contents-under-2.html threshold-textarea-contents-under-2.html
+fuzzy-if(gtkWidget,1,10) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-textarea-contents-at-1.html threshold-textarea-contents-at-1-ref.html
+fuzzy-if(gtkWidget,1,10) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-textarea-contents-at-2.html threshold-textarea-contents-at-2-ref.html
+fuzzy-if(gtkWidget,1,10) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-input-text-contents-under-1.html threshold-input-text-contents-under-1.html
+fuzzy-if(gtkWidget,1,10) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-input-text-contents-under-2.html threshold-input-text-contents-under-2.html
+fuzzy-if(gtkWidget,1,10) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-input-text-contents-at-1.html threshold-input-text-contents-at-1-ref.html
+fuzzy-if(gtkWidget,1,10) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-input-text-contents-at-2.html threshold-input-text-contents-at-2-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-listbox-contents-under-1.html threshold-select-listbox-contents-under-1.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-listbox-contents-under-2.html threshold-select-listbox-contents-under-2.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-listbox-contents-at-1.html threshold-select-listbox-contents-at-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-listbox-contents-at-2.html threshold-select-listbox-contents-at-2-ref.html
+fuzzy-if(gtkWidget,1,8) fuzzy-if(Android,4,2) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-combobox-contents-under-1.html threshold-select-combobox-contents-under-1.html
+fuzzy-if(gtkWidget,1,8) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-combobox-contents-under-2.html threshold-select-combobox-contents-under-2.html
+fuzzy-if(gtkWidget,1,8) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-combobox-contents-at-1.html threshold-select-combobox-contents-at-1-ref.html
+fuzzy-if(gtkWidget,1,8) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-combobox-contents-at-2.html threshold-select-combobox-contents-at-2-ref.html
+
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == relevant-width-1.html relevant-width-1-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == relevant-width-overflow-1.html relevant-width-overflow-1-ref.html
+
+pref(font.size.inflation.emPerLine,15) pref(font.size.inflation.forceEnabled,true) pref(font.size.inflation.lineThreshold,0) == min-width-passes-1.html min-width-passes-1-ref.html
+
+pref(font.size.inflation.emPerLine,15) pref(font.size.inflation.forceEnabled,true) == xul-reflow-1.html xul-reflow-1-ref.html
+
+# reset the default preferences
+default-preferences
diff --git a/layout/reftests/font-inflation/relevant-width-1-ref.html b/layout/reftests/font-inflation/relevant-width-1-ref.html
new file mode 100644
index 000000000..90b67e1b6
--- /dev/null
+++ b/layout/reftests/font-inflation/relevant-width-1-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 34px; width: 450px }
+div.inner { width: 300px }
+</style>
+<div class="middle">
+ Text in middle.
+ <div class="inner">Text in inner.</div>
+</div>
diff --git a/layout/reftests/font-inflation/relevant-width-1.html b/layout/reftests/font-inflation/relevant-width-1.html
new file mode 100644
index 000000000..814917786
--- /dev/null
+++ b/layout/reftests/font-inflation/relevant-width-1.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<style>
+div.outer { font-size: 12px; width: 600px }
+div.middle { width: 450px; }
+div.inner { width: 300px; }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div class="outer">
+ <div class="middle">
+ Text in middle.
+ <div class="inner">Text in inner.</div>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/relevant-width-overflow-1-ref.html b/layout/reftests/font-inflation/relevant-width-overflow-1-ref.html
new file mode 100644
index 000000000..96f555569
--- /dev/null
+++ b/layout/reftests/font-inflation/relevant-width-overflow-1-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 34px; width: 450px }
+div.inner { width: 300px; overflow: hidden; }
+</style>
+<div class="middle">
+ Text in middle.
+ <div class="inner">Text in inner.</div>
+</div>
diff --git a/layout/reftests/font-inflation/relevant-width-overflow-1.html b/layout/reftests/font-inflation/relevant-width-overflow-1.html
new file mode 100644
index 000000000..ca6bf57c7
--- /dev/null
+++ b/layout/reftests/font-inflation/relevant-width-overflow-1.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<style>
+div.outer { font-size: 12px; width: 600px }
+div.middle { width: 450px; }
+div.inner { width: 300px; overflow: hidden; }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div class="outer">
+ <div class="middle">
+ Text in middle.
+ <div class="inner">Text in inner.</div>
+ </div>
+</div>
diff --git a/layout/reftests/font-inflation/select-combobox-1-ref.html b/layout/reftests/font-inflation/select-combobox-1-ref.html
new file mode 100644
index 000000000..17d29405d
--- /dev/null
+++ b/layout/reftests/font-inflation/select-combobox-1-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+body { width: 450px }
+body, select { font-size: 34px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<select><option>One</option><option>Two</option></select>
diff --git a/layout/reftests/font-inflation/select-combobox-1.html b/layout/reftests/font-inflation/select-combobox-1.html
new file mode 100644
index 000000000..87b01d9bd
--- /dev/null
+++ b/layout/reftests/font-inflation/select-combobox-1.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+body { width: 450px }
+body, select { font-size: 12px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<select><option>One</option><option>Two</option></select>
diff --git a/layout/reftests/font-inflation/select-combobox-2-ref.html b/layout/reftests/font-inflation/select-combobox-2-ref.html
new file mode 100644
index 000000000..50c12dc92
--- /dev/null
+++ b/layout/reftests/font-inflation/select-combobox-2-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<style>
+body { width: 450px }
+body, select { font-size: 34px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<select>
+ <optgroup label="Counties">
+ <option>Arlington
+ <option>Fairfax
+ <option>Loudon
+ <option>Prince William
+ <optgroup label="Cities">
+ <option>Alexandria
+ <option>Falls Church
+ <option>Manassas
+ <option>Manassas Park
+</select>
diff --git a/layout/reftests/font-inflation/select-combobox-2.html b/layout/reftests/font-inflation/select-combobox-2.html
new file mode 100644
index 000000000..19808ed1b
--- /dev/null
+++ b/layout/reftests/font-inflation/select-combobox-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<style>
+body { width: 450px }
+body, select { font-size: 12px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<select>
+ <optgroup label="Counties">
+ <option>Arlington
+ <option>Fairfax
+ <option>Loudon
+ <option>Prince William
+ <optgroup label="Cities">
+ <option>Alexandria
+ <option>Falls Church
+ <option>Manassas
+ <option>Manassas Park
+</select>
diff --git a/layout/reftests/font-inflation/select-combobox-3-ref.html b/layout/reftests/font-inflation/select-combobox-3-ref.html
new file mode 100644
index 000000000..3c966264c
--- /dev/null
+++ b/layout/reftests/font-inflation/select-combobox-3-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+ body { line-height: 1.0; width: 450px; font-size: 34px; }
+ select { vertical-align: top; font-size: 12px; width: 100px; }
+</style>
+<!--
+Because the combobox has constrained width, font inflation
+should be disabled.
+-->
+<select><option>One</Option><option>Two</option></select>
diff --git a/layout/reftests/font-inflation/select-combobox-3.html b/layout/reftests/font-inflation/select-combobox-3.html
new file mode 100644
index 000000000..3c966264c
--- /dev/null
+++ b/layout/reftests/font-inflation/select-combobox-3.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+ body { line-height: 1.0; width: 450px; font-size: 34px; }
+ select { vertical-align: top; font-size: 12px; width: 100px; }
+</style>
+<!--
+Because the combobox has constrained width, font inflation
+should be disabled.
+-->
+<select><option>One</Option><option>Two</option></select>
diff --git a/layout/reftests/font-inflation/select-listbox-1-ref.html b/layout/reftests/font-inflation/select-listbox-1-ref.html
new file mode 100644
index 000000000..e8758855b
--- /dev/null
+++ b/layout/reftests/font-inflation/select-listbox-1-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+body { width: 450px }
+body, select { font-size: 34px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<select size="3"><option>One</option><option>Two</option></select>
diff --git a/layout/reftests/font-inflation/select-listbox-1.html b/layout/reftests/font-inflation/select-listbox-1.html
new file mode 100644
index 000000000..a6b073f7f
--- /dev/null
+++ b/layout/reftests/font-inflation/select-listbox-1.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+body { width: 450px }
+body, select { font-size: 12px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<select size="3"><option>One</option><option>Two</option></select>
diff --git a/layout/reftests/font-inflation/select-listbox-2-ref.html b/layout/reftests/font-inflation/select-listbox-2-ref.html
new file mode 100644
index 000000000..d25b80275
--- /dev/null
+++ b/layout/reftests/font-inflation/select-listbox-2-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<style>
+body { width: 450px }
+body, select { font-size: 34px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<select size="3">
+ <optgroup label="Counties">
+ <option>Arlington
+ <option>Fairfax
+ <option>Loudon
+ <option>Prince William
+ <optgroup label="Cities">
+ <option>Alexandria
+ <option>Falls Church
+ <option>Manassas
+ <option>Manassas Park
+</select>
diff --git a/layout/reftests/font-inflation/select-listbox-2.html b/layout/reftests/font-inflation/select-listbox-2.html
new file mode 100644
index 000000000..ba5da1124
--- /dev/null
+++ b/layout/reftests/font-inflation/select-listbox-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<style>
+body { width: 450px }
+body, select { font-size: 12px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<select size="3">
+ <optgroup label="Counties">
+ <option>Arlington
+ <option>Fairfax
+ <option>Loudon
+ <option>Prince William
+ <optgroup label="Cities">
+ <option>Alexandria
+ <option>Falls Church
+ <option>Manassas
+ <option>Manassas Park
+</select>
diff --git a/layout/reftests/font-inflation/text-1-ref.html b/layout/reftests/font-inflation/text-1-ref.html
new file mode 100644
index 000000000..cdf5d8544
--- /dev/null
+++ b/layout/reftests/font-inflation/text-1-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<style>
+div { background: yellow }
+div { font-size: 34px; width: 450px }
+</style>
+<div>Hello world</div>
diff --git a/layout/reftests/font-inflation/text-1.html b/layout/reftests/font-inflation/text-1.html
new file mode 100644
index 000000000..3bc6129d3
--- /dev/null
+++ b/layout/reftests/font-inflation/text-1.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+div { background: yellow }
+div { font-size: 12px; width: 450px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div>Hello world</div>
diff --git a/layout/reftests/font-inflation/text-2-ref.html b/layout/reftests/font-inflation/text-2-ref.html
new file mode 100644
index 000000000..ea117963c
--- /dev/null
+++ b/layout/reftests/font-inflation/text-2-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<style>
+div { background: yellow }
+div { font-size: 34px; line-height: 1.0; width: 450px }
+</style>
+<div>Hello world</div>
diff --git a/layout/reftests/font-inflation/text-2.html b/layout/reftests/font-inflation/text-2.html
new file mode 100644
index 000000000..848a40eb3
--- /dev/null
+++ b/layout/reftests/font-inflation/text-2.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+div { background: yellow }
+div { font-size: 12px; line-height: 1.0; width: 450px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div>Hello world</div>
diff --git a/layout/reftests/font-inflation/text-3-ref.html b/layout/reftests/font-inflation/text-3-ref.html
new file mode 100644
index 000000000..c2565f0c9
--- /dev/null
+++ b/layout/reftests/font-inflation/text-3-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<style>
+div { background: yellow }
+span { background: aqua }
+div { font-size: 34px; width: 450px }
+</style>
+<div><span>Hello world</span></div>
diff --git a/layout/reftests/font-inflation/text-3.html b/layout/reftests/font-inflation/text-3.html
new file mode 100644
index 000000000..e410a10ac
--- /dev/null
+++ b/layout/reftests/font-inflation/text-3.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { background: yellow }
+span { background: aqua }
+div { font-size: 12px; width: 450px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div><span>Hello world</span></div>
diff --git a/layout/reftests/font-inflation/text-4-ref.html b/layout/reftests/font-inflation/text-4-ref.html
new file mode 100644
index 000000000..b8930c117
--- /dev/null
+++ b/layout/reftests/font-inflation/text-4-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<style>
+div { background: yellow }
+span { background: aqua }
+div { font-size: 34px; line-height: 1.0; width: 450px }
+</style>
+<div><span>Hello world</span></div>
diff --git a/layout/reftests/font-inflation/text-4.html b/layout/reftests/font-inflation/text-4.html
new file mode 100644
index 000000000..ba9ab9ef8
--- /dev/null
+++ b/layout/reftests/font-inflation/text-4.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { background: yellow }
+span { background: aqua }
+div { font-size: 12px; line-height: 1.0; width: 450px }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div><span>Hello world</span></div>
diff --git a/layout/reftests/font-inflation/textarea-1-ref.html b/layout/reftests/font-inflation/textarea-1-ref.html
new file mode 100644
index 000000000..78adafb84
--- /dev/null
+++ b/layout/reftests/font-inflation/textarea-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 34px; line-height: 1.0; width: 450px }
+textarea { font-size: 12px; width: 200px; height: 50px }
+textarea { line-height: 1.0 }
+</style>
+<!--
+Because the textarea has constrained width and height, font
+inflation should be disabled for this case.
+-->
+<div><textarea>Hello world</textarea></div>
diff --git a/layout/reftests/font-inflation/textarea-1.html b/layout/reftests/font-inflation/textarea-1.html
new file mode 100644
index 000000000..f8bac798c
--- /dev/null
+++ b/layout/reftests/font-inflation/textarea-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; line-height: 1.0; width: 450px }
+textarea { font-size: 12px; width: 200px; height: 50px }
+textarea { line-height: 1.0 }
+</style>
+<!--
+Because the textarea has constrained width and height, font
+inflation should be disabled for this case.
+-->
+<div><textarea>Hello world</textarea></div>
diff --git a/layout/reftests/font-inflation/textarea-2-ref.html b/layout/reftests/font-inflation/textarea-2-ref.html
new file mode 100644
index 000000000..da650e128
--- /dev/null
+++ b/layout/reftests/font-inflation/textarea-2-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 34px; line-height: 1.0; width: 450px }
+textarea { font-size: 34px; }
+textarea { line-height: 1.0 }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div><textarea rows="4" cols="25">Hello world</textarea></div>
diff --git a/layout/reftests/font-inflation/textarea-2.html b/layout/reftests/font-inflation/textarea-2.html
new file mode 100644
index 000000000..7405f7075
--- /dev/null
+++ b/layout/reftests/font-inflation/textarea-2.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; line-height: 1.0; width: 450px }
+textarea { font-size: 12px; }
+textarea { line-height: 1.0 }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div><textarea rows="4" cols="25">Hello world</textarea></div>
diff --git a/layout/reftests/font-inflation/textarea-3-ref.html b/layout/reftests/font-inflation/textarea-3-ref.html
new file mode 100644
index 000000000..4f9d6065b
--- /dev/null
+++ b/layout/reftests/font-inflation/textarea-3-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 34px; line-height: 1.0; width: 450px }
+textarea { font-size: 34px; }
+textarea { line-height: 1.0 }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div><textarea>Hello world</textarea></div>
diff --git a/layout/reftests/font-inflation/textarea-3.html b/layout/reftests/font-inflation/textarea-3.html
new file mode 100644
index 000000000..e4ed681f4
--- /dev/null
+++ b/layout/reftests/font-inflation/textarea-3.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<style>
+div { font-size: 12px; line-height: 1.0; width: 450px }
+textarea { font-size: 12px; }
+textarea { line-height: 1.0 }
+</style>
+<!--
+In a 450px container, the minimum font size at 15em per line is 30px.
+This means we map 0px-45px into 30px-45px, so 12px gets mapped to 34px.
+-->
+<div><textarea>Hello world</textarea></div>
diff --git a/layout/reftests/font-inflation/threshold-1a.html b/layout/reftests/font-inflation/threshold-1a.html
new file mode 100644
index 000000000..0c204707b
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-1a.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+</style>
+<p>123456789
+123456789
+123456789
+123456789
+123456789</p>
diff --git a/layout/reftests/font-inflation/threshold-1b-ref.html b/layout/reftests/font-inflation/threshold-1b-ref.html
new file mode 100644
index 000000000..3f6a472a2
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-1b-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { font-size: 44px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+123456789
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-1b.html b/layout/reftests/font-inflation/threshold-1b.html
new file mode 100644
index 000000000..76d7ebd77
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-1b.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+123456789
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-1c-ref.html b/layout/reftests/font-inflation/threshold-1c-ref.html
new file mode 100644
index 000000000..f4ba6ed80
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-1c-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { font-size: 44px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+123456789
+123456789
+12345678901</p>
diff --git a/layout/reftests/font-inflation/threshold-1c.html b/layout/reftests/font-inflation/threshold-1c.html
new file mode 100644
index 000000000..9548035cc
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-1c.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+123456789
+123456789
+12345678901</p>
diff --git a/layout/reftests/font-inflation/threshold-2-ref.html b/layout/reftests/font-inflation/threshold-2-ref.html
new file mode 100644
index 000000000..8aa266621
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-2-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: separate blocks count together</title>
+<style>
+body { font-size: 44px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>1234567890</p>
+<p>123456789
+123456789
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-2.html b/layout/reftests/font-inflation/threshold-2.html
new file mode 100644
index 000000000..cdd7413eb
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-2.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: separate blocks count together</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>1234567890</p>
+<p>123456789
+123456789
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-3-ref.html b/layout/reftests/font-inflation/threshold-3-ref.html
new file mode 100644
index 000000000..5deaac49b
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-3-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: separate blocks count together</title>
+<style>
+body { font-size: 44px; width: 600px; }
+h1, p { margin: 0 }
+h1 { font-size: 56px; }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>1234567890</p>
+<h1>Heading</h1>
+<p>123456789
+123456789
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-3.html b/layout/reftests/font-inflation/threshold-3.html
new file mode 100644
index 000000000..eb842c511
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-3.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: separate blocks count together</title>
+<style>
+body { font-size: 12px; width: 600px; }
+h1, p { margin: 0 }
+h1 { font-size: 48px; }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>1234567890</p>
+<h1>Heading</h1>
+<p>123456789
+123456789
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-input-text-contents-at-1-ref.html b/layout/reftests/font-inflation/threshold-input-text-contents-at-1-ref.html
new file mode 100644
index 000000000..472ccc62b
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-input-text-contents-at-1-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, input { font-size: 44px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<input size="10" value="hi">
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-input-text-contents-at-1.html b/layout/reftests/font-inflation/threshold-input-text-contents-at-1.html
new file mode 100644
index 000000000..b277c6556
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-input-text-contents-at-1.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, input { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<input size="10" value="hi">
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-input-text-contents-at-2-ref.html b/layout/reftests/font-inflation/threshold-input-text-contents-at-2-ref.html
new file mode 100644
index 000000000..639d05e8b
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-input-text-contents-at-2-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, input { font-size: 44px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<input size="10" value="this is a lot of text but it doesn't have an effect">
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-input-text-contents-at-2.html b/layout/reftests/font-inflation/threshold-input-text-contents-at-2.html
new file mode 100644
index 000000000..a26f0e92e
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-input-text-contents-at-2.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, input { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<input size="10" value="this is a lot of text but it doesn't have an effect">
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-input-text-contents-under-1.html b/layout/reftests/font-inflation/threshold-input-text-contents-under-1.html
new file mode 100644
index 000000000..d464c66ab
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-input-text-contents-under-1.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, input { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<input size="9" value="hi">
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-input-text-contents-under-2.html b/layout/reftests/font-inflation/threshold-input-text-contents-under-2.html
new file mode 100644
index 000000000..adf81cb9e
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-input-text-contents-under-2.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, input { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<input size="9" value="this is a lot of text but it doesn't have an effect">
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-scope-cell-1-ref.html b/layout/reftests/font-inflation/threshold-scope-cell-1-ref.html
new file mode 100644
index 000000000..4e06fa9d8
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-scope-cell-1-ref.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: scope of accumulation</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+table { border-spacing: 0 } /* FIXME: why is this needed? Something to do with ComputeDescendantWidth in nsFontInflationData? */
+td { padding: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<table><tr><td style="width: 600px; font-size: 44px">123456789
+123456789
+123456789
+123456789
+1234567890</td></tr>
+<tr><td>123456789
+123456789
+123456789
+123456789
+123456789</td></tr>
+</table>
+<p>123456789
+123456789
+123456789
+123456789
+123456789</p>
diff --git a/layout/reftests/font-inflation/threshold-scope-cell-1.html b/layout/reftests/font-inflation/threshold-scope-cell-1.html
new file mode 100644
index 000000000..85e8f6f0d
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-scope-cell-1.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: scope of accumulation</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+table { border-spacing: 0 } /* FIXME: why is this needed? Something to do with ComputeDescendantWidth in nsFontInflationData? */
+td { padding: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<table><tr><td style="width: 600px">123456789
+123456789
+123456789
+123456789
+1234567890</td></tr>
+<tr><td>123456789
+123456789
+123456789
+123456789
+123456789</td></tr>
+</table>
+<p>123456789
+123456789
+123456789
+123456789
+123456789</p>
diff --git a/layout/reftests/font-inflation/threshold-scope-cell-2-ref.html b/layout/reftests/font-inflation/threshold-scope-cell-2-ref.html
new file mode 100644
index 000000000..f42a2fc38
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-scope-cell-2-ref.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: scope of accumulation</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+table { border-spacing: 0 } /* FIXME: why is this needed? Something to do with ComputeDescendantWidth in nsFontInflationData? */
+td { padding: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<table><tr><td style="width: 600px">123456789
+123456789
+123456789
+123456789
+123456789</td></tr>
+<tr><td style="font-size: 44px">123456789
+123456789
+123456789
+123456789
+1234567890</td></tr>
+</table>
+<p>123456789
+123456789
+123456789
+123456789
+123456789</p>
diff --git a/layout/reftests/font-inflation/threshold-scope-cell-2.html b/layout/reftests/font-inflation/threshold-scope-cell-2.html
new file mode 100644
index 000000000..3e485793c
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-scope-cell-2.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: scope of accumulation</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+table { border-spacing: 0 } /* FIXME: why is this needed? Something to do with ComputeDescendantWidth in nsFontInflationData? */
+td { padding: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<table><tr><td style="width: 600px">123456789
+123456789
+123456789
+123456789
+123456789</td></tr>
+<tr><td>123456789
+123456789
+123456789
+123456789
+1234567890</td></tr>
+</table>
+<p>123456789
+123456789
+123456789
+123456789
+123456789</p>
diff --git a/layout/reftests/font-inflation/threshold-scope-cell-3-ref.html b/layout/reftests/font-inflation/threshold-scope-cell-3-ref.html
new file mode 100644
index 000000000..3bb1f74a2
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-scope-cell-3-ref.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: scope of accumulation</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<table><tr><td style="width: 600px">123456789
+123456789
+123456789
+123456789
+123456789</td></tr>
+<tr><td>123456789
+123456789
+123456789
+123456789
+123456789</td></tr>
+</table>
+<p style="font-size: 44px">123456789
+123456789
+123456789
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-scope-cell-3.html b/layout/reftests/font-inflation/threshold-scope-cell-3.html
new file mode 100644
index 000000000..0d71335c0
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-scope-cell-3.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: scope of accumulation</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<table><tr><td style="width: 600px">123456789
+123456789
+123456789
+123456789
+123456789</td></tr>
+<tr><td>123456789
+123456789
+123456789
+123456789
+123456789</td></tr>
+</table>
+<p>123456789
+123456789
+123456789
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-scope-float-1-ref.html b/layout/reftests/font-inflation/threshold-scope-float-1-ref.html
new file mode 100644
index 000000000..54b1b4de8
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-scope-float-1-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: scope of accumulation</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p style="float:right; width: 600px; font-size: 44px">123456789
+123456789
+123456789
+123456789
+1234567890</p>
+<p>123456789
+123456789
+123456789
+123456789
+123456789</p>
diff --git a/layout/reftests/font-inflation/threshold-scope-float-1.html b/layout/reftests/font-inflation/threshold-scope-float-1.html
new file mode 100644
index 000000000..75aa541b8
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-scope-float-1.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: scope of accumulation</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p style="float:right; width: 600px">123456789
+123456789
+123456789
+123456789
+1234567890</p>
+<p>123456789
+123456789
+123456789
+123456789
+123456789</p>
diff --git a/layout/reftests/font-inflation/threshold-scope-float-2-ref.html b/layout/reftests/font-inflation/threshold-scope-float-2-ref.html
new file mode 100644
index 000000000..7b0f11dfc
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-scope-float-2-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: scope of accumulation</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p style="float:right; width: 600px">123456789
+123456789
+123456789
+123456789
+123456789</p>
+<p style="font-size: 44px">123456789
+123456789
+123456789
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-scope-float-2.html b/layout/reftests/font-inflation/threshold-scope-float-2.html
new file mode 100644
index 000000000..f8078f6b2
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-scope-float-2.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: scope of accumulation</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p style="float:right; width: 600px">123456789
+123456789
+123456789
+123456789
+123456789</p>
+<p>123456789
+123456789
+123456789
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-scope-float-overflow-1-ref.html b/layout/reftests/font-inflation/threshold-scope-float-overflow-1-ref.html
new file mode 100644
index 000000000..4fcb6a40c
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-scope-float-overflow-1-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: scope of accumulation</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p style="float:right; overflow: hidden; width: 600px; font-size: 44px">123456789
+123456789
+123456789
+123456789
+1234567890</p>
+<p>123456789
+123456789
+123456789
+123456789
+123456789</p>
diff --git a/layout/reftests/font-inflation/threshold-scope-float-overflow-1.html b/layout/reftests/font-inflation/threshold-scope-float-overflow-1.html
new file mode 100644
index 000000000..11cd34e40
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-scope-float-overflow-1.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: scope of accumulation</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p style="float:right; overflow: hidden; width: 600px">123456789
+123456789
+123456789
+123456789
+1234567890</p>
+<p>123456789
+123456789
+123456789
+123456789
+123456789</p>
diff --git a/layout/reftests/font-inflation/threshold-scope-float-overflow-2-ref.html b/layout/reftests/font-inflation/threshold-scope-float-overflow-2-ref.html
new file mode 100644
index 000000000..73104b9c8
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-scope-float-overflow-2-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: scope of accumulation</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p style="float:right; overflow: hidden; width: 600px">123456789
+123456789
+123456789
+123456789
+123456789</p>
+<p style="font-size: 44px">123456789
+123456789
+123456789
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-scope-float-overflow-2.html b/layout/reftests/font-inflation/threshold-scope-float-overflow-2.html
new file mode 100644
index 000000000..1b57917a9
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-scope-float-overflow-2.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test: scope of accumulation</title>
+<style>
+body { font-size: 12px; width: 600px; }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p style="float:right; overflow: hidden; width: 600px">123456789
+123456789
+123456789
+123456789
+123456789</p>
+<p>123456789
+123456789
+123456789
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-select-combobox-contents-at-1-ref.html b/layout/reftests/font-inflation/threshold-select-combobox-contents-at-1-ref.html
new file mode 100644
index 000000000..9e585c4bc
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-select-combobox-contents-at-1-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, select, option { font-size: 44px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<select>
+ <option>1234567890</option>
+ <option>2</option>
+ <option>3</option>
+</select>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-select-combobox-contents-at-1.html b/layout/reftests/font-inflation/threshold-select-combobox-contents-at-1.html
new file mode 100644
index 000000000..8e24ea46b
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-select-combobox-contents-at-1.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, select, option { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<select>
+ <option>1234567890</option>
+ <option>2</option>
+ <option>3</option>
+</select>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-select-combobox-contents-at-2-ref.html b/layout/reftests/font-inflation/threshold-select-combobox-contents-at-2-ref.html
new file mode 100644
index 000000000..7ccb43a52
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-select-combobox-contents-at-2-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, select, option { font-size: 44px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<select>
+ <option>1234567890</option>
+ <option>23456789</option>
+ <option>3</option>
+</select>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-select-combobox-contents-at-2.html b/layout/reftests/font-inflation/threshold-select-combobox-contents-at-2.html
new file mode 100644
index 000000000..87f5f3ced
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-select-combobox-contents-at-2.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, select, option { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<select>
+ <option>1234567890</option>
+ <option>23456789</option>
+ <option>3</option>
+</select>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-select-combobox-contents-under-1.html b/layout/reftests/font-inflation/threshold-select-combobox-contents-under-1.html
new file mode 100644
index 000000000..a29001f9e
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-select-combobox-contents-under-1.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, select, option { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<select>
+ <option>123456789</option>
+ <option>2</option>
+ <option>3</option>
+</select>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-select-combobox-contents-under-2.html b/layout/reftests/font-inflation/threshold-select-combobox-contents-under-2.html
new file mode 100644
index 000000000..de5e82b55
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-select-combobox-contents-under-2.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, select, option { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<select>
+ <option>123456789</option>
+ <option>23456789</option>
+ <option>3</option>
+</select>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-select-listbox-contents-at-1-ref.html b/layout/reftests/font-inflation/threshold-select-listbox-contents-at-1-ref.html
new file mode 100644
index 000000000..df3ce9742
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-select-listbox-contents-at-1-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, select, option { font-size: 44px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<select size="3">
+ <option>1234567890</option>
+ <option>2</option>
+ <option>3</option>
+</select>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-select-listbox-contents-at-1.html b/layout/reftests/font-inflation/threshold-select-listbox-contents-at-1.html
new file mode 100644
index 000000000..b43e209d5
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-select-listbox-contents-at-1.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, select, option { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<select size="3">
+ <option>1234567890</option>
+ <option>2</option>
+ <option>3</option>
+</select>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-select-listbox-contents-at-2-ref.html b/layout/reftests/font-inflation/threshold-select-listbox-contents-at-2-ref.html
new file mode 100644
index 000000000..7b79a9988
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-select-listbox-contents-at-2-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, select, option { font-size: 44px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<select size="3">
+ <option>1234567890</option>
+ <option>23456789</option>
+ <option>3</option>
+</select>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-select-listbox-contents-at-2.html b/layout/reftests/font-inflation/threshold-select-listbox-contents-at-2.html
new file mode 100644
index 000000000..8b7374e69
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-select-listbox-contents-at-2.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, select, option { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<select size="3">
+ <option>1234567890</option>
+ <option>23456789</option>
+ <option>3</option>
+</select>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-select-listbox-contents-under-1.html b/layout/reftests/font-inflation/threshold-select-listbox-contents-under-1.html
new file mode 100644
index 000000000..777ac09f3
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-select-listbox-contents-under-1.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, select, option { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<select size="3">
+ <option>123456789</option>
+ <option>2</option>
+ <option>3</option>
+</select>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-select-listbox-contents-under-2.html b/layout/reftests/font-inflation/threshold-select-listbox-contents-under-2.html
new file mode 100644
index 000000000..abfada7e3
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-select-listbox-contents-under-2.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, select, option { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<select size="3">
+ <option>123456789</option>
+ <option>23456789</option>
+ <option>3</option>
+</select>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-textarea-contents-at-1-ref.html b/layout/reftests/font-inflation/threshold-textarea-contents-at-1-ref.html
new file mode 100644
index 000000000..5728bb0fd
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-textarea-contents-at-1-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, textarea { font-size: 44px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<textarea rows="2" cols="10">
+hi
+</textarea>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-textarea-contents-at-1.html b/layout/reftests/font-inflation/threshold-textarea-contents-at-1.html
new file mode 100644
index 000000000..d527e070f
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-textarea-contents-at-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, textarea { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<textarea rows="2" cols="10">
+hi
+</textarea>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-textarea-contents-at-2-ref.html b/layout/reftests/font-inflation/threshold-textarea-contents-at-2-ref.html
new file mode 100644
index 000000000..27dd26146
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-textarea-contents-at-2-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, textarea { font-size: 44px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<textarea rows="2" cols="10">
+this is a lot of text but it doesn't have an effect
+</textarea>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-textarea-contents-at-2.html b/layout/reftests/font-inflation/threshold-textarea-contents-at-2.html
new file mode 100644
index 000000000..02989efe1
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-textarea-contents-at-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, textarea { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<textarea rows="2" cols="10">
+this is a lot of text but it doesn't have an effect
+</textarea>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-textarea-contents-under-1.html b/layout/reftests/font-inflation/threshold-textarea-contents-under-1.html
new file mode 100644
index 000000000..7b8b62321
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-textarea-contents-under-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, textarea { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<textarea rows="2" cols="9">
+hi
+</textarea>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/threshold-textarea-contents-under-2.html b/layout/reftests/font-inflation/threshold-textarea-contents-under-2.html
new file mode 100644
index 000000000..82c8faf0f
--- /dev/null
+++ b/layout/reftests/font-inflation/threshold-textarea-contents-under-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<title>font.size.inflation.lineThreshold test</title>
+<style>
+body { width: 600px; }
+body, textarea { font-size: 12px }
+p { margin: 0 }
+</style>
+<!--
+In a 600px container, the minimum font size at 15em per line is 40px.
+This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
+
+Further, with a lineThreshold of 100, we need 50 characters of 12px
+text to meet the line threshold.
+-->
+<p>123456789
+123456789
+<textarea rows="2" cols="9">
+this is a lot of text but it doesn't have an effect
+</textarea>
+123456789
+1234567890</p>
diff --git a/layout/reftests/font-inflation/video-1.html b/layout/reftests/font-inflation/video-1.html
new file mode 100644
index 000000000..a8a4780dd
--- /dev/null
+++ b/layout/reftests/font-inflation/video-1.html
@@ -0,0 +1,2 @@
+<!DOCTYPE HTML>
+<video src="../webm-video/black140x100.webm"></video>
diff --git a/layout/reftests/font-inflation/xul-reflow-1-ref.html b/layout/reftests/font-inflation/xul-reflow-1-ref.html
new file mode 100644
index 000000000..a4ea6e860
--- /dev/null
+++ b/layout/reftests/font-inflation/xul-reflow-1-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<title>Testcase, bug 764354</title>
+<style>
+#outer {
+ width: 300px;
+ height: 100px;
+ background: yellow; color: black;
+}
+.inner {
+ background: aqua; color: black;
+ text-align: center;
+}
+</style>
+
+<div id="outer">
+ <div class="inner">Text</div>
+ <div class="inner">Text</div>
+</div>
diff --git a/layout/reftests/font-inflation/xul-reflow-1.html b/layout/reftests/font-inflation/xul-reflow-1.html
new file mode 100644
index 000000000..929fd9883
--- /dev/null
+++ b/layout/reftests/font-inflation/xul-reflow-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<title>Testcase, bug 764354</title>
+<style>
+#outer {
+ display: -moz-box;
+ overflow: hidden;
+ -moz-box-orient: vertical;
+ width: 300px;
+ height: 100px;
+ background: yellow; color: black;
+}
+.inner {
+ background: aqua; color: black;
+ text-align: center;
+}
+</style>
+
+<div id="outer">
+ <div class="inner">Text</div>
+ <div class="inner">Text</div>
+</div>