[whatwg] Effect of image-orientation on naturalWidth/Height

Hi all!

I wanted to get the opinion of this list on how image-orientation and the <img> element’s naturalWidth and naturalHeight properties should interact. The css-images level 3 spec says:

"The intrinsic height and width are derived from the rotated rather than the original image dimensions.”

The HTML spec says:

"The IDL attributes naturalWidth and naturalHeight must return the intrinsic width and height of the image, in CSS pixels, if the image is available, or else 0.”

On the surface, it seems clear that image-orientation must affect naturalWidth/Height. However, I’m not sure whether this was intended, and I don’t have a strong intuition for whether this is more or less surprising to content authors than having these two features be totally independent.

There is certainly a potential performance cost if the two features do interact, since that means that naturalWidth/Height will depend on style information. On the other hand, naturalWidth and naturalHeight would definitely take EXIF orientation into account if we respected it by default, so perhaps they also should when content authors opt in to EXIF orientation support using image-orientation.

Let me know what you think.

Thanks,
- Seth

Received on Monday, 9 March 2015 23:02:20 UTC