Closed Bug 769115 Opened 12 years ago Closed 12 years ago

SVG marker orientation wrong on curved paths


(Core :: SVG, defect)

Not set



Tracking Status
firefox13 --- affected
firefox14 - affected
firefox15 + verified
firefox16 + fixed


(Reporter: maps, Assigned: heycam)



(Keywords: regression, testcase)


(3 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1
Build ID: 20120615112143

Steps to reproduce:

When rendering a curved SVG path with an orient="auto" marker at the start and/or end, the marker is not properly oriented.  See the attached test case.

Actual results:

The wide black arrows on the ends of the arc point roughly perpendicular to the line.

The arrows point in different directions depending on how the line is drawn, and in many cases they point in the opposite direction that they should.

Expected results:

The arrows should point "along" the line, with the arrow on the right pointing down and the one on the left pointing up.  View the testcase in Chrome to see the expected/proper behavior.
This is very similar to bug 288165, but I didn't want to reopen a seven year old bug.
There is a regression indeed. Left arrow is up and right arrow is down in FF12-. Broken in FF13+ (Nightly too).

Mozregression range:



Suspected bug:
766fdf473acd	Cameron McCormack — Bug 728661 - Remove CalcVectorAngle and use AngleOfVector instead. r=jwatt
Blocks: 728661
Component: Untriaged → SVG
Ever confirmed: true
Keywords: regression, testcase
OS: Linux → All
Product: Firefox → Core
QA Contact: untriaged → general
Hardware: x86_64 → All
Thanks for the regression range, I'll look into it.
Assignee: nobody → cam
Attached patch patchSplinter Review
The previous fix was bogus was completely bogus -- AngleOfVector computes the angle between the vector and the x axis, so for computing theta we didn't need to use the (1,0) vector and for delta we can just pass the second point to AngleOfVector and get the difference between that and theta.
Attachment #637398 - Flags: review?
Comment on attachment 637398 [details] [diff] [review]

*cough double bogosity*
Attachment #637398 - Flags: review? → review?(jwatt)
I experienced the same problem on firefox 13.0.1 and 14.0 beta. firefox 12.0 has no problem.

The problem is 
 marker arrow is added to arch with refX and refY, but the arrow position is not put properly.

Comment on attachment 637398 [details] [diff] [review]

I think jwatt is away at the moment.
Attachment #637398 - Flags: review?(jwatt) → review?(longsonr)
Attachment #637398 - Attachment is patch: true
Version: 13 Branch → Trunk
Comment on attachment 637398 [details] [diff] [review]

r=jwatt, but fix the bug number mentioned in the test and ref to 769115.

We should land this on branches too.
Attachment #637398 - Flags: review?(longsonr) → review+
Not tracking for Firefox 14 as this is not a new regression in FF14, and doesn't sound particularly critical from the user perspective. If this patch carries near-zero risk, please nominate for Beta approval on top of Aurora approval.
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
The bug - marker on arch was fixed in the

It has been tested with NetFlow Auditor on several cases.

Thanks for so fast respond.
Dirk, thanks for the bug report, and for the nice small testcase.

Boris, you're welcome, and thanks for testing the patch.

By the way, the SVG team could really do with some help catching problems like this _before_ they reach the release builds. We don't seem to have enough people testing SVG before that stage right now. The Beta builds are very stable (get virtually no changes before release), so if you'd be willing to use Beta or Aurora builds for your day-to-day browsing and report any regressions that you notice, that would be a great help. If you're interested, you can find Beta/Aurora builds here:
Attachment #637398 - Flags: approval-mozilla-beta?
(In reply to Alex Keybl [:akeybl] from comment #10)
> If this patch carries near-zero risk, please nominate for Beta approval on top
> of Aurora approval.

It does indeed have near zero risk. Pretty much all this patch can do is change the orientation of markers, and if that were to be wrong for some reason, well we'd just swap one type of orientation breakage for another. I think it's worth taking this on beta, so nominating.

We are happy to do some test for you. Our product only uses a small part of SVG. It would be useful to understand your release/development cycle so we can align some of our development. Alternatively you can install an eval of our software (NetFlow Auditor) in your network so that you can test SVG with our netflow visualization feature at any stage of your development.
Boris: provides some info on upcoming releases. Basically I'm suggesting that you use one of the upcoming releases instead of the release version of Firefox when developing your product. That way you'll be able to report in advance if we break something that affects you, and hopefully we can fix it before it affects your customers. We don't have the time or resources to run everyone's applications for them I'm afraid.
No problem, we will try it. Thanks.
Awesome, thank you!
Comment on attachment 637398 [details] [diff] [review]

Thanks for getting this into Aurora, it's too late to land this on Beta now though so we'll have to let this ride another cycle.
Attachment #637398 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
Verified fixed on FF 15b3 on Win 7, Ubuntu 12.04 and Mac OS X 10.6 using the STR in comment 0.
You need to log in before you can comment on or make changes to this bug.