-
Notifications
You must be signed in to change notification settings - Fork 61
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
update core media type requirements for picture and img #1247
Conversation
Updated prose can be read more easily here: https://raw.githack.com/w3c/publ-epub-revision/0e0781d8c5dacbcbd04b832ba6a542bca7b72230/epub32/spec/epub-contentdocs.html#confreq-resources-cd-fallback-img |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes do reflect my proposal accurately 👍 (I hope we got it right this time 😅).
I made a couple nitpicking comments inline, I'll let you decide whether they're worth an update or not.
epub32/spec/epub-contentdocs.html
Outdated
<ul> | ||
<li>it MUST reference Core Media Type Resources from its <code>src</code> and | ||
<code>srcset</code> attributes, when those attributes are specified;</li> | ||
<li>any child <a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: "any child source elements" might need to explicit the parent context here, as the main subject is the img
element.
We could say "any child source
elements of this picture
element" (referencing the wording introducing this list item) or "any sibling source
elements of the img
element".
Note btw that only the preceding source
siblings will be used to define the img
source set. But we may not need to go to this level of detail…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blah, right, "child" was from an earlier drafting. I'll change it to sibling.
epub32/spec/epub-contentdocs.html
Outdated
href="https://www.w3.org/TR/html/semantics-embedded-content.html#the-source-element" | ||
><code>source</code> elements</a> also MUST reference Core Media Type | ||
Resources from their <code>src</code> and <code>srcset</code> attributes unless the | ||
element specifies that it references a Foreign Resource media type in its |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: "specifies that it references a Foreign Resource media type in its type
attribute" is understandable but might sound a little odd or hard to parse?
- we never explicitly specify what is a Foreign Resource media type (is it any media type that is not a CMT? or the media type of a Foreign Resource that is correctly declared in the Package Doc?).
- also, a
source
element can't be said to "reference a (…) media type" - it doesn't really take into account MIME type parameters, which are allowed in the
type
attribute value.
In HTML/WHATWG lingo, we could say something along the lines of:
unless its
type
specifies a MIME type whose essence is listed as a Core Media Type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use "essence", everyone has to take a trip to another specification... :)
How about we just keep this in epub parlance by restating it as:
unless it specifies a media type in its
type
attribute that is not a Core Media Type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we just keep this in epub parlance by restating it as:
unless it specifies a media type in its
type
attribute that is not a Core Media Type.
yes, works for me!
If we use "essence", everyone has to take a trip to another specification... :)
meh, where's the fun when not doing that? 😁🤓
epub32/spec/epub-contentdocs.html
Outdated
</li> | ||
<li>Otherwise, it MAY reference Foreign Resources in its <code>src</code> and | ||
<code>srcset</code> attributes provided a <a | ||
href="epub-packages.html#sec-foreign-restrictions-manifest">manifest fallback</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/manifest fallback/manifest fallbacks/ ?
This PR fixes #1237 (again) as described in #1237 (comment):
picture
the only time foreign resources can be referenced is from asource
element that explicitly identifies that it references a foreign media type in itstype
attributeimg
element requires a core media type fallback whenever itssrc
orsrcset
attributes reference foreign resources.@rdeltour please verify that I have this right, and that the spec prose reflects your proposal.