-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
picture element and image CMTs #781
Comments
Is this only EPUB 3.1 or also EPUB 3.0? |
Only for 3.1. The picture element wasn't in HTML 5.0, and EPUB 3.0(.1) have hard references to that version. |
I'm not sure what the rule should be, given that a non-naïve check would need to compute not-only the image source set, but also the image selection algorithm (in other words, an image from the source set can only be considered as a fallback when it can be selected in the same conditions –viewport size, etc– as the non-CMT image). Thoughts? |
So after discussed with @mattgarrish we agreed we should at least:
This requires however a correct implementation of As the full requirements depend on the discussion happening in the CG, and it's unlikely that |
Message changes: - new `MED-007` (`ERROR`) message is reported when an image source references a foreign resource (unless on `source` elements which `type` attribute specify non-core media type). - reworded `MED-003`; it now includes the resource path. Internal changes: - add a `SourceSet` class to represent an image source set, along with a parser folloing the "parsing a srcset attribute" algorithm from HTML. See https://html.spec.whatwg.org/#parsing-a-srcset-attribute - add to new reference types to the `XRefChecker` class, `PICTURE_SOURCE` and `PICTURE_SOURCE_FOREIGN`, to identify image source references in `picture` elements. - add tests, for both the `srcset` parser and the new fallback rules. Fix #781
Message changes: - new `MED-007` (`ERROR`) message is reported when an image source references a foreign resource (unless on `source` elements which `type` attribute specify non-core media type). - reworded `MED-003`; it now includes the resource path. Internal changes: - add a `SourceSet` class to represent an image source set, along with a parser folloing the "parsing a srcset attribute" algorithm from HTML. See https://html.spec.whatwg.org/#parsing-a-srcset-attribute - add to new reference types to the `XRefChecker` class, `PICTURE_SOURCE` and `PICTURE_SOURCE_FOREIGN`, to identify image source references in `picture` elements. - add tests, for both the `srcset` parser and the new fallback rules. Fix #781
Noting that HTML 5.1 adds the picture element, which allows multiple source images to be specified. This means that you can provide a fallback CMT image for a non-CMT image type without having to use manifest fallbacks.
epubcheck will need to account for the child source elements in determining whether a CMT is available.
This doesn't change fallbacks for images outside the picture element.
The text was updated successfully, but these errors were encountered: