diff --git a/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java b/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java index 89c5344e1..70c47db76 100644 --- a/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java +++ b/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java @@ -71,7 +71,7 @@ private void initialize() severities.put(MessageId.CSS_002, Severity.ERROR); severities.put(MessageId.CSS_003, Severity.WARNING); severities.put(MessageId.CSS_004, Severity.ERROR); - severities.put(MessageId.CSS_005, Severity.ERROR); + severities.put(MessageId.CSS_005, Severity.USAGE); severities.put(MessageId.CSS_006, Severity.USAGE); severities.put(MessageId.CSS_007, Severity.INFO); severities.put(MessageId.CSS_008, Severity.ERROR); diff --git a/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java b/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java index cb558beb2..290a042ae 100644 --- a/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java +++ b/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java @@ -46,6 +46,7 @@ import com.adobe.epubcheck.vocab.StagingEdupubVocab; import com.adobe.epubcheck.vocab.StructureVocab; import com.adobe.epubcheck.vocab.StructureVocab.EPUB_TYPES; +import com.adobe.epubcheck.vocab.UncheckedVocab; import com.adobe.epubcheck.vocab.Vocab; import com.adobe.epubcheck.vocab.VocabUtil; import com.adobe.epubcheck.xml.model.XMLAttribute; @@ -69,7 +70,7 @@ public class OPSHandler30 extends OPSHandler MagazineNavigationVocab.PREFIX, MagazineNavigationVocab.VOCAB, ForeignVocabs.PRISM_PREFIX, ForeignVocabs.PRISM_VOCAB); private static Map ALTCSS_VOCABS = ImmutableMap. of("", - AltStylesheetVocab.VOCAB); + AggregateVocab.of(AltStylesheetVocab.VOCAB, new UncheckedVocab("", ""))); private static Map KNOWN_VOCAB_URIS = ImmutableMap.of(MagazineNavigationVocab.URI, MagazineNavigationVocab.VOCAB, ForeignVocabs.PRISM_URI, ForeignVocabs.PRISM_VOCAB); private static Set DEFAULT_VOCAB_URIS = ImmutableSet.of(StructureVocab.URI); diff --git a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties index 0db941e50..ea63d663f 100644 --- a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties +++ b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties @@ -27,7 +27,7 @@ CSS_001=The "%1$s" property must not be included in an EPUB Style Sheet. CSS_002=Empty or NULL reference found. CSS_003=CSS document is encoded in UTF-16. It should be encoded in UTF-8 instead. CSS_004=CSS documents must be encoded in UTF-8, detected %1%s; -CSS_005=Conflicting alternate style attributes found: %1$s. +CSS_005=Conflicting alternate style tags found: %1$s. CSS_006=CSS selector specifies fixed position. CSS_007=Font-face reference "%1$s" refers to non-standard font type "%2$s". CSS_008=An error occurred while parsing the CSS: %1$s. diff --git a/src/test/resources/epub3/06-content-document/content-document-xhtml.feature b/src/test/resources/epub3/06-content-document/content-document-xhtml.feature index e9456c732..e91e52b8f 100644 --- a/src/test/resources/epub3/06-content-document/content-document-xhtml.feature +++ b/src/test/resources/epub3/06-content-document/content-document-xhtml.feature @@ -367,14 +367,23 @@ Feature: EPUB 3 — Content Documents — XHTML #### Links Scenario: Verify a `link` element with a known alt style tag - When checking document 'link-alt-style-tags-valid.xhtml' + Given the reporting level is set to usage + When checking document 'link-alt-style-tags-known-valid.xhtml' + Then no usages are reported + And no errors or warnings are reported + + Scenario: Report a `link` element with an unknown alt style tag + Given the reporting level is set to usage + When checking document 'link-alt-style-tags-unknown-valid.xhtml' Then no errors or warnings are reported + And no usages are reported Scenario: Report a `link` element with an unknown alt style tag - When checking document 'link-alt-style-tags-error.xhtml' - Then error OPF-027 is reported - And error CSS-005 is reported - And no other errors or warnings are reported + Given the reporting level is set to usage + When checking document 'link-alt-style-tags-conflict-usage.xhtml' + Then no errors or warnings are reported + And usage CSS-005 is reported + But no other usages are reported Scenario: Verify `link` elements used to declare alternative stylesheets When checking document 'link-rel-stylesheet-alternate-valid.xhtml' diff --git a/src/test/resources/epub3/06-content-document/files/link-alt-style-tags-conflict-usage.xhtml b/src/test/resources/epub3/06-content-document/files/link-alt-style-tags-conflict-usage.xhtml new file mode 100644 index 000000000..56d57496f --- /dev/null +++ b/src/test/resources/epub3/06-content-document/files/link-alt-style-tags-conflict-usage.xhtml @@ -0,0 +1,9 @@ + + + + + alt style tag css declaration + + + + diff --git a/src/test/resources/epub3/06-content-document/files/link-alt-style-tags-valid.xhtml b/src/test/resources/epub3/06-content-document/files/link-alt-style-tags-known-valid.xhtml similarity index 100% rename from src/test/resources/epub3/06-content-document/files/link-alt-style-tags-valid.xhtml rename to src/test/resources/epub3/06-content-document/files/link-alt-style-tags-known-valid.xhtml diff --git a/src/test/resources/epub3/06-content-document/files/link-alt-style-tags-error.xhtml b/src/test/resources/epub3/06-content-document/files/link-alt-style-tags-unknown-valid.xhtml similarity index 51% rename from src/test/resources/epub3/06-content-document/files/link-alt-style-tags-error.xhtml rename to src/test/resources/epub3/06-content-document/files/link-alt-style-tags-unknown-valid.xhtml index a96443d9c..212d02bbb 100644 --- a/src/test/resources/epub3/06-content-document/files/link-alt-style-tags-error.xhtml +++ b/src/test/resources/epub3/06-content-document/files/link-alt-style-tags-unknown-valid.xhtml @@ -2,8 +2,8 @@ - invalid alt style tag css declaration - + unknown alt style tag css declaration +