Help w/ Markers

I know no one has anything better to do than think about markers over the weekend ;)

Alright, what is the expected behavior here?

1) Should marker instances fire events? (yes?)
2) Should they inherit CSS properties at the point of instantiation? (seems like they should)

We are seeing signficantly different behaviors on hit testing, and sytles (via selectors or style).  The spec is ambiguous. 

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
  <svg width="800" height="600" version="1.1" xmlns="http://www.w3.org/2000/svg"
    style="fill:blue;">
  <defs style="fill:green;">
    <style type="text/css">
    <![CDATA[
    .mystyle {stroke: blue;}
    .mystyle:hover {stroke: red; }
    ]]>
    </style>
    <marker id="Triangle" refX="0" refY="5" 
      markerUnits="strokeWidth" markerWidth="20" markerHeight="10"
      class="mystyle"
      onclick="alert('Hit Marker');">
      <path d="M 0 0 L 20 5 L 0 10 z" />
    </marker>
  </defs>
  <line x1="100" y1="75" x2="200" y2="75"
        stroke-width="5"
        class="mystyle"
        marker-end="url(#Triangle)" 
        onclick="alert('Hit Line');" />
</svg>


Marker: “For user agents that support Styling with CSS, the conceptual deep cloning of the referenced ‘marker’ element into a non-exposed DOM tree also copies any property values resulting from the CSS cascade ([CSS2], chapter 6) and property inheritance on the referenced element and its contents. CSS2 selectors can be applied to the original (i.e., referenced) elements because they are part of the formal document structure. CSS2 selectors cannot be applied to the (conceptually) cloned DOM tree because its contents are not part of the formal document structure.”
 
Use: “For user agents that support Styling with CSS, the conceptual deep cloning of the referenced element into a non-exposed DOM tree also copies any property values resulting from the CSS cascade ([CSS2], chapter 6) on the referenced element and its contents. CSS2 selectors can be applied to the original (i.e., referenced) elements because they are part of the formal document structure. CSS2 selectors cannot be applied to the (conceptually) cloned DOM tree because its contents are not part of the formal document structure.”
 
(from our fantastically smart test engineer Kurt:)
The differentiation in style inheritance for <use> is described in this sentence: “Property inheritance, however, works as if the referenced element had been textually included as a deeply cloned child of the ‘use’ element. The referenced element inherits properties from the ‘use’ element and the ‘use’ element's ancestors. An instance of a referenced element does not inherit properties from the referenced element's original parents.” – it looks like <marker> behaves differently here, and actually does inherit properties from the referenced element’s parents.
 

Received on Saturday, 10 April 2010 02:37:43 UTC