[css-images-3] change which images image-orientation applies to · Issue #5245 · w3c/csswg-drafts (original) (raw)

Comments

@faceless2

In #4165 it was resolved that EXIF orientation applies to all images by default. There was some discussion about which images the image-orientation property and talk of a resolution, but no actual resolution.

This matters because we've got two sets of WPT tests added in the last six months which disagree - see web-platform-tests/wpt#18549 (comment) - and different results in Firefox and Chrome (see a, b). So we need a once-and-for-all resolution on this.

@heycam made the same observation in #4165 (comment), and we'd like to implement this but can't until it's clarified.

So the question is: does the image-orientation property apply to "decorative" images, such as background-image and border-image? And if it does not (as currently specified), the second question is can we tightly define "decorative" images.

@zcorpan made a full list at web-platform-tests/wpt#18549 (comment)

CSS

SVG

HTML

load an image in an iframe
load an image in a top-level doc (this already respects EXIF in all browsers I believe)
Favicon link rel=icon / favicon.ico (manual tests?)
web app manifest icon (manual test?)

cc @schenney-chromium

@heycam

So the question is: does the image-orientation property apply to "decorative" images, such as background-image and border-image? And if it does not (as currently specified), the second question is can we tightly define "decorative" images.

Agree that that's what we need to answer.

The goal of the image-orientation property is to make it easy to turn off the new automatic re-orientation behavior, in case authors have content that breaks with the new behavior. (We had a few bug reports in Firefox of content that broke, due to images being used that had incorrect orientation metadata in them, probably because of tools that rotated the image data but left the metadata untouched. So it is useful for quickly fixing this. But these were all <img> elements.)

If image-orientation doesn't apply to decorative images, then there is no easy way to opt out of any breakage that's occurred. So I would prefer to have it apply to all content and decorative images that the element has, and then not bother with defining decorative images.

I don't have a strong opinion on cursor and resources linked to with <link> / <meta> elements, but I think it would be fine not to them apply there. It's unlikely people are using JPEGs with orientation data in them.

My view of orientation metadata is that it's an implementation detail of the image, and the only reason that we are allowing control of whether it is honored is to help authors manage this change in behavior.

@faceless2

I agree with Cam on all his points. If EXIF applies to all images, then I think image-orientation has to as well.

@css-meeting-bot

The CSS Working Group just discussed [css-images-3] clarify which images image-orientation applies to, and agreed to the following:

@fantasai fantasai changed the title[css-images-3] clarify which images image-orientation applies to [css-images-3] change which images image-orientation applies to

Jul 2, 2020

@fantasai

Because the spec was pretty clear that it does not apply to background images etc., only to replaced elements (including generated content).

fantasai added a commit that referenced this issue

Oct 5, 2020

@fantasai

…tive images as well as content images. #5245 #5294

fantasai added a commit that referenced this issue

Oct 5, 2020

@fantasai

…tive images as well as content images. Part II (because forgot to hit save or something) #5245 #5294