Re: Display Property Suggestion

Ian Hickson wrote:
>On Sat, 31 Oct 1998, Christian Kaufhold wrote:
>> For replaced elements (not :before and :after), <counter> and quotes
>> are
>> not allowed - I don't think it makes sense. So it looks like this:
>That`s a bit of an arbitary limitation. Why should "attr()" be allowed
>but not "quote"?! How would you quote the attribute?
Yes that's correct.
[...]
>Actually, what you quote would allow a completely blank value (you
>probably meant to use "+" not "*" on the second line).
Yes that's what I meant.
>However, this is actually a _bad_ thing. There are some decorative
>images that *must not* have alternative text, sicne it makes no sense
>to litter the text browser with irrelevant descriptions of stars and
>bullets or whatever. Corner graphics, for example.
Then the stylesheet could say:  content:url(attr(src)), "";
Or even the alt value of them could be "", so that attr(alt) works.
>> b) the first uris can also be combined with text.
>How do you render replaced content with text?!
>The whole point of replaced content is that it`s unrelated to the
>outside document, as it were, being merely a box as far as the renderer
>is concerned. If you have attached text, you then have to define how it
>is rendered, and the only sensible way I see is the way that `content`
>is *currently* rendered, that is, *not* as replaced content.
But even content in CSS2 can contain an uri, so in that way it contains
a replaced element.
>Originally I was going to suggest allowing text as well as <uri>, in
>fact, but I could not see any logical way of rendering it.
>
>Another problem is that the whole point of having multiple values is
>that if one cannot be drawn then you fall onto the next one, until you
>get to the last value in the `content` list, which is text-based (or a
>mixture of text and uri). If you allow text first, as your suggestion
>does, then it allows for the content value " attr(alt), uri(xyz) ",
>which would be pointless (the uri would *never* be shown) while still
>being valid.
But the last uri offered can also be mixed with text and attribute
values, why not the first ones?
For example consider the following XML fragment which uses an XML link
to cite some other author (or is it too far-fetched?):
<headline>Mr. Miller says to this topic:</headline>
<quote xml:link="simple" inline="true" show="embed" actuate="auto"
href="http://www.whatever.com/article.xml#special"/>
Now quotes could be inserted even though it is a replaced element:
quote[show=embed][actuate=auto] { display:block;
content:open-quote url(attr(href)) close-quote, attr(href) }
(The attr(href) is added as a backup if the resource is not available,
so that you user can the uri at least.)
>In that case I suggest
>
>  [ <uri> "," ]*
>  [ [ <string> | <uri> | <counter> | attr(X) | open-quote |
>    close-quote | no-open-quote | no-close-quote ]+ | auto ]
>    | inherit ]
>
>...so we only allow uris first, which results in the element becoming a
>replaced element with that uri, trying each one in turn until a
>supported one is found, and failing that the content property works as
>it does now, except if the "auto" keyword is used, which indicates that
>the content of the property as specified by the document should be
used.
But this still has the problem that the even the last possible value for
content can contain an uri, and if the browser can't handle that,
something undefined is displayed. I would suggest that the last value
for content must _not_ contain an uri (like the last value for
font-family
has to be a generic font-family and the last value for cursor a generic
cursor), even if this is "" or auto (which would mean "" with empty
elements).
My suggestion is now:
[ [ [ <string> | <uri> | <counter> | attr(X) | open-quote |
      close-quote | no-open-quote | no-close-quote ]* , ]*
   [ [ <string> | <counter> | attr(X) | open-quote |
      close-quote | no-open-quote | no-close-quote ]* | auto ] ]
    | inherit
(looks quite ugly).

Christian Kaufhold

Received on Sunday, 1 November 1998 14:32:00 UTC