Re: [css-syntax] Duplicate declarations in style rules

On Mon, 12 Aug 2013 09:39:16 +0200, Simon Sapin <simon.sapin@exyr.org>  
wrote:

> Le 12/08/2013 07:27, Simon Sapin a écrit :
>> §8.1 Style rules of css-syntax says:
>>> If a style rule contains multiple declarations with the same name,
>>> all but the last such declaration are discarded.
>> It’s actually not that simple:
>>
>> If a style rule contains multiple declarations for the same longhand
>> property after shorthand expansion [refer to CSS Cascade], all but the
>> one with greatest cascading order [refer to CSS Cascade] are discarded.
>>
>>     Note: within one style rule, the relative cascading order is
>> determined only by '!important', then source order.
>
> Actually, is that paragraph necessary at all?
>
> The cascade has to deal with duplicate declarations anyway (eg. from  
> different style rules) and already knows how to pick one.  
> Implementations may choose to optimize by dropping early declarations  
> that can never be in the result of the cascade, but this does not have  
> to be normative.
>
> The only normative bit we need it to describe CSSOM’s  
> CSSStyleDeclaration.

https://dvcs.w3.org/hg/csswg/rev/bfc93c31b961

-- 
Simon Pieters
Opera Software

Received on Monday, 12 August 2013 11:21:34 UTC