W3C home > Mailing lists > Public > www-svg@w3.org > September 2015

Re: pathLength="" affecting stroke dashing

From: Philip Rogers <pdr@google.com>
Date: Fri, 25 Sep 2015 15:42:39 -0700
Message-ID: <CAJgFLLsbN59srKPc4TvABpMFbsLBoypgcjhKSEHc3K88T13zgg@mail.gmail.com>
To: Amelia Bellamy-Royds <amelia.bellamy.royds@gmail.com>
Cc: www-svg <www-svg@w3.org>
I agree that this seems useful. I've filed http://crbug.com/536217 to
implement this in blink-based engines. Can this be made a presentation
attribute as well?

On Thu, Sep 24, 2015 at 9:01 PM, Amelia Bellamy-Royds <
amelia.bellamy.royds@gmail.com> wrote:

> Just a voice from the authoring side, it is currently really frustrating
> that browsers (other than Firefox) do not scale stroke dashes to the
> pathLength.  It makes it very difficult to arrange neat strokes that are
> symmetrical at the ends of a line, and it makes it difficult to precisely
> control the timing of stroke-drawing animations.
>
> Currently, you need to use path.getTotalLength() (or do the geometry
> calculations yourself for basic shapes), and then you need to overestimate
> the length of a dash that will cover the entire path to account for
> differences in path-length heuristics between browsers.  It would be much
> easier if you could normalize the length with pathLength="100" or similar,
> and work from there.  It is also, quite frankly, what authors *expect* the
> pathLength attribute to do, from anyone I've ever discussed it with.
> Having the attribute, but only having it affect animation and DOM methods,
> seems a waste.
>
> In other words, I'm really glad to see this new text in the spec &
> matching test case.  I can't see it breaking any current content,
> especially seeing as how Firefox already implements it this way.  But it
> does require updates to the other implementations.
>
> Amelia
>
> On 24 September 2015 at 19:09, Cameron McCormack <cam@mcc.id.au> wrote:
>
>> There was an issue in the Painting chapter to describe how the
>> pathLength="" attribute affects stroke dashing.  I’ve fixed that in the
>> spec, but upon testing I found that implementations differ.  Firefox
>> (and old Presto Opera) do scale stroke-dasharray and stroke-dashoffset
>> by the factor that results from pathLength="", while WebKit/Blink/Edge
>> don’t.  I think it does make sense for pathLength="" to affect these, as
>> anything that is specified relative to the length of the path should.
>>
>> I made an example that uses pathLength="" and dashing, which obviously
>> looks “correct” in Firefox and not in other browsers:
>>
>>
>> https://github.com/w3c/svgwg/blob/master/master/images/painting/dash-pathlength.svg
>>
>> Is this something that WebKit/Blink/Edge would be willing to fix?
>>
>> --
>> Cameron McCormack ≝ http://mcc.id.au/
>>
>>
>
Received on Friday, 25 September 2015 22:43:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:55:03 UTC