-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support new rules related to FXL SVG sizing
This change implements the new rules related to expressing the initial containing block dimensions for SVG documents in Fixed Layout EPUBs. New messages: - `HTM-054` (`WARNING`): when the size is given by `width`/`height` attributes, but the recommended `viewBox` attribute is missing - `HTM-055` (`WARNING`): when the values of the `height` and `width` attributes are not specified in pixels, and `viewBox` is not present Changed message: - `HTM-048` (`ERROR`): now says that either `viewBox` or `height` and `width` must be present Bug fix: - Only the outer SVG element is checked (previously, all the `svg` elements where checked). Fix #902. Note: the checking logic may need to be tweaked depending on the outcome of issue w3c/epub-specs#1236
- Loading branch information
1 parent
ac2f1bd
commit 17f5eee
Showing
41 changed files
with
299 additions
and
734 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
.../resources/30/expanded/invalid/fxl-svg-no-viewbox-no-heightwidth/EPUB/cover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/test/resources/30/expanded/invalid/fxl-svg-no-viewbox-no-heightwidth/EPUB/package.opf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" xml:lang="en" unique-identifier="q"> | ||
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/"> | ||
<dc:title id="title">Minimal EPUB 3.0</dc:title> | ||
<dc:language>en</dc:language> | ||
<dc:identifier id="q">NOID</dc:identifier> | ||
<meta property="dcterms:modified">2017-06-14T00:00:01Z</meta> | ||
<meta property="rendition:layout">pre-paginated</meta> | ||
</metadata> | ||
<manifest> | ||
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/> | ||
<item id="cover" href="cover.svg" media-type="image/svg+xml"/> | ||
</manifest> | ||
<spine> | ||
<itemref idref="nav" linear="no"/> | ||
<itemref idref="cover"/> | ||
</spine> | ||
</package> |
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...es/30/expanded/invalid/fxl-svg-no-viewbox-widthheight-in-percent/EPUB/cover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
...st/resources/30/expanded/invalid/fxl-svg-no-viewbox-widthheight-in-percent/EPUB/nav.xhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la" | ||
xmlns:epub="http://www.idpf.org/2007/ops"> | ||
<head> | ||
<title>Nav Doc</title> | ||
<meta name="viewport" content="width=1200, height=600" /> | ||
</head> | ||
<body> | ||
<h2>Table of Contents</h2> | ||
<nav epub:type="toc"> | ||
<ol> | ||
<li><a href="cover.svg">Cover</a></li> | ||
</ol> | ||
</nav> | ||
</body> | ||
</html> |
18 changes: 18 additions & 0 deletions
18
.../resources/30/expanded/invalid/fxl-svg-no-viewbox-widthheight-in-percent/EPUB/package.opf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" xml:lang="en" unique-identifier="q"> | ||
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/"> | ||
<dc:title id="title">Minimal EPUB 3.0</dc:title> | ||
<dc:language>en</dc:language> | ||
<dc:identifier id="q">NOID</dc:identifier> | ||
<meta property="dcterms:modified">2017-06-14T00:00:01Z</meta> | ||
<meta property="rendition:layout">pre-paginated</meta> | ||
</metadata> | ||
<manifest> | ||
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/> | ||
<item id="cover" href="cover.svg" media-type="image/svg+xml"/> | ||
</manifest> | ||
<spine> | ||
<itemref idref="nav" linear="no"/> | ||
<itemref idref="cover"/> | ||
</spine> | ||
</package> |
7 changes: 7 additions & 0 deletions
7
...rces/30/expanded/invalid/fxl-svg-no-viewbox-widthheight-in-percent/META-INF/container.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0"> | ||
<rootfiles> | ||
<rootfile full-path="EPUB/package.opf" | ||
media-type="application/oebps-package+xml"/> | ||
</rootfiles> | ||
</container> |
1 change: 1 addition & 0 deletions
1
src/test/resources/30/expanded/invalid/fxl-svg-no-viewbox-widthheight-in-percent/mimetype
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
application/epub+zip |
5 changes: 5 additions & 0 deletions
5
src/test/resources/30/expanded/invalid/fxl-svg-no-viewbox/EPUB/cover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
src/test/resources/30/expanded/invalid/fxl-svg-no-viewbox/EPUB/nav.xhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la" | ||
xmlns:epub="http://www.idpf.org/2007/ops"> | ||
<head> | ||
<title>Nav Doc</title> | ||
<meta name="viewport" content="width=1200, height=600" /> | ||
</head> | ||
<body> | ||
<h2>Table of Contents</h2> | ||
<nav epub:type="toc"> | ||
<ol> | ||
<li><a href="cover.svg">Cover</a></li> | ||
</ol> | ||
</nav> | ||
</body> | ||
</html> |
18 changes: 18 additions & 0 deletions
18
src/test/resources/30/expanded/invalid/fxl-svg-no-viewbox/EPUB/package.opf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" xml:lang="en" unique-identifier="q"> | ||
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/"> | ||
<dc:title id="title">Minimal EPUB 3.0</dc:title> | ||
<dc:language>en</dc:language> | ||
<dc:identifier id="q">NOID</dc:identifier> | ||
<meta property="dcterms:modified">2017-06-14T00:00:01Z</meta> | ||
<meta property="rendition:layout">pre-paginated</meta> | ||
</metadata> | ||
<manifest> | ||
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/> | ||
<item id="cover" href="cover.svg" media-type="image/svg+xml"/> | ||
</manifest> | ||
<spine> | ||
<itemref idref="nav" linear="no"/> | ||
<itemref idref="cover"/> | ||
</spine> | ||
</package> |
7 changes: 7 additions & 0 deletions
7
src/test/resources/30/expanded/invalid/fxl-svg-no-viewbox/META-INF/container.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0"> | ||
<rootfiles> | ||
<rootfile full-path="EPUB/package.opf" | ||
media-type="application/oebps-package+xml"/> | ||
</rootfiles> | ||
</container> |
1 change: 1 addition & 0 deletions
1
src/test/resources/30/expanded/invalid/fxl-svg-no-viewbox/mimetype
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
application/epub+zip |
Oops, something went wrong.