Re: 'stroke' shorthand

On Nov 13, 2013, at 10:04 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> On Tue, Nov 12, 2013 at 6:00 PM, Dirk Schulze <dschulze@adobe.com> wrote:
>> 2) Furthermore, a shorthand can not have its “own” syntax. It can only inherit the syntax of one of the longhand. Following the rules of CSS, we would need to introduce a new longhand property taking the values of the current ’stroke’ property.
> 
> Slight clarification: it can have its own syntax, but it must
> decompose into longhand properties.  That is, a shorthand is *defined*
> solely by the values of the longhand properties it decomposes into.
> 
> But yes, your conclusion is right - the current value of 'stroke'
> would have to move into a longhand, probably 'stroke-color' or
> something.

I hoped it would be clear from my last mail that I am less worried about point 2) but more about the first point. Let me paste it again:

1) The CSS WG uses the shorter initial part of a term as a so called "shorthand property". A shorthand property sets all “longhand properties” by reseting them to the initial value or reseting them again. The “longhand properties” are all related properties which also share the same initial part of a term. Meaning, ‘stroke' would be the shorthand property for all other listed properties above.

That also means that in the following example, the shorthand property resets all previously set properties according to the regulations of the CSS WG:

stroke-width: 2px;
stroke-linecap: round;
stroke-linejoin: round;
stroke-dasharray: 4px 3px;
stroke: green;

stroke-width would be reset to 1px, stroke-linecap to butt stoke-linejoin to miter and stroke-dasharray to none, because stroke (the shorthand) is set after these properties.

This makes property handling significantly different in SVG and potentially break existing content.

Greetings,
Dirk


> 
> ~TJ

Received on Wednesday, 13 November 2013 03:26:24 UTC