Re: content: url() is bad

On 13 Apr 2004 at 20:14, Ian Hickson wrote:

> On Tue, 13 Apr 2004 wrote:
> >
> > However, my preference was to allow the above to "work". If you stated
> > that all elements with a content value were to be considered replaced,
> > what would break?
> I have no idea what it means for an inline element to be a replaced
> element. Or do you mean that 'display' could compute to 'inline-block'
> whenever 'content' is not 'contents'?
> How would you get the more usual case of text that flows?

Hmm yeah i did not consder that the "replacedness" of the content 
value affects whether it can flow multiple lines or not. 

When testing with a long alt-text in a broken img, the nowrap of the 
alt-text used by two of three tested browsers suggests to me that the 
img alt-text is not handled as if the image was made non-replaced due 
to its alt-text being used. 

I suppose that solution is not workable in this case and you are more 
looking for an object replacement in CSS syntax. To fully work that 
it seems you need to allow selectors on parts of the content value 
(which might get even more interesting when text/html is being 
referred to...), and i am not quite convinced that your single image 
special-case is a good enough compromise. It might be better to 
"isolate" this issue to where it is caused and add new 
properties/selector for sizing the content value, or to special-case 
the text-only case instead?

The reason i prefer to view the content value as replaced is probably 
that i dislike the concept of having a pseudo-document-fragment in 
the content value, but also because it seems to create more intuitive 
results in most sane cases. I think allowing to much power into the 
content value means mixing layers, which is what started this thread.

> > When the author uses a combination of text and imagas and tries to scale
> > it at the same time, it might be ok with a UA dependant resolution since
> > it such an edge case.
> I don't think it's an edge case at all. I think it's a very common case.
> For example:
>    h1 { content: url(letter-X) url(letter-Y) url(letter-Z) " Company " url(logo); }
> get:
>    [X][Y][Z] Company {(@)}
> ...or some such.

But since the above does not rescale the contents of the h1, i would 
have thought it was no major issue to consider it "replaced" in a 
sense from the perspective of the h1 element. To get the issue i was 
considering we need something like:
h1 {content: "Company " url(logo); height: 50px; width: 50px}
That is, what does the measurements do to the text if the text is 
considered part of a replaced content value. In your example the 
value of the content should have some form of intrinsic width/height.

Could this be compared to the broken image icon combined with alt-
texts of some browsers?


Received on Wednesday, 14 April 2004 03:51:20 UTC