W3C home > Mailing lists > Public > www-style@w3.org > January 2014

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

From: Simon Sapin <simon.sapin@exyr.org>
Date: Wed, 22 Jan 2014 12:18:21 -0800
Message-ID: <52E0278D.4080400@exyr.org>
To: www-style <www-style@w3.org>

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%"/>\


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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:18 UTC