-
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: better check media overlays styling properties
- report schema error RSC-005 when the 'media:active-class' or 'media:playback-active-class' properties are declared more than once. - report schema error RSC-005 when the 'media:active-class' or 'media:playback-active-class' properties define more than once class names. - report new usage CSS-029 when a CSS selector is found referring to the widely-used '-epub-media-overlay-active' or '-epub-media-overlay- playing' class names but no 'media:active-class' or 'media:playback- active-class' properties were declared in the package document. - report new error CSS-030 when the 'media:active-class' or 'media:playback-active-class' properties are declared but no CSS is found in a content document with media overlays. - added various test scenarios for the checks described above. Closs #1218.
- Loading branch information
Showing
54 changed files
with
581 additions
and
5 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
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
Binary file added
BIN
+10.1 KB
...pub3/09-media-overlays/files/mediaoverlays-active-class-inline-valid/EPUB/content_001.mp3
Binary file not shown.
9 changes: 9 additions & 0 deletions
9
...ub3/09-media-overlays/files/mediaoverlays-active-class-inline-valid/EPUB/content_001.smil
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,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<smil xmlns="http://www.w3.org/ns/SMIL" xmlns:epub="http://www.idpf.org/2007/ops" version="3.0"> | ||
<body> | ||
<par id="par1"> | ||
<text src="content_001.xhtml#c01"/> | ||
<audio src="content_001.mp3"/> | ||
</par> | ||
</body> | ||
</smil> |
19 changes: 19 additions & 0 deletions
19
...b3/09-media-overlays/files/mediaoverlays-active-class-inline-valid/EPUB/content_001.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,19 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Minimal EPUB</title> | ||
<style> | ||
.-epub-media-overlay-active { | ||
background-color: yellow; | ||
} | ||
.-epub-media-overlay-playing { | ||
color: gray; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1 id="c01">Loomings</h1> | ||
<p>Call me Ishmael.</p> | ||
</body> | ||
</html> |
14 changes: 14 additions & 0 deletions
14
...rces/epub3/09-media-overlays/files/mediaoverlays-active-class-inline-valid/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,14 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="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>Minimal Nav</title> | ||
</head> | ||
<body> | ||
<nav epub:type="toc"> | ||
<ol> | ||
<li><a href="content_001.xhtml">content 001</a></li> | ||
</ol> | ||
</nav> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
...es/epub3/09-media-overlays/files/mediaoverlays-active-class-inline-valid/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,22 @@ | ||
<?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="media:duration">2.5s</meta> | ||
<meta property="media:duration" refines="#mo_001">2.5s</meta> | ||
<meta property="media:active-class">-epub-media-overlay-active</meta> | ||
<meta property="media:playback-active-class">-epub-media-overlay-playing</meta> | ||
</metadata> | ||
<manifest> | ||
<item id="content_001" href="content_001.xhtml" media-type="application/xhtml+xml" media-overlay="mo_001"/> | ||
<item id="mo_001" href="content_001.smil" media-type="application/smil+xml"/> | ||
<item id="audio_001" href="content_001.mp3" media-type="audio/mpeg"/> | ||
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/> | ||
</manifest> | ||
<spine> | ||
<itemref idref="content_001" /> | ||
</spine> | ||
</package> |
6 changes: 6 additions & 0 deletions
6
...b3/09-media-overlays/files/mediaoverlays-active-class-inline-valid/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,6 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container"> | ||
<rootfiles> | ||
<rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/> | ||
</rootfiles> | ||
</container> |
1 change: 1 addition & 0 deletions
1
.../resources/epub3/09-media-overlays/files/mediaoverlays-active-class-inline-valid/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 |
21 changes: 21 additions & 0 deletions
21
...s/epub3/09-media-overlays/files/mediaoverlays-active-class-multiple-class-names-error.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,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" | ||
xmlns:dc="http://purl.org/dc/elements/1.1/"> | ||
<metadata> | ||
<dc:title>Title</dc:title> | ||
<dc:language>en</dc:language> | ||
<dc:identifier id="uid">NOID</dc:identifier> | ||
<meta property="dcterms:modified">2019-01-01T12:00:00Z</meta> | ||
<meta property="media:active-class">class1 class2</meta> | ||
<!-- Media Overlays Duration Properties --> | ||
<meta property="media:duration">10min</meta> | ||
<meta refines="#mo001" property="media:duration">10min</meta> | ||
</metadata> | ||
<manifest> | ||
<item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml"/> | ||
<item id="mo001" href="mediaoverlay_001.smil" media-type="application/smil+xml"/> | ||
</manifest> | ||
<spine> | ||
<itemref idref="t001"/> | ||
</spine> | ||
</package> |
Binary file added
BIN
+10.1 KB
...edia-overlays/files/mediaoverlays-active-class-style-not-found-error/EPUB/content_001.mp3
Binary file not shown.
9 changes: 9 additions & 0 deletions
9
...dia-overlays/files/mediaoverlays-active-class-style-not-found-error/EPUB/content_001.smil
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,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<smil xmlns="http://www.w3.org/ns/SMIL" xmlns:epub="http://www.idpf.org/2007/ops" version="3.0"> | ||
<body> | ||
<par id="par1"> | ||
<text src="content_001.xhtml#c01"/> | ||
<audio src="content_001.mp3"/> | ||
</par> | ||
</body> | ||
</smil> |
11 changes: 11 additions & 0 deletions
11
...ia-overlays/files/mediaoverlays-active-class-style-not-found-error/EPUB/content_001.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,11 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Minimal EPUB</title> | ||
</head> | ||
<body> | ||
<h1 id="c01">Loomings</h1> | ||
<p>Call me Ishmael.</p> | ||
</body> | ||
</html> |
14 changes: 14 additions & 0 deletions
14
...3/09-media-overlays/files/mediaoverlays-active-class-style-not-found-error/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,14 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="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>Minimal Nav</title> | ||
</head> | ||
<body> | ||
<nav epub:type="toc"> | ||
<ol> | ||
<li><a href="content_001.xhtml">content 001</a></li> | ||
</ol> | ||
</nav> | ||
</body> | ||
</html> |
21 changes: 21 additions & 0 deletions
21
...09-media-overlays/files/mediaoverlays-active-class-style-not-found-error/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,21 @@ | ||
<?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="media:duration">2.5s</meta> | ||
<meta property="media:duration" refines="#mo_001">2.5s</meta> | ||
<meta property="media:active-class">-epub-media-overlay-active</meta> | ||
</metadata> | ||
<manifest> | ||
<item id="content_001" href="content_001.xhtml" media-type="application/xhtml+xml" media-overlay="mo_001"/> | ||
<item id="mo_001" href="content_001.smil" media-type="application/smil+xml"/> | ||
<item id="audio_001" href="content_001.mp3" media-type="audio/mpeg"/> | ||
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/> | ||
</manifest> | ||
<spine> | ||
<itemref idref="content_001" /> | ||
</spine> | ||
</package> |
6 changes: 6 additions & 0 deletions
6
...ia-overlays/files/mediaoverlays-active-class-style-not-found-error/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,6 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container"> | ||
<rootfiles> | ||
<rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/> | ||
</rootfiles> | ||
</container> |
1 change: 1 addition & 0 deletions
1
...s/epub3/09-media-overlays/files/mediaoverlays-active-class-style-not-found-error/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 |
Binary file added
BIN
+10.1 KB
...verlays/files/mediaoverlays-active-class-stylesheet-undeclared-valid/EPUB/content_001.mp3
Binary file not shown.
9 changes: 9 additions & 0 deletions
9
...erlays/files/mediaoverlays-active-class-stylesheet-undeclared-valid/EPUB/content_001.smil
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,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<smil xmlns="http://www.w3.org/ns/SMIL" xmlns:epub="http://www.idpf.org/2007/ops" version="3.0"> | ||
<body> | ||
<par id="par1"> | ||
<text src="content_001.xhtml#c01"/> | ||
<audio src="content_001.mp3"/> | ||
</par> | ||
</body> | ||
</smil> |
Oops, something went wrong.