Bug 202052 - Remove the argument 'resultElement' from the SVG animation functions
Summary: Remove the argument 'resultElement' from the SVG animation functions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-09-20 12:07 PDT by Said Abou-Hallawa
Modified: 2019-10-30 15:16 PDT (History)
11 users (show)

See Also:


Attachments
Patch (19.48 KB, patch)
2019-09-20 12:47 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (15.06 KB, patch)
2019-09-30 11:14 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (15.06 KB, patch)
2019-10-30 12:42 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 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>.
Comment 1 Said Abou-Hallawa 2019-09-20 12:47:53 PDT
Created attachment 379258 [details]
Patch
Comment 2 Nikolas Zimmermann 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.
Comment 3 Said Abou-Hallawa 2019-09-30 11:14:13 PDT
Created attachment 379835 [details]
Patch
Comment 4 Said Abou-Hallawa 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.
Comment 5 Said Abou-Hallawa 2019-10-30 12:42:39 PDT
Created attachment 382341 [details]
Patch
Comment 6 WebKit Commit Bot 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>
Comment 7 WebKit Commit Bot 2019-10-30 15:15:26 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2019-10-30 15:16:28 PDT
<rdar://problem/56760433>