Re: content: url() is bad

On Mon, 12 Apr 2004, Boris Zbarsky wrote:
>>>   h1 { content: "foo" }
>>>   h1 { content: url(foo) }
>>>
>> >Should both be replaced elements?
>>
>> I don't understand what it would mean for the "foo" case to be a replaced
>> element.
>
> The string "foo" has an intrinsic size, no?

Not really -- it depends on the font, line wrapping, etc. In CSS terms,
inline boxes are not replaced elements.


>> For the first one I would want h1 to be a block-level element
>> containing a line box containing an anonymous inline box containing the
>> text "foo".
>>
>> For the second I would want a block-level replaced element rendering
>> the resource "foo".
>>
>> Why would anything else make sense?
>
> Well, having the rendering of an object completely change based on its
> contents is a very backwards logical relationship to me (this is my
> author hat on, now).

It's the way <object> and <img> work, and since describing their behaviour
in CSS is the original use case here...


>> They're not conceputally different. They're conceptually the same. The
>> concept is "the content of the element".
>
> To me, replacing the entire element altogether is not "the content of an
> element".  The content of an element are the things that live inside the
> element...

So the image in an <img> is not the element's contents?


> I don't have a proposal yet.  I'm just pointing out that yours does not
> really map well to what I think of as "content of an element".  Perhaps
> others think differently of "content of an element".

Ah. I'm finding it difficult to understand why whether the content causes
height/width 'auto' to mean 'intrinsic' rather than 'fill' changes whether
it is content or not...


>> Well, it's pretty clear that
>>
>>    :before { content: 'PASS' url(404); }
>>
>> ...should render "PASS", isn't it?
>
> Well.... not sure.

Aha. In that case, I'll spec away. ;-)

-- 
Ian Hickson                                      )\._.,--....,'``.    fL
U+1047E                                         /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'

Received on Monday, 12 April 2004 18:01:06 UTC