Images in <video> and stretching/preserving ratio

The HTML <img> element always stretches images and <video> always preserves aspect ratio. HTML5 doesn't restrict which formats <video> may support.

Currently both WebKit and internal builds of Opera can show images in <video>. (WebKit seems to render some other formats, too, e.g. fonts.)

It is very hard to achieve the effect of preserving aspect ratio of images using <img> and CSS while having a (maximum) width and height. Therefore there's a risk that authors will start to abuse <video> for this effect.

Two things come to mind for preventing this abuse:

   1. Make images not work in <video> even though the media backend support them
   2. Implement http://dev.w3.org/csswg/css3-page/#propdef-image-fit


We're considering both... (2) would also solve the use case for which the pixelratio="" attribute was intended.

What do other people think?

-- 
Simon Pieters
Opera Software

Received on Tuesday, 10 March 2009 15:32:37 UTC