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

RE: oddities with dasharray, markers and use

From: Tony Schreiner <tonyschr@microsoft.com>
Date: Wed, 6 Apr 2011 23:50:58 +0000
To: David Dailey <ddailey@zoominternet.net>, "www-svg@w3.org" <www-svg@w3.org>
CC: "yan.li@sru.edu" <yan.li@sru.edu>
Message-ID: <B20868C1F6435540A97DBB6B05F18F2517EAF378@TK5EX14MBXW605.wingroup.windeploy.ntdev.microsoft.com>
Hi David, a few comments below:

#1 unfortunately looks like a bug in IE9 and I've forwarded for investigation. This is specific to marker and has a simple (but odd) workaround that should work for most scenarios: create a dummy marker and attach it  to an unused marker attribute on the original path, e.g.:
    <marker id="Blank">
      <rect />
    </marker>
    <path id="P" d="M 100 50 C 100 50 150 250 200 100 250 -50 300 250 350 170 400 90 450 50 600 160" fill="none" marker-start="url(#Blank)" />
This will make the real marker-mid and marker-end from the <use> show up properly.

#2 - There have been discussions about this from time to time. See:
- http://lists.w3.org/Archives/Public/www-svg/2010Feb/0023.html
- http://lists.w3.org/Archives/Public/www-svg/2010Jul/0066.html
- http://www.w3.org/2010/07/20-svg-minutes.html

After consideration and discussion with the working group IE9 slightly deviates from the spec on the grounds that it's the more correct, future-looking behavior. The <use> style of inheritance enables the key scenario of being able to apply a single marker (e.g. arrowhead) to lines with differing styles, and have it match the line. It is a minor interoperability issue, but can be solved by explicitly setting the properties on the primitives in the marker. I can't speak for Chrome or the ASV.

#4 - I don't understand the question. The two <use> elements with transforms are referencing the T1 element, which does not have a stroke-dasharray.

- Tony

From: www-svg-request@w3.org [mailto:www-svg-request@w3.org] On Behalf Of David Dailey
Sent: Sunday, April 03, 2011 2:04 PM
To: www-svg@w3.org
Cc: yan.li@sru.edu
Subject: oddities with dasharray, markers and use

Hi folks,

(I'm not sure what about this is browser bugs and what is spec bugs)

Take a look at the examples at http://granite.sru.edu/~ddailey/svg/tracks.svg .


1.       In IE9 and ASV, the markers cannot be applied to a <use> even though stroke-dasharray can.

2.       In Chrome (and ASV and IE9 when no use is involved), the markers inherit the dash array of the stroke. Not elsewhere though.

3.       In Firefox (but nowhere else), if you click on the brown lines of the dasharray or on the silver line underneath, (just the top uses and not the second reuse), the event bubbles through to the defined path.  (this idiosyncracy of <use> in the larger case, and whether or not the event finds the original is rather startling to many authors, who expect the <use> to behave more as if it is a clone when it comes to event handling - perhaps this relates to a recent call for input concerning <use>

4.       The transform applied to the two <use>s of T1 in the lower example, interestingly, does not translate the dasharray. This might come as a bit of a shock to some.

5.       It would be awfully nice for cartographic purposes to be able to apply markers at regular intervals along a path, rather than just at the vertices (as per SVG 1.1, at least). Sure, one can do this with script, but then the slope of the curve has to be calculated and so forth. It would allow for a much broader class of path decorations appropriate to such things as trails, rails, highways, borders, lake boundaries etc.

My guesses above:

1.       Is a bug in IE and ASV

2.       Is a bug in Chrome, ASV and IE

3.       Is a bug in Firefox (though I think I prefer it to how Opera, WebKit, IE and ASV handle it)

4.       Is how the spec is written, but perhaps shouldn't be

5.       Is how the spec is written, but perhaps shouldn't be.
I'll be interested to hear others' opinions.

Cheers
David
Received on Wednesday, 6 April 2011 23:51:29 GMT

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