Re: Content property (again)

Daniel Glazman wrote:
>This raises two difficulties :
>
>1) conformance with CSS general syntax (section 4.1.1). 'declaration'
>is not in the definition of 'any' which is the only definition allowed
>between the name of an at-rule and the following block.

According to the general syntax, it would first be parsed as any* (which
I believe is possible), and then it would have to be interpreted as
"declaration" (when the @try rule is recognized).

>2) the 'if' case is only interesting if you also have the 'else' case
>and we see no easy way to declare that ! Think about something like (in
>the formalism you propose)
>
> @try declaration1 { block1 } { block2 };
>
>where block1 is applied if declaration1 is valid, and block2 if not.
>If declaration1 is not valid, all the rule is thrown away according to
>section 4.2 ! So block2 cannot be applied...

I don't quite understand that.

I thought about using an @else rule as well. It would apply if none of
the @try possibilities are possible. But I think this can be emulated by
putting all "backup" declarations before the @try block which then will
(have to) overwrite them:
BODY
{
    color:green;
    @try background-image:url(back.gif)
    {
        color:black;
    }
}
This way CSS2 parsers will also be able to understand the first
declaration and ignore only the @try rule.

Christian Kaufhold

Received on Monday, 16 November 1998 20:36:14 UTC