W3C home > Mailing lists > Public > www-svg@w3.org > November 2013

Re: 'stroke' shorthand

From: Dirk Schulze <dschulze@adobe.com>
Date: Tue, 12 Nov 2013 19:25:57 -0800
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: www-svg <www-svg@w3.org>
Message-ID: <6D701256-AA60-44AB-953C-5BA5CBBFF2FC@adobe.com>

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.


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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:47 UTC