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 11
11
import com .adobe .epubcheck .messages .MessageId ;
12
12
import com .adobe .epubcheck .opf .OPFChecker30 ;
13
13
import com .adobe .epubcheck .opf .ValidationContext ;
14
- import com .adobe .epubcheck .opf .XRefChecker ;
15
14
import com .adobe .epubcheck .opf .XRefChecker .Type ;
16
15
import com .adobe .epubcheck .util .EpubConstants ;
17
16
import com .adobe .epubcheck .vocab .AggregateVocab ;
@@ -163,8 +162,17 @@ private void processAudioSrc()
163
162
{
164
163
165
164
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
+
166
173
if (url != null && context .xrefChecker .isPresent ())
167
174
{
175
+
168
176
// check that the audio type is a core media type resource
169
177
String mimeType = context .xrefChecker .get ().getMimeType (url );
170
178
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
142
142
MED_011 =EPUB Content Document referenced from multiple Media Overlay Documents.
143
143
MED_012 =The "media-overlay" attribute does not match the ID of the Media Overlay that refers to this document.
144
144
MED_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'.
146
146
MED_015 =Media overlay text references must be in reading order. Text target "%1$s" is before the previous link target in %2$s order.
147
147
MED_016 =Media Overlays total duration should be the sum of the durations of all Media Overlays documents.
148
148
MED_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
92
92
93
93
#### 9.2.2.8 The `audio` element
94
94
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
+
95
101
@spec @xref:sec-smil-audio-elem
96
102
Scenario : Allow clock values with the full clock syntax (`hh:mm:ss.milli`)
97
103
When checking document 'clock-value-full-syntax-valid.smil'
You can’t perform that action at this time.
0 commit comments