Skip to content

Commit 90bf5dd

Browse files
committed
Update tests
Adding test for deprecated font-size implementation and font-size normalize
1 parent ced644a commit 90bf5dd

File tree

3 files changed

+120
-0
lines changed

3 files changed

+120
-0
lines changed

backstop.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@
113113
"selectors": ["document"],
114114
"misMatchThreshold" : 0.1
115115
},
116+
{
117+
"label": "Deprecated font size pref",
118+
"url": "http://localhost:8000/tests/font-size-deprecated.html",
119+
"delay": 0,
120+
"selectors": ["document"],
121+
"misMatchThreshold" : 0.1
122+
},
123+
{
124+
"label": "Font size normalize pref",
125+
"url": "http://localhost:8000/tests/font-size-normalize.html",
126+
"delay": 0,
127+
"selectors": ["document"],
128+
"misMatchThreshold" : 0.1
129+
},
116130
{
117131
"label": "Type scale pref",
118132
"url": "http://localhost:8000/tests/type-scale.html",

tests/font-size-deprecated.html

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!doctype html>
2+
<html style="--USER__view: readium-scroll-on; --USER__fontSizeImplementation: readium-deprecatedFontSize-on; --USER__fontSize: 200%;">
3+
<head>
4+
<title>Test</title>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
7+
<link rel="stylesheet" href="../css/dist/ReadiumCSS-before.css" />
8+
<link rel="stylesheet" href="../css/dist/ReadiumCSS-default.css" />
9+
<link rel="stylesheet" href="../css/dist/ReadiumCSS-after.css" />
10+
</head>
11+
<body>
12+
<h1>Heading 1</h1>
13+
14+
<p>Text. <small>Smaller text</small>. Text followed by sup.<sup>[1]</sup></p>
15+
16+
<h2>Heading 2</h2>
17+
18+
<ul>
19+
<li>List item 1;</li>
20+
<li>List item 2;</li>
21+
<li>List item 3.</li>
22+
</ul>
23+
24+
<h3>Heading 3</h3>
25+
26+
<div style="border: 2px solid red; margin: 1em 0; padding: 0 5%;">
27+
This is an aside.
28+
</div>
29+
30+
<h4>Heading 4</h4>
31+
32+
<dl>
33+
<dt>Artist</dt>
34+
35+
<dd>He desires to paint you the dreamiest, shadiest, quietest, most enchanting bit of romantic landscape in all the valley of the Saco. What is the chief element he employs? There stand his trees, each with a hollow trunk, as if a hermit and a crucifix were within; and here sleeps his meadow, and there sleep his cattle; and up from yonder cottage goes a sleepy smoke.</dd>
36+
</dl>
37+
38+
<h5>Heading 5</h5>
39+
40+
<pre><code>h1 {
41+
font-family: sans-serif;
42+
font-size: 2em;
43+
margin: 1.5em 0;
44+
text-align: center;
45+
}</code></pre>
46+
47+
<h6>Heading 6</h6>
48+
49+
<p>Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation. Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; whenever I find myself involuntarily pausing before coffin warehouses, and bringing up the rear of every funeral I meet; and especially whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent me from deliberately stepping into the street, and methodically knocking people’s hats off—then, I account it high time to get to sea as soon as I can. This is my substitute for pistol and ball. With a philosophical flourish Cato throws himself upon his sword; I quietly take to the ship. There is nothing surprising in this. If they but knew it, almost all men in their degree, some time or other, cherish very nearly the same feelings towards the ocean with me.</p>
50+
</body>
51+
</html>

tests/font-size-normalize.html

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!doctype html>
2+
<html style="--USER__view: readium-scroll-on; --USER__fsImplementation: readium-deprecatedFontSize-on; --USER__fontSize: 200%; --USER__fsNormalize: readium-normalize-on;">
3+
<head>
4+
<title>Test</title>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
7+
<link rel="stylesheet" href="../css/dist/ReadiumCSS-before.css" />
8+
<link rel="stylesheet" href="../css/dist/ReadiumCSS-default.css" />
9+
<link rel="stylesheet" href="../css/dist/ReadiumCSS-after.css" />
10+
<style type="text/css">
11+
h1, h2, h3, h4, h5, h6 { font-size: 16px; }
12+
p, div, li, dt, dd, pre { font-size: 12pt; }
13+
</style>
14+
</head>
15+
<body>
16+
<h1>Heading 1</h1>
17+
18+
<p>Text. <small>Smaller text</small>. Text followed by sup.<sup>[1]</sup></p>
19+
20+
<h2>Heading 2</h2>
21+
22+
<ul>
23+
<li>List item 1;</li>
24+
<li>List item 2;</li>
25+
<li>List item 3.</li>
26+
</ul>
27+
28+
<h3>Heading 3</h3>
29+
30+
<div style="border: 2px solid red; margin: 1em 0; padding: 0 5%;">
31+
This is an aside.
32+
</div>
33+
34+
<h4>Heading 4</h4>
35+
36+
<dl>
37+
<dt>Artist</dt>
38+
39+
<dd>He desires to paint you the dreamiest, shadiest, quietest, most enchanting bit of romantic landscape in all the valley of the Saco. What is the chief element he employs? There stand his trees, each with a hollow trunk, as if a hermit and a crucifix were within; and here sleeps his meadow, and there sleep his cattle; and up from yonder cottage goes a sleepy smoke.</dd>
40+
</dl>
41+
42+
<h5>Heading 5</h5>
43+
44+
<pre><code>h1 {
45+
font-family: sans-serif;
46+
font-size: 2em;
47+
margin: 1.5em 0;
48+
text-align: center;
49+
}</code></pre>
50+
51+
<h6>Heading 6</h6>
52+
53+
<p>Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation. Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; whenever I find myself involuntarily pausing before coffin warehouses, and bringing up the rear of every funeral I meet; and especially whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent me from deliberately stepping into the street, and methodically knocking people’s hats off—then, I account it high time to get to sea as soon as I can. This is my substitute for pistol and ball. With a philosophical flourish Cato throws himself upon his sword; I quietly take to the ship. There is nothing surprising in this. If they but knew it, almost all men in their degree, some time or other, cherish very nearly the same feelings towards the ocean with me.</p>
54+
</body>
55+
</html>

0 commit comments

Comments
 (0)