-
Notifications
You must be signed in to change notification settings - Fork 719
[css-images-3] Define optimizeSpeed as nearest neighbor #8259
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
Comments
I am sorry for the following aside/question but should it be aliases or mappings? FF handles them as aliases (Chrome does not support the CSS property). The spec suggests a mapping:
Mapped values are preserved and aliases are replaced, iiuc. I do not know when/why a legacy value should be aliased vs. mapped, or if consistency does not matter to you for this kind of minor detail. |
Further, if |
First and probably most importantly, I don't think the mappings really matter. They exist only because I'm reusing a good property name from SVG that already had some values, even tho iirc browsers didn't actually pay attention to them (other renderers might have). Giving them an approximately correct answer seems fine; we're not designing these values from scratch and don't care about whatever use-cases they might have been originally intended for. In that light, I think it's fine for optimizeSpeed to continue to map to crisp-edges. It's approximately right, and altho the value allows for other algorithms, nobody does anything beyond NN right now, or is planning to. optimizeQuality absolutely should not be mapped to 'high-quality'. That value comes with implications that definitely weren't present in the original value. For example, if you knew were rendering in a sufficiently powerful machine, applying optimizeQuality to everything would be reasonable, but applying 'high-quality' to everything is a no-op. 'smooth' is the correct analogue for it.
I don't think it matters what the behavior is, but it is good to be interoperable in this regard. I specified them with "behaves as" to avoid the possibility of breaking any scripts querying computed value and expecting the legacy values. But it's very possible that this doesn't matter in practice, and if a value alias is easier for impls, I'm fine with switching to that. |
Agree. Personally, I only care about interoperability. Aliasing possibly allows to later drop legacy values, and the author possibly can see he is using a legacy value. I think neither is easier to implement. |
The CSS Working Group just discussed
The full IRC log of that discussion |
Uh oh!
There was an error while loading. Please reload this page.
The spec preserves the old SVG
optimizeSpeed
andoptimizeQuality
keywords of theimage-rendering
property, defining them as alisases ofcrisp-edges
andsmooth
.However, in #6038 we confirmed that
crisp-edges
is not necessarily nearest neighbor, and that browsers may use a more sophisticated edge-preserving algorithm (which might not be as fast).Would it make sense to simply define
optimizeSpeed
as nearest neighbor? This guarantees its speed and also gives authors direct access to nearest neighbor.(Tangential follow-up: should
optimizeQuality
stay mapped tosmooth
or should it map to the newhigh-quality
keyword?)The text was updated successfully, but these errors were encountered: