Add tests for font.size.inflation.lineThreshold preference and the associated threshold behavior. (Bug 706193, patch 5) r=roc

This commit is contained in:
L. David Baron 2012-04-16 15:32:12 -07:00
parent c1ad19f6be
commit 1b065cd809
24 changed files with 540 additions and 0 deletions

View File

@ -1,3 +1,10 @@
# 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.
test-pref(font.size.inflation.emPerLine,15) 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.lineThreshold,0) == text-2.html text-2-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,0) == text-3.html text-3-ref.html
@ -45,3 +52,18 @@ test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineTh
test-pref(font.size.inflation.emPerLine,15) 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.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.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.lineThreshold,100) == text-1.html text-1.html
test-pref(font.size.inflation.emPerLine,15) 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.lineThreshold,100) == threshold-1b.html threshold-1b-ref.html
test-pref(font.size.inflation.emPerLine,15) 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.lineThreshold,100) == threshold-2.html threshold-2-ref.html
test-pref(font.size.inflation.emPerLine,15) 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.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.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.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.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.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.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.lineThreshold,100) == threshold-scope-cell-3.html threshold-scope-cell-3-ref.html

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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; 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>

View File

@ -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
1234567890</td></tr>
<tr><td>123456789
123456789
123456789
123456789
123456789</td></tr>
</table>
<p>123456789
123456789
123456789
123456789
123456789</p>

View File

@ -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 style="font-size: 44px">123456789
123456789
123456789
123456789
1234567890</td></tr>
</table>
<p>123456789
123456789
123456789
123456789
123456789</p>

View File

@ -0,0 +1,30 @@
<!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>123456789
123456789
123456789
123456789
123456789</td></tr>
<!-- FIXME: Why is it a little off when this width is on the first cell? -->
<tr><td style="width: 600px">123456789
123456789
123456789
123456789
1234567890</td></tr>
</table>
<p>123456789
123456789
123456789
123456789
123456789</p>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>