marker-pattern has a weird grammar

The current grammar for marker-pattern is:

[ none | <length> | <percentage> | <marker-ref> ]+

What this is trying to express is "one or more groups of markers (or
'none' to indicate no marker at a given spot), each group separated by
a length or percentage, and the whole list possibly preceded or
followed by a length or percentage"

What it actually expresses is that things like this are possible:

50px 5% url(#m1) none url(#m2)

1. Chaining multiple lengths/percentages together is unnecessary, as
we have calc() when we want to add together dissimilar units.

2. Allowing multiple markers at a given spot is fine, but it should be
a choice of saying "none" *or* 1+ markers; mixing them is silly.

Here's a grammar that expresses what we want better:

<marker-gap>? <marker-ref-group> [ <marker-gap> <marker-ref-group> ]*
<marker-gap>?
<marker-gap> = <length> | <percentage>
<marker-ref-group> = none | <marker-ref>+

~TJ

Received on Wednesday, 5 November 2014 23:29:53 UTC