Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ All notable changes to this project will be documented in this file. Take a look
* EPUB: Fallback on `reflowable` if the `presentation.layout` hint is missing from a manifest.
* EPUB: Offset of the current selection's `rect` to take into account the vertical padding.
* Improve backward compatibility of JavaScript files using Babel.
* [#193](https://github.com/readium/r2-navigator-kotlin/issues/193) Fixed invisible `<audio>` elements.


## [2.1.1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ internal class HtmlInjector(
val endIncludes = mutableListOf<String>()
val beginIncludes = mutableListOf<String>()
beginIncludes.add(getHtmlLink("/assets/readium-css/${layout.readiumCSSPath}ReadiumCSS-before.css"))

// Fix Readium CSS issue with the positioning of <audio> elements.
// https://github.com/readium/readium-css/issues/94
// https://github.com/readium/r2-navigator-kotlin/issues/193
beginIncludes.add("""
<style>
audio[controls] {
width: revert;
height: revert;
}
</style>
""".trimIndent())

endIncludes.add(getHtmlLink("/assets/readium-css/${layout.readiumCSSPath}ReadiumCSS-after.css"))
endIncludes.add(getHtmlScript("/assets/scripts/readium-reflowable.js"))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ class HtmlInjectorTest {
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="/assets/readium-css/ReadiumCSS-before.css"/>

<style>
audio[controls] {
width: revert;
height: revert;
}
</style>
<title>Publication</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
<link rel="stylesheet" type="text/css" href="/assets/readium-css/ReadiumCSS-after.css"/>
Expand Down Expand Up @@ -49,7 +54,12 @@ class HtmlInjectorTest {
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head xmlns:xlink="http://www.w3.org/1999/xlink"><link rel="stylesheet" type="text/css" href="/assets/readium-css/ReadiumCSS-before.css"/>

<style>
audio[controls] {
width: revert;
height: revert;
}
</style>
<title>Publication</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
<link rel="stylesheet" type="text/css" href="/assets/readium-css/ReadiumCSS-after.css"/>
Expand Down Expand Up @@ -80,7 +90,12 @@ class HtmlInjectorTest {
"""
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head xmlns:xlink="http://www.w3.org/1999/xlink"><link rel="stylesheet" type="text/css" href="/assets/readium-css/ReadiumCSS-before.css"/>
<title>Publication</title><link rel="stylesheet" href="style.css" type="text/css"/><link rel="stylesheet" type="text/css" href="/assets/readium-css/ReadiumCSS-after.css"/>
<style>
audio[controls] {
width: revert;
height: revert;
}
</style><title>Publication</title><link rel="stylesheet" href="style.css" type="text/css"/><link rel="stylesheet" type="text/css" href="/assets/readium-css/ReadiumCSS-after.css"/>
<script type="text/javascript" src="/assets/scripts/readium-reflowable.js"></script>
<style>@import url('https://fonts.googleapis.com/css?family=PT+Serif|Roboto|Source+Sans+Pro|Vollkorn');</style>
<style type="text/css"> @font-face{font-family: "OpenDyslexic"; src:url("/assets/fonts/OpenDyslexic-Regular.otf") format('truetype');}</style>
Expand All @@ -101,7 +116,12 @@ class HtmlInjectorTest {
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><HEAD
xmlns:xlink="http://www.w3.org/1999/xlink"
><link rel="stylesheet" type="text/css" href="/assets/readium-css/ReadiumCSS-before.css"/>
<title>Publication</title><link rel="stylesheet" href="style.css" type="text/css"/><link rel="stylesheet" type="text/css" href="/assets/readium-css/ReadiumCSS-after.css"/>
<style>
audio[controls] {
width: revert;
height: revert;
}
</style><title>Publication</title><link rel="stylesheet" href="style.css" type="text/css"/><link rel="stylesheet" type="text/css" href="/assets/readium-css/ReadiumCSS-after.css"/>
<script type="text/javascript" src="/assets/scripts/readium-reflowable.js"></script>
<style>@import url('https://fonts.googleapis.com/css?family=PT+Serif|Roboto|Source+Sans+Pro|Vollkorn');</style>
<style type="text/css"> @font-face{font-family: "OpenDyslexic"; src:url("/assets/fonts/OpenDyslexic-Regular.otf") format('truetype');}</style>
Expand Down