File tree Expand file tree Collapse file tree
main/java/org/w3c/epubcheck/core/references
test/resources/epub3/06-content-document
files/object-pdf-fragment-valid Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -169,11 +169,15 @@ else if (MIMEType.SVG.is(targetMimetype) && !fragment.isValid())
169169 {
170170 Reference .Type targetIDType = resourceRegistry .getIDType (fragment .getId (),
171171 targetResource );
172- if (targetIDType == null )
172+
173+ // Check that target ID exists (if the target is XHTML or SVG)
174+ if (targetIDType == null
175+ && (MIMEType .SVG .is (targetMimetype ) || MIMEType .XHTML .is (targetMimetype )))
173176 {
174177 report .message (MessageId .RSC_012 , reference .location .context (reference .url .toString ()));
175178 throw new CheckAbortException ();
176179 }
180+
177181 switch (reference .type )
178182 {
179183 case SVG_PAINT :
Original file line number Diff line number Diff line change @@ -523,6 +523,11 @@ Feature: EPUB 3 — Content Documents — XHTML
523523 And no other errors or warnings are reported
524524
525525
526+ #### Objects
527+
528+ Scenario : Allow fragment identifiers on PDFs
529+ When checking EPUB 'object-pdf-fragment-valid'
530+ Then no errors or warnings are reported
526531
527532 #### Schematron Assertions
528533
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html xmlns:epub ="http://www.idpf.org/2007/ops " xmlns ="http://www.w3.org/1999/xhtml " xml:lang ="en " lang ="en ">
3+ < head >
4+ < meta charset ="utf-8 "/>
5+ < title > Minimal EPUB</ title >
6+ </ head >
7+ < body >
8+ < h1 > Loomings</ h1 >
9+ < p > Call me Ishmael.</ p >
10+ < object data ="test.pdf#view=FitV " type ="application/pdf "> </ object >
11+ </ body >
12+ </ html >
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html xmlns ="http://www.w3.org/1999/xhtml " xmlns:epub ="http://www.idpf.org/2007/ops " xml:lang ="en " lang ="en ">
3+ < head >
4+ < meta charset ="utf-8 "/>
5+ < title > Minimal Nav</ title >
6+ </ head >
7+ < body >
8+ < nav epub:type ="toc ">
9+ < ol >
10+ < li > < a href ="content_001.xhtml "> content 001</ a > </ li >
11+ </ ol >
12+ </ nav >
13+ </ body >
14+ </ html >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <package xmlns =" http://www.idpf.org/2007/opf" version =" 3.0" xml : lang =" en" unique-identifier =" q" >
3+ <metadata xmlns : dc =" http://purl.org/dc/elements/1.1/" >
4+ <dc : title id =" title" >Minimal EPUB 3.0</dc : title >
5+ <dc : language >en</dc : language >
6+ <dc : identifier id =" q" >NOID</dc : identifier >
7+ <meta property =" dcterms:modified" >2017-06-14T00:00:01Z</meta >
8+ </metadata >
9+ <manifest >
10+ <item id =" content_001" href =" content_001.xhtml" media-type =" application/xhtml+xml" />
11+ <item id =" nav" href =" nav.xhtml" media-type =" application/xhtml+xml" properties =" nav" />
12+ <item id =" pdf" href =" test.pdf" media-type =" application/pdf" fallback =" content_001" />
13+ </manifest >
14+ <spine >
15+ <itemref idref =" content_001" />
16+ </spine >
17+ </package >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <container version =" 1.0" xmlns =" urn:oasis:names:tc:opendocument:xmlns:container" >
3+ <rootfiles >
4+ <rootfile full-path =" EPUB/package.opf" media-type =" application/oebps-package+xml" />
5+ </rootfiles >
6+ </container >
Original file line number Diff line number Diff line change 1+ application/epub+zip
You can’t perform that action at this time.
0 commit comments