W3C home > Mailing lists > Public > www-svg@w3.org > April 2010

Help w/ Markers

From: Patrick Dengler <patd@microsoft.com>
Date: Sat, 10 Apr 2010 02:37:04 +0000
To: Doug Schepers <schepers@w3.org>, "www-svg@w3.org" <www-svg@w3.org>
Message-ID: <4A2DB3AE4504E944AF122BBFBA7FBA1F4E7CAD53@TK5EX14MBXC116.redmond.corp.microsoft.com>
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 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:44 GMT