W3C home > Mailing lists > Public > www-style@w3.org > November 1998

Re: Content property (again)

From: Daniel Glazman <Daniel.Glazman@der.edf.fr>
Date: Mon, 16 Nov 1998 05:01:24 +0100
Message-ID: <364FA393.7CE596B6@der.edf.fr>
To: chka@uni-bremen.de
CC: www-style@w3.org
> I therefore suggest a different syntax that makes it possible to set
> some properties only if a certain other property can be set.
> Of course this is not backwards compatible with CSS2, but any forward
> compatible parser will just ignore the rule, and the replaced content
> syntax would be illegal anyway for a CSS2 parser.
> I suggest the creation of a "@try" rule. After the "@try" follows a
> single declaration (that contains an uri). If this declaration can be
> fulfilled (is not overwritten by a rule afterwards or before, and the
> uri can be read and shown), all the declarations in the block apply,
> otherwise not.
> Multiple @try's are possible and are evaluated one after the other (or
> combined if they contain the same declaration), but if a declaration for
> the same property without a @try follows, it removes all @try's before.  


Your suggestion is interesting and your examples are very clear. Deriving
from an original suggestion made by Chris Wilson, I proposed an equivalent
mechanism to the working group some months ago. In my proposal, the tested
declaration was contained in a block. My example was the first one : if you
cannot use background-repeat, you might want to change the image used as
a background-image...

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.
   I think that the parsing of a declaration is possible given section 4.1.1,
   but difficult. The parsing of one declaration in a block is...hmmm...

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...

Received on Sunday, 15 November 1998 23:03:36 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:48 UTC