Page MenuHomePhabricator

Add image-rendering to cssImage3 set
Closed, ResolvedPublicFeature

Description

image-rendering (caniuse) is a CSS Image 3 property that tells the browser how to best upscale an image. It is very useful for keeping server-side image output like that from Module:Graph crisp and readable.

The standard prescribes these names: auto | smooth | high-quality | crisp-edges | pixelated. Of these, crisp-edges and pixelated are the two most useful options we need, although you may also want to allow -webkit-optimize-contrast because Chrome (which the majority of visitors use) wants to use its own name for crisp-edges.

Event Timeline

<s>@Arthur2e5: How is this related to css-sanitizer?</s>Meh, please ignore. I skipped reading the word "parser".

Anomie subscribed.

image-rendering is a CSS Image 3 property

I don't see it in the latest published version of CSS Image Values and Replaced Content Module Level 3. It seems it's currently only in the Editor's Draft.

Other than that and the attendant possibility for it to be modified before it is finally published, this request seems sensible enough.

Per caniuse it's at 90% support (plus a few more percent with IE's custom equivalent, -ms-interpolation-mode: nearest-neighbor).

@Reedy https://gerrit.wikimedia.org/r/c/css-sanitizer/+/562681 supporting Images 3 of the particular version linked in that patch suggests this one should be supported now, but I am getting filtered after submission of an edit form. Was this missed?

@Reedy https://gerrit.wikimedia.org/r/c/css-sanitizer/+/562681 supporting Images 3 of the particular version linked in that patch suggests this one should be supported now, but I am getting filtered after submission of an edit form. Was this missed?

The patch only exists in master. No release of css-sanitizer has been tagged since that commit landed, so hence it hasn't been integrated into TemplateStyles yet - https://github.com/wikimedia/css-sanitizer/compare/v3.0.2...master

@Reedy https://gerrit.wikimedia.org/r/c/css-sanitizer/+/562681 supporting Images 3 of the particular version linked in that patch suggests this one should be supported now, but I am getting filtered after submission of an edit form. Was this missed?

The patch only exists in master. No release of css-sanitizer has been tagged since that commit landed, so hence it hasn't been integrated into TemplateStyles yet - https://github.com/wikimedia/css-sanitizer/compare/v3.0.2...master

Ah, thanks.

Izno changed the subtype of this task from "Task" to "Feature Request".Jan 14 2023, 1:56 AM
Tgr assigned this task to Anomie.

The changes were included in 4.0, released in 2022 July (rMWVDbd89258378cc: Upgrading wikimedia/css-sanitizer (v3.0.2 => v4.0.0)). The feature now works in production.