Re: Feature Request: markerPaint

Jeff Schiller:
>Indeed, currentColor seems like it would meet part of the need:
>
><svg xmlns="http://www.w3.org/2000/svg">
> <defs>
> <marker refX="2" orient="auto" markerHeight="5" markerWidth="5"
>markerUnits="strokeWidth" refY="5" id="arrow" viewBox="0 0 10 10">
>   <path fill="currentColor" d="m10,0l-10,5l10,5l-5,-5l5,-5z"/>
>  </marker>
> </defs>
> <line marker-start="url(#arrow)" style="color:red" stroke-width="5"
>stroke="red" y2="240" x2="293" y1="131" x1="123"/>
></svg>

>Should this give me a red marker?  I could not get any browser to do
>this, maybe it's a support thing?

No, because:
"Properties inherit into the 'marker' element from its ancestors; properties 
do not inherit from the element referencing the 'marker' element."
http://www.w3.org/TR/SVG11/painting.html#MarkerElement

You can write <marker color="red" ...><path fill="currentColor" ...>...
or set color on the svg element.

But this does not really help, if you want to reuse the marker with
different colors. But at least you can reuse the content of marker
with a use-element or a DTD entity definition and put it into 
different marker elements, one for each color.

And ... display="marker" has the same effect as display="inline" or
display="block".

Olaf

Received on Tuesday, 9 February 2010 16:19:01 UTC