Skip to content

Commit 6bdfdd1

Browse files
committed
Add tests for new settings
Tests for letter-spacing in CJK and hiding ruby annotations
1 parent 95a0ec0 commit 6bdfdd1

3 files changed

Lines changed: 76 additions & 1 deletion

File tree

backstop.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@
160160
"selectors": ["document"],
161161
"misMatchThreshold" : 0.1
162162
},
163+
{
164+
"label": "Letterspacing CJK pref",
165+
"url": "http://localhost:8000/tests/letter-spacing-cjk.html",
166+
"delay": 0,
167+
"selectors": ["document"],
168+
"misMatchThreshold" : 0.1
169+
},
163170
{
164171
"label": "Ligatures pref",
165172
"url": "http://localhost:8000/tests/arabic-ligatures.html",
@@ -170,7 +177,7 @@
170177
{
171178
"label": "Accessibility font pref",
172179
"url": "http://localhost:8000/tests/a11y-font.html",
173-
"delay": 0,
180+
"delay": 200,
174181
"selectors": ["document"],
175182
"misMatchThreshold" : 0.1
176183
},
@@ -184,6 +191,13 @@
184191
{
185192
"label": "Accessibility custom pref",
186193
"url": "http://localhost:8000/tests/a11y-custom.html",
194+
"delay": 200,
195+
"selectors": ["document"],
196+
"misMatchThreshold" : 0.1
197+
},
198+
{
199+
"label": "no Ruby pref",
200+
"url": "http://localhost:8000/tests/no-ruby.html",
187201
"delay": 0,
188202
"selectors": ["document"],
189203
"misMatchThreshold" : 0.1

tests/letter-spacing-cjk.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!doctype html>
2+
<html style="--USER__view: readium-scroll-on; --USER__advancedSettings: readium-advanced-on; --USER__letterSpacing: 1rem;">
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/cjk-horizontal/ReadiumCSS-before.css" />
8+
<link rel="stylesheet" href="../css/dist/cjk-horizontal/ReadiumCSS-default.css" />
9+
<link rel="stylesheet" href="../css/dist/cjk-horizontal/ReadiumCSS-after.css" />
10+
</head>
11+
<body>
12+
<h1>日本語</h1>
13+
14+
<p><strong>日本語</strong>(にほんご、にっぽんご<sup>[注 1]</sup>)は、主に日本国内や日本人同士の間で使われている言語である。日本は法令によって公用語を規定していないが、法令その他の公用文は全て日本語で記述され、各種法令において日本語を用いることが定められ、学校教育においては「国語」として教えられるなど、事実上、唯一の公用語となっている。</p>
15+
16+
<p>使用人口について正確な統計はないが、日本国内の人口、および日本国外に住む日本人や日系人、日本がかつて統治した地域の一部住民など、約1億3千万人以上と考えられている。統計によって前後する可能性はあるが、この数は世界の母語話者数で上位10位以内に入る人数である。</p>
17+
18+
<p>日本で生まれ育ったほとんどの人は、日本語を母語とする<sup>[注 2]</sup>。日本語の文法体系や音韻体系を反映する手話として日本語対応手話がある。</p>
19+
20+
<p>2017年4月現在、インターネット上の言語使用者数は、英語、中国語、スペイン語、アラビア語、ポルトガル語、マレー語に次いで7番目に多い。</p>
21+
</body>
22+
</html>

tests/no-ruby.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!doctype html>
2+
<html style="--USER__view: readium-scroll-on; --USER__advancedSettings: readium-advanced-on; --USER__noRuby: readium-noRuby-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/cjk-horizontal/ReadiumCSS-before.css" />
8+
<link rel="stylesheet" href="../css/dist/cjk-horizontal/ReadiumCSS-default.css" />
9+
<link rel="stylesheet" href="../css/dist/cjk-horizontal/ReadiumCSS-after.css" />
10+
<style type="text/css">
11+
ruby {
12+
background-color: yellow;
13+
}
14+
rt, rp {
15+
background-color: lightcoral;
16+
}
17+
.spacer {
18+
margin-top: 1rem;
19+
}
20+
</style>
21+
</head>
22+
<body>
23+
<h1>ルビ</h1>
24+
25+
<p>ルビを振りたい親字を含む全体をrubyタグで囲み、その中のrtタグをつけた箇所がルビ部分となる。rubyタグの内側でrpタグで囲った部分は、rubyタグをサポートしていない環境で表示するためのタグであり、rubyタグをサポートしている環境では非表示になる。</p>
26+
27+
<p class="spacer">Ruby to hide: かんじ</p>
28+
29+
<p>表意文字である<ruby>漢字<rp></rp><rt>かんじ</rt><rp></rp></ruby>にルビを振る。</p>
30+
31+
<p class="spacer">Ruby to hide: Kan ji</p>
32+
33+
<p><ruby><rp>(</rp><rt>Kan</rt><rp>)</rp><rp>(</rp><rt>ji</rt><rp>)</rp></ruby></p>
34+
35+
<p class="spacer">Ruby to hide: Ashita</p>
36+
37+
<p><ruby> 明日 <rp>(</rp><rt>Ashita</rt><rp>)</rp> </ruby></p>
38+
</body>
39+
</html>

0 commit comments

Comments
 (0)