Closed Bug 1508028 Opened 4 years ago Closed 3 years ago

stroke-miterlimit minimum should now be 0 instead of 1


(Core :: SVG, defect, P3)




Tracking Status
firefox63 --- wontfix
firefox64 --- wontfix
firefox65 --- wontfix
firefox66 --- wontfix
firefox67 --- fixed


(Reporter: ericwilligers, Assigned: violet.bugreport, Mentored)




(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36

Steps to reproduce:

SVG 1.1 had a minimum stroke-miterlimit of 1: 

SVG 2 Draft changes the minimum to 0: 
"A negative value for stroke-miterlimit must be treated as an illegal value.
Previous versions of the SVG specification also stated that values between 0 and 1 were in error, but ..."
Blink/Edge/Safari accept values from 0.

Actual results:

Firefox rejects stroke-miterlimit values less than 1

Expected results:

Firefox should only reject stroke-miterlimit values less than 0

Then Firefox would be consistent with SVG 2 Draft and Blink/Edge/Safari
Reproduced the issue on Firefox 65.0a1 20181120220133 / 64.0b11 20181119162153/  63.0.3 20181114214635 on Ubuntu 16.04 & Windows 10.
Component: Untriaged → SVG
Product: Firefox → Core
See Also: → 649960
bug 649960 seems to be already fixed, at leased, I cannot see a wrong behaviour in my example in current versions anymore (or only, if I dynamically change the size of the SVG, that might be a hint, that only the accuracy is low).
And it seems not to be related.

About this issue: 
Because the miter angle is always between 0 and 180 degree, miterLength/stroke-width will be always larger than or equal 1.
Therefore it is not meaningful, if authors note values smaller than 1. SVG 1.1 is correct here.
But the formula is the same in 1.1 and 2 anyway, therefore no other behaviour (the comment in the SVG 2 draft about other historically definitions is wrong, at least concerning SVG).
The SVG 2 draft seems not to describe, what to do with values smaller than 1, presumably the behaviour can be the same as for 1, in this case there is no difference between stroke-linejoin miter or bevel anyway, because the two segments join smoothly without a corner.
Firefox Nightly fails the proposed parsing WPT
Fail['stroke-miterlimit'] = "0" should set the property value
Fail['stroke-miterlimit'] = "0.5" should set the property value
Pass['stroke-miterlimit'] = "1" should set the property value
Pass['stroke-miterlimit'] = "7.5" should set the property value
Mentor: jwatt
Ever confirmed: true
Priority: -- → P3

SVG2 permits stroke-miterlimit to be between 0 and 1, which is also implemented
in other browsers. Our previous parser didn't allow stroke-miterlimit to be
smaller than 1. We relax this limitation to satisfy SVG2.

Hi Violet, and welcome. Thanks for the patch. :)

Won't this patch need wpt changes as we'll get more passes there. Do you need this sending to the try server?

Assignee: nobody → violet.bugreport

Looks like there's a try failure in 14. Can you fix it?

Sorry for the delay, I didn't seem to get notifications about your comments, perhaps you forgot to needinfo me...

I've fixed the test 14 in layout/style. But there're 2 wpt tests that are deliberately configured as "expect to fail", now it should pass and it actually passes, so it's becoming "UNEXPECTED-PASS". Do you know how it is configured that way? I couldn't find a clue in the test file, it must be in some config stuff.

Flags: needinfo?(longsonr)

You need to delete these files: and

If there were remaining failures you'd just edit the files but I belive there aren't so you can just remove the files altogether.

Flags: needinfo?(longsonr)
Flags: needinfo?(violet.bugreport)
Attachment #9045545 - Attachment description: Bug 1508028 - Change stroke-miterlimit restriction from GreaterThanOrEqualToOneNumber to NonNegativeNumber. r=jwatt → Bug 1508028 - Change stroke-miterlimit restriction from GreaterThanOrEqualToOneNumber to NonNegativeNumber.
Flags: needinfo?(violet.bugreport)
Keywords: checkin-needed

We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again.

Flags: needinfo?(violet.bugreport)
Keywords: checkin-needed
Pushed by
Change stroke-miterlimit restriction from GreaterThanOrEqualToOneNumber to NonNegativeNumber. r=longsonr,emilio

Thanks for the patch violet.

Flags: needinfo?(violet.bugreport)
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.