Re: [css3-content] "content" property, replaced elements, and width

On Saturday 2010-05-08 23:25 +1200, Robert O'Callahan wrote:
> On Sat, May 8, 2010 at 7:32 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> > CSS 2.1 was not at all clear on how this should work.  The current
> > behavior, though, is almost certainly *not* what we want when
> > 'content' applies to all elements.  What are the feelings of
> > implementors on the possibility of changing the behavior here?
> >
> 
> Not hard to fix in Gecko. It does seem like a weird special case though.

The motiviation for the special case was the extension of 'content'
to work on elements rather than just pseudo-elements.  It is needed
to make that extension do what authors want.  That extension, plus
this special case, plus the extended attr() function, allows
'content' to describe the presentation of a bunch of standard
replaced elements in HTML (and other languages).  That is, with this
extension, an image element is just displayed using the rule:

  img { content: attr(src, url); }

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Saturday, 8 May 2010 15:05:40 UTC