File tree Expand file tree Collapse file tree 4 files changed +29
-2
lines changed
java/com/adobe/epubcheck/overlay
resources/com/adobe/epubcheck/messages
test/resources/epub3/09-media-overlays Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 1111import com .adobe .epubcheck .messages .MessageId ;
1212import com .adobe .epubcheck .opf .OPFChecker30 ;
1313import com .adobe .epubcheck .opf .ValidationContext ;
14- import com .adobe .epubcheck .opf .XRefChecker ;
1514import com .adobe .epubcheck .opf .XRefChecker .Type ;
1615import com .adobe .epubcheck .util .EpubConstants ;
1716import com .adobe .epubcheck .vocab .AggregateVocab ;
@@ -163,8 +162,17 @@ private void processAudioSrc()
163162 {
164163
165164 URL url = checkURL (currentElement ().getAttribute ("src" ));
165+
166+ // check that the URL has no fragment
167+ if (url .fragment () != null )
168+ {
169+ report .message (MessageId .MED_014 , location (), url .fragment ());
170+ url = URLUtils .docURL (url );
171+ }
172+
166173 if (url != null && context .xrefChecker .isPresent ())
167174 {
175+
168176 // check that the audio type is a core media type resource
169177 String mimeType = context .xrefChecker .get ().getMimeType (url );
170178 if (mimeType != null && !OPFChecker30 .isBlessedAudioType (mimeType ))
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ MED_010=EPUB Content Documents referenced from a Media Overlay must specify the
142142MED_011 =EPUB Content Document referenced from multiple Media Overlay Documents.
143143MED_012 =The "media-overlay" attribute does not match the ID of the Media Overlay that refers to this document.
144144MED_013 =Media Overlay Document referenced from the "media-overlay" attribute does not contain a reference to this Content Document.
145- MED_014 =A non-empty fragment identifier is required.
145+ MED_014 =Media overlay audio file URLs must not have a fragment, but found '#%1$s'.
146146MED_015 =Media overlay text references must be in reading order. Text target "%1$s" is before the previous link target in %2$s order.
147147MED_016 =Media Overlays total duration should be the sum of the durations of all Media Overlays documents.
148148MED_017 =URL fragment should indicate an element ID, but found '#%1$s'.
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <smil xmlns =" http://www.w3.org/ns/SMIL" xmlns : epub =" http://www.idpf.org/2007/ops" version =" 3.0" >
3+ <body >
4+ <par id =" par1" >
5+ <text src =" chapter1.xhtml#text1" />
6+ <audio src =" chapter1.mp3" clipBegin =" 0s" clipEnd =" 10s" />
7+ </par >
8+ <par id =" par2" >
9+ <text src =" chapter1.xhtml#text2" />
10+ <audio src =" chapter1.mp3#fragment" clipBegin =" 10s" clipEnd =" 20s" />
11+ </par >
12+ </body >
13+ </smil >
Original file line number Diff line number Diff line change @@ -92,6 +92,12 @@ Feature: EPUB 3 — Media Overlays
9292
9393 #### 9.2.2.8 The `audio` element
9494
95+ @spec @xref:sec-smil-audio-elem
96+ Scenario : Report an audio file URL with a fragment
97+ When checking document 'audio-src-fragment-error.smil'
98+ Then error MED-014 is reported
99+ And no other errors or warnings are reported
100+
95101 @spec @xref:sec-smil-audio-elem
96102 Scenario : Allow clock values with the full clock syntax (`hh:mm:ss.milli`)
97103 When checking document 'clock-value-full-syntax-valid.smil'
You can’t perform that action at this time.
0 commit comments