Closed
Bug 825254
Opened 12 years ago
Closed 1 year ago
SMIL animateMotion fails to stay on path when the path itself is SMIL-animated
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
117 Branch
Tracking | Status | |
---|---|---|
firefox117 | --- | fixed |
People
(Reporter: david.dailey, Assigned: longsonr)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 1 obsolete file)
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0
Build ID: 20121128204232
Steps to reproduce:
http://granite.sru.edu/~ddailey/svg/animoval8b.svg
or
http://cs.sru.edu/~ddailey/svg/animpath3.svg
Actual results:
The moving object does not stay on the path as the path moves.
Expected results:
It should stay on the path. It does so in Opera, Chrome and Safari.
Updated•12 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 7 → All
Hardware: x86_64 → All
Version: 17 Branch → Trunk
Updated•12 years ago
|
Depends on: animateMotion
Assignee | ||
Comment 1•12 years ago
|
||
Is this a duplicate of bug 665392
Comment 2•12 years ago
|
||
Nope. An un-bitrotted version of that bug's patch doesn't seem to have any effect on this bug's testcases (but still fixes its own testcase).
I think the bug here is that we're working with the <path>'s base value, rather than its animated value, or something like that.
Comment 3•12 years ago
|
||
Here's a reduced testcase.
Comment 4•12 years ago
|
||
Updated•12 years ago
|
Attachment #696584 -
Attachment description: testcase demonstrating that this works correctly w/ JS tweaks → reference testcase (w/ JS tweaks)
Comment 5•12 years ago
|
||
OK -- so we cache the flattened path in SVGMotionSMILAnimationFunction::mPath, and we track whether we need to update our cached flattened path with "mIsPathStale".
When the <path> element changes due to scripted modifications (as in "reference testcase"), we end up toggling mIsPathStale because the <mpath> element is a mutation observer on the <path> element, and it receives a call to AttributeChanged.
However, when the path is modified by SMIL animation (as in comment 0's URLs and my attached "testcase 1"), we don't get a mutation notification for some reason.
Comment 6•12 years ago
|
||
Yeah, looks like the path's frame is the only thing that receives a notification "d" is animated.
SVGAnimatedPathSegList::SetAnimValue() calls "aElement->DidAnimatePathSegList()"...
https://mxr.mozilla.org/mozilla-central/source/content/svg/content/src/SVGAnimatedPathSegList.cpp#123
...which just calls AttributeChanged on our frame, if we have a frame:
https://mxr.mozilla.org/mozilla-central/source/content/svg/content/src/nsSVGElement.cpp#1964
Updated•12 years ago
|
Summary: SVG animation fails to stay on curve when curve is animated → SMIL animateMotion fails to stay on path when the path itself is SMIL-animated
Comment 7•12 years ago
|
||
This makes DidAnimatePathSegList() fire AttributeChanged notifications to all listeners, not just to the frame.
That's probably overkill (and may have undesirable effects), so this isn't a finished patch, but it fixes all of the attached testcases (though it seems to cause some occasional weird flickering of the paths in the first URL from comment 0, for "animoval8b.svg").
Assignee | ||
Comment 8•12 years ago
|
||
I think a better approach is that mpath shouldn't use a mutation observer, it should use an nsSVGRenderingObserver instead.
Comment 9•12 years ago
|
||
Would that work even if the <path> is "display:none", though?
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Reporter | ||
Comment 12•10 years ago
|
||
Another instance of this :
http://srufaculty.sru.edu/david.dailey/svg/bezierovals.svg
Reporter | ||
Comment 13•10 years ago
|
||
Am hoping to develop several new things using this based on http://srufaculty.sru.edu/david.dailey/cs337/follow.svg for upcoming presentations, so hope ya'll can work on it. cheers
D
Reporter | ||
Comment 14•9 years ago
|
||
It is interesting to note that animating the stroke-dasharray works fine in Firefox when the path is animated -- seems like the underlying logic in the browser might be somehow related since pathLength varies dynamically
http://cs.sru.edu/~ddailey/tangles/AnimTangleStroke.svg
and http://cs.sru.edu/~ddailey/tangles/tangleAnimStrokeAndPath.svg (latter may be more understandable, but former is simpler).
Updated•2 years ago
|
Severity: normal → S3
Assignee | ||
Comment 15•1 year ago
|
||
Updated•1 year ago
|
Assignee: nobody → longsonr
Status: NEW → ASSIGNED
Assignee | ||
Updated•1 year ago
|
Attachment #696588 -
Attachment is obsolete: true
Assignee | ||
Comment 16•1 year ago
|
||
Assignee | ||
Comment 17•1 year ago
|
||
Comment 18•1 year ago
|
||
Pushed by longsonr@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/77043dead023
SMIL animateMotion should react to the path itself being animated r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/41015 for changes under testing/web-platform/tests
Comment 20•1 year ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
status-firefox117:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in
before you can comment on or make changes to this bug.
Description
•