RESOLVED FIXED Bug 202052
Remove the argument 'resultElement' from the SVG animation functions
https://bugs.webkit.org/show_bug.cgi?id=202052
Summary Remove the argument 'resultElement' from the SVG animation functions
Said Abou-Hallawa
Reported 2019-09-20 12:07:43 PDT
This argument was used with the SVG tear-off objects. SVGAnimateElementBase used to have the unique_ptr 'm_animatedType' whose type was SVGAnimatedType. Because this pointer could not be shared, all the contributing SVGAnimateElementBase elements had to use the pointer of the first one which was named resultElement. Consider the following example: <svg xmlns="http://www.w3.org/2000/svg"> <rect width="100" height="100"> <animate attributeType="XML" attributeName="x" from="0" to="100" dur="3s" begin="0" fill="freeze"/> <animate attributeType="XML" attributeName="x" from="100" to="0" dur="3s" begin="3" fill="freeze"/> </rect> </svg> In this SVG, there are two <animate> elements which animate the same attribute: 'x'. In the SVG tear-off objects world, the first <animate> element was called 'resultElement' because it was creating the pointer 'm_animatedType'. The second, which was called contributor, would access this pointer through the argument 'resultElement'. After removing the SVG tear-off objects and the type SVGAnimateType, this argument is not used anymore since the SVGAnimatedPropertyAnimator accesses the animVal() of the SVGAnimatedProperty of the SVGElement directly. And this SVGAnimatedProperty can be shared among the other SVGAnimatedPropertyAnimator because the SVGElement store a Ref<SVGAnimatedProperty>.
Attachments
Patch (19.48 KB, patch)
2019-09-20 12:47 PDT, Said Abou-Hallawa
no flags
Patch (15.06 KB, patch)
2019-09-30 11:14 PDT, Said Abou-Hallawa
no flags
Patch (15.06 KB, patch)
2019-10-30 12:42 PDT, Said Abou-Hallawa
no flags
Said Abou-Hallawa
Comment 1 2019-09-20 12:47:53 PDT
Nikolas Zimmermann
Comment 2 2019-09-24 09:30:18 PDT
Comment on attachment 379258 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=379258&action=review The patch itself is a nice cleanup, thanks! > Source/WebCore/ChangeLog:8 > + This is clean-up will do the following: s/is// > Source/WebCore/ChangeLog:10 > + -- Delete the argument 'resultElement' from all the SVG animation functions s/Delete/Remove/ > Source/WebCore/ChangeLog:13 > + is progressed. processed? > Source/WebCore/ChangeLog:16 > + to stopAnimation() since there is SVGAnimatedType anymore. Starting there is no? Can you clarify this paragraph, it is hard to read. > Source/WebCore/ChangeLog:19 > + -- Use SetForScope for some temporary settings in SMILTimeContainer. This is unclear to me without some context. How about: Use the SetForScope<> for helper to temporarily change settings in SMILTimeContainer instead of hand written, potentially error-prone code.
Said Abou-Hallawa
Comment 3 2019-09-30 11:14:13 PDT
Said Abou-Hallawa
Comment 4 2019-09-30 11:18:12 PDT
Comment on attachment 379258 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=379258&action=review 1 >> Source/WebCore/ChangeLog:8 >> + This is clean-up will do the following: > > s/is// The sentence was rephrased. >> Source/WebCore/ChangeLog:10 >> + -- Delete the argument 'resultElement' from all the SVG animation functions > > s/Delete/Remove/ Fixed. >> Source/WebCore/ChangeLog:13 >> + is progressed. > > processed? Fixed. >> Source/WebCore/ChangeLog:16 >> + to stopAnimation() since there is SVGAnimatedType anymore. Starting > > there is no? Can you clarify this paragraph, it is hard to read. The sentence was rephrased. >> Source/WebCore/ChangeLog:19 >> + -- Use SetForScope for some temporary settings in SMILTimeContainer. > > This is unclear to me without some context. How about: Use the SetForScope<> for helper to temporarily change settings in SMILTimeContainer instead of hand written, potentially error-prone code. The guard m_preventScheduledAnimationsChanges was removed in r250488. So there is no need for this change anymore.
Said Abou-Hallawa
Comment 5 2019-10-30 12:42:39 PDT
WebKit Commit Bot
Comment 6 2019-10-30 15:15:25 PDT
Comment on attachment 382341 [details] Patch Clearing flags on attachment: 382341 Committed r251809: <https://trac.webkit.org/changeset/251809>
WebKit Commit Bot
Comment 7 2019-10-30 15:15:26 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 8 2019-10-30 15:16:28 PDT
Note You need to log in before you can comment on or make changes to this bug.