-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow epub:type on SVG renderable elements
Update the SVG schemas to allow the "epub:type" attribute on all renderable elements, as suggested in w3c/epub-specs#2556. Note: this is a willful violation of the EPUB 3.3 spec, which (at the time of writing) only allows the attribute on structural, shape, and text elements. Fix #1497
- Loading branch information
Showing
8 changed files
with
79 additions
and
79 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
9 changes: 5 additions & 4 deletions
9
src/test/resources/epub3/06-content-document/files/epubtype-not-allowed-error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion
3
src/test/resources/epub3/06-content-document/files/epubtype-valid.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
36 changes: 36 additions & 0 deletions
36
src/test/resources/epub3/06-content-document/files/svg-epubtype-valid.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,36 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:x="http://www.w3.org/1999/xhtml" | ||
xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="en" lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>SVG with epub:type embedded in HTML</title> | ||
</head> | ||
<body> | ||
<section> | ||
<!--epub:type on SVG `svg` element--> | ||
<svg xmlns="http://www.w3.org/2000/svg" epub:type="titlepage" | ||
viewBox="0 0 100 100" version="1.1"> | ||
<desc>Test</desc> | ||
</svg> | ||
|
||
<!--epub:type on SVG `g` element--> | ||
<svg xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 100 100" version="1.1"> | ||
<desc>Test</desc> | ||
<circle cx="50" cy="50" r="50"/> | ||
<g epub:type="notice"> | ||
<circle cx="50" cy="50" r="50"/> | ||
</g> | ||
</svg> | ||
|
||
<!--epub:type on SVG `a` element--> | ||
<svg xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 100 100" version="1.1"> | ||
<desc>Test</desc> | ||
<a epub:type="noteref" href="#note" id="ref"> | ||
</a> | ||
</svg> | ||
<p id="note">a note</p> | ||
</section> | ||
</body> | ||
</html> |
33 changes: 0 additions & 33 deletions
33
src/test/resources/epub3/06-content-document/files/svg-with-epubtype-valid.xhtml
This file was deleted.
Oops, something went wrong.