Re: [css3-values] RE: CSSStyleDeclaration#length and shorthands.

On Wed, Feb 1, 2012 at 6:25 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 2/1/12 4:20 PM, Boris Zbarsky wrote:
>>
>> On 2/1/12 4:04 PM, Brian Manthos wrote:
>>>
>>> Example A
>>>
>>> <div style=”border: red dashed 1px;”>
>>>
>>> Example B
>>>
>>> <div style=”border-color: red; border-style: solid; border-width: 2px;”>
>>>
>>> JavaScript then queries…
>>>
>>> 1.document.getElementsByTagName(‘div’)[0].style.border
>>>
>>> 2.document.getElementsByTagName(‘div’)[0].style.border-color
>>>
>>> I would argue that the answers should be…
>>>
>>> A1 “red dashed 1px”
>>>
>>> A2 “red”
>>>
>>> B1 “red dashed 1px”
>>>
>>> B2 “red”
>>
>>
>> Yes (modulo 1px vs 2px and solid vs dashed and borderColor vs
>> border-color).
>
>
> And modulo the spec needing to define whether it's "red dashed 1px" or "1px
> dashed red" or one of the other 4 options.

When I implemented getComputedStyle for shorthand in WebKit I totally
arbitrary follow the order that is in the spec, for example :

'border'
Value:          [ <border-width> || <border-style> ||
<'border-top-color'> ] | inherit

Even if yes this line doesn't say it should be the order. I believe
Firefox and Opera are doing the same.

>
> -Boris
>



-- 
Alexis Menard (darktears)
Software Engineer
INdT Recife Brazil

Received on Friday, 3 February 2012 18:37:46 UTC