On Mon, Mar 9, 2015 at 4:01 PM, Seth Fowler <s...@mozilla.com> wrote: > 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.
That's a good question. I suspect that .naturalWidth/Height should return the image's dimensions before applying CSS rotations. This is likely to be surprising, but also probably the correct answer for separation-of-concerns reasons. I wonder whether I need to tweak Images, or Hixie needs tweak <img>. Hmm. ~TJ