-
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
Fallback requirements for picture element #1237
Comments
To resolve this one, I'd suggest we either add a paragraph like this to the end of section 2.5.5:
or possibly the more flexible:
|
In my understanding, manifest fallback is not widely used or implemented. Why should we use it here? |
The I'd rather not perpetuate it, but unless we require a usable CMT in the |
I understand now. I prefer your first solution. It is simple. The second one does not add any practical advantages since the media attribute cannot be used as a condition. |
I'm not sure what you mean here. The attribute is a condition on use. If you omit it, then the referenced image can be used anywhere. For example, this is fine:
but this is problematic because the core media type is only available for small device screens:
It's sort of a question of best practice whether the CMT needs to be in the It's also what makes manifest fallbacks confusing. Technically this is about the For example, if you have:
Then in the manifest you might also add a fallback attribute just to be safe:
But it's this kind of complexity, plus EPUB's goal to have CMTs for interoperability, that makes the |
@mattgarrish wrote:
That child source element does not define any conditions and is thus always selected. This is what I mean. |
I haven't seen that stated in the HTML specification. Do you have a reference? It is always possible to select it, but all I've seen is that the selection is user agent-defined. (The |
The addition of |
@mattgarrish I stand corrected about non-mandatory selection. But I also wonder if we are making things unnecessarily complicated. Is it possible to lift the manifest-level fallback requirement for image elements within picture elements? |
Right, I'd prefer to require a core media type in the If we require the core media type in the |
A couple things to take into account if we want to make this restriction:
The backward compatibility issue is what worries me the most. Maybe an intermediary approach is to:
That way we get the "best" of both worlds. Apart from that, I think that making the
EPUBCheck will still have to parse |
Yes, sorry if that's not clear. I'm only talking about |
Hi,
Just checking on devices with no screen, we are still good?
Best
George
From: Romain Deltour <notifications@github.com>
Sent: Wednesday, March 6, 2019 6:24 AM
To: w3c/publ-epub-revision <publ-epub-revision@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: Re: [w3c/publ-epub-revision] Fallback requirements for picture element (#1237)
Right, I'd prefer to require a core media type in the img element. I'm only raising the other option because it is technically valid to do, so I wonder if people will complain that we've been overly restrictive again.
(…)
If we require the core media type in the img, then the other nice thing is that manifest fallbacks never factor in. Technically, they are only for elements that don't have fallback capabilities, and in the case of picture the img is the fallback for graceful degradation, so I think we do have a strong case to make it a requirement.
A couple things to take into account if we want to make this restriction:
* it creates a new backward incompatibility, when a foreign type on img was previously allowed with a manifest fallback
* the ability to effectively provide a fallback depends on RS support for the picture element; granted, browser support is pretty good <https://caniuse.com/#search=picture> .
The backward compatibility issue is what worries me the most. Maybe an intermediary approach is to:
* when picture is used, require the img/@src to be a CMT.
* otherwise, the img can be a foreign type if it has a manifest fallback.
That way we get the "best" of both worlds.
Apart from that, I think that making the img the holder of the CMT (instead of allowing a source to do it) is perfectly acceptable, and it's also more robust.
It also makes things a lot simpler for epubcheck if we don't have to check sources, but we couldn't implement this on our own.
EPUBCheck will still have to parse source elements, and srcset attributes (on both source and img), as we need to check things like the image is not remote, exists in the container, is declared in the manifest, etc, etc. But that's another issue 😊
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#1237 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AG3HSBjFLSjim91QQLM38cR4f3FmZ1csks5vT8FVgaJpZM4bO8QH> . <https://github.com/notifications/beacon/AG3HSO0nwiDlWNnM-QvNsSHB4bC0AO7Kks5vT8FVgaJpZM4bO8QH.gif>
|
@GeorgeKerscher Yes, the |
Fixed by #1244. |
So, I had a detailed look at HTLM's images processing model, and I think the resolution of this issue is actually wrong. Basically, for browsers supporting
To simplify again, the algorithm which returns an image’s source set says:
In other words, the HTML processing model does not use the If we keep the current resolution, we're basically creating a willful violation of HTML, and I really doubt EPUB reading systems will bother to tweak the image processing model of underlying browser components. I suggest we change the rules to:
(in other words: only allow foreign types on Technically, we could loosen the latter point to requiring that the source set contains at least one CMT resource, but I don't know if browsers would use that for content negotiation. We'd better stick to Or, alternatively, we consider that image core media type are a thing of the past better left to best practices, and we make no restriction at all ¯\_(ツ)_/¯. |
Now that the picture element is valid for use, there is a question for epubcheck about how to determine when a manifest fallback needs to be applied. The
media
attribute makes determining whether a core media type will be available complicated, since it all depends on the runtime environment which will apply.If we require that a core media type be specified in the
img
element, though, then it doesn't matter what combination of formats and media queries are used in the source elements. Theimg
element also represents the default, so a reading system will still have the option to choose the foreign resource(s). As the natural fallback, it seems like it should always specify the CMT to avoid manifest fallback requirements.(It's probably also going to be best practice to have a CMT in the
img
, too, since there's no guarantee of support for picture/source yet.)But, we need to know if the CG agrees with this conclusion, and we should make this requirement explicit in the fallback requirements, if so.
If not, how else can we reliably determine if a CMT will be available? Do we require that at least one source element specify a CMT and not specify a
media
attribute? Do we ignoremedia
attributes and just hope for the best so long as a CMT is listed?The text was updated successfully, but these errors were encountered: