Re: SVG-ISSUE-2430 (shorthand-presentation): shorthand properties should be allowed as presentation attributes [SVG 2]

On Monday, January 9, 2012, 1:34:09 AM, SVG wrote:

SWGIT> SVG-ISSUE-2430 (shorthand-presentation): shorthand properties
SWGIT> should be allowed as presentation attributes [SVG 2]

SWGIT> http://www.w3.org/Graphics/SVG/WG/track/issues/2430

SWGIT> Raised by: Cameron McCormack
SWGIT> On product: SVG 2

SWGIT> It can be confusing for authors why this will work:

SWGIT>   <path d="..." style="marker: url(#m)"/>

SWGIT> while this won't:

SWGIT>   <path d="..." marker="url(#m)"/>

SWGIT> and instead it must be written as:

SWGIT>   <path d="..." marker-start="url(#m)" marker-mid="url(#m)" marker-end="url(#m)"/>


And there is a good reason why we disallowed shorthand properties in attributes (this was a deliberate design decision, not an inadvertent omission).

Please explain to the above confused author what the result is of this

<path d="..." marker="url(#x)" marker-mid="url(#m)"/>

and this

<path d="..."  marker-mid="url(#m)" marker="url(#x)"/>

and why.

Then if need be, re-read the part of the XML specification that says attributes are unordered before reading both the CSS 2, CSS 2.1 and CSS 3 Fonts specs on the font shorthand property and which properties it resets (and which it doesn't).

I suggest that preliminary reading because otherwise, asking you to explain the result of

<text font="400 12px/14px 'Foo  Bar'" font-weight="bold" font-stretch="condensed" >A <tspan font-weight="bold">B</tspan</text>

(in any order of attributes) would be just cruel.

In other words, while accepting that it is a common case to set the same marker at start, mid and end, allowing shorthands to be mixed in with properties would greatly widen the scope of confusing and seemingly illogical effects and is thus a poor resolution of this specific problem.

Also, bear in mind that markers are a) not commonly used, especially on paths that are also filled or stroked b) not powerful enough for some common use cases and c) being revisited for SVG2.

-- 
 Chris Lilley   Technical Director, Interaction Domain                 
 W3C Graphics Activity Lead, Fonts Activity Lead
 Co-Chair, W3C Hypertext CG
 Member, CSS, WebFonts, SVG Working Groups

Received on Monday, 9 January 2012 11:30:21 UTC