Re: Markers and currentColor

Hi Tav,

Tavmjong Bah:
> I propose adding a sentence after the one that begins "Properties
> inherit into the 'marker' element..." so that the paragraph reads:
>
>     Properties inherit into the ‘marker’ element from its ancestors;
>     properties do not inherit from the element referencing the
>     ‘marker’ element. If a child element in the marker has a property
>     or style attribute with a value of "currentColor" and an ancestor
>     of that child element in the marker or the marker itself does not
>     specify a value for <color>, the marker shall use the value of
>     <color> obtained from the element referencing the 'marker' element.

It is not usual in CSS to have different behaviour depending on how a
property got its value.  The color property has a value on every
element: it is an inherited property, so if it is not specified on the
root element, it gets the initial value (black) and if it is no
specified on any other element, it gets its parent element’s value.

Having the behaviour of currentColor differ depending on whether the
color property was *specified* on the marker element (or one of its
children) is not consistent with how properties and their values are
treated in CSS.

I dont think we can get away with just a simple clarification in SVG 1.1
Second Edition.  The simplest we can do, I believe, is to introduce new
keywords for paints that mean “the computed value of fill/stroke/color
from the referencing element”.  For example something like:

  <svg ...>
    <defs>
      <marker id="MyMarker" ...>
        <path style="fill:referencingFill" ...>
      </marker>
    </defs>
    <path style="marker-end:url(#MyMarker);
                 stroke:red..." .../>
  </svg>

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Wednesday, 16 March 2011 01:27:54 UTC