Changeset 243185 in webkit


Ignore:
Timestamp:
Mar 19, 2019 6:49:29 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Remove the SVG property tear off objects of SVGAnimatedPreserveAspectRatio
https://bugs.webkit.org/show_bug.cgi?id=195960

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-03-19
Reviewed by Simon Fraser.

-- Define SVGAnimatedPreserveAspectRatio to be SVGAnimatedValueProperty<

SVGPreserveAspectRatio>.

-- Make SVGPreserveAspectRatio be derived form SVGValueProperty<

SVGPreserveAspectRatioValue>.

-- Add SVGAnimatedPreserveAspectRatioAccessor to access the animated

property.

-- Add SVGAnimatedPreserveAspectRatioAnimator to animate the animated

property of the target element and all its instances.

-- Add SVGAnimationPreserveAspectRatioFunction to progress animVal of

animated property in a period of time.

SVGFilterPrimitiveStandardAttributes::build() should be const function.
This is required for this patch because SVGFEImageElement::build() calls
SVGFEImageElement::preserveAspectRatio() which is const.

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • svg/SVGAnimatedPreserveAspectRatio.cpp: Removed.
  • svg/SVGAnimatedPreserveAspectRatio.h: Removed.
  • svg/SVGAnimatorFactory.h:

(WebCore::SVGAnimatorFactory::create):

  • svg/SVGFEBlendElement.cpp:

(WebCore::SVGFEBlendElement::build const):
(WebCore::SVGFEBlendElement::build): Deleted.

  • svg/SVGFEBlendElement.h:
  • svg/SVGFEColorMatrixElement.cpp:

(WebCore::SVGFEColorMatrixElement::build const):
(WebCore::SVGFEColorMatrixElement::build): Deleted.

  • svg/SVGFEColorMatrixElement.h:
  • svg/SVGFEComponentTransferElement.cpp:

(WebCore::SVGFEComponentTransferElement::build const):
(WebCore::SVGFEComponentTransferElement::build): Deleted.

  • svg/SVGFEComponentTransferElement.h:
  • svg/SVGFECompositeElement.cpp:

(WebCore::SVGFECompositeElement::build const):
(WebCore::SVGFECompositeElement::build): Deleted.

  • svg/SVGFECompositeElement.h:
  • svg/SVGFEConvolveMatrixElement.cpp:

(WebCore::SVGFEConvolveMatrixElement::build const):
(WebCore::SVGFEConvolveMatrixElement::build): Deleted.

  • svg/SVGFEConvolveMatrixElement.h:
  • svg/SVGFEDiffuseLightingElement.cpp:

(WebCore::SVGFEDiffuseLightingElement::build const):
(WebCore::SVGFEDiffuseLightingElement::build): Deleted.

  • svg/SVGFEDiffuseLightingElement.h:
  • svg/SVGFEDisplacementMapElement.cpp:

(WebCore::SVGFEDisplacementMapElement::build const):
(WebCore::SVGFEDisplacementMapElement::build): Deleted.

  • svg/SVGFEDisplacementMapElement.h:
  • svg/SVGFEDropShadowElement.cpp:

(WebCore::SVGFEDropShadowElement::build const):
(WebCore::SVGFEDropShadowElement::build): Deleted.

  • svg/SVGFEDropShadowElement.h:
  • svg/SVGFEFloodElement.cpp:

(WebCore::SVGFEFloodElement::build const):
(WebCore::SVGFEFloodElement::build): Deleted.

  • svg/SVGFEFloodElement.h:
  • svg/SVGFEGaussianBlurElement.cpp:

(WebCore::SVGFEGaussianBlurElement::build const):
(WebCore::SVGFEGaussianBlurElement::build): Deleted.

  • svg/SVGFEGaussianBlurElement.h:
  • svg/SVGFEImageElement.cpp:

(WebCore::SVGFEImageElement::SVGFEImageElement):
(WebCore::SVGFEImageElement::parseAttribute):
(WebCore::SVGFEImageElement::build const):
(WebCore::SVGFEImageElement::registerAttributes): Deleted.
(WebCore::SVGFEImageElement::build): Deleted.

  • svg/SVGFEImageElement.h:
  • svg/SVGFEMergeElement.cpp:

(WebCore::SVGFEMergeElement::build const):
(WebCore::SVGFEMergeElement::build): Deleted.

  • svg/SVGFEMergeElement.h:
  • svg/SVGFEMorphologyElement.cpp:

(WebCore::SVGFEMorphologyElement::build const):
(WebCore::SVGFEMorphologyElement::build): Deleted.

  • svg/SVGFEMorphologyElement.h:
  • svg/SVGFEOffsetElement.cpp:

(WebCore::SVGFEOffsetElement::build const):
(WebCore::SVGFEOffsetElement::build): Deleted.

  • svg/SVGFEOffsetElement.h:
  • svg/SVGFESpecularLightingElement.cpp:

(WebCore::SVGFESpecularLightingElement::build const):
(WebCore::SVGFESpecularLightingElement::build): Deleted.

  • svg/SVGFESpecularLightingElement.h:
  • svg/SVGFETileElement.cpp:

(WebCore::SVGFETileElement::build const):
(WebCore::SVGFETileElement::build): Deleted.

  • svg/SVGFETileElement.h:
  • svg/SVGFETurbulenceElement.cpp:

(WebCore::SVGFETurbulenceElement::build const):
(WebCore::SVGFETurbulenceElement::build): Deleted.

  • svg/SVGFETurbulenceElement.h:
  • svg/SVGFilterPrimitiveStandardAttributes.h:
  • svg/SVGFitToViewBox.cpp:

(WebCore::SVGFitToViewBox::SVGFitToViewBox):
(WebCore::SVGFitToViewBox::parseViewBox):
(WebCore::SVGFitToViewBox::registerAttributes): Deleted.

  • svg/SVGFitToViewBox.h:

(WebCore::SVGFitToViewBox::preserveAspectRatio const):
(WebCore::SVGFitToViewBox::preserveAspectRatioAnimated):
(WebCore::SVGFitToViewBox::setPreserveAspectRatio):
(WebCore::SVGFitToViewBox::resetPreserveAspectRatio):
(WebCore::SVGFitToViewBox::preserveAspectRatioString const):

  • svg/SVGImageElement.cpp:

(WebCore::SVGImageElement::SVGImageElement):
(WebCore::SVGImageElement::registerAttributes):
(WebCore::SVGImageElement::parseAttribute):

  • svg/SVGImageElement.h:
  • svg/SVGMarkerElement.h:
  • svg/SVGPatternElement.h:
  • svg/SVGPreserveAspectRatio.h:

(WebCore::SVGPreserveAspectRatio::create):
(WebCore::SVGPreserveAspectRatio::align const):
(WebCore::SVGPreserveAspectRatio::setAlign):
(WebCore::SVGPreserveAspectRatio::meetOrSlice const):
(WebCore::SVGPreserveAspectRatio::setMeetOrSlice):
(WebCore::SVGPreserveAspectRatio::align): Deleted.
(WebCore::SVGPreserveAspectRatio::meetOrSlice): Deleted.
(WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Deleted.

  • svg/SVGSVGElement.h:
  • svg/SVGStringList.h:
  • svg/SVGSymbolElement.h:
  • svg/SVGViewSpec.h:
  • svg/properties/SVGAnimatedPropertyAccessorImpl.h:
  • svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
  • svg/properties/SVGAnimatedPropertyImpl.h:
  • svg/properties/SVGAnimationDiscreteFunctionImpl.h:
  • svg/properties/SVGAttributeRegistry.h:
  • svg/properties/SVGPropertyOwnerRegistry.h:

(WebCore::SVGPropertyOwnerRegistry::registerProperty):

Location:
trunk/Source/WebCore
Files:
2 deleted
56 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r243183 r243185  
     12019-03-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        Remove the SVG property tear off objects of SVGAnimatedPreserveAspectRatio
     4        https://bugs.webkit.org/show_bug.cgi?id=195960
     5
     6        Reviewed by Simon Fraser.
     7
     8        -- Define SVGAnimatedPreserveAspectRatio to be SVGAnimatedValueProperty<
     9           SVGPreserveAspectRatio>.
     10
     11        -- Make SVGPreserveAspectRatio be derived form SVGValueProperty<
     12           SVGPreserveAspectRatioValue>.
     13
     14        -- Add SVGAnimatedPreserveAspectRatioAccessor to access the animated
     15           property.
     16
     17        -- Add SVGAnimatedPreserveAspectRatioAnimator to animate the animated
     18           property of the target element and all its instances.
     19
     20        -- Add SVGAnimationPreserveAspectRatioFunction to progress animVal of
     21           animated property in a period of time.
     22
     23        SVGFilterPrimitiveStandardAttributes::build() should be const function.
     24        This is required for this patch because SVGFEImageElement::build() calls
     25        SVGFEImageElement::preserveAspectRatio() which is const.
     26
     27        * Sources.txt:
     28        * WebCore.xcodeproj/project.pbxproj:
     29        * svg/SVGAnimatedPreserveAspectRatio.cpp: Removed.
     30        * svg/SVGAnimatedPreserveAspectRatio.h: Removed.
     31        * svg/SVGAnimatorFactory.h:
     32        (WebCore::SVGAnimatorFactory::create):
     33        * svg/SVGFEBlendElement.cpp:
     34        (WebCore::SVGFEBlendElement::build const):
     35        (WebCore::SVGFEBlendElement::build): Deleted.
     36        * svg/SVGFEBlendElement.h:
     37        * svg/SVGFEColorMatrixElement.cpp:
     38        (WebCore::SVGFEColorMatrixElement::build const):
     39        (WebCore::SVGFEColorMatrixElement::build): Deleted.
     40        * svg/SVGFEColorMatrixElement.h:
     41        * svg/SVGFEComponentTransferElement.cpp:
     42        (WebCore::SVGFEComponentTransferElement::build const):
     43        (WebCore::SVGFEComponentTransferElement::build): Deleted.
     44        * svg/SVGFEComponentTransferElement.h:
     45        * svg/SVGFECompositeElement.cpp:
     46        (WebCore::SVGFECompositeElement::build const):
     47        (WebCore::SVGFECompositeElement::build): Deleted.
     48        * svg/SVGFECompositeElement.h:
     49        * svg/SVGFEConvolveMatrixElement.cpp:
     50        (WebCore::SVGFEConvolveMatrixElement::build const):
     51        (WebCore::SVGFEConvolveMatrixElement::build): Deleted.
     52        * svg/SVGFEConvolveMatrixElement.h:
     53        * svg/SVGFEDiffuseLightingElement.cpp:
     54        (WebCore::SVGFEDiffuseLightingElement::build const):
     55        (WebCore::SVGFEDiffuseLightingElement::build): Deleted.
     56        * svg/SVGFEDiffuseLightingElement.h:
     57        * svg/SVGFEDisplacementMapElement.cpp:
     58        (WebCore::SVGFEDisplacementMapElement::build const):
     59        (WebCore::SVGFEDisplacementMapElement::build): Deleted.
     60        * svg/SVGFEDisplacementMapElement.h:
     61        * svg/SVGFEDropShadowElement.cpp:
     62        (WebCore::SVGFEDropShadowElement::build const):
     63        (WebCore::SVGFEDropShadowElement::build): Deleted.
     64        * svg/SVGFEDropShadowElement.h:
     65        * svg/SVGFEFloodElement.cpp:
     66        (WebCore::SVGFEFloodElement::build const):
     67        (WebCore::SVGFEFloodElement::build): Deleted.
     68        * svg/SVGFEFloodElement.h:
     69        * svg/SVGFEGaussianBlurElement.cpp:
     70        (WebCore::SVGFEGaussianBlurElement::build const):
     71        (WebCore::SVGFEGaussianBlurElement::build): Deleted.
     72        * svg/SVGFEGaussianBlurElement.h:
     73        * svg/SVGFEImageElement.cpp:
     74        (WebCore::SVGFEImageElement::SVGFEImageElement):
     75        (WebCore::SVGFEImageElement::parseAttribute):
     76        (WebCore::SVGFEImageElement::build const):
     77        (WebCore::SVGFEImageElement::registerAttributes): Deleted.
     78        (WebCore::SVGFEImageElement::build): Deleted.
     79        * svg/SVGFEImageElement.h:
     80        * svg/SVGFEMergeElement.cpp:
     81        (WebCore::SVGFEMergeElement::build const):
     82        (WebCore::SVGFEMergeElement::build): Deleted.
     83        * svg/SVGFEMergeElement.h:
     84        * svg/SVGFEMorphologyElement.cpp:
     85        (WebCore::SVGFEMorphologyElement::build const):
     86        (WebCore::SVGFEMorphologyElement::build): Deleted.
     87        * svg/SVGFEMorphologyElement.h:
     88        * svg/SVGFEOffsetElement.cpp:
     89        (WebCore::SVGFEOffsetElement::build const):
     90        (WebCore::SVGFEOffsetElement::build): Deleted.
     91        * svg/SVGFEOffsetElement.h:
     92        * svg/SVGFESpecularLightingElement.cpp:
     93        (WebCore::SVGFESpecularLightingElement::build const):
     94        (WebCore::SVGFESpecularLightingElement::build): Deleted.
     95        * svg/SVGFESpecularLightingElement.h:
     96        * svg/SVGFETileElement.cpp:
     97        (WebCore::SVGFETileElement::build const):
     98        (WebCore::SVGFETileElement::build): Deleted.
     99        * svg/SVGFETileElement.h:
     100        * svg/SVGFETurbulenceElement.cpp:
     101        (WebCore::SVGFETurbulenceElement::build const):
     102        (WebCore::SVGFETurbulenceElement::build): Deleted.
     103        * svg/SVGFETurbulenceElement.h:
     104        * svg/SVGFilterPrimitiveStandardAttributes.h:
     105        * svg/SVGFitToViewBox.cpp:
     106        (WebCore::SVGFitToViewBox::SVGFitToViewBox):
     107        (WebCore::SVGFitToViewBox::parseViewBox):
     108        (WebCore::SVGFitToViewBox::registerAttributes): Deleted.
     109        * svg/SVGFitToViewBox.h:
     110        (WebCore::SVGFitToViewBox::preserveAspectRatio const):
     111        (WebCore::SVGFitToViewBox::preserveAspectRatioAnimated):
     112        (WebCore::SVGFitToViewBox::setPreserveAspectRatio):
     113        (WebCore::SVGFitToViewBox::resetPreserveAspectRatio):
     114        (WebCore::SVGFitToViewBox::preserveAspectRatioString const):
     115        * svg/SVGImageElement.cpp:
     116        (WebCore::SVGImageElement::SVGImageElement):
     117        (WebCore::SVGImageElement::registerAttributes):
     118        (WebCore::SVGImageElement::parseAttribute):
     119        * svg/SVGImageElement.h:
     120        * svg/SVGMarkerElement.h:
     121        * svg/SVGPatternElement.h:
     122        * svg/SVGPreserveAspectRatio.h:
     123        (WebCore::SVGPreserveAspectRatio::create):
     124        (WebCore::SVGPreserveAspectRatio::align const):
     125        (WebCore::SVGPreserveAspectRatio::setAlign):
     126        (WebCore::SVGPreserveAspectRatio::meetOrSlice const):
     127        (WebCore::SVGPreserveAspectRatio::setMeetOrSlice):
     128        (WebCore::SVGPreserveAspectRatio::align): Deleted.
     129        (WebCore::SVGPreserveAspectRatio::meetOrSlice): Deleted.
     130        (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Deleted.
     131        * svg/SVGSVGElement.h:
     132        * svg/SVGStringList.h:
     133        * svg/SVGSymbolElement.h:
     134        * svg/SVGViewSpec.h:
     135        * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
     136        * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
     137        * svg/properties/SVGAnimatedPropertyImpl.h:
     138        * svg/properties/SVGAnimationDiscreteFunctionImpl.h:
     139        * svg/properties/SVGAttributeRegistry.h:
     140        * svg/properties/SVGPropertyOwnerRegistry.h:
     141        (WebCore::SVGPropertyOwnerRegistry::registerProperty):
     142
    11432019-03-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
    2144
  • trunk/Source/WebCore/Sources.txt

    r243183 r243185  
    22802280svg/SVGAnimatedPath.cpp
    22812281svg/SVGAnimatedPointList.cpp
    2282 svg/SVGAnimatedPreserveAspectRatio.cpp
    22832282svg/SVGAnimatedString.cpp
    22842283svg/SVGAnimatedTransformList.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r243183 r243185  
    294294                08F859D51463F9CD0067D933 /* SVGImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F859D31463F9CD0067D933 /* SVGImageCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
    295295                08F859D51463F9CD0067D934 /* SVGImageForContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F859D31463F9CD0067D934 /* SVGImageForContainer.h */; };
    296                 08FE0BC5127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h in Headers */ = {isa = PBXBuildFile; fileRef = 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */; };
    297296                0AFDAC3D10F5448C00E1F3D2 /* PluginViewBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
    298297                0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */; settings = {ATTRIBUTES = (); }; };
     
    56795678                08F859D31463F9CD0067D933 /* SVGImageCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageCache.h; sourceTree = "<group>"; };
    56805679                08F859D31463F9CD0067D934 /* SVGImageForContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageForContainer.h; sourceTree = "<group>"; };
    5681                 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPreserveAspectRatio.h; sourceTree = "<group>"; };
    56825680                0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginViewBase.h; sourceTree = "<group>"; };
    56835681                0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderMap.cpp; sourceTree = "<group>"; };
     
    75797577                431A2F9B13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumberOptionalNumber.cpp; sourceTree = "<group>"; };
    75807578                431A2FD613B7707A007791E4 /* SVGAnimatedLengthList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedLengthList.cpp; sourceTree = "<group>"; };
    7581                 431A302013B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedPreserveAspectRatio.cpp; sourceTree = "<group>"; };
    75827579                432D3FE718A8658400D7DC03 /* SelectorCheckerTestFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorCheckerTestFunctions.h; sourceTree = "<group>"; };
    75837580                4331AC7713B6870000A9E5AE /* SVGAnimatedNumberList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumberList.cpp; sourceTree = "<group>"; };
     
    2414824145                                43B9336813B261B1004584BF /* SVGAnimatedPointList.cpp */,
    2414924146                                43B9336713B261B1004584BF /* SVGAnimatedPointList.h */,
    24150                                 431A302013B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp */,
    24151                                 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */,
    2415224147                                B22277F40D00BF1F0071B782 /* SVGAnimatedPreserveAspectRatio.idl */,
    2415324148                                B22277F50D00BF1F0071B782 /* SVGAnimatedRect.idl */,
     
    3192931924                                089A8E07128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h in Headers */,
    3193031925                                43B9336913B261B1004584BF /* SVGAnimatedPointList.h in Headers */,
    31931                                 08FE0BC5127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h in Headers */,
    3193231926                                088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */,
    3193331927                                088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */,
  • trunk/Source/WebCore/svg/SVGAnimatorFactory.h

    r243183 r243185  
    3030#include "SVGAnimatedPath.h"
    3131#include "SVGAnimatedPointList.h"
    32 #include "SVGAnimatedPreserveAspectRatio.h"
    3332#include "SVGAnimatedString.h"
    3433#include "SVGAnimatedTransformList.h"
     
    7372            return std::make_unique<SVGAnimatedPointListAnimator>(animationElement, contextElement);
    7473        case AnimatedPreserveAspectRatio:
    75             return std::make_unique<SVGAnimatedPreserveAspectRatioAnimator>(animationElement, contextElement);
     74            return nullptr;
    7675        case AnimatedRect:
    7776            return nullptr;
  • trunk/Source/WebCore/svg/SVGFEBlendElement.cpp

    r243163 r243185  
    105105}
    106106
    107 RefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
     107RefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
    108108{
    109109    auto input1 = filterBuilder->getEffectById(in1());
  • trunk/Source/WebCore/svg/SVGFEBlendElement.h

    r243114 r243185  
    7474    void svgAttributeChanged(const QualifiedName&) override;
    7575
    76     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     76    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    7777    bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override;
    7878
  • trunk/Source/WebCore/svg/SVGFEColorMatrixElement.cpp

    r243163 r243185  
    108108}
    109109
    110 RefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
     110RefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
    111111{
    112112    auto input1 = filterBuilder->getEffectById(in1());
  • trunk/Source/WebCore/svg/SVGFEColorMatrixElement.h

    r243114 r243185  
    9999
    100100    bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
    101     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     101    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    102102
    103103    AttributeOwnerProxy m_attributeOwnerProxy { *this };
  • trunk/Source/WebCore/svg/SVGFEComponentTransferElement.cpp

    r243163 r243185  
    6767}
    6868
    69 RefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
     69RefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
    7070{
    7171    auto input1 = filterBuilder->getEffectById(in1());
  • trunk/Source/WebCore/svg/SVGFEComponentTransferElement.h

    r243114 r243185  
    4949    void parseAttribute(const QualifiedName&, const AtomicString&) override;
    5050
    51     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     51    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    5252
    5353    AttributeOwnerProxy m_attributeOwnerProxy { *this };
  • trunk/Source/WebCore/svg/SVGFECompositeElement.cpp

    r243163 r243185  
    136136}
    137137
    138 RefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
     138RefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
    139139{
    140140    auto input1 = filterBuilder->getEffectById(in1());
  • trunk/Source/WebCore/svg/SVGFECompositeElement.h

    r243114 r243185  
    8686    static Ref<SVGFECompositeElement> create(const QualifiedName&, Document&);
    8787
    88     String in1() { return m_in1.currentValue(attributeOwnerProxy()); }
    89     String in2() { return m_in2.currentValue(attributeOwnerProxy()); }
     88    String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
     89    String in2() const { return m_in2.currentValue(attributeOwnerProxy()); }
    9090    CompositeOperationType svgOperator() const { return m_svgOperator.currentValue(attributeOwnerProxy()); }
    9191    float k1() const { return m_k1.currentValue(attributeOwnerProxy()); }
     
    122122
    123123    bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
    124     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     124    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    125125
    126126    AttributeOwnerProxy m_attributeOwnerProxy { *this };
  • trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp

    r243163 r243185  
    217217}
    218218
    219 RefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
     219RefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
    220220{
    221221    auto input1 = filterBuilder->getEffectById(in1());
  • trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.h

    r243121 r243185  
    114114
    115115    bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
    116     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     116    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    117117
    118118    static const AtomicString& kernelUnitLengthXIdentifier();
  • trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp

    r243163 r243185  
    171171}
    172172
    173 RefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
     173RefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
    174174{
    175175    auto input1 = filterBuilder->getEffectById(in1());
  • trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.h

    r243114 r243185  
    6969
    7070    bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
    71     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     71    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    7272
    7373    static const AtomicString& kernelUnitLengthXIdentifier();
  • trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp

    r243163 r243185  
    120120}
    121121
    122 RefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
     122RefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
    123123{
    124124    auto input1 = filterBuilder->getEffectById(in1());
  • trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.h

    r243114 r243185  
    104104
    105105    bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override;
    106     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     106    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    107107
    108108    AttributeOwnerProxy m_attributeOwnerProxy { *this };
  • trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp

    r243163 r243185  
    117117}
    118118
    119 RefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
     119RefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
    120120{
    121121    RenderObject* renderer = this->renderer();
  • trunk/Source/WebCore/svg/SVGFEDropShadowElement.h

    r243114 r243185  
    6565    void svgAttributeChanged(const QualifiedName&) override;
    6666
    67     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     67    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    6868
    6969    static const AtomicString& stdDeviationXIdentifier();
  • trunk/Source/WebCore/svg/SVGFEFloodElement.cpp

    r231153 r243185  
    5959}
    6060
    61 RefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter& filter)
     61RefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter& filter) const
    6262{
    6363    RenderObject* renderer = this->renderer();
  • trunk/Source/WebCore/svg/SVGFEFloodElement.h

    r229694 r243185  
    3434
    3535    bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override;
    36     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     36    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    3737};
    3838
  • trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp

    r243163 r243185  
    115115}
    116116
    117 RefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
     117RefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
    118118{
    119119    auto input1 = filterBuilder->getEffectById(in1());
  • trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.h

    r243114 r243185  
    6666    void svgAttributeChanged(const QualifiedName&) override;
    6767
    68     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     68    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    6969
    7070    static const AtomicString& stdDeviationXIdentifier();
  • trunk/Source/WebCore/svg/SVGFEImageElement.cpp

    r240237 r243185  
    4545{
    4646    ASSERT(hasTagName(SVGNames::feImageTag));
    47     registerAttributes();
     47
     48    static std::once_flag onceFlag;
     49    std::call_once(onceFlag, [] {
     50        PropertyRegistry::registerProperty<SVGNames::preserveAspectRatioAttr, &SVGFEImageElement::m_preserveAspectRatio>();
     51    });
    4852}
    4953
     
    112116}
    113117
    114 void SVGFEImageElement::registerAttributes()
    115 {
    116     auto& registry = attributeRegistry();
    117     if (!registry.isEmpty())
    118         return;
    119     registry.registerAttribute<SVGNames::preserveAspectRatioAttr, &SVGFEImageElement::m_preserveAspectRatio>();
    120 }
    121 
    122118void SVGFEImageElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
    123119{
     
    125121        SVGPreserveAspectRatioValue preserveAspectRatio;
    126122        preserveAspectRatio.parse(value);
    127         m_preserveAspectRatio.setValue(preserveAspectRatio);
     123        m_preserveAspectRatio->setBaseValInternal(preserveAspectRatio);
    128124        return;
    129125    }
     
    186182}
    187183
    188 RefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter& filter)
     184RefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter& filter) const
    189185{
    190186    if (m_cachedImage)
  • trunk/Source/WebCore/svg/SVGFEImageElement.h

    r243121 r243185  
    2424#include "CachedImageClient.h"
    2525#include "CachedResourceHandle.h"
    26 #include "SVGAnimatedPreserveAspectRatio.h"
    2726#include "SVGExternalResourcesRequired.h"
    2827#include "SVGFEImage.h"
     
    4140    bool hasSingleSecurityOrigin() const;
    4241
    43     const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio.currentValue(attributeOwnerProxy()); }
    44     RefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated() { return m_preserveAspectRatio.animatedProperty(attributeOwnerProxy()); }
     42    const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio->currentValue(); }
     43    SVGAnimatedPreserveAspectRatio& preserveAspectRatioAnimated() { return m_preserveAspectRatio; }
    4544
    4645private:
     
    4847
    4948    using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEImageElement, SVGFilterPrimitiveStandardAttributes, SVGExternalResourcesRequired, SVGURIReference>;
    50     static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }
    51     static void registerAttributes();
    5249    const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; }
    5350   
     
    6865    void didFinishInsertingNode() override;
    6966
    70     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     67    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    7168
    7269    void clearResourceReferences();
     
    7976    AttributeOwnerProxy m_attributeOwnerProxy { *this };
    8077    PropertyRegistry m_propertyRegistry { *this };
    81     SVGAnimatedPreserveAspectRatioAttribute m_preserveAspectRatio;
     78    Ref<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio { SVGAnimatedPreserveAspectRatio::create(this) };
    8279    CachedResourceHandle<CachedImage> m_cachedImage;
    8380};
  • trunk/Source/WebCore/svg/SVGFEMergeElement.cpp

    r243163 r243185  
    4545}
    4646
    47 RefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
     47RefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
    4848{
    4949    auto effect = FEMerge::create(filter);
  • trunk/Source/WebCore/svg/SVGFEMergeElement.h

    r229694 r243185  
    3333    SVGFEMergeElement(const QualifiedName&, Document&);
    3434
    35     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     35    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    3636};
    3737
  • trunk/Source/WebCore/svg/SVGFEMorphologyElement.cpp

    r243163 r243185  
    134134}
    135135
    136 RefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
     136RefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
    137137{
    138138    auto input1 = filterBuilder->getEffectById(in1());
  • trunk/Source/WebCore/svg/SVGFEMorphologyElement.h

    r243114 r243185  
    9494
    9595    bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
    96     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     96    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    9797
    9898    static const AtomicString& radiusXIdentifier();
  • trunk/Source/WebCore/svg/SVGFEOffsetElement.cpp

    r243163 r243185  
    8686}
    8787
    88 RefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
     88RefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
    8989{
    9090    auto input1 = filterBuilder->getEffectById(in1());
  • trunk/Source/WebCore/svg/SVGFEOffsetElement.h

    r243114 r243185  
    5959    void svgAttributeChanged(const QualifiedName&) override;
    6060
    61     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     61    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    6262
    6363    AttributeOwnerProxy m_attributeOwnerProxy { *this };
  • trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp

    r243163 r243185  
    180180}
    181181
    182 RefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
     182RefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
    183183{
    184184    auto input1 = filterBuilder->getEffectById(in1());
  • trunk/Source/WebCore/svg/SVGFESpecularLightingElement.h

    r243114 r243185  
    7070
    7171    bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
    72     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     72    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    7373
    7474    static const AtomicString& kernelUnitLengthXIdentifier();
  • trunk/Source/WebCore/svg/SVGFETileElement.cpp

    r243163 r243185  
    7575}
    7676
    77 RefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
     77RefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
    7878{
    7979    auto input1 = filterBuilder->getEffectById(in1());
  • trunk/Source/WebCore/svg/SVGFETileElement.h

    r243114 r243185  
    5353    void svgAttributeChanged(const QualifiedName&) override;
    5454
    55     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     55    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    5656
    5757    AttributeOwnerProxy m_attributeOwnerProxy { *this };
  • trunk/Source/WebCore/svg/SVGFETurbulenceElement.cpp

    r243114 r243185  
    140140}
    141141
    142 RefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter& filter)
     142RefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter& filter) const
    143143{
    144144    if (baseFrequencyX() < 0 || baseFrequencyY() < 0)
  • trunk/Source/WebCore/svg/SVGFETurbulenceElement.h

    r243114 r243185  
    132132
    133133    bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override;
    134     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
     134    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    135135
    136136    static const AtomicString& baseFrequencyXIdentifier();
  • trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h

    r243114 r243185  
    4141    void setStandardAttributes(FilterEffect*) const;
    4242
    43     virtual RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) = 0;
     43    virtual RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const = 0;
    4444    // Returns true, if the new value is different from the old one.
    4545    virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
  • trunk/Source/WebCore/svg/SVGFitToViewBox.cpp

    r243183 r243185  
    3636
    3737SVGFitToViewBox::SVGFitToViewBox(SVGElement* contextElement, SVGPropertyAccess access)
    38     : m_attributeOwnerProxy(*this, *contextElement, access == SVGPropertyAccess::ReadWrite ? PropertyIsReadWrite : PropertyIsReadOnly)
    39     , m_viewBox(SVGAnimatedRect::create(contextElement, access))
     38    : m_viewBox(SVGAnimatedRect::create(contextElement, access))
     39    , m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(contextElement, access))
    4040{
    41     registerAttributes();
    42 
    4341    static std::once_flag onceFlag;
    4442    std::call_once(onceFlag, [] {
    4543        PropertyRegistry::registerProperty<SVGNames::viewBoxAttr, &SVGFitToViewBox::m_viewBox>();
     44        PropertyRegistry::registerProperty<SVGNames::preserveAspectRatioAttr, &SVGFitToViewBox::m_preserveAspectRatio>();
    4645    });
    47 }
    48 
    49 void SVGFitToViewBox::registerAttributes()
    50 {
    51     auto& registry = attributeRegistry();
    52     if (!registry.isEmpty())
    53         return;
    54     registry.registerAttribute<SVGNames::preserveAspectRatioAttr, &SVGFitToViewBox::m_preserveAspectRatio>();
    5546}
    5647
     
    114105
    115106    if (validate) {
    116         Document& document = m_attributeOwnerProxy.element().document();
     107        Document& document = m_viewBox->contextElement()->document();
    117108
    118109        if (!valid) {
  • trunk/Source/WebCore/svg/SVGFitToViewBox.h

    r243183 r243185  
    4444
    4545    const FloatRect& viewBox() const { return m_viewBox->currentValue(); }
    46     const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio.currentValue(m_attributeOwnerProxy); }
     46    const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio->currentValue(); }
    4747
    4848    SVGAnimatedRect& viewBoxAnimated() { return m_viewBox; }
    49     RefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated() { return m_preserveAspectRatio.animatedProperty(m_attributeOwnerProxy); }
     49    SVGAnimatedPreserveAspectRatio& preserveAspectRatioAnimated() { return m_preserveAspectRatio; }
    5050
    5151    void setViewBox(const FloatRect&);
    5252    void resetViewBox();
    5353
    54     void setPreserveAspectRatio(const SVGPreserveAspectRatioValue& preserveAspectRatio) { m_preserveAspectRatio.setValue(preserveAspectRatio); }
    55     void resetPreserveAspectRatio() { m_preserveAspectRatio.resetValue(); }
     54    void setPreserveAspectRatio(const SVGPreserveAspectRatioValue& preserveAspectRatio) { m_preserveAspectRatio->setBaseValInternal(preserveAspectRatio); }
     55    void resetPreserveAspectRatio() { m_preserveAspectRatio->setBaseValInternal({ }); }
    5656
    5757    String viewBoxString() const { return SVGPropertyTraits<FloatRect>::toString(viewBox()); }
    58     String preserveAspectRatioString() const { return m_preserveAspectRatio.toString(); }
     58    String preserveAspectRatioString() const { return preserveAspectRatio().valueAsString(); }
    5959
    6060    bool hasValidViewBox() const { return m_isViewBoxValid; }
     
    7575
    7676private:
    77     static void registerAttributes();
    78 
    79     AttributeOwnerProxy m_attributeOwnerProxy;
    8077    Ref<SVGAnimatedRect> m_viewBox;
    81     SVGAnimatedPreserveAspectRatioAttribute m_preserveAspectRatio;
     78    Ref<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio;
    8279    bool m_isViewBoxValid { false };
    8380};
  • trunk/Source/WebCore/svg/SVGImageElement.cpp

    r234683 r243185  
    4545{
    4646    registerAttributes();
     47
     48    static std::once_flag onceFlag;
     49    std::call_once(onceFlag, [] {
     50        PropertyRegistry::registerProperty<SVGNames::preserveAspectRatioAttr, &SVGImageElement::m_preserveAspectRatio>();
     51    });
    4752}
    4853
     
    7075    registry.registerAttribute<SVGNames::widthAttr, &SVGImageElement::m_width>();
    7176    registry.registerAttribute<SVGNames::heightAttr, &SVGImageElement::m_height>();
    72     registry.registerAttribute<SVGNames::preserveAspectRatioAttr, &SVGImageElement::m_preserveAspectRatio>();
    7377}
    7478
     
    7882        SVGPreserveAspectRatioValue preserveAspectRatio;
    7983        preserveAspectRatio.parse(value);
    80         m_preserveAspectRatio.setValue(preserveAspectRatio);
     84        m_preserveAspectRatio->setBaseValInternal(preserveAspectRatio);
    8185        return;
    8286    }
  • trunk/Source/WebCore/svg/SVGImageElement.h

    r243114 r243185  
    2323
    2424#include "SVGAnimatedLength.h"
    25 #include "SVGAnimatedPreserveAspectRatio.h"
    2625#include "SVGExternalResourcesRequired.h"
    2726#include "SVGGraphicsElement.h"
     
    4342    const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); }
    4443    const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); }
    45     const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio.currentValue(attributeOwnerProxy()); }
     44    const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio->currentValue(); }
    4645
    4746    RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); }
     
    4948    RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); }
    5049    RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); }
    51     RefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated() { return m_preserveAspectRatio.animatedProperty(attributeOwnerProxy()); }
     50    SVGAnimatedPreserveAspectRatio& preserveAspectRatioAnimated() { return m_preserveAspectRatio; }
    5251
    5352private:
     
    8786    SVGAnimatedLengthAttribute m_width { LengthModeWidth };
    8887    SVGAnimatedLengthAttribute m_height { LengthModeHeight };
    89     SVGAnimatedPreserveAspectRatioAttribute m_preserveAspectRatio;
     88    Ref<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio { SVGAnimatedPreserveAspectRatio::create(this) };
    9089    SVGImageLoader m_imageLoader;
    9190};
  • trunk/Source/WebCore/svg/SVGMarkerElement.h

    r243183 r243185  
    2525#include "SVGAnimatedEnumeration.h"
    2626#include "SVGAnimatedLength.h"
    27 #include "SVGAnimatedPreserveAspectRatio.h"
    2827#include "SVGElement.h"
    2928#include "SVGExternalResourcesRequired.h"
  • trunk/Source/WebCore/svg/SVGPatternElement.h

    r243183 r243185  
    2424#include "SVGAnimatedEnumeration.h"
    2525#include "SVGAnimatedLength.h"
    26 #include "SVGAnimatedPreserveAspectRatio.h"
    2726#include "SVGAnimatedTransformList.h"
    2827#include "SVGElement.h"
  • trunk/Source/WebCore/svg/SVGPreserveAspectRatio.h

    r242978 r243185  
    11/*
    2  * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2727
    2828#include "SVGPreserveAspectRatioValue.h"
    29 #include "SVGPropertyTearOff.h"
     29#include "SVGValueProperty.h"
    3030
    3131namespace WebCore {
    3232
    33 class SVGPreserveAspectRatio : public SVGPropertyTearOff<SVGPreserveAspectRatioValue> {
     33class SVGPreserveAspectRatio : public SVGValueProperty<SVGPreserveAspectRatioValue> {
     34    using Base = SVGValueProperty<SVGPreserveAspectRatioValue>;
     35    using Base::Base;
     36    using Base::m_value;
     37
    3438public:
    35     static Ref<SVGPreserveAspectRatio> create(SVGLegacyAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGPreserveAspectRatioValue& value)
     39    static Ref<SVGPreserveAspectRatio> create(SVGPropertyOwner* owner, SVGPropertyAccess access, const SVGPreserveAspectRatioValue& value = { })
    3640    {
    37         return adoptRef(*new SVGPreserveAspectRatio(animatedProperty, role, value));
     41        return adoptRef(*new SVGPreserveAspectRatio(owner, access, value));
    3842    }
    3943
    40     static Ref<SVGPreserveAspectRatio> create(const SVGPreserveAspectRatioValue& initialValue = { })
     44    template<typename T>
     45    static ExceptionOr<Ref<SVGPreserveAspectRatio>> create(ExceptionOr<T>&& value)
    4146    {
    42         return adoptRef(*new SVGPreserveAspectRatio(initialValue));
     47        if (value.hasException())
     48            return value.releaseException();
     49        return adoptRef(*new SVGPreserveAspectRatio(value.releaseReturnValue()));
    4350    }
    4451
    45     template<typename T> static ExceptionOr<Ref<SVGPreserveAspectRatio>> create(ExceptionOr<T>&& initialValue)
    46     {
    47         if (initialValue.hasException())
    48             return initialValue.releaseException();
    49         return create(initialValue.releaseReturnValue());
    50     }
    51 
    52     unsigned short align()
    53     {
    54         return propertyReference().align();
    55     }
     52    unsigned short align() const { return m_value.align(); }
    5653
    5754    ExceptionOr<void> setAlign(float value)
     
    6057            return Exception { NoModificationAllowedError };
    6158
    62         auto result = propertyReference().setAlign(value);
     59        auto result = m_value.setAlign(value);
    6360        if (result.hasException())
    6461            return result;
     
    6865    }
    6966
    70     unsigned short meetOrSlice()
    71     {
    72         return propertyReference().meetOrSlice();
    73     }
     67    unsigned short meetOrSlice() const { return m_value.meetOrSlice(); }
    7468
    7569    ExceptionOr<void> setMeetOrSlice(float value)
     
    7872            return Exception { NoModificationAllowedError };
    7973
    80         auto result = propertyReference().setMeetOrSlice(value);
     74        auto result = m_value.setMeetOrSlice(value);
    8175        if (result.hasException())
    8276            return result;
     
    8680    }
    8781
    88 private:
    89     SVGPreserveAspectRatio(SVGLegacyAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGPreserveAspectRatioValue& value)
    90         : SVGPropertyTearOff<SVGPreserveAspectRatioValue>(&animatedProperty, role, value)
     82    String valueAsString() const override
    9183    {
    92     }
    93 
    94     explicit SVGPreserveAspectRatio(const SVGPreserveAspectRatioValue& initialValue)
    95         : SVGPropertyTearOff<SVGPreserveAspectRatioValue>(initialValue)
    96     {
     84        return m_value.valueAsString();
    9785    }
    9886};
  • trunk/Source/WebCore/svg/SVGSVGElement.h

    r243183 r243185  
    2424#include "FloatPoint.h"
    2525#include "SVGAnimatedLength.h"
    26 #include "SVGAnimatedPreserveAspectRatio.h"
    2726#include "SVGExternalResourcesRequired.h"
    2827#include "SVGFitToViewBox.h"
  • trunk/Source/WebCore/svg/SVGStringList.h

    r243130 r243185  
    2828#include "SVGParserUtilities.h"
    2929#include "SVGPrimitiveList.h"
     30#include <wtf/text/StringBuilder.h>
    3031
    3132namespace WebCore {
  • trunk/Source/WebCore/svg/SVGSymbolElement.h

    r243183 r243185  
    2222#pragma once
    2323
    24 #include "SVGAnimatedPreserveAspectRatio.h"
    2524#include "SVGElement.h"
    2625#include "SVGExternalResourcesRequired.h"
  • trunk/Source/WebCore/svg/SVGViewSpec.h

    r243183 r243185  
    2121#pragma once
    2222
    23 #include "SVGAnimatedPreserveAspectRatio.h"
    2423#include "SVGFitToViewBox.h"
    2524#include "SVGTransformListValues.h"
  • trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h

    r243183 r243185  
    7878
    7979template<typename OwnerType>
     80class SVGAnimatedPreserveAspectRatioAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPreserveAspectRatio> {
     81    using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPreserveAspectRatio>;
     82    using Base::property;
     83
     84public:
     85    using Base::Base;
     86    template<Ref<SVGAnimatedPreserveAspectRatio> OwnerType::*property>
     87    constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedPreserveAspectRatioAccessor, property>(); }
     88
     89private:
     90    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     91    {
     92        return SVGAnimatedPreserveAspectRatioAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive);
     93    }
     94
     95    void appendAnimatedInstance(OwnerType& owner, SVGAttributeAnimator& animator) const final
     96    {
     97        static_cast<SVGAnimatedPreserveAspectRatioAnimator&>(animator).appendAnimatedInstance(property(owner));
     98    }
     99};
     100
     101template<typename OwnerType>
    80102class SVGAnimatedRectAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedRect> {
    81103    using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedRect>;
  • trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h

    r243183 r243185  
    7676    }
    7777};
    78    
     78
     79class SVGAnimatedPreserveAspectRatioAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction> {
     80    using Base = SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction>;
     81    using Base::Base;
     82
     83public:
     84    static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedPreserveAspectRatio>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     85    {
     86        return std::make_unique<SVGAnimatedPreserveAspectRatioAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
     87    }
     88
     89private:
     90    void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final
     91    {
     92        SVGPreserveAspectRatioValue& animated = m_animated->animVal()->value();
     93        m_function.progress(targetElement, percentage, repeatCount, animated);
     94    }
     95};
     96
    7997class SVGAnimatedRectAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedRect, SVGAnimationRectFunction> {
    8098    using Base = SVGAnimatedPropertyAnimator<SVGAnimatedRect, SVGAnimationRectFunction>;
  • trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h

    r243183 r243185  
    3333#include "SVGAnimatedNumberList.h"
    3434#include "SVGAnimatedPointList.h"
    35 #include "SVGAnimatedPreserveAspectRatio.h"
    3635#include "SVGAnimatedPrimitiveProperty.h"
    3736#include "SVGAnimatedString.h"
    3837#include "SVGAnimatedTransformList.h"
    3938#include "SVGAnimatedValueProperty.h"
     39#include "SVGPreserveAspectRatio.h"
    4040#include "SVGRect.h"
    4141
     
    4646
    4747using SVGAnimatedRect = SVGAnimatedValueProperty<SVGRect>;
     48using SVGAnimatedPreserveAspectRatio = SVGAnimatedValueProperty<SVGPreserveAspectRatio>;
    4849
    4950}
  • trunk/Source/WebCore/svg/properties/SVGAnimationDiscreteFunctionImpl.h

    r243121 r243185  
    4343};
    4444
     45class SVGAnimationPreserveAspectRatioFunction : public SVGAnimationDiscreteFunction<SVGPreserveAspectRatioValue> {
     46public:
     47    using Base = SVGAnimationDiscreteFunction<SVGPreserveAspectRatioValue>;
     48    using Base::Base;
     49   
     50    void setFromAndToValues(SVGElement*, const String& from, const String& to) override
     51    {
     52        m_from = SVGPreserveAspectRatioValue(from);
     53        m_to = SVGPreserveAspectRatioValue(to);
     54    }
     55};
     56
     57class SVGAnimationStringFunction : public SVGAnimationDiscreteFunction<String> {
     58public:
     59    using Base = SVGAnimationDiscreteFunction<String>;
     60    using Base::Base;
     61   
     62    void setFromAndToValues(SVGElement*, const String& from, const String& to) override
     63    {
     64        m_from = from;
     65        m_to = to;
     66    }
     67};
     68
    4569}
  • trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h

    r243183 r243185  
    3232#include "SVGAnimatedNumberList.h"
    3333#include "SVGAnimatedPointList.h"
    34 #include "SVGAnimatedPreserveAspectRatio.h"
    3534#include "SVGAnimatedString.h"
    3635#include "SVGAnimatedTransformList.h"
     
    10099    {
    101100        registerAttribute(SVGAnimatedPointListAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());
    102     }
    103 
    104     template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedPreserveAspectRatioAttribute OwnerType::*attribute>
    105     void registerAttribute()
    106     {
    107         registerAttribute(SVGAnimatedPreserveAspectRatioAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());
    108101    }
    109102
  • trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h

    r243183 r243185  
    5656    }
    5757
     58    template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedInteger> OwnerType::*property>
     59    static void registerProperty()
     60    {
     61        registerProperty(attributeName, SVGAnimatedIntegerAccessor<OwnerType>::template singleton<property>());
     62    }
     63   
     64    template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedPreserveAspectRatio> OwnerType::*property>
     65    static void registerProperty()
     66    {
     67        registerProperty(attributeName, SVGAnimatedPreserveAspectRatioAccessor<OwnerType>::template singleton<property>());
     68    }
     69
    5870    template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedRect> OwnerType::*property>
    5971    static void registerProperty()
    6072    {
    6173        registerProperty(attributeName, SVGAnimatedRectAccessor<OwnerType>::template singleton<property>());
    62     }
    63 
    64     template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedInteger> OwnerType::*property>
    65     static void registerProperty()
    66     {
    67         registerProperty(attributeName, SVGAnimatedIntegerAccessor<OwnerType>::template singleton<property>());
    6874    }
    6975
Note: See TracChangeset for help on using the changeset viewer.