From eea1574c0fd45137bb697b67898b49eda10493b6 Mon Sep 17 00:00:00 2001 From: MattGarrish Date: Wed, 12 Aug 2020 11:52:39 -0300 Subject: [PATCH] feat: check the epub:textref attribute on Media Overlays body and seq elements - Check the value of the `epub:textref` attribute when found on `body` or `seq` elements - New error MED-014 is reported when a fragment has been specified in `epub:textref` and `src` attributes - RSC-012 is reported when the resource referenced in `epub.textref` could not be found --- .../epubcheck/messages/DefaultSeverities.java | 1 + .../adobe/epubcheck/messages/MessageId.java | 1 + .../epubcheck/overlay/OverlayHandler.java | 63 ++++++++++-------- .../messages/MessageBundle.properties | 1 + .../EPUB/content_001.smil | 2 +- .../EPUB/content_001.xhtml | 2 +- .../EPUB/content_001.mp3 | Bin 0 -> 10363 bytes .../EPUB/content_001.smil | 9 +++ .../EPUB/content_001.xhtml | 11 +++ .../EPUB/nav.xhtml | 14 ++++ .../EPUB/package.opf | 20 ++++++ .../META-INF/container.xml | 6 ++ .../mimetype | 1 + .../EPUB/content_001.mp3 | Bin 0 -> 10363 bytes .../EPUB/content_001.smil | 11 +++ .../EPUB/content_001.xhtml | 11 +++ .../EPUB/nav.xhtml | 14 ++++ .../EPUB/package.opf | 20 ++++++ .../META-INF/container.xml | 6 ++ .../mimetype | 1 + .../EPUB/content_001.smil | 2 +- .../EPUB/content_001.xhtml | 2 +- .../epub3/mediaoverlays-publication.feature | 12 +++- 23 files changed, 179 insertions(+), 31 deletions(-) create mode 100644 src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/content_001.mp3 create mode 100644 src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/content_001.smil create mode 100644 src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/content_001.xhtml create mode 100644 src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/nav.xhtml create mode 100644 src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/package.opf create mode 100644 src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/META-INF/container.xml create mode 100644 src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/mimetype create mode 100644 src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/content_001.mp3 create mode 100644 src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/content_001.smil create mode 100644 src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/content_001.xhtml create mode 100644 src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/nav.xhtml create mode 100644 src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/package.opf create mode 100644 src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/META-INF/container.xml create mode 100644 src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/mimetype diff --git a/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java b/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java index 78dea852e..438ce5eb7 100644 --- a/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java +++ b/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java @@ -150,6 +150,7 @@ private void initialize() severities.put(MessageId.MED_011, Severity.ERROR); severities.put(MessageId.MED_012, Severity.ERROR); severities.put(MessageId.MED_013, Severity.ERROR); + severities.put(MessageId.MED_014, Severity.ERROR); // NAV severities.put(MessageId.NAV_001, Severity.ERROR); diff --git a/src/main/java/com/adobe/epubcheck/messages/MessageId.java b/src/main/java/com/adobe/epubcheck/messages/MessageId.java index 41ebb0ee5..a65c56374 100644 --- a/src/main/java/com/adobe/epubcheck/messages/MessageId.java +++ b/src/main/java/com/adobe/epubcheck/messages/MessageId.java @@ -144,6 +144,7 @@ public enum MessageId implements Comparable MED_011("MED_011"), MED_012("MED_012"), MED_013("MED_013"), + MED_014("MED_014"), // Epub3 based table of content errors NAV_001("NAV-001"), diff --git a/src/main/java/com/adobe/epubcheck/overlay/OverlayHandler.java b/src/main/java/com/adobe/epubcheck/overlay/OverlayHandler.java index c5f9f4217..3b86be119 100644 --- a/src/main/java/com/adobe/epubcheck/overlay/OverlayHandler.java +++ b/src/main/java/com/adobe/epubcheck/overlay/OverlayHandler.java @@ -64,29 +64,28 @@ public void startElement() XMLElement e = parser.getCurrentElement(); String name = e.getName(); - if (name.equals("smil")) - { - vocabs = VocabUtil.parsePrefixDeclaration( - e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "prefix"), RESERVED_VOCABS, - KNOWN_VOCAB_URIS, DEFAULT_VOCAB_URIS, report, - EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber())); - } - else if (name.equals("seq")) - { - processSeq(e); - } - else if (name.equals("text")) - { - processSrc(e); - } - else if (name.equals("audio")) - { - processRef(e.getAttribute("src"), XRefChecker.Type.AUDIO); - checkTime(e.getAttribute("clipBegin"), e.getAttribute("clipEnd")); - } - else if (name.equals("body") || name.equals("par")) - { - checkType(e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "type")); + switch (name) { + case "smil": + vocabs = VocabUtil.parsePrefixDeclaration( + e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "prefix"), RESERVED_VOCABS, + KNOWN_VOCAB_URIS, DEFAULT_VOCAB_URIS, report, + EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber())); + break; + + case "body": + case "seq": + case "par": + processGlobalAttrs(e); + break; + + case "text": + processSrc(e); + break; + + case "audio": + processRef(e.getAttribute("src"), XRefChecker.Type.AUDIO); + checkTime(e.getAttribute("clipBegin"), e.getAttribute("clipEnd")); + break; } } @@ -163,6 +162,7 @@ private void processRef(String ref, XRefChecker.Type type) } } else { + checkFragment(ref); String uniqueResource = PathUtil.removeFragment(ref); if (!Strings.isNullOrEmpty(uniqueResource)) { if (!context.overlayTextChecker.get().add(uniqueResource, context.opfItem.get().getId())) { @@ -175,10 +175,12 @@ private void processRef(String ref, XRefChecker.Type type) } } - private void processSeq(XMLElement e) + private void processGlobalAttrs(XMLElement e) { - processRef(e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "textref"), - XRefChecker.Type.HYPERLINK); + if (!e.getName().equals("audio")) { + processRef(e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "textref"), + XRefChecker.Type.HYPERLINK); + } checkType(e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "type")); } @@ -212,4 +214,13 @@ private void checkItemReferences() { } + private void checkFragment(String ref) { + + String frag = PathUtil.getFragment(ref.trim()); + + if (ref.indexOf("#") == -1 || Strings.isNullOrEmpty(frag)) { + // must include a non-empty fragid + report.message(MessageId.MED_014, EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber())); + } + } } diff --git a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties index 41cd66183..b6c3e55e4 100644 --- a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties +++ b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties @@ -137,6 +137,7 @@ MED_010=EPUB Content Documents referenced from a Media Overlay must specify the MED_011=EPUB Content Document referenced from multiple Media Overlay Documents. MED_012=The "media-overlay" attribute does not match the ID of the Media Overlay that refers to this document. MED_013=Media Overlay Document referenced from the "media-overlay" attribute does not contain a reference to this Content Document. +MED_014=A non-empty fragment identifier is required. #NAV EPUB v3 Table of contents NAV_001=The nav file is not supported for EPUB v2. diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-audio-non-cmt-error/EPUB/content_001.smil b/src/test/resources/epub3/files/epub/mediaoverlays-audio-non-cmt-error/EPUB/content_001.smil index c4406fda7..254786ac5 100644 --- a/src/test/resources/epub3/files/epub/mediaoverlays-audio-non-cmt-error/EPUB/content_001.smil +++ b/src/test/resources/epub3/files/epub/mediaoverlays-audio-non-cmt-error/EPUB/content_001.smil @@ -2,7 +2,7 @@ - + diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-audio-non-cmt-error/EPUB/content_001.xhtml b/src/test/resources/epub3/files/epub/mediaoverlays-audio-non-cmt-error/EPUB/content_001.xhtml index 96ea27c7e..28757800c 100644 --- a/src/test/resources/epub3/files/epub/mediaoverlays-audio-non-cmt-error/EPUB/content_001.xhtml +++ b/src/test/resources/epub3/files/epub/mediaoverlays-audio-non-cmt-error/EPUB/content_001.xhtml @@ -5,7 +5,7 @@ Minimal EPUB -

Loomings

+

Loomings

Call me Ishmael.

diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/content_001.mp3 b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/content_001.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..3f140bbc4f2bba4396e38c140245d027a5aa5681 GIT binary patch literal 10363 zcmeI%XH*ki+bG}=T0lAhL5g(g5PA~`Jrt!&lO|n2s(>x@j?^F^y@T{Fy?2!+2uSY; zDn&Y(L!Ng%-#PDE&-%_;XT3ka`H^H#lDYRa``&wI??EUD0P2T5Rt!^%+(iv)?P2<))_ZYOPqz|Xgj@X zYm`d>Yal1=z?RdOQlMX;B+AT?E*ipA=_@}{te@(@W`8K;J%El>%26BpjsfNW9cTss zyr5w@007juWT(Z1<*e)7dWLz6va9LbqF(qIU&a%2ovcn}eoSU6On8NFyE7C)Y zV$);^sy100Dy|{0n+OHlO!SvUjy=|?a$_- ztJm&;;Yt2n<34a$m@u@t9;iboH5hE2Ga*M2rXystE4%SXOv2j>yPMGS`Qq7pPkm06 zG*ReERA;&uUWm1a+AmU^>hI=^F}Lt0Js^wUdZsX-pEP=NURY@kAor|K8U=}O`rav+ zf0nzc`pO)|Mt*^R-3jm`|C?k^KGrQON$q;>;oR{gk=J(AkopjOZu^#8P)3zy9AS-S zo)#iNr#8Rs9nZ_Hh>#bdMOvRm$|BEZ+ZG#zFrY2Yr-tbZvqsn{LX*wTgF=~duq2IJ zFj?hH)D>!RBh|ro!^>>yX=aIrxII_)DPI^x2hci*Pw{14Tl= zcXi1tk&c9uhi@=dX_AqFRg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T^^2eZL3n_W;Y*vK=1+$CH+lO}mEx=^>bA(*? zAHzOAJGJP%m7AMjg_}5Cp*Iikj6mLByWKSf3ln}y6G^_8B<$x9v1D!VulD$`XT3OC zc!*-aiG!QNMbg)N63Ft#2`MTb-*b%a`1GIw5RK|M6PH8I)Vp$!8ebrR=~!U+ChLB< zD<@asj>T7bbz(q-RB*xhVms zh;ElCOd+FQSv$v%zGjx1p z21v4yU-i3ck$*lTyE*hP&h>05V3t8ey9Y8wh{`{KF&CsA!<^&_x$1?v+#oD5pMRws zg0a)!rn5$DlZCi}16LC$$*q|2QVfVzTLno@CZAY+Cs3lTmciYd*yO-B8vhqwmRHU96L1$o9f|{(9e~xuHLkO?tC=#8VtN znc+hoh!q}l(-5;S*kEaXlGwmiTjA%UdjyYaYN_~ehk`zgv(W?tVx*i~EWSw}@RT5V z+!%*cm~N#)Qh|WN2A9SIU6j8mkTYuvTr(V&H2}cQ&9t=M-wQ^7PttS85#bk LR + + + + + + + diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/content_001.xhtml b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/content_001.xhtml new file mode 100644 index 000000000..28757800c --- /dev/null +++ b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/content_001.xhtml @@ -0,0 +1,11 @@ + + + + + Minimal EPUB + + +

Loomings

+

Call me Ishmael.

+ + diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/nav.xhtml b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/nav.xhtml new file mode 100644 index 000000000..240745e63 --- /dev/null +++ b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/nav.xhtml @@ -0,0 +1,14 @@ + + + + + Minimal Nav + + + + + diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/package.opf b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/package.opf new file mode 100644 index 000000000..d45324410 --- /dev/null +++ b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/EPUB/package.opf @@ -0,0 +1,20 @@ + + + + Minimal EPUB 3.0 + en + NOID + 2017-06-14T00:00:01Z + 2.5s + 2.5s + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/META-INF/container.xml b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/META-INF/container.xml new file mode 100644 index 000000000..318782179 --- /dev/null +++ b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/META-INF/container.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/mimetype b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/mimetype new file mode 100644 index 000000000..57ef03f24 --- /dev/null +++ b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-invalid-error/mimetype @@ -0,0 +1 @@ +application/epub+zip \ No newline at end of file diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/content_001.mp3 b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/content_001.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..3f140bbc4f2bba4396e38c140245d027a5aa5681 GIT binary patch literal 10363 zcmeI%XH*ki+bG}=T0lAhL5g(g5PA~`Jrt!&lO|n2s(>x@j?^F^y@T{Fy?2!+2uSY; zDn&Y(L!Ng%-#PDE&-%_;XT3ka`H^H#lDYRa``&wI??EUD0P2T5Rt!^%+(iv)?P2<))_ZYOPqz|Xgj@X zYm`d>Yal1=z?RdOQlMX;B+AT?E*ipA=_@}{te@(@W`8K;J%El>%26BpjsfNW9cTss zyr5w@007juWT(Z1<*e)7dWLz6va9LbqF(qIU&a%2ovcn}eoSU6On8NFyE7C)Y zV$);^sy100Dy|{0n+OHlO!SvUjy=|?a$_- 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+@er7QKpySLP`$W# z`|Kut-ezNx=tKhAy(bI+3L{d-rGGv8Oks}{nzl&w1!J2TuEN!~TtSU^cbcG7pJ8)_$rfF#s2>B%QdRopadR{Imv9$3c&-K2r`1%Q5CFQLFxZv`Y zbeJ)H1}Mn{PTJLsPkQW%ZOiu8gEceuBk-q=SR;^^ArFJfO!JZF7W)>r*Mqr8w>*T( z<^amO^w&+N?ErvXBmkVhlo?C$0G37@)^t>mK+nRE&c_*p!nY&xAc{oY;RS!XT;6Pk z%`Shtth`UCiFm)(Ek{cSY)lI=(aly&A!F4*tdQY|-xpZ@-&`0!GOXtw9p}ZL=Ng1A z?iBYIuT^^2eZL3n_W;Y*vK=1+$CH+lO}mEx=^>bA(*? zAHzOAJGJP%m7AMjg_}5Cp*Iikj6mLByWKSf3ln}y6G^_8B<$x9v1D!VulD$`XT3OC zc!*-aiG!QNMbg)N63Ft#2`MTb-*b%a`1GIw5RK|M6PH8I)Vp$!8ebrR=~!U+ChLB< zD<@asj>T7bbz(q-RB*xhVms zh;ElCOd+FQSv$v%zGjx1p z21v4yU-i3ck$*lTyE*hP&h>05V3t8ey9Y8wh{`{KF&CsA!<^&_x$1?v+#oD5pMRws zg0a)!rn5$DlZCi}16LC$$*q|2QVfVzTLno@CZAY+Cs3lTmciYd*yO-B8vhqwmRHU96L1$o9f|{(9e~xuHLkO?tC=#8VtN znc+hoh!q}l(-5;S*kEaXlGwmiTjA%UdjyYaYN_~ehk`zgv(W?tVx*i~EWSw}@RT5V z+!%*cm~N#)Qh|WN2A9SIU6j8mkTYuvTr(V&H2}cQ&9t=M-wQ^7PttS85#bk LR + + + + + + + + + diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/content_001.xhtml b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/content_001.xhtml new file mode 100644 index 000000000..28757800c --- /dev/null +++ b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/content_001.xhtml @@ -0,0 +1,11 @@ + + + + + Minimal EPUB + + +

Loomings

+

Call me Ishmael.

+ + diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/nav.xhtml b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/nav.xhtml new file mode 100644 index 000000000..240745e63 --- /dev/null +++ b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/nav.xhtml @@ -0,0 +1,14 @@ + + + + + Minimal Nav + + + + + diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/package.opf b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/package.opf new file mode 100644 index 000000000..d45324410 --- /dev/null +++ b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/EPUB/package.opf @@ -0,0 +1,20 @@ + + + + Minimal EPUB 3.0 + en + NOID + 2017-06-14T00:00:01Z + 2.5s + 2.5s + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/META-INF/container.xml b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/META-INF/container.xml new file mode 100644 index 000000000..318782179 --- /dev/null +++ b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/META-INF/container.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/mimetype b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/mimetype new file mode 100644 index 000000000..57ef03f24 --- /dev/null +++ b/src/test/resources/epub3/files/epub/mediaoverlays-fragid-resolve-error/mimetype @@ -0,0 +1 @@ +application/epub+zip \ No newline at end of file diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-minimal-valid/EPUB/content_001.smil b/src/test/resources/epub3/files/epub/mediaoverlays-minimal-valid/EPUB/content_001.smil index 73d8477bb..11a9a791c 100644 --- a/src/test/resources/epub3/files/epub/mediaoverlays-minimal-valid/EPUB/content_001.smil +++ b/src/test/resources/epub3/files/epub/mediaoverlays-minimal-valid/EPUB/content_001.smil @@ -2,7 +2,7 @@ - + diff --git a/src/test/resources/epub3/files/epub/mediaoverlays-minimal-valid/EPUB/content_001.xhtml b/src/test/resources/epub3/files/epub/mediaoverlays-minimal-valid/EPUB/content_001.xhtml index 96ea27c7e..28757800c 100644 --- a/src/test/resources/epub3/files/epub/mediaoverlays-minimal-valid/EPUB/content_001.xhtml +++ b/src/test/resources/epub3/files/epub/mediaoverlays-minimal-valid/EPUB/content_001.xhtml @@ -5,7 +5,7 @@ Minimal EPUB -

Loomings

+

Loomings

Call me Ishmael.

diff --git a/src/test/resources/epub3/mediaoverlays-publication.feature b/src/test/resources/epub3/mediaoverlays-publication.feature index 1a6bc4201..e0a570e46 100644 --- a/src/test/resources/epub3/mediaoverlays-publication.feature +++ b/src/test/resources/epub3/mediaoverlays-publication.feature @@ -28,7 +28,17 @@ Feature: EPUB 3 ▸ Media Overlays ▸ Full Publication Checks Then error MED-011 is reported And no other errors or warnings are reported - ### The audio Element + Scenario: Report empty fragment identifiers + When checking EPUB 'mediaoverlays-fragid-invalid-error' + Then error MED-014 is reported 2 times + And no other errors or warnings are reported + + Scenario: Report a fragment identifier that does not resolve to an element + When checking EPUB 'mediaoverlays-fragid-resolve-error' + Then error RSC-012 is reported + And no other errors or warnings are reported + + ### 2.4.8 The audio Element Scenario: Report an audio clip that is not a Core Media Type When checking EPUB 'mediaoverlays-audio-non-cmt-error'