Re: Proposal: @property(value) Selector

From: "L. David Baron" <dbaron@dbaron.org>
Sent: Monday, January 25, 2010 6:14 AM
To: <www-style@w3.org>
Subject: Re: Proposal: @property(value) Selector

> On Sunday 2010-01-24 19:54 -0800, Alex Mitchell wrote:
>> If the property used in the @property(value) is defined inside of the
>> rule, it would give a parse error and drop the rule, just as if you were
>> to put an invalid value for margin or another property.
> 
> That's not sufficient, since you can have arbitrary cycles.

Such cycles would be defined so :

div { color: red; }

div:CSSValue(color, red) {
    background: white;
}

div:CSSValue(background, white) {
    color: blue !important;
}

>
> [...]
>
> I think you'd need to present strong use cases for such a selector
> for it to be adopted.

I think they are use-cases, but maybe it would be simpler to define
the thing so :

div { color: red; }

div {
    background: iif(color='red', 'white', 'initial');
}

This would have a different comportement than
what has been asked by Alex, but at least, it would
not require an huge modification of the way the 
css rules are supported. I think many uses cases
would be covered. For more complex one, using a 
script would be needed.

The only 'problematic case' would be :

div {
    color: iif(background='white', 'red', 'initial');
    background: iif(color='red', 'white', 'initial');
}

This case could be handled so :

"When a depency cycle is encountered, the condition
of the first property in alphabetical order of the cycle
is considerated as false and all others properties are
evaluated accordoingly." 

Received on Monday, 25 January 2010 09:49:56 UTC