SVG<path>: seting dash length in percents don't works properly




8 years ago
8 years ago


(Reporter: Brazhnyk_Yuriy, Unassigned)


Firefox Tracking Flags

(Not tracked)



(1 attachment)



8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 Safari/534.16
Build Identifier: 4.0 RC1

When seting attribute stroke-dasharray in percents result is wrong.

Reproducible: Always

Steps to Reproduce:
path d="M0,0 L100,0" stroke-dasharray="50%,50%"
Actual Results:  
Dash length ~35% of path length

Expected Results:  
Dash length shuld be 50% of path length
Component: General → SVG
Product: Firefox → Core
QA Contact: general → general
Please create SVG bugs under the Product Core and Component SVG. And can you add a complete testcase for this bug too please?

Comment 2

8 years ago
Created attachment 520656 [details]
Test SVG file

Blue and Black line must be the same, becouse path length is 100 and 50% of it is 50.

Comment 3

8 years ago
Shuld i repost this bug to Product Core, Component SVG?
OS: Windows 7 → Windows XP
No, I've changed the bug so that it is Core/SVG
Percentages are a new feature in SVG 1.1 2nd edition. They weren't allowed in SVG 1.1 1st edition.

Comment 6

8 years ago
According to (wich is previous version of standart) stroke-dasharray supports percentages but percentages calculated from viewport.
Wich means FireFox 4.0 RC1 does not fully support even 2003 year standart.

Comment 7

8 years ago
Please ignore previous message. =)
It somehow related to viewport but i can't manage how.
So it does, somehow I missed that. BTW, no browser fully supports the 2003 SVG standard.
Ever confirmed: true

Comment 9

8 years ago
I find a formula in the standard! And as far i can see it's calculated properly.
So you can close this bug. Sorry for inconvenience.

You can find formula under
sqrt((actual-width)**2 + (actual-height)**2))/sqrt(2)

Comment 10

8 years ago
Treat this like a feature request for implementing new SVG percentage system.
If you want a new percentage system for SVG you should explain your requirements to the w3c as they control the specification. Here's a link to the SVG mailing list where they discuss new ideas:
Last Resolved: 8 years ago
Resolution: --- → INVALID
They're taking new requirements for SVG 2.0 now so do join in :-)
You need to log in before you can comment on or make changes to this bug.