[CSS21][css-images] Default object size of replaced elements

Hi,

The CSS Images spec calls "default object size" the size that is used 
when an image has neither a specified or intrinsic size.

Although it doesn’t use that name, CSS 2 defines the default object size 
of replaced elements (in section 10.3.2 and 10.6.2) as 300x150px if that 
fits the device width, or the largest 2:1 rectangle that fits if not.

I’d like that we drop the latter part, and just make it 300x150px 
regardless of device width. Given lack of interop (see below) and that 
images without an intrinsic width are rare, I doubt that this will have 
much impact on existing content.


Here is a test case. A black rectangle should show up and have the 
default object size.

body:after {
   content: url('data:image/svg+xml,\
     <svg xmlns="http://www.w3.org/2000/svg">\
       <rect width="100%" height="100%"/>\
     </svg>\
   ');
}

http://dabblet.com/gist/8565595

In Firefox 26 and Opera 12 (Presto) show a 300x150px rectangle. I don’t 
have access to a device where "300px is too wide to fit the device" (as 
I understand it), but shrinking the viewport width to below 300px does 
not affect the image.

I’m not sure how to explain what Chromium 32 does, but it’s using 
something close to the viewport size. Not 300x150px at all.

The rectangle does not show up at all in IE11, but I don’t know to to 
fix the test case for this.

-- 
Simon Sapin

Received on Wednesday, 22 January 2014 20:18:46 UTC