Re: CSSStyleDeclaration: Setting only a value or a priority

On Fri, 23 Aug 2013 16:47:39 +0200, Sylvain Galineau <galineau@adobe.com>  
wrote:

> On 8/23/13 1:17 AM, "Simon Pieters" <simonp@opera.com> wrote:
>>
>> But that's the behavior the spec has and that browsers have as well (I
>> can't test IE right now but IIRC it does this also).
>>
>> http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2480
>>
>> Note that color is still first in the list.
>
> Same behavior in IE11 Dev Preview.
>
>>
>> Now, in the case of margin-left vs margin-start...
>>
>> http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2481
>>
>> The order in CSSOM is unchanged in both Gecko and Blink. Gecko uses
>> margin-left while Blink uses margin-start. So in this case Gecko ends up
>> in a state where the order exposed by CSSStyleDeclaration doesn't match
>> what Gecko actually uses.
>
> This doesn't seem testable in IE yet.

Thanks for checking IE.


>> It's unclear to me why margin-left vs margin-start depends on the order
>> instead of e.g. always letting margin-start win.
>
> I think that'd be surprising; if two properties set the same thing,  
> aren't
> authors are used to the last one winning?

For shorthand/longhand or aliases, that's the case, but margin-left vs  
margin-start are different properties and are both stored in CSSOM. I  
think CSS usually deals with over-constrained cases without involving the  
order of different properties. For instance, see:

http://www.w3.org/TR/CSS2/visudet.html#blockwidth

[[
If all of the above have a computed value other than 'auto', the values  
are said to be "over-constrained" and one of the used values will have to  
be different from its computed value. If the 'direction' property of the  
containing block has the value 'ltr', the specified value of  
'margin-right' is ignored and the value is calculated so as to make the  
equality true. If the value of 'direction' is 'rtl', this happens to  
'margin-left' instead.
]]

-- 
Simon Pieters
Opera Software

Received on Monday, 26 August 2013 12:14:44 UTC