epubcheck
epubcheck copied to clipboard
Loosen restrictions on where remote resources can be referenced
The following rules now apply:
- remote audio only allowed from
audio+sourceelements and the MOaudioelement - remote video only allowed from
video+sourceelements - remote fonts only allowed from CSS
@font-facerules,@importrules, and the htmllinkelement - remote data only allowed from scripting API calls (XHR and Fetch)
See https://github.com/w3c/epub-specs/issues/1857
I'm not sure I fully understand the above.
- If a script dynamically adds an
audioelement referring to remote audio, is that allowed? - an alternative non-core media type document cannot use remote audio if it is not also used in HTML, correct?
- remote audio listed in the manifest, but not referenced in HTML, becomes invalid, correct?
- remote audio/video cannot be referenced from an object param, unless they also appear in
videooraudioelement, correct?
This all seems a bit overly restrictive to me, I'm not sure I see the reason or what problem it is trying to solve.
Also, I'm not familiar with the state of custom elements in EPUB, so this may not be so relevant, but these restrictions disallow any remote audio/video referenced from custom elements too.
Also, I'm not familiar with the state of custom elements in EPUB
Ya, that's interesting now. They used to be not allowed because they were defined in separate W3C specs. But now that we're referencing the WHATWG document, template is allowed and I believe we also get the WHATWG DOM standard.
but these restrictions disallow any remote audio/video referenced from custom elements too
Ya, that gets kind of quirky. The reference will end up in an audio or video element, at least as I understand how custom elements work, but epubcheck won't know that because the html markup corresponding to the custom element is generated from code or a template at run time.
The restrictions were undone, but it appears that epubcheck already restricts where remote resources can be referenced.
Remote audio and video, at least, are only allowed from audio and video elements otherwise you get an error that remote resources must be placed in the OCF.
These restrictions need to be loosened to reflect the specification.
It looks like fonts are also restricted.
If I use a stylesheet link declaration or import rule for a Google font, I also get the message about the resource having to be placed in the OCF.
And if I declare a font-face rule in an xhtml doc then epubcheck emits a warning that it couldn't find any remote resources in the file.