diff --git a/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java b/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java index 6590269e3..84ed58854 100644 --- a/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java +++ b/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java @@ -245,7 +245,7 @@ else if (name.equals("script")) { requiredProperties.add(ITEM_PROPERTIES.SCRIPTED); } - else if (!context.mimeType.equals("image/svg+xml") && name.equals("switch")) + else if (EpubConstants.EpubTypeNamespaceUri.equals(e.getNamespace()) && name.equals("switch")) { requiredProperties.add(ITEM_PROPERTIES.SWITCH); } diff --git a/src/test/java/com/adobe/epubcheck/api/Epub30CheckExpandedTest.java b/src/test/java/com/adobe/epubcheck/api/Epub30CheckExpandedTest.java index 7bf940d1d..d531b6efa 100644 --- a/src/test/java/com/adobe/epubcheck/api/Epub30CheckExpandedTest.java +++ b/src/test/java/com/adobe/epubcheck/api/Epub30CheckExpandedTest.java @@ -418,6 +418,13 @@ public void testValidateEPUB30_svgReferenced() testValidateDocument("valid/svg-referenced/"); } + @Test + public void testValidateEPUB30_svgSwitch() + { + // tests that svg:switch doesn't trigger the OPF 'switch' property check + testValidateDocument("valid/svg-switch/"); + } + @Test public void testValidateEPUB30_videoAudioTrigger() { diff --git a/src/test/resources/30/expanded/valid/svg-switch/META-INF/container.xml b/src/test/resources/30/expanded/valid/svg-switch/META-INF/container.xml new file mode 100644 index 000000000..cd9945b48 --- /dev/null +++ b/src/test/resources/30/expanded/valid/svg-switch/META-INF/container.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/test/resources/30/expanded/valid/svg-switch/OPS/content_001.xhtml b/src/test/resources/30/expanded/valid/svg-switch/OPS/content_001.xhtml new file mode 100644 index 000000000..fcf046a09 --- /dev/null +++ b/src/test/resources/30/expanded/valid/svg-switch/OPS/content_001.xhtml @@ -0,0 +1,22 @@ + + + + + Minimal EPUB + + +

Loomings

+

Call me Ishmael.

+ + + +

foo

+
+ + bar + +
+
+ + diff --git a/src/test/resources/30/expanded/valid/svg-switch/OPS/nav.xhtml b/src/test/resources/30/expanded/valid/svg-switch/OPS/nav.xhtml new file mode 100644 index 000000000..fb044b8c6 --- /dev/null +++ b/src/test/resources/30/expanded/valid/svg-switch/OPS/nav.xhtml @@ -0,0 +1,19 @@ + + + + + Minimal Nav + + + + + + diff --git a/src/test/resources/30/expanded/valid/svg-switch/OPS/package.opf b/src/test/resources/30/expanded/valid/svg-switch/OPS/package.opf new file mode 100644 index 000000000..7ce8b2f1a --- /dev/null +++ b/src/test/resources/30/expanded/valid/svg-switch/OPS/package.opf @@ -0,0 +1,16 @@ + + + + Minimal EPUB 3.0 + en + NOID + 2017-06-14T00:00:01Z + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/30/expanded/valid/svg-switch/mimetype b/src/test/resources/30/expanded/valid/svg-switch/mimetype new file mode 100644 index 000000000..57ef03f24 --- /dev/null +++ b/src/test/resources/30/expanded/valid/svg-switch/mimetype @@ -0,0 +1 @@ +application/epub+zip \ No newline at end of file