Skip to content

Commit 754a177

Browse files
authored
Merge pull request #145 from readium/thorium-ports
Thorium ports: - it resolves Letter-spacing for japanese #136 - it resolves User setting to disable/hide ruby #140 - it fixes Width and height safeguards hide audio controls + video #94 - it fixes forcing "start" text alignment (left or right depending on document language) does not work with "inherit" #128
2 parents 738b732 + 7d96198 commit 754a177

33 files changed

Lines changed: 314 additions & 82 deletions

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

css/ReadiumCSS-config.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
@custom-selector :--darken-filter [style*="readium-darken-on"];
4545
@custom-selector :--invert-filter [style*="readium-invert-on"];
4646

47+
/* Hiding ruby */
48+
@custom-selector :--no-ruby [style*="readium-noRuby-on"];
49+
4750
/* Accessibility normalization */
4851
@custom-selector :--a11y-normalize [style*="readium-a11y-on"];
4952

css/dist/ReadMe.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ Disabled user settings:
5454
- `text-align`;
5555
- `hyphens`;
5656
- paragraphs’ indent;
57-
- `word-spacing`;
58-
- `letter-spacing`.
57+
- `word-spacing`.
58+
59+
Added user settings:
60+
61+
- hiding/disabling ruby (mapped to `--USER__noRuby: readium-noRuby-on` flag).
5962

6063
### Vertical
6164

@@ -87,8 +90,11 @@ Disabled user settings:
8790
- `text-align`;
8891
- `hyphens`;
8992
- paragraphs’ indent;
90-
- `word-spacing`;
91-
- `letter-spacing`.
93+
- `word-spacing`.
94+
95+
Added user settings:
96+
97+
- hiding/disabling ruby (mapped to `--USER__noRuby: readium-noRuby-on` flag).
9298

9399
### EBPAJ Polyfill
94100

css/dist/ReadiumCSS-after.css

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Readium CSS (v. 1.0.0-beta.3)
2+
* Readium CSS (v. 1.1.0)
33
* Developers: Jiminy Panoz
44
* Copyright (c) 2017. Readium Foundation. All rights reserved.
55
* Use of this source code is governed by a BSD-style license which is detailed in the
@@ -316,24 +316,12 @@ screen and (min-device-width: 36em) and (max-device-width: 47em) and (orientatio
316316
:root[style*="readium-advanced-on"][style*="--USER__textAlign"] body,
317317
:root[style*="readium-advanced-on"][style*="--USER__textAlign"] *:not(blockquote):not(figcaption) p,
318318
:root[style*="readium-advanced-on"][style*="--USER__textAlign"] li{
319-
text-align:inherit !important;
319+
text-align:var(--USER__textAlign) !important;
320320
-moz-text-align-last:auto !important;
321321
-epub-text-align-last:auto !important;
322322
text-align-last:auto !important;
323323
}
324324

325-
:root[style*="readium-advanced-on"][dir="rtl"][style*="--USER__textAlign: left"],
326-
:root[style*="readium-advanced-on"][dir="rtl"][style*="--USER__textAlign:left"],
327-
:root[style*="readium-advanced-on"][style*="--USER__textAlign: left"] *[dir="rtl"],
328-
:root[style*="readium-advanced-on"][style*="--USER__textAlign:left"] *[dir="rtl"]{
329-
text-align:right;
330-
}
331-
332-
:root[style*="readium-advanced-on"][dir="rtl"][style*="--USER__textAlign: start"],
333-
:root[style*="readium-advanced-on"][dir="rtl"][style*="--USER__textAlign:start"]{
334-
text-align:right;
335-
}
336-
337325
:root[style*="readium-advanced-on"][style*="--USER__textAlign: justify"] body,
338326
:root[style*="readium-advanced-on"][style*="--USER__textAlign:justify"] body{
339327
-webkit-hyphens:auto;

css/dist/ReadiumCSS-before.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Readium CSS (v. 1.0.0-beta.3)
2+
* Readium CSS (v. 1.1.0)
33
* Developers: Jiminy Panoz
44
* Copyright (c) 2017. Readium Foundation. All rights reserved.
55
* Use of this source code is governed by a BSD-style license which is detailed in the
@@ -398,7 +398,7 @@ div{
398398
max-width:var(--RS__maxMediaWidth);
399399
}
400400

401-
img, svg, audio, video{
401+
img, svg, video{
402402
object-fit:contain;
403403

404404
width:auto;
@@ -411,6 +411,13 @@ img, svg, audio, video{
411411
break-inside:avoid;
412412
}
413413

414+
audio{
415+
max-width:100%;
416+
-webkit-column-break-inside:avoid;
417+
page-break-inside:avoid;
418+
break-inside:avoid;
419+
}
420+
414421
table{
415422
max-width:var(--RS__maxMediaWidth);
416423
box-sizing:var(--RS__boxSizingTable);

css/dist/ReadiumCSS-default.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Readium CSS (v. 1.0.0-beta.3)
2+
* Readium CSS (v. 1.1.0)
33
* Developers: Jiminy Panoz
44
* Copyright (c) 2017. Readium Foundation. All rights reserved.
55
* Use of this source code is governed by a BSD-style license which is detailed in the

css/dist/cjk-horizontal/ReadiumCSS-after.css

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Readium CSS (v. 1.0.0-beta.3)
2+
* Readium CSS (v. 1.1.0)
33
* Developers: Jiminy Panoz
44
* Copyright (c) 2017. Readium Foundation. All rights reserved.
55
* Use of this source code is governed by a BSD-style license which is detailed in the
@@ -357,6 +357,24 @@ screen and (min-device-width: 36em) and (max-device-width: 47em) and (orientatio
357357
margin-bottom:var(--USER__paraSpacing) !important;
358358
}
359359

360+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h1,
361+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h2,
362+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h3,
363+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h4,
364+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h5,
365+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h6,
366+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] p,
367+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] li,
368+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] div{
369+
letter-spacing:var(--USER__letterSpacing);
370+
font-variant:none;
371+
}
372+
373+
:root[style*="readium-advanced-on"][style*="readium-noRuby-on"] body rt,
374+
:root[style*="readium-advanced-on"][style*="readium-noRuby-on"] body rp{
375+
display:none;
376+
}
377+
360378
:root[style*="readium-advanced-on"]{
361379
--USER__typeScale:1.2;
362380
}

css/dist/cjk-horizontal/ReadiumCSS-before.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Readium CSS (v. 1.0.0-beta.3)
2+
* Readium CSS (v. 1.1.0)
33
* Developers: Jiminy Panoz
44
* Copyright (c) 2017. Readium Foundation. All rights reserved.
55
* Use of this source code is governed by a BSD-style license which is detailed in the
@@ -370,7 +370,7 @@ div{
370370
max-width:var(--RS__maxMediaWidth);
371371
}
372372

373-
img, svg, audio, video{
373+
img, svg, video{
374374
object-fit:contain;
375375

376376
width:auto;
@@ -383,6 +383,13 @@ img, svg, audio, video{
383383
break-inside:avoid;
384384
}
385385

386+
audio{
387+
max-width:100%;
388+
-webkit-column-break-inside:avoid;
389+
page-break-inside:avoid;
390+
break-inside:avoid;
391+
}
392+
386393
table{
387394
max-width:var(--RS__maxMediaWidth);
388395
box-sizing:var(--RS__boxSizingTable);

css/dist/cjk-horizontal/ReadiumCSS-default.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Readium CSS (v. 1.0.0-beta.3)
2+
* Readium CSS (v. 1.1.0)
33
* Developers: Jiminy Panoz
44
* Copyright (c) 2017. Readium Foundation. All rights reserved.
55
* Use of this source code is governed by a BSD-style license which is detailed in the

css/dist/cjk-vertical/ReadiumCSS-after.css

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Readium CSS (v. 1.0.0-beta.3)
2+
* Readium CSS (v. 1.1.0)
33
* Developers: Jiminy Panoz
44
* Copyright (c) 2017. Readium Foundation. All rights reserved.
55
* Use of this source code is governed by a BSD-style license which is detailed in the
@@ -338,6 +338,24 @@ body{
338338
margin-left:var(--USER__paraSpacing) !important;
339339
}
340340

341+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h1,
342+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h2,
343+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h3,
344+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h4,
345+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h5,
346+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] h6,
347+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] p,
348+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] li,
349+
:root[style*="readium-advanced-on"][style*="--USER__letterSpacing"] div{
350+
letter-spacing:var(--USER__letterSpacing);
351+
font-variant:none;
352+
}
353+
354+
:root[style*="readium-advanced-on"][style*="readium-noRuby-on"] body rt,
355+
:root[style*="readium-advanced-on"][style*="readium-noRuby-on"] body rp{
356+
display:none;
357+
}
358+
341359
:root[style*="readium-advanced-on"]{
342360
--USER__typeScale:1.2;
343361
}

0 commit comments

Comments
 (0)