stroke-miterlimit minimum should now be 0 instead of 1
Categories
(Core :: SVG, defect, P3)
Tracking
()
People
(Reporter: ericwilligers, Assigned: violet.bugreport, Mentored)
References
Details
Attachments
(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: https://jsfiddle.net/ericwilligers/w57hm1Lc/ SVG 1.1 had a minimum stroke-miterlimit of 1: https://www.w3.org/TR/SVG11/painting.html#StrokeMiterlimitProperty https://bugzilla.mozilla.org/show_bug.cgi?id=470706 SVG 2 Draft changes the minimum to 0: https://svgwg.org/svg2-draft/painting.html#LineJoin "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
Comment 1•6 years ago
|
||
Reproduced the issue on Firefox 65.0a1 20181120220133 / 64.0b11 20181119162153/ 63.0.3 20181114214635 on Ubuntu 16.04 & Windows 10.
Comment 2•6 years ago
|
||
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.
Reporter | ||
Comment 3•6 years ago
|
||
Firefox Nightly fails the proposed parsing WPT https://github.com/web-platform-tests/wpt/pull/14114/files#diff-6ccd6c8fdf1f64bb82fa2696d5bb9648 Fail e.style['stroke-miterlimit'] = "0" should set the property value Fail e.style['stroke-miterlimit'] = "0.5" should set the property value Pass e.style['stroke-miterlimit'] = "1" should set the property value Pass e.style['stroke-miterlimit'] = "7.5" should set the property value
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
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.
Comment 5•5 years ago
|
||
Hi Violet, and welcome. Thanks for the patch. :)
Comment 6•5 years ago
|
||
Won't this patch need wpt changes as we'll get more passes there. Do you need this sending to the try server?
Updated•5 years ago
|
Comment 7•5 years ago
|
||
Comment 8•5 years ago
|
||
Looks like there's a try failure in 14. Can you fix it?
Assignee | ||
Comment 9•5 years ago
|
||
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.
Comment 10•5 years ago
|
||
You need to delete these files: https://searchfox.org/mozilla-central/source/testing/web-platform/meta/svg/painting/parsing/stroke-miterlimit-computed.svg.ini and https://searchfox.org/mozilla-central/source/testing/web-platform/meta/svg/painting/parsing/stroke-miterlimit-valid.svg.ini
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.
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Comment 11•5 years ago
|
||
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again.
Comment 12•5 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7c0393c88d68fc52066332e76549191fb861b208
if this passes I'll land it.
Comment 13•5 years ago
|
||
Pushed by longsonr@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/fbbc4b0c00c3 Change stroke-miterlimit restriction from GreaterThanOrEqualToOneNumber to NonNegativeNumber. r=longsonr,emilio
Comment 15•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Updated•5 years ago
|
Description
•