Bug 195862 - Remove the SVG property tear off objects for SVGAnimatedBoolean
Summary: Remove the SVG property tear off objects for SVGAnimatedBoolean
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: 195859
Blocks: 191237 195863
  Show dependency treegraph
 
Reported: 2019-03-17 09:07 PDT by Said Abou-Hallawa
Modified: 2022-09-29 13:18 PDT (History)
7 users (show)

See Also:


Attachments
Patch (156.73 KB, patch)
2019-03-17 09:19 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch for review (46.57 KB, patch)
2019-03-17 09:26 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (38.90 KB, patch)
2019-03-18 16:59 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-03-17 09:07:42 PDT
Like what we did for SVGAnimatedInteger in <https://trac.webkit.org/changeset/243036>, we are going to do similar transform for SVGAnimatedBoolean. Instead of saving the raw boolean data in the SVGElement and use the tear off object to provide the animation and the DOM objects, the SVGElement will hold a Ref<SVGAnimatedBoolean>. This will eliminate the need to create any other objects.
Comment 1 Said Abou-Hallawa 2019-03-17 09:19:47 PDT
Created attachment 364965 [details]
Patch
Comment 2 Said Abou-Hallawa 2019-03-17 09:26:57 PDT
Created attachment 364966 [details]
Patch for review
Comment 3 Simon Fraser (smfr) 2019-03-18 13:35:56 PDT
Comment on attachment 364966 [details]
Patch for review

View in context: https://bugs.webkit.org/attachment.cgi?id=364966&action=review

> Source/WebCore/svg/SVGAnimatorFactory.h:52
> -            return std::make_unique<SVGAnimatedBooleanAnimator>(animationElement, contextElement);
> +            return nullptr;

This is legacy code that will be removed?

> Source/WebCore/svg/SVGExternalResourcesRequired.h:77
> +    Ref<SVGAnimatedBoolean> m_externalResourcesRequired;

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/externalResourcesRequired says that "externalResourcesRequired" is not animatable (I could not find it in the spec). So why do we make a animated boolean for it?
Comment 4 Said Abou-Hallawa 2019-03-18 16:12:20 PDT
Comment on attachment 364966 [details]
Patch for review

View in context: https://bugs.webkit.org/attachment.cgi?id=364966&action=review

>> Source/WebCore/svg/SVGAnimatorFactory.h:52
>> +            return nullptr;
> 
> This is legacy code that will be removed?

Yes.

>> Source/WebCore/svg/SVGExternalResourcesRequired.h:77
>> +    Ref<SVGAnimatedBoolean> m_externalResourcesRequired;
> 
> https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/externalResourcesRequired says that "externalResourcesRequired" is not animatable (I could not find it in the spec). So why do we make a animated boolean for it?

This comment at the top of Source/WebCore/svg/SVGExternalResourcesRequired.h might explain why it was defined as SVGAnimatedBoolean. But I did not understand what is the difference between the SVG DOM and the SVG language definition especially there is no links. 

// Notes on a SVG 1.1 spec discrepancy:
// The SVG DOM defines the attribute externalResourcesRequired as being of type SVGAnimatedBoolean, whereas the 
// SVG language definition says that externalResourcesRequired is not animated. Because the SVG language definition
// states that externalResourcesRequired cannot be animated, the animVal will always be the same as the baseVal.
// FIXME: When implementing animVal support, make sure that animVal==baseVal for externalResourcesRequired

I am not sure what we should do here. According to https://www.w3.org/TR/SVG/changes.html, SVGExternalResourcesRequired was removed from SVG2. Should we remove it? If we remove it, what is the backward compatibility story here?

We still need the SVGAnimatedBoolean because it is used by SVGFEConvolveMatrixElement according to https://drafts.fxtf.org/filter-effects/#element-attrdef-feconvolvematrix-preservealpha.
Comment 5 Simon Fraser (smfr) 2019-03-18 16:26:23 PDT
Let's just keep existing behavior for now.
Comment 6 Said Abou-Hallawa 2019-03-18 16:59:50 PDT
Created attachment 365092 [details]
Patch
Comment 7 WebKit Commit Bot 2019-03-18 17:39:47 PDT
Comment on attachment 365092 [details]
Patch

Clearing flags on attachment: 365092

Committed r243121: <https://trac.webkit.org/changeset/243121>
Comment 8 WebKit Commit Bot 2019-03-18 17:39:48 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2019-03-18 17:40:22 PDT
<rdar://problem/49001748>