[css3-content] sizing of images inserted using the content property

Section "8. Replaced content" says that when the content introduced by  
content: is a single url, then the element or pseudo element is a replaced  
element.

Given what the box model says about replaced elements, I understand it to  
mean that both of these should insert an image and size it to 42 x 42  
pixels.

#foo {content: url("bar.jpg"); width : 42px; height:42px;}

#foo::before {content: url("bar.jpg"); width: 42px; height:42px;}

Chrome resizes the first one, but uses the intrinsic dimensions of the  
image for the second

firefox and ie don't support the first, and use intrinsic dimensions for  
the second

opera uses intrinsic dimensions for both cases

So we have interoperability but (obsolete) spec violation when replacing  
content on pseudo elements. For non-pseudos, Opera choses to be consistent  
with pseudos, while Chrome decides to follow the spec it just ignored.

Any idea about how to resolve this?

Received on Monday, 21 November 2011 12:45:28 UTC