DumpRenderTree crashes under WebAnimation::isRelevant when running imported/mozilla...
authorsaid@apple.com <said@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2019 00:35:50 +0000 (00:35 +0000)
committersaid@apple.com <said@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2019 00:35:50 +0000 (00:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196028
<rdar://problem/46842707>

Patch by Antoine Quint <graouts@apple.com> on 2019-03-20
Reviewed by Dean Jackson.

Instead of keeping a ListHashSet of raw pointers, we are now using a Vector of WeakPtrs.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::forgetAnimation):
(WebCore::AnimationTimeline::animationTimingDidChange):
(WebCore::AnimationTimeline::cancelDeclarativeAnimation):
* animation/AnimationTimeline.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::getAnimations const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243266 268f45cc-cd09-0410-ab3c-d52691b4dbfc

52 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/svg/SVGAnimatedLength.cpp
Source/WebCore/svg/SVGAnimatedLengthList.cpp
Source/WebCore/svg/SVGAnimatedNumber.cpp [deleted file]
Source/WebCore/svg/SVGAnimatedNumber.h [deleted file]
Source/WebCore/svg/SVGAnimatedNumberList.cpp
Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.cpp [deleted file]
Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.h [deleted file]
Source/WebCore/svg/SVGAnimatedTransformList.cpp
Source/WebCore/svg/SVGAnimatorFactory.h
Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp
Source/WebCore/svg/SVGComponentTransferFunctionElement.h
Source/WebCore/svg/SVGFECompositeElement.cpp
Source/WebCore/svg/SVGFECompositeElement.h
Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp
Source/WebCore/svg/SVGFEConvolveMatrixElement.h
Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
Source/WebCore/svg/SVGFEDiffuseLightingElement.h
Source/WebCore/svg/SVGFEDisplacementMapElement.cpp
Source/WebCore/svg/SVGFEDisplacementMapElement.h
Source/WebCore/svg/SVGFEDropShadowElement.cpp
Source/WebCore/svg/SVGFEDropShadowElement.h
Source/WebCore/svg/SVGFEGaussianBlurElement.cpp
Source/WebCore/svg/SVGFEGaussianBlurElement.h
Source/WebCore/svg/SVGFELightElement.cpp
Source/WebCore/svg/SVGFELightElement.h
Source/WebCore/svg/SVGFEMorphologyElement.cpp
Source/WebCore/svg/SVGFEMorphologyElement.h
Source/WebCore/svg/SVGFEOffsetElement.cpp
Source/WebCore/svg/SVGFEOffsetElement.h
Source/WebCore/svg/SVGFESpecularLightingElement.cpp
Source/WebCore/svg/SVGFESpecularLightingElement.h
Source/WebCore/svg/SVGFETurbulenceElement.cpp
Source/WebCore/svg/SVGFETurbulenceElement.h
Source/WebCore/svg/SVGGeometryElement.cpp
Source/WebCore/svg/SVGGeometryElement.h
Source/WebCore/svg/SVGPathElement.h
Source/WebCore/svg/SVGPathSegListValues.cpp
Source/WebCore/svg/SVGStopElement.cpp
Source/WebCore/svg/SVGStopElement.h
Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h
Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h
Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h
Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessorImpl.h
Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h
Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.h
Source/WebCore/svg/properties/SVGAttributeRegistry.h
Source/WebCore/svg/properties/SVGPrimitivePropertyAnimatorImpl.h
Source/WebCore/svg/properties/SVGPropertyAnimatorFactory.h
Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h

index c0af9fd..30e0677 100644 (file)
 
 2019-03-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
+        Remove the SVG property tear off objects for SVGAnimatedNumber
+        https://bugs.webkit.org/show_bug.cgi?id=196037
+
+        Reviewed by Simon Fraser.
+
+        -- Define SVGAnimatedNumber to be SVGAnimatedPrimitiveProperty<float>.
+
+        -- Add SVGAnimatedNumberAccessor to associate an attribute name with a 
+           pointer to an SVGAnimatedNumber. Given a pointer to an SVGElement,
+           this accessor will and create an animator for the animated property.
+
+        -- Add SVGAnimatedNumberPairAccessor to associate an attribute name
+           with a pair of pointers to SVGAnimatedNumbers. Given a pointer to an
+           SVGElement, this accessor will and create an animator for these
+           animated properties.
+
+        -- Add SVGAnimatedNumberAnimator to animated an SVGAnimatedNumber.
+
+        -- Add SVGAnimatedNumberPairAnimator to animated a pair of SVGAnimatedNumbers.
+
+        -- Add SVGAnimationNumberFunction which will be responsible for progressing
+           a float over a period of time.
+
+        -- Define SVGNumberAnimator to be SVGPrimitivePropertyAnimator<float,
+           SVGAnimationNumberFunction>. SVGNumberAnimator will be responsible 
+           for animating attributes with no reflecting animated properties, e.g.
+           "fill-opacity".
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * svg/SVGAnimatedLength.cpp:
+        * svg/SVGAnimatedLengthList.cpp:
+        * svg/SVGAnimatedNumber.cpp: Removed.
+        * svg/SVGAnimatedNumber.h: Removed.
+        * svg/SVGAnimatedNumberList.cpp:
+        * svg/SVGAnimatedNumberOptionalNumber.cpp: Removed.
+        * svg/SVGAnimatedNumberOptionalNumber.h: Removed.
+        * svg/SVGAnimatedTransformList.cpp:
+        * svg/SVGAnimatorFactory.h:
+        (WebCore::SVGAnimatorFactory::create):
+        * svg/SVGComponentTransferFunctionElement.cpp:
+        (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
+        (WebCore::SVGComponentTransferFunctionElement::registerAttributes):
+        (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
+        * svg/SVGComponentTransferFunctionElement.h:
+        (WebCore::SVGComponentTransferFunctionElement::slope const):
+        (WebCore::SVGComponentTransferFunctionElement::intercept const):
+        (WebCore::SVGComponentTransferFunctionElement::amplitude const):
+        (WebCore::SVGComponentTransferFunctionElement::exponent const):
+        (WebCore::SVGComponentTransferFunctionElement::offset const):
+        (WebCore::SVGComponentTransferFunctionElement::slopeAnimated):
+        (WebCore::SVGComponentTransferFunctionElement::interceptAnimated):
+        (WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated):
+        (WebCore::SVGComponentTransferFunctionElement::exponentAnimated):
+        (WebCore::SVGComponentTransferFunctionElement::offsetAnimated):
+        * svg/SVGFECompositeElement.cpp:
+        (WebCore::SVGFECompositeElement::SVGFECompositeElement):
+        (WebCore::SVGFECompositeElement::registerAttributes):
+        (WebCore::SVGFECompositeElement::parseAttribute):
+        * svg/SVGFECompositeElement.h:
+        * svg/SVGFEConvolveMatrixElement.cpp:
+        (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
+        (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
+        (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
+        (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength):
+        (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier): Deleted.
+        (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier): Deleted.
+        * svg/SVGFEConvolveMatrixElement.h:
+        * svg/SVGFEDiffuseLightingElement.cpp:
+        (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
+        (WebCore::SVGFEDiffuseLightingElement::registerAttributes):
+        (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
+        (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier): Deleted.
+        (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier): Deleted.
+        * svg/SVGFEDiffuseLightingElement.h:
+        * svg/SVGFEDisplacementMapElement.cpp:
+        (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
+        (WebCore::SVGFEDisplacementMapElement::registerAttributes):
+        (WebCore::SVGFEDisplacementMapElement::parseAttribute):
+        * svg/SVGFEDisplacementMapElement.h:
+        * svg/SVGFEDropShadowElement.cpp:
+        (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
+        (WebCore::SVGFEDropShadowElement::setStdDeviation):
+        (WebCore::SVGFEDropShadowElement::registerAttributes):
+        (WebCore::SVGFEDropShadowElement::parseAttribute):
+        (WebCore::SVGFEDropShadowElement::stdDeviationXIdentifier): Deleted.
+        (WebCore::SVGFEDropShadowElement::stdDeviationYIdentifier): Deleted.
+        * svg/SVGFEDropShadowElement.h:
+        * svg/SVGFEGaussianBlurElement.cpp:
+        (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
+        (WebCore::SVGFEGaussianBlurElement::setStdDeviation):
+        (WebCore::SVGFEGaussianBlurElement::registerAttributes):
+        (WebCore::SVGFEGaussianBlurElement::parseAttribute):
+        (WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier): Deleted.
+        (WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier): Deleted.
+        * svg/SVGFEGaussianBlurElement.h:
+        * svg/SVGFELightElement.cpp:
+        (WebCore::SVGFELightElement::SVGFELightElement):
+        (WebCore::SVGFELightElement::parseAttribute):
+        (WebCore::SVGFELightElement::svgAttributeChanged):
+        (WebCore::SVGFELightElement::registerAttributes): Deleted.
+        * svg/SVGFELightElement.h:
+        (WebCore::SVGFELightElement::azimuth const):
+        (WebCore::SVGFELightElement::elevation const):
+        (WebCore::SVGFELightElement::x const):
+        (WebCore::SVGFELightElement::y const):
+        (WebCore::SVGFELightElement::z const):
+        (WebCore::SVGFELightElement::pointsAtX const):
+        (WebCore::SVGFELightElement::pointsAtY const):
+        (WebCore::SVGFELightElement::pointsAtZ const):
+        (WebCore::SVGFELightElement::specularExponent const):
+        (WebCore::SVGFELightElement::limitingConeAngle const):
+        (WebCore::SVGFELightElement::azimuthAnimated):
+        (WebCore::SVGFELightElement::elevationAnimated):
+        (WebCore::SVGFELightElement::xAnimated):
+        (WebCore::SVGFELightElement::yAnimated):
+        (WebCore::SVGFELightElement::zAnimated):
+        (WebCore::SVGFELightElement::pointsAtXAnimated):
+        (WebCore::SVGFELightElement::pointsAtYAnimated):
+        (WebCore::SVGFELightElement::pointsAtZAnimated):
+        (WebCore::SVGFELightElement::specularExponentAnimated):
+        (WebCore::SVGFELightElement::limitingConeAngleAnimated):
+        (WebCore::SVGFELightElement::attributeRegistry): Deleted.
+        (WebCore::SVGFELightElement::isKnownAttribute): Deleted.
+        * svg/SVGFEMorphologyElement.cpp:
+        (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
+        (WebCore::SVGFEMorphologyElement::setRadius):
+        (WebCore::SVGFEMorphologyElement::registerAttributes):
+        (WebCore::SVGFEMorphologyElement::parseAttribute):
+        (WebCore::SVGFEMorphologyElement::radiusXIdentifier): Deleted.
+        (WebCore::SVGFEMorphologyElement::radiusYIdentifier): Deleted.
+        * svg/SVGFEMorphologyElement.h:
+        * svg/SVGFEOffsetElement.cpp:
+        (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
+        (WebCore::SVGFEOffsetElement::registerAttributes):
+        (WebCore::SVGFEOffsetElement::parseAttribute):
+        * svg/SVGFEOffsetElement.h:
+        * svg/SVGFESpecularLightingElement.cpp:
+        (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
+        (WebCore::SVGFESpecularLightingElement::registerAttributes):
+        (WebCore::SVGFESpecularLightingElement::parseAttribute):
+        (WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier): Deleted.
+        (WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier): Deleted.
+        * svg/SVGFESpecularLightingElement.h:
+        * svg/SVGFETurbulenceElement.cpp:
+        (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
+        (WebCore::SVGFETurbulenceElement::registerAttributes):
+        (WebCore::SVGFETurbulenceElement::parseAttribute):
+        (WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier): Deleted.
+        (WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier): Deleted.
+        * svg/SVGFETurbulenceElement.h:
+        * svg/SVGGeometryElement.cpp:
+        (WebCore::SVGGeometryElement::SVGGeometryElement):
+        (WebCore::SVGGeometryElement::parseAttribute):
+        (WebCore::SVGGeometryElement::registerAttributes): Deleted.
+        * svg/SVGGeometryElement.h:
+        (WebCore::SVGGeometryElement::pathLength const):
+        (WebCore::SVGGeometryElement::pathLengthAnimated):
+        (WebCore::SVGGeometryElement::attributeRegistry): Deleted.
+        (WebCore::SVGGeometryElement::isKnownAttribute): Deleted.
+        * svg/SVGPathElement.h:
+        * svg/SVGStopElement.cpp:
+        (WebCore::SVGStopElement::SVGStopElement):
+        (WebCore::SVGStopElement::parseAttribute):
+        (WebCore::SVGStopElement::registerAttributes): Deleted.
+        * svg/SVGStopElement.h:
+        * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
+        * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
+        * svg/properties/SVGAnimatedPropertyImpl.h:
+        * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
+        * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
+        * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
+        (WebCore::SVGAnimationNumberFunction::progress):
+        * svg/properties/SVGAttributeRegistry.h:
+        * svg/properties/SVGPrimitivePropertyAnimatorImpl.h:
+        * svg/properties/SVGPropertyAnimatorCreator.h:
+        (WebCore::SVGPropertyAnimatorCreator::createNumberAnimator):
+        (WebCore::SVGPropertyAnimatorCreator::attributeAnimatorCreator):
+        * svg/properties/SVGPropertyOwnerRegistry.h:
+        (WebCore::SVGPropertyOwnerRegistry::registerProperty):
+
+2019-03-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
+
         Remove the SVG tear off objects for SVGColorAnimator
         https://bugs.webkit.org/show_bug.cgi?id=196025
 
index 455de0f..6edc461 100644 (file)
@@ -2273,9 +2273,7 @@ svg/SVGAnimatedAngle.cpp
 svg/SVGAnimatedEnumeration.cpp
 svg/SVGAnimatedLength.cpp
 svg/SVGAnimatedLengthList.cpp
-svg/SVGAnimatedNumber.cpp
 svg/SVGAnimatedNumberList.cpp
-svg/SVGAnimatedNumberOptionalNumber.cpp
 svg/SVGAnimatedPath.cpp
 svg/SVGAnimatedPointList.cpp
 svg/SVGAnimatedString.cpp
index fe97813..e0f13c5 100644 (file)
                089582560E857A7E00F82C83 /* ImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 089582540E857A7E00F82C83 /* ImageLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
                089A8E07128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 089A8E06128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h */; };
                08A484780E5272C500C3FE76 /* ScriptElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08A484760E5272C500C3FE76 /* ScriptElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               08B35B13127B6A7C005314DD /* SVGAnimatedNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 08B35B12127B6A7C005314DD /* SVGAnimatedNumber.h */; };
                08B35B17127B6A88005314DD /* SVGAnimatedNumberList.h in Headers */ = {isa = PBXBuildFile; fileRef = 08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */; };
                08C7A2C710DC7462002D368B /* SVGNames.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 656581E909D1508D000E61D7 /* SVGNames.h */; };
                08C9251A0FCC7C4A00480DEC /* FilterEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C925180FCC7C4A00480DEC /* FilterEffect.h */; settings = {ATTRIBUTES = (Private, ); }; };
                427DA71D13735DFA007C57FB /* JSServiceWorkerInternals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 427DA71B13735DFA007C57FB /* JSServiceWorkerInternals.cpp */; };
                427DA71E13735DFA007C57FB /* JSServiceWorkerInternals.h in Headers */ = {isa = PBXBuildFile; fileRef = 427DA71C13735DFA007C57FB /* JSServiceWorkerInternals.h */; };
                43107BE218CC19DE00CC18E8 /* SelectorPseudoTypeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 43107BE118CC19DE00CC18E8 /* SelectorPseudoTypeMap.h */; };
-               431A2F9C13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 431A2F9A13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h */; };
                432D3FE818A8658400D7DC03 /* SelectorCheckerTestFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 432D3FE718A8658400D7DC03 /* SelectorCheckerTestFunctions.h */; };
                4358E87D1360A2EE00E4748C /* JSSVGFEDropShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4358E87B1360A2EE00E4748C /* JSSVGFEDropShadowElement.h */; };
                4358E8811360A31700E4748C /* FEDropShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = 4358E87F1360A31700E4748C /* FEDropShadow.h */; };
                089A8E06128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPathSegListPropertyTearOff.h; sourceTree = "<group>"; };
                08A484750E5272C500C3FE76 /* ScriptElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptElement.cpp; sourceTree = "<group>"; };
                08A484760E5272C500C3FE76 /* ScriptElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptElement.h; sourceTree = "<group>"; };
-               08B35B12127B6A7C005314DD /* SVGAnimatedNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedNumber.h; sourceTree = "<group>"; };
                08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedNumberList.h; sourceTree = "<group>"; };
                08C925170FCC7C4A00480DEC /* FilterEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FilterEffect.cpp; sourceTree = "<group>"; };
                08C925180FCC7C4A00480DEC /* FilterEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FilterEffect.h; sourceTree = "<group>"; };
                427DA71B13735DFA007C57FB /* JSServiceWorkerInternals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorkerInternals.cpp; sourceTree = "<group>"; };
                427DA71C13735DFA007C57FB /* JSServiceWorkerInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSServiceWorkerInternals.h; sourceTree = "<group>"; };
                43107BE118CC19DE00CC18E8 /* SelectorPseudoTypeMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorPseudoTypeMap.h; sourceTree = "<group>"; };
-               431A2F9A13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedNumberOptionalNumber.h; sourceTree = "<group>"; };
-               431A2F9B13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumberOptionalNumber.cpp; sourceTree = "<group>"; };
                431A2FD613B7707A007791E4 /* SVGAnimatedLengthList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedLengthList.cpp; sourceTree = "<group>"; };
                432D3FE718A8658400D7DC03 /* SelectorCheckerTestFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorCheckerTestFunctions.h; sourceTree = "<group>"; };
                4331AC7713B6870000A9E5AE /* SVGAnimatedNumberList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumberList.cpp; sourceTree = "<group>"; };
                439D334013A6911C00C20F4F /* SVGAnimatedType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedType.h; sourceTree = "<group>"; };
                439D334113A6911C00C20F4F /* SVGAnimatedTypeAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTypeAnimator.h; sourceTree = "<group>"; };
                439D334213A6911C00C20F4F /* SVGAnimatorFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatorFactory.h; sourceTree = "<group>"; };
-               43A0F0B013AC7D6D00A5F0A7 /* SVGAnimatedNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumber.cpp; sourceTree = "<group>"; };
                43A6266613B3D11000AC94B8 /* SVGAnimatedString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedString.cpp; sourceTree = "<group>"; };
                43B85ED018CBEACE00E31AF4 /* makeSelectorPseudoClassAndCompatibilityElementMap.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = makeSelectorPseudoClassAndCompatibilityElementMap.py; sourceTree = "<group>"; };
                43B85ED218CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SelectorPseudoClassAndCompatibilityElementMap.cpp; path = DerivedSources/WebCore/SelectorPseudoClassAndCompatibilityElementMap.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
                                431A2FD613B7707A007791E4 /* SVGAnimatedLengthList.cpp */,
                                089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */,
                                B22277EB0D00BF1F0071B782 /* SVGAnimatedLengthList.idl */,
-                               43A0F0B013AC7D6D00A5F0A7 /* SVGAnimatedNumber.cpp */,
-                               08B35B12127B6A7C005314DD /* SVGAnimatedNumber.h */,
                                B22277EC0D00BF1F0071B782 /* SVGAnimatedNumber.idl */,
                                4331AC7713B6870000A9E5AE /* SVGAnimatedNumberList.cpp */,
                                08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */,
                                B22277ED0D00BF1F0071B782 /* SVGAnimatedNumberList.idl */,
-                               431A2F9B13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp */,
-                               431A2F9A13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h */,
                                0863951313B5FE5700BB344D /* SVGAnimatedPath.cpp */,
                                0863951413B5FE5700BB344D /* SVGAnimatedPath.h */,
                                43B9336813B261B1004584BF /* SVGAnimatedPointList.cpp */,
                                089021A9126EF5DE0092D5EA /* SVGAnimatedLength.h in Headers */,
                                089021AD126EF5E90092D5EA /* SVGAnimatedLengthList.h in Headers */,
                                088A0E04126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h in Headers */,
-                               08B35B13127B6A7C005314DD /* SVGAnimatedNumber.h in Headers */,
                                08B35B17127B6A88005314DD /* SVGAnimatedNumberList.h in Headers */,
-                               431A2F9C13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h in Headers */,
                                0863951613B5FE5700BB344D /* SVGAnimatedPath.h in Headers */,
                                089A8E07128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h in Headers */,
                                43B9336913B261B1004584BF /* SVGAnimatedPointList.h in Headers */,
index a2e0f1e..58f1003 100644 (file)
@@ -22,7 +22,6 @@
 #include "SVGAnimatedLength.h"
 
 #include "SVGAnimateElementBase.h"
-#include "SVGAnimatedNumber.h"
 
 namespace WebCore {
 
index c42ca3e..3a7ddff 100644 (file)
@@ -21,7 +21,6 @@
 #include "SVGAnimatedLengthList.h"
 
 #include "SVGAnimateElementBase.h"
-#include "SVGAnimatedNumber.h"
 
 namespace WebCore {
 
diff --git a/Source/WebCore/svg/SVGAnimatedNumber.cpp b/Source/WebCore/svg/SVGAnimatedNumber.cpp
deleted file mode 100644 (file)
index a1cffa4..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2011. All rights reserved.
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "SVGAnimatedNumber.h"
-
-#include "SVGAnimateElementBase.h"
-#include "SVGParserUtilities.h"
-
-namespace WebCore {
-
-SVGAnimatedNumberAnimator::SVGAnimatedNumberAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement)
-    : SVGAnimatedTypeAnimator(AnimatedNumber, animationElement, contextElement)
-{
-}
-
-std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberAnimator::constructFromString(const String& string)
-{
-    return SVGAnimatedType::create(SVGPropertyTraits<float>::fromString(string));
-}
-
-std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
-{
-    return constructFromBaseValue<SVGAnimatedNumber>(animatedTypes);
-}
-
-void SVGAnimatedNumberAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
-{
-    stopAnimValAnimationForType<SVGAnimatedNumber>(animatedTypes);
-}
-
-void SVGAnimatedNumberAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type)
-{
-    resetFromBaseValue<SVGAnimatedNumber>(animatedTypes, type);
-}
-
-void SVGAnimatedNumberAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes)
-{
-    animValWillChangeForType<SVGAnimatedNumber>(animatedTypes);
-}
-
-void SVGAnimatedNumberAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes)
-{
-    animValDidChangeForType<SVGAnimatedNumber>(animatedTypes);
-}
-
-void SVGAnimatedNumberAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to)
-{
-    ASSERT(from->type() == AnimatedNumber);
-    ASSERT(from->type() == to->type());
-
-    to->as<float>() += from->as<float>();
-}
-
-static float parseNumberFromString(SVGAnimationElement*, const String& string)
-{
-    return SVGPropertyTraits<float>::fromString(string);
-}
-
-void SVGAnimatedNumberAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated)
-{
-    ASSERT(m_animationElement);
-    ASSERT(m_contextElement);
-
-    auto fromNumber = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<float>();
-    auto toNumber = to->as<float>();
-    const auto toAtEndOfDurationNumber = toAtEndOfDuration->as<float>();
-    auto& animatedNumber = animated->as<float>();
-
-    // Apply CSS inheritance rules.
-    m_animationElement->adjustForInheritance<float>(parseNumberFromString, m_animationElement->fromPropertyValueType(), fromNumber, m_contextElement);
-    m_animationElement->adjustForInheritance<float>(parseNumberFromString, m_animationElement->toPropertyValueType(), toNumber, m_contextElement);
-
-    m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromNumber, toNumber, toAtEndOfDurationNumber, animatedNumber);
-}
-
-float SVGAnimatedNumberAnimator::calculateDistance(const String& fromString, const String& toString)
-{
-    ASSERT(m_contextElement);
-    float from = 0;
-    float to = 0;
-    parseNumberFromString(fromString, from);
-    parseNumberFromString(toString, to);
-    return fabsf(to - from);
-}
-
-}
diff --git a/Source/WebCore/svg/SVGAnimatedNumber.h b/Source/WebCore/svg/SVGAnimatedNumber.h
deleted file mode 100644 (file)
index da3d96b..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#pragma once
-
-#include "SVGAnimatedStaticPropertyTearOff.h"
-#include "SVGAnimatedTypeAnimator.h"
-#include "SVGAttributeAccessor.h"
-
-namespace WebCore {
-
-class SVGAnimationElement;
-
-using SVGAnimatedNumber = SVGAnimatedStaticPropertyTearOff<float>;
-using SVGAnimatedNumberAttribute = SVGAnimatedAttribute<SVGAnimatedNumber>;
-
-template<typename OwnerType>
-using SVGAnimatedNumberAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedNumberAttribute, AnimatedNumber>;
-
-template<typename OwnerType>
-using SVGAnimatedOptionalNumberAttributeAccessor = SVGAnimatedOptionalAttributeAccessor<OwnerType, SVGAnimatedNumberAttribute, AnimatedNumberOptionalNumber>;
-
-class SVGAnimatedNumberAnimator final : public SVGAnimatedTypeAnimator {
-public:
-    SVGAnimatedNumberAnimator(SVGAnimationElement*, SVGElement*);
-
-    std::unique_ptr<SVGAnimatedType> constructFromString(const String&) override;
-    std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) override;
-    void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) override;
-    void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType&) override;
-    void animValWillChange(const SVGElementAnimatedPropertyList&) override;
-    void animValDidChange(const SVGElementAnimatedPropertyList&) override;
-
-    void addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) override;
-    void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*) override;
-    float calculateDistance(const String& fromString, const String& toString) override;
-};
-
-} // namespace WebCore
index f56983c..02e0108 100644 (file)
@@ -22,7 +22,6 @@
 #include "SVGAnimatedNumberList.h"
 
 #include "SVGAnimateElementBase.h"
-#include "SVGAnimatedNumber.h"
 
 namespace WebCore {
 
diff --git a/Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.cpp b/Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.cpp
deleted file mode 100644 (file)
index 4526694..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2011. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "SVGAnimatedNumberOptionalNumber.h"
-
-#include "SVGAnimateElementBase.h"
-#include "SVGAnimatedNumber.h"
-#include "SVGParserUtilities.h"
-
-namespace WebCore {
-
-SVGAnimatedNumberOptionalNumberAnimator::SVGAnimatedNumberOptionalNumberAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement)
-    : SVGAnimatedTypeAnimator(AnimatedNumberOptionalNumber, animationElement, contextElement)
-{
-}
-
-std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberOptionalNumberAnimator::constructFromString(const String& string)
-{
-    return SVGAnimatedType::create(SVGPropertyTraits<std::pair<float, float>>::fromString(string));
-}
-
-std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberOptionalNumberAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
-{
-    return constructFromBaseValues<SVGAnimatedNumber, SVGAnimatedNumber>(animatedTypes);
-}
-
-void SVGAnimatedNumberOptionalNumberAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
-{
-    stopAnimValAnimationForTypes<SVGAnimatedNumber, SVGAnimatedNumber>(animatedTypes);
-}
-
-void SVGAnimatedNumberOptionalNumberAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type)
-{
-    resetFromBaseValues<SVGAnimatedNumber, SVGAnimatedNumber>(animatedTypes, type);
-}
-
-void SVGAnimatedNumberOptionalNumberAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes)
-{
-    animValWillChangeForTypes<SVGAnimatedNumber, SVGAnimatedNumber>(animatedTypes);
-}
-
-void SVGAnimatedNumberOptionalNumberAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes)
-{
-    animValDidChangeForTypes<SVGAnimatedNumber, SVGAnimatedNumber>(animatedTypes);
-}
-
-void SVGAnimatedNumberOptionalNumberAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to)
-{
-    ASSERT(from->type() == AnimatedNumberOptionalNumber);
-    ASSERT(from->type() == to->type());
-
-    const auto& fromNumberPair = from->as<std::pair<float, float>>();
-    auto& toNumberPair = to->as<std::pair<float, float>>();
-
-    toNumberPair.first += fromNumberPair.first;
-    toNumberPair.second += fromNumberPair.second;
-}
-
-void SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated)
-{
-    ASSERT(m_animationElement);
-    ASSERT(m_contextElement);
-
-    const auto& fromNumberPair = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<std::pair<float, float>>();
-    const auto& toNumberPair = to->as<std::pair<float, float>>();
-    const auto& toAtEndOfDurationNumberPair = toAtEndOfDuration->as<std::pair<float, float>>();
-    auto& animatedNumberPair = animated->as<std::pair<float, float>>();
-
-    m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromNumberPair.first, toNumberPair.first, toAtEndOfDurationNumberPair.first, animatedNumberPair.first);
-    m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromNumberPair.second, toNumberPair.second, toAtEndOfDurationNumberPair.second, animatedNumberPair.second);
-}
-
-float SVGAnimatedNumberOptionalNumberAnimator::calculateDistance(const String&, const String&)
-{
-    // FIXME: Distance calculation is not possible for SVGNumberOptionalNumber right now. We need the distance for every single value.
-    return -1;
-}
-
-}
diff --git a/Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.h b/Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.h
deleted file mode 100644 (file)
index 66c4fc0..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#pragma once
-
-#include "SVGAnimatedTypeAnimator.h"
-
-namespace WebCore {
-
-class SVGAnimationElement;
-
-class SVGAnimatedNumberOptionalNumberAnimator final : public SVGAnimatedTypeAnimator {
-public:
-    SVGAnimatedNumberOptionalNumberAnimator(SVGAnimationElement*, SVGElement*);
-
-    std::unique_ptr<SVGAnimatedType> constructFromString(const String&) override;
-    std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) override;
-    void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) override;
-    void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType&) override;
-    void animValWillChange(const SVGElementAnimatedPropertyList&) override;
-    void animValDidChange(const SVGElementAnimatedPropertyList&) override;
-
-    void addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) override;
-    void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*) override;
-    float calculateDistance(const String& fromString, const String& toString) override;
-};
-
-} // namespace WebCore
index 8c3c087..048611b 100644 (file)
@@ -25,7 +25,6 @@
 #include "SVGAnimatedTransformList.h"
 
 #include "SVGAnimateTransformElement.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGNames.h"
 #include "SVGTransformDistance.h"
 
index 381fc57..80e50bd 100644 (file)
@@ -23,9 +23,7 @@
 #include "SVGAnimatedEnumeration.h"
 #include "SVGAnimatedLength.h"
 #include "SVGAnimatedLengthList.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGAnimatedNumberList.h"
-#include "SVGAnimatedNumberOptionalNumber.h"
 #include "SVGAnimatedPath.h"
 #include "SVGAnimatedPointList.h"
 #include "SVGAnimatedString.h"
@@ -47,6 +45,8 @@ public:
         case AnimatedColor:
         case AnimatedInteger:
         case AnimatedIntegerOptionalInteger:
+        case AnimatedNumber:
+        case AnimatedNumberOptionalNumber:
         case AnimatedPreserveAspectRatio:
         case AnimatedRect:
             return nullptr;
@@ -59,12 +59,8 @@ public:
             return std::make_unique<SVGAnimatedLengthAnimator>(animationElement, contextElement);
         case AnimatedLengthList:
             return std::make_unique<SVGAnimatedLengthListAnimator>(animationElement, contextElement);
-        case AnimatedNumber:
-            return std::make_unique<SVGAnimatedNumberAnimator>(animationElement, contextElement);
         case AnimatedNumberList:
             return std::make_unique<SVGAnimatedNumberListAnimator>(animationElement, contextElement);
-        case AnimatedNumberOptionalNumber:
-            return std::make_unique<SVGAnimatedNumberOptionalNumberAnimator>(animationElement, contextElement);
         case AnimatedPath:
             return std::make_unique<SVGAnimatedPathAnimator>(animationElement, contextElement);
         case AnimatedPoints:
index 4e2032b..140519c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
  * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -36,6 +36,15 @@ SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(const Q
     : SVGElement(tagName, document)
 {
     registerAttributes();
+    
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        PropertyRegistry::registerProperty<SVGNames::slopeAttr, &SVGComponentTransferFunctionElement::m_slope>();
+        PropertyRegistry::registerProperty<SVGNames::interceptAttr, &SVGComponentTransferFunctionElement::m_intercept>();
+        PropertyRegistry::registerProperty<SVGNames::amplitudeAttr, &SVGComponentTransferFunctionElement::m_amplitude>();
+        PropertyRegistry::registerProperty<SVGNames::exponentAttr, &SVGComponentTransferFunctionElement::m_exponent>();
+        PropertyRegistry::registerProperty<SVGNames::offsetAttr, &SVGComponentTransferFunctionElement::m_offset>();
+    });
 }
 
 void SVGComponentTransferFunctionElement::registerAttributes()
@@ -45,11 +54,6 @@ void SVGComponentTransferFunctionElement::registerAttributes()
         return;
     registry.registerAttribute<SVGNames::typeAttr, ComponentTransferType, &SVGComponentTransferFunctionElement::m_type>();
     registry.registerAttribute<SVGNames::tableValuesAttr, &SVGComponentTransferFunctionElement::m_tableValues>();
-    registry.registerAttribute<SVGNames::slopeAttr, &SVGComponentTransferFunctionElement::m_slope>();
-    registry.registerAttribute<SVGNames::interceptAttr, &SVGComponentTransferFunctionElement::m_intercept>();
-    registry.registerAttribute<SVGNames::amplitudeAttr, &SVGComponentTransferFunctionElement::m_amplitude>();
-    registry.registerAttribute<SVGNames::exponentAttr, &SVGComponentTransferFunctionElement::m_exponent>();
-    registry.registerAttribute<SVGNames::offsetAttr, &SVGComponentTransferFunctionElement::m_offset>();
 }
 
 void SVGComponentTransferFunctionElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -70,27 +74,27 @@ void SVGComponentTransferFunctionElement::parseAttribute(const QualifiedName& na
     }
 
     if (name == SVGNames::slopeAttr) {
-        m_slope.setValue(value.toFloat());
+        m_slope->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::interceptAttr) {
-        m_intercept.setValue(value.toFloat());
+        m_intercept->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::amplitudeAttr) {
-        m_amplitude.setValue(value.toFloat());
+        m_amplitude->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::exponentAttr) {
-        m_exponent.setValue(value.toFloat());
+        m_exponent->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::offsetAttr) {
-        m_offset.setValue(value.toFloat());
+        m_offset->setBaseValInternal(value.toFloat());
         return;
     }
 
index 9d2b6de..89e6d0c 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "FEComponentTransfer.h"
 #include "SVGAnimatedEnumeration.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGAnimatedNumberList.h"
 #include "SVGElement.h"
 
@@ -77,19 +76,19 @@ public:
 
     ComponentTransferType type() const { return m_type.currentValue(attributeOwnerProxy()); }
     const SVGNumberListValues& tableValues() const { return m_tableValues.currentValue(attributeOwnerProxy()); }
-    float slope() const { return m_slope.currentValue(attributeOwnerProxy()); }
-    float intercept() const { return m_intercept.currentValue(attributeOwnerProxy()); }
-    float amplitude() const { return m_amplitude.currentValue(attributeOwnerProxy()); }
-    float exponent() const { return m_exponent.currentValue(attributeOwnerProxy()); }
-    float offset() const { return m_offset.currentValue(attributeOwnerProxy()); }
+    float slope() const { return m_slope->currentValue(); }
+    float intercept() const { return m_intercept->currentValue(); }
+    float amplitude() const { return m_amplitude->currentValue(); }
+    float exponent() const { return m_exponent->currentValue(); }
+    float offset() const { return m_offset->currentValue(); }
 
     RefPtr<SVGAnimatedEnumeration> typeAnimated() { return m_type.animatedProperty(attributeOwnerProxy()); }
     RefPtr<SVGAnimatedNumberList> tableValuesAnimated() { return m_tableValues.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> slopeAnimated() { return m_slope.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> interceptAnimated() { return m_intercept.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> amplitudeAnimated() { return m_amplitude.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> exponentAnimated() { return m_exponent.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> offsetAnimated() { return m_offset.animatedProperty(attributeOwnerProxy()); }
+    SVGAnimatedNumber& slopeAnimated() { return m_slope; }
+    SVGAnimatedNumber& interceptAnimated() { return m_intercept; }
+    SVGAnimatedNumber& amplitudeAnimated() { return m_amplitude; }
+    SVGAnimatedNumber& exponentAnimated() { return m_exponent; }
+    SVGAnimatedNumber& offsetAnimated() { return m_offset; }
 
 protected:
     SVGComponentTransferFunctionElement(const QualifiedName&, Document&);
@@ -117,11 +116,11 @@ private:
     PropertyRegistry m_propertyRegistry { *this };
     SVGAnimatedEnumerationAttribute<ComponentTransferType> m_type { FECOMPONENTTRANSFER_TYPE_IDENTITY };
     SVGAnimatedNumberListAttribute m_tableValues;
-    SVGAnimatedNumberAttribute m_slope { 1 };
-    SVGAnimatedNumberAttribute m_intercept;
-    SVGAnimatedNumberAttribute m_amplitude { 1 };
-    SVGAnimatedNumberAttribute m_exponent { 1 };
-    SVGAnimatedNumberAttribute m_offset;
+    Ref<SVGAnimatedNumber> m_slope { SVGAnimatedNumber::create(this, 1) };
+    Ref<SVGAnimatedNumber> m_intercept { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_amplitude { SVGAnimatedNumber::create(this, 1) };
+    Ref<SVGAnimatedNumber> m_exponent { SVGAnimatedNumber::create(this, 1) };
+    Ref<SVGAnimatedNumber> m_offset { SVGAnimatedNumber::create(this) };
 };
 
 } // namespace WebCore
index 374083c..2657ae9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
  * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -36,6 +36,14 @@ inline SVGFECompositeElement::SVGFECompositeElement(const QualifiedName& tagName
 {
     ASSERT(hasTagName(SVGNames::feCompositeTag));
     registerAttributes();
+    
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        PropertyRegistry::registerProperty<SVGNames::k1Attr, &SVGFECompositeElement::m_k1>();
+        PropertyRegistry::registerProperty<SVGNames::k2Attr, &SVGFECompositeElement::m_k2>();
+        PropertyRegistry::registerProperty<SVGNames::k3Attr, &SVGFECompositeElement::m_k3>();
+        PropertyRegistry::registerProperty<SVGNames::k4Attr, &SVGFECompositeElement::m_k4>();
+    });
 }
 
 Ref<SVGFECompositeElement> SVGFECompositeElement::create(const QualifiedName& tagName, Document& document)
@@ -51,10 +59,6 @@ void SVGFECompositeElement::registerAttributes()
     registry.registerAttribute<SVGNames::inAttr, &SVGFECompositeElement::m_in1>();
     registry.registerAttribute<SVGNames::in2Attr, &SVGFECompositeElement::m_in2>();
     registry.registerAttribute<SVGNames::operatorAttr, CompositeOperationType, &SVGFECompositeElement::m_svgOperator>();
-    registry.registerAttribute<SVGNames::k1Attr, &SVGFECompositeElement::m_k1>();
-    registry.registerAttribute<SVGNames::k2Attr, &SVGFECompositeElement::m_k2>();
-    registry.registerAttribute<SVGNames::k3Attr, &SVGFECompositeElement::m_k3>();
-    registry.registerAttribute<SVGNames::k4Attr, &SVGFECompositeElement::m_k4>();
 }
 
 void SVGFECompositeElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -77,22 +81,22 @@ void SVGFECompositeElement::parseAttribute(const QualifiedName& name, const Atom
     }
 
     if (name == SVGNames::k1Attr) {
-        m_k1.setValue(value.toFloat());
+        m_k1->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::k2Attr) {
-        m_k2.setValue(value.toFloat());
+        m_k2->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::k3Attr) {
-        m_k3.setValue(value.toFloat());
+        m_k3->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::k4Attr) {
-        m_k4.setValue(value.toFloat());
+        m_k4->setBaseValInternal(value.toFloat());
         return;
     }
 
index 55ba8fa..03a7dbe 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "FEComposite.h"
 #include "SVGAnimatedEnumeration.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 
 namespace WebCore {
@@ -88,18 +87,18 @@ public:
     String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
     String in2() const { return m_in2.currentValue(attributeOwnerProxy()); }
     CompositeOperationType svgOperator() const { return m_svgOperator.currentValue(attributeOwnerProxy()); }
-    float k1() const { return m_k1.currentValue(attributeOwnerProxy()); }
-    float k2() const { return m_k2.currentValue(attributeOwnerProxy()); }
-    float k3() const { return m_k3.currentValue(attributeOwnerProxy()); }
-    float k4() const { return m_k4.currentValue(attributeOwnerProxy()); }
+    float k1() const { return m_k1->currentValue(); }
+    float k2() const { return m_k2->currentValue(); }
+    float k3() const { return m_k3->currentValue(); }
+    float k4() const { return m_k4->currentValue(); }
 
     RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
     RefPtr<SVGAnimatedString> in2Animated() { return m_in2.animatedProperty(attributeOwnerProxy()); }
     RefPtr<SVGAnimatedEnumeration> svgOperatorAnimated() { return m_svgOperator.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> k1Animated() { return m_k1.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> k2Animated() { return m_k2.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> k3Animated() { return m_k3.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> k4Animated() { return m_k4.animatedProperty(attributeOwnerProxy()); }
+    SVGAnimatedNumber& k1Animated() { return m_k1; }
+    SVGAnimatedNumber& k2Animated() { return m_k2; }
+    SVGAnimatedNumber& k3Animated() { return m_k3; }
+    SVGAnimatedNumber& k4Animated() { return m_k4; }
 
 private:
     SVGFECompositeElement(const QualifiedName&, Document&);
@@ -128,10 +127,10 @@ private:
     SVGAnimatedStringAttribute m_in1;
     SVGAnimatedStringAttribute m_in2;
     SVGAnimatedEnumerationAttribute<CompositeOperationType> m_svgOperator { FECOMPOSITE_OPERATOR_OVER };
-    SVGAnimatedNumberAttribute m_k1;
-    SVGAnimatedNumberAttribute m_k2;
-    SVGAnimatedNumberAttribute m_k3;
-    SVGAnimatedNumberAttribute m_k4;
+    Ref<SVGAnimatedNumber> m_k1 { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_k2 { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_k3 { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_k4 { SVGAnimatedNumber::create(this) };
 };
 
 } // namespace WebCore
index 52e2e65..e209661 100644 (file)
@@ -44,8 +44,11 @@ inline SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(const QualifiedNam
     static std::once_flag onceFlag;
     std::call_once(onceFlag, [] {
         PropertyRegistry::registerProperty<SVGNames::orderAttr, &SVGFEConvolveMatrixElement::m_orderX, &SVGFEConvolveMatrixElement::m_orderY>();
+        PropertyRegistry::registerProperty<SVGNames::divisorAttr, &SVGFEConvolveMatrixElement::m_divisor>();
+        PropertyRegistry::registerProperty<SVGNames::biasAttr, &SVGFEConvolveMatrixElement::m_bias>();
         PropertyRegistry::registerProperty<SVGNames::targetXAttr, &SVGFEConvolveMatrixElement::m_targetX>();
         PropertyRegistry::registerProperty<SVGNames::targetYAttr, &SVGFEConvolveMatrixElement::m_targetY>();
+        PropertyRegistry::registerProperty<SVGNames::kernelUnitLengthAttr, &SVGFEConvolveMatrixElement::m_kernelUnitLengthX, &SVGFEConvolveMatrixElement::m_kernelUnitLengthY>();
         PropertyRegistry::registerProperty<SVGNames::preserveAlphaAttr, &SVGFEConvolveMatrixElement::m_preserveAlpha>();
     });
 }
@@ -55,18 +58,6 @@ Ref<SVGFEConvolveMatrixElement> SVGFEConvolveMatrixElement::create(const Qualifi
     return adoptRef(*new SVGFEConvolveMatrixElement(tagName, document));
 }
 
-const AtomicString& SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier()
-{
-    static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthX", AtomicString::ConstructFromLiteral);
-    return s_identifier;
-}
-
-const AtomicString& SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier()
-{
-    static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthY", AtomicString::ConstructFromLiteral);
-    return s_identifier;
-}
-
 void SVGFEConvolveMatrixElement::registerAttributes()
 {
     auto& registry = attributeRegistry();
@@ -74,12 +65,7 @@ void SVGFEConvolveMatrixElement::registerAttributes()
         return;
     registry.registerAttribute<SVGNames::inAttr, &SVGFEConvolveMatrixElement::m_in1>();
     registry.registerAttribute<SVGNames::kernelMatrixAttr, &SVGFEConvolveMatrixElement::m_kernelMatrix>();
-    registry.registerAttribute<SVGNames::divisorAttr, &SVGFEConvolveMatrixElement::m_divisor>();
-    registry.registerAttribute<SVGNames::biasAttr, &SVGFEConvolveMatrixElement::m_bias>();
     registry.registerAttribute<SVGNames::edgeModeAttr, EdgeModeType, &SVGFEConvolveMatrixElement::m_edgeMode>();
-    registry.registerAttribute<SVGNames::kernelUnitLengthAttr,
-        &SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier, &SVGFEConvolveMatrixElement::m_kernelUnitLengthX,
-        &SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier, &SVGFEConvolveMatrixElement::m_kernelUnitLengthY>();
 }
 
 void SVGFEConvolveMatrixElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -119,14 +105,14 @@ void SVGFEConvolveMatrixElement::parseAttribute(const QualifiedName& name, const
     if (name == SVGNames::divisorAttr) {
         float divisor = value.toFloat();
         if (divisor)
-            m_divisor.setValue(divisor);
+            m_divisor->setBaseValInternal(divisor);
         else
             document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing divisor=\"" + value + "\". Filtered element will not be displayed.");
         return;
     }
     
     if (name == SVGNames::biasAttr) {
-        m_bias.setValue(value.toFloat());
+        m_bias->setBaseValInternal(value.toFloat());
         return;
     }
 
@@ -143,8 +129,8 @@ void SVGFEConvolveMatrixElement::parseAttribute(const QualifiedName& name, const
     if (name == SVGNames::kernelUnitLengthAttr) {
         float x, y;
         if (parseNumberOptionalNumber(value, x, y) && x > 0 && y > 0) {
-            m_kernelUnitLengthX.setValue(x);
-            m_kernelUnitLengthY.setValue(y);
+            m_kernelUnitLengthX->setBaseValInternal(x);
+            m_kernelUnitLengthY->setBaseValInternal(y);
         } else
             document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing kernelUnitLength=\"" + value + "\". Filtered element will not be displayed.");
         return;
@@ -194,8 +180,8 @@ void SVGFEConvolveMatrixElement::setOrder(float x, float y)
 
 void SVGFEConvolveMatrixElement::setKernelUnitLength(float x, float y)
 {
-    m_kernelUnitLengthX.setValue(x);
-    m_kernelUnitLengthY.setValue(y);
+    m_kernelUnitLengthX->setBaseValInternal(x);
+    m_kernelUnitLengthY->setBaseValInternal(y);
     invalidate();
 }
 
index c73fc9c..452dc73 100644 (file)
@@ -71,26 +71,26 @@ public:
     int orderX() const { return m_orderX->currentValue(); }
     int orderY() const { return m_orderY->currentValue(); }
     const SVGNumberListValues& kernelMatrix() const { return m_kernelMatrix.currentValue(attributeOwnerProxy()); }
-    float divisor() const { return m_divisor.currentValue(attributeOwnerProxy()); }
-    float bias() const { return m_bias.currentValue(attributeOwnerProxy()); }
+    float divisor() const { return m_divisor->currentValue(); }
+    float bias() const { return m_bias->currentValue(); }
     int targetX() const { return m_targetX->currentValue(); }
     int targetY() const { return m_targetY->currentValue(); }
     EdgeModeType edgeMode() const { return m_edgeMode.currentValue(attributeOwnerProxy()); }
-    float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(attributeOwnerProxy()); }
-    float kernelUnitLengthY() const { return m_kernelUnitLengthY.currentValue(attributeOwnerProxy()); }
+    float kernelUnitLengthX() const { return m_kernelUnitLengthX->currentValue(); }
+    float kernelUnitLengthY() const { return m_kernelUnitLengthY->currentValue(); }
     bool preserveAlpha() const { return m_preserveAlpha->currentValue(); }
 
     RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
     SVGAnimatedInteger& orderXAnimated() { return m_orderX; }
     SVGAnimatedInteger& orderYAnimated() { return m_orderY; }
     RefPtr<SVGAnimatedNumberList> kernelMatrixAnimated() { return m_kernelMatrix.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> divisorAnimated() { return m_divisor.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> biasAnimated() { return m_bias.animatedProperty(attributeOwnerProxy()); }
+    SVGAnimatedNumber& divisorAnimated() { return m_divisor; }
+    SVGAnimatedNumber& biasAnimated() { return m_bias; }
     SVGAnimatedInteger& targetXAnimated() { return m_targetX; }
     SVGAnimatedInteger& targetYAnimated() { return m_targetY; }
     RefPtr<SVGAnimatedEnumeration> edgeModeAnimated() { return m_edgeMode.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> kernelUnitLengthYAnimated() { return m_kernelUnitLengthY.animatedProperty(attributeOwnerProxy()); }
+    SVGAnimatedNumber& kernelUnitLengthXAnimated() { return m_kernelUnitLengthX; }
+    SVGAnimatedNumber& kernelUnitLengthYAnimated() { return m_kernelUnitLengthY; }
     SVGAnimatedBoolean& preserveAlphaAnimated() { return m_preserveAlpha; }
 
 private:
@@ -115,22 +115,19 @@ private:
     bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
 
-    static const AtomicString& kernelUnitLengthXIdentifier();
-    static const AtomicString& kernelUnitLengthYIdentifier();
-
     AttributeOwnerProxy m_attributeOwnerProxy { *this };
     PropertyRegistry m_propertyRegistry { *this };
     SVGAnimatedStringAttribute m_in1;
     Ref<SVGAnimatedInteger> m_orderX { SVGAnimatedInteger::create(this) };
     Ref<SVGAnimatedInteger> m_orderY { SVGAnimatedInteger::create(this) };
     SVGAnimatedNumberListAttribute m_kernelMatrix;
-    SVGAnimatedNumberAttribute m_divisor;
-    SVGAnimatedNumberAttribute m_bias;
+    Ref<SVGAnimatedNumber> m_divisor { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_bias { SVGAnimatedNumber::create(this) };
     Ref<SVGAnimatedInteger> m_targetX { SVGAnimatedInteger::create(this) };
     Ref<SVGAnimatedInteger> m_targetY { SVGAnimatedInteger::create(this) };
     SVGAnimatedEnumerationAttribute<EdgeModeType> m_edgeMode { EDGEMODE_DUPLICATE };
-    SVGAnimatedNumberAttribute m_kernelUnitLengthX;
-    SVGAnimatedNumberAttribute m_kernelUnitLengthY;
+    Ref<SVGAnimatedNumber> m_kernelUnitLengthX { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_kernelUnitLengthY { SVGAnimatedNumber::create(this) };
     Ref<SVGAnimatedBoolean> m_preserveAlpha { SVGAnimatedBoolean::create(this) };
 };
 
index 8b23f24..b570c8b 100644 (file)
@@ -39,6 +39,13 @@ inline SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const QualifiedN
 {
     ASSERT(hasTagName(SVGNames::feDiffuseLightingTag));
     registerAttributes();
+
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        PropertyRegistry::registerProperty<SVGNames::diffuseConstantAttr, &SVGFEDiffuseLightingElement::m_diffuseConstant>();
+        PropertyRegistry::registerProperty<SVGNames::surfaceScaleAttr, &SVGFEDiffuseLightingElement::m_surfaceScale>();
+        PropertyRegistry::registerProperty<SVGNames::kernelUnitLengthAttr, &SVGFEDiffuseLightingElement::m_kernelUnitLengthX, &SVGFEDiffuseLightingElement::m_kernelUnitLengthY>();
+    });
 }
 
 Ref<SVGFEDiffuseLightingElement> SVGFEDiffuseLightingElement::create(const QualifiedName& tagName, Document& document)
@@ -46,29 +53,12 @@ Ref<SVGFEDiffuseLightingElement> SVGFEDiffuseLightingElement::create(const Quali
     return adoptRef(*new SVGFEDiffuseLightingElement(tagName, document));
 }
 
-const AtomicString& SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier()
-{
-    static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthX", AtomicString::ConstructFromLiteral);
-    return s_identifier;
-}
-
-const AtomicString& SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier()
-{
-    static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthY", AtomicString::ConstructFromLiteral);
-    return s_identifier;
-}
-
 void SVGFEDiffuseLightingElement::registerAttributes()
 {
     auto& registry = attributeRegistry();
     if (!registry.isEmpty())
         return;
     registry.registerAttribute<SVGNames::inAttr, &SVGFEDiffuseLightingElement::m_in1>();
-    registry.registerAttribute<SVGNames::diffuseConstantAttr, &SVGFEDiffuseLightingElement::m_diffuseConstant>();
-    registry.registerAttribute<SVGNames::surfaceScaleAttr, &SVGFEDiffuseLightingElement::m_surfaceScale>();
-    registry.registerAttribute<SVGNames::kernelUnitLengthAttr,
-        &SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier, &SVGFEDiffuseLightingElement::m_kernelUnitLengthX,
-        &SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier, &SVGFEDiffuseLightingElement::m_kernelUnitLengthY>();
 }
 
 void SVGFEDiffuseLightingElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -79,20 +69,20 @@ void SVGFEDiffuseLightingElement::parseAttribute(const QualifiedName& name, cons
     }
 
     if (name == SVGNames::surfaceScaleAttr) {
-        m_surfaceScale.setValue(value.toFloat());
+        m_surfaceScale->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::diffuseConstantAttr) {
-        m_diffuseConstant.setValue(value.toFloat());
+        m_diffuseConstant->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::kernelUnitLengthAttr) {
         float x, y;
         if (parseNumberOptionalNumber(value, x, y)) {
-            m_kernelUnitLengthX.setValue(x);
-            m_kernelUnitLengthY.setValue(y);
+            m_kernelUnitLengthX->setBaseValInternal(x);
+            m_kernelUnitLengthY->setBaseValInternal(y);
         }
         return;
     }
index 3be6da8..7614078 100644 (file)
@@ -37,16 +37,16 @@ public:
     void lightElementAttributeChanged(const SVGFELightElement*, const QualifiedName&);
 
     String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
-    float diffuseConstant() const { return m_diffuseConstant.currentValue(attributeOwnerProxy()); }
-    float surfaceScale() const { return m_surfaceScale.currentValue(attributeOwnerProxy()); }
-    float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(attributeOwnerProxy()); }
-    float kernelUnitLengthY() const { return m_kernelUnitLengthY.currentValue(attributeOwnerProxy()); }
+    float diffuseConstant() const { return m_diffuseConstant->currentValue(); }
+    float surfaceScale() const { return m_surfaceScale->currentValue(); }
+    float kernelUnitLengthX() const { return m_kernelUnitLengthX->currentValue(); }
+    float kernelUnitLengthY() const { return m_kernelUnitLengthY->currentValue(); }
 
     RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> diffuseConstantAnimated() { return m_diffuseConstant.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> surfaceScaleAnimated() { return m_surfaceScale.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> kernelUnitLengthYAnimated() { return m_kernelUnitLengthY.animatedProperty(attributeOwnerProxy()); }
+    SVGAnimatedNumber& diffuseConstantAnimated() { return m_diffuseConstant; }
+    SVGAnimatedNumber& surfaceScaleAnimated() { return m_surfaceScale; }
+    SVGAnimatedNumber& kernelUnitLengthXAnimated() { return m_kernelUnitLengthX; }
+    SVGAnimatedNumber& kernelUnitLengthYAnimated() { return m_kernelUnitLengthY; }
 
 private:
     SVGFEDiffuseLightingElement(const QualifiedName&, Document&);
@@ -70,16 +70,13 @@ private:
     bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
 
-    static const AtomicString& kernelUnitLengthXIdentifier();
-    static const AtomicString& kernelUnitLengthYIdentifier();
-
     AttributeOwnerProxy m_attributeOwnerProxy { *this };
     PropertyRegistry m_propertyRegistry { *this };
     SVGAnimatedStringAttribute m_in1;
-    SVGAnimatedNumberAttribute m_diffuseConstant { 1 };
-    SVGAnimatedNumberAttribute m_surfaceScale { 1 };
-    SVGAnimatedNumberAttribute m_kernelUnitLengthX;
-    SVGAnimatedNumberAttribute m_kernelUnitLengthY;
+    Ref<SVGAnimatedNumber> m_diffuseConstant { SVGAnimatedNumber::create(this, 1) };
+    Ref<SVGAnimatedNumber> m_surfaceScale { SVGAnimatedNumber::create(this, 1) };
+    Ref<SVGAnimatedNumber> m_kernelUnitLengthX { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_kernelUnitLengthY { SVGAnimatedNumber::create(this) };
 };
 
 } // namespace WebCore
index 2809e47..b2a26ac 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2006 Oliver Hunt <oliver@nerget.com>
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -35,6 +35,11 @@ inline SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const QualifiedN
 {
     ASSERT(hasTagName(SVGNames::feDisplacementMapTag));
     registerAttributes();
+    
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        PropertyRegistry::registerProperty<SVGNames::scaleAttr, &SVGFEDisplacementMapElement::m_scale>();
+    });
 }
 
 Ref<SVGFEDisplacementMapElement> SVGFEDisplacementMapElement::create(const QualifiedName& tagName, Document& document)
@@ -51,7 +56,6 @@ void SVGFEDisplacementMapElement::registerAttributes()
     registry.registerAttribute<SVGNames::in2Attr, &SVGFEDisplacementMapElement::m_in2>();
     registry.registerAttribute<SVGNames::xChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_xChannelSelector>();
     registry.registerAttribute<SVGNames::yChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_yChannelSelector>();
-    registry.registerAttribute<SVGNames::scaleAttr, &SVGFEDisplacementMapElement::m_scale>();
 }
 
 void SVGFEDisplacementMapElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -81,7 +85,7 @@ void SVGFEDisplacementMapElement::parseAttribute(const QualifiedName& name, cons
     }
 
     if (name == SVGNames::scaleAttr) {
-        m_scale.setValue(value.toFloat());
+        m_scale->setBaseValInternal(value.toFloat());
         return;
     }
 
index 2448ad0..f49ee0c 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "FEDisplacementMap.h"
 #include "SVGAnimatedEnumeration.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 
 namespace WebCore {
@@ -75,13 +74,13 @@ public:
     String in2() const { return m_in2.currentValue(attributeOwnerProxy()); }
     ChannelSelectorType xChannelSelector() const { return m_xChannelSelector.currentValue(attributeOwnerProxy()); }
     ChannelSelectorType yChannelSelector() const { return m_yChannelSelector.currentValue(attributeOwnerProxy()); }
-    float scale() const { return m_scale.currentValue(attributeOwnerProxy()); }
+    float scale() const { return m_scale->currentValue(); }
 
     RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
     RefPtr<SVGAnimatedString> in2Animated() { return m_in2.animatedProperty(attributeOwnerProxy()); }
     RefPtr<SVGAnimatedEnumeration> xChannelSelectorAnimated() { return m_xChannelSelector.animatedProperty(attributeOwnerProxy()); }
     RefPtr<SVGAnimatedEnumeration> yChannelSelectorAnimated() { return m_yChannelSelector.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> scaleAnimated() { return m_scale.animatedProperty(attributeOwnerProxy()); }
+    SVGAnimatedNumber& scaleAnimated() { return m_scale; }
 
 private:
     SVGFEDisplacementMapElement(const QualifiedName& tagName, Document&);
@@ -111,7 +110,7 @@ private:
     SVGAnimatedStringAttribute m_in2;
     SVGAnimatedEnumerationAttribute<ChannelSelectorType> m_xChannelSelector { CHANNEL_A };
     SVGAnimatedEnumerationAttribute<ChannelSelectorType> m_yChannelSelector { CHANNEL_A };
-    SVGAnimatedNumberAttribute m_scale;
+    Ref<SVGAnimatedNumber> m_scale { SVGAnimatedNumber::create(this) };
 };
 
 } // namespace WebCore
index 960ec44..4b8502b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) Research In Motion Limited 2011. All rights reserved.
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -37,6 +37,13 @@ inline SVGFEDropShadowElement::SVGFEDropShadowElement(const QualifiedName& tagNa
 {
     ASSERT(hasTagName(SVGNames::feDropShadowTag));
     registerAttributes();
+    
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        PropertyRegistry::registerProperty<SVGNames::dxAttr, &SVGFEDropShadowElement::m_dx>();
+        PropertyRegistry::registerProperty<SVGNames::dyAttr, &SVGFEDropShadowElement::m_dy>();
+        PropertyRegistry::registerProperty<SVGNames::stdDeviationAttr, &SVGFEDropShadowElement::m_stdDeviationX, &SVGFEDropShadowElement::m_stdDeviationY>();
+    });
 }
 
 Ref<SVGFEDropShadowElement> SVGFEDropShadowElement::create(const QualifiedName& tagName, Document& document)
@@ -44,22 +51,10 @@ Ref<SVGFEDropShadowElement> SVGFEDropShadowElement::create(const QualifiedName&
     return adoptRef(*new SVGFEDropShadowElement(tagName, document));
 }
 
-const AtomicString& SVGFEDropShadowElement::stdDeviationXIdentifier()
-{
-    static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationX", AtomicString::ConstructFromLiteral);
-    return s_identifier;
-}
-
-const AtomicString& SVGFEDropShadowElement::stdDeviationYIdentifier()
-{
-    static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationY", AtomicString::ConstructFromLiteral);
-    return s_identifier;
-}
-
 void SVGFEDropShadowElement::setStdDeviation(float x, float y)
 {
-    m_stdDeviationX.setValue(x);
-    m_stdDeviationY.setValue(y);
+    m_stdDeviationX->setBaseValInternal(x);
+    m_stdDeviationY->setBaseValInternal(y);
     invalidate();
 }
 
@@ -69,11 +64,6 @@ void SVGFEDropShadowElement::registerAttributes()
     if (!registry.isEmpty())
         return;
     registry.registerAttribute<SVGNames::inAttr, &SVGFEDropShadowElement::m_in1>();
-    registry.registerAttribute<SVGNames::dxAttr, &SVGFEDropShadowElement::m_dx>();
-    registry.registerAttribute<SVGNames::dyAttr, &SVGFEDropShadowElement::m_dy>();
-    registry.registerAttribute<SVGNames::stdDeviationAttr,
-        &SVGFEDropShadowElement::stdDeviationXIdentifier, &SVGFEDropShadowElement::m_stdDeviationX,
-        &SVGFEDropShadowElement::stdDeviationYIdentifier, &SVGFEDropShadowElement::m_stdDeviationY>();
 }
 
 void SVGFEDropShadowElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -81,8 +71,8 @@ void SVGFEDropShadowElement::parseAttribute(const QualifiedName& name, const Ato
     if (name == SVGNames::stdDeviationAttr) {
         float x, y;
         if (parseNumberOptionalNumber(value, x, y)) {
-            m_stdDeviationX.setValue(x);
-            m_stdDeviationY.setValue(y);
+            m_stdDeviationX->setBaseValInternal(x);
+            m_stdDeviationY->setBaseValInternal(y);
         }
         return;
     }
@@ -93,12 +83,12 @@ void SVGFEDropShadowElement::parseAttribute(const QualifiedName& name, const Ato
     }
 
     if (name == SVGNames::dxAttr) {
-        m_dx.setValue(value.toFloat());
+        m_dx->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::dyAttr) {
-        m_dy.setValue(value.toFloat());
+        m_dy->setBaseValInternal(value.toFloat());
         return;
     }
 
index 8e29c0d..a0e65c2 100644 (file)
@@ -21,7 +21,6 @@
 #pragma once
 
 #include "FEDropShadow.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 
 namespace WebCore {
@@ -34,16 +33,16 @@ public:
     void setStdDeviation(float stdDeviationX, float stdDeviationY);
 
     String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
-    float dx() const { return m_dx.currentValue(attributeOwnerProxy()); }
-    float dy() const { return m_dy.currentValue(attributeOwnerProxy()); }
-    float stdDeviationX() const { return m_stdDeviationX.currentValue(attributeOwnerProxy()); }
-    float stdDeviationY() const { return m_stdDeviationY.currentValue(attributeOwnerProxy()); }
+    float dx() const { return m_dx->currentValue(); }
+    float dy() const { return m_dy->currentValue(); }
+    float stdDeviationX() const { return m_stdDeviationX->currentValue(); }
+    float stdDeviationY() const { return m_stdDeviationY->currentValue(); }
 
     RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> dxAnimated() { return m_dx.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> dyAnimated() { return m_dy.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> stdDeviationXAnimated() { return m_stdDeviationX.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> stdDeviationYAnimated() { return m_stdDeviationY.animatedProperty(attributeOwnerProxy()); }
+    SVGAnimatedNumber& dxAnimated() { return m_dx; }
+    SVGAnimatedNumber& dyAnimated() { return m_dy; }
+    SVGAnimatedNumber& stdDeviationXAnimated() { return m_stdDeviationX; }
+    SVGAnimatedNumber& stdDeviationYAnimated() { return m_stdDeviationY; }
 
 private:
     SVGFEDropShadowElement(const QualifiedName&, Document&);
@@ -66,16 +65,13 @@ private:
 
     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
 
-    static const AtomicString& stdDeviationXIdentifier();
-    static const AtomicString& stdDeviationYIdentifier();
-
     AttributeOwnerProxy m_attributeOwnerProxy { *this };
     PropertyRegistry m_propertyRegistry { *this };
     SVGAnimatedStringAttribute m_in1;
-    SVGAnimatedNumberAttribute m_dx { 2 };
-    SVGAnimatedNumberAttribute m_dy { 2 };
-    SVGAnimatedNumberAttribute m_stdDeviationX { 2 };
-    SVGAnimatedNumberAttribute m_stdDeviationY { 2 };
+    Ref<SVGAnimatedNumber> m_dx { SVGAnimatedNumber::create(this, 2) };
+    Ref<SVGAnimatedNumber> m_dy { SVGAnimatedNumber::create(this, 2) };
+    Ref<SVGAnimatedNumber> m_stdDeviationX { SVGAnimatedNumber::create(this, 2) };
+    Ref<SVGAnimatedNumber> m_stdDeviationY { SVGAnimatedNumber::create(this, 2) };
 };
     
 } // namespace WebCore
index 12a9270..0a927fe 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
  * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -37,6 +37,11 @@ inline SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(const QualifiedName& t
 {
     ASSERT(hasTagName(SVGNames::feGaussianBlurTag));
     registerAttributes();
+
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        PropertyRegistry::registerProperty<SVGNames::stdDeviationAttr, &SVGFEGaussianBlurElement::m_stdDeviationX, &SVGFEGaussianBlurElement::m_stdDeviationY>();
+    });
 }
 
 Ref<SVGFEGaussianBlurElement> SVGFEGaussianBlurElement::create(const QualifiedName& tagName, Document& document)
@@ -44,22 +49,10 @@ Ref<SVGFEGaussianBlurElement> SVGFEGaussianBlurElement::create(const QualifiedNa
     return adoptRef(*new SVGFEGaussianBlurElement(tagName, document));
 }
 
-const AtomicString& SVGFEGaussianBlurElement::stdDeviationXIdentifier()
-{
-    static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationX", AtomicString::ConstructFromLiteral);
-    return s_identifier;
-}
-
-const AtomicString& SVGFEGaussianBlurElement::stdDeviationYIdentifier()
-{
-    static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationY", AtomicString::ConstructFromLiteral);
-    return s_identifier;
-}
-
 void SVGFEGaussianBlurElement::setStdDeviation(float x, float y)
 {
-    m_stdDeviationX.setValue(x);
-    m_stdDeviationY.setValue(y);
+    m_stdDeviationX->setBaseValInternal(x);
+    m_stdDeviationY->setBaseValInternal(y);
     invalidate();
 }
 
@@ -69,9 +62,6 @@ void SVGFEGaussianBlurElement::registerAttributes()
     if (!registry.isEmpty())
         return;
     registry.registerAttribute<SVGNames::inAttr, &SVGFEGaussianBlurElement::m_in1>();
-    registry.registerAttribute<SVGNames::stdDeviationAttr,
-        &SVGFEGaussianBlurElement::stdDeviationXIdentifier, &SVGFEGaussianBlurElement::m_stdDeviationX,
-        &SVGFEGaussianBlurElement::stdDeviationYIdentifier, &SVGFEGaussianBlurElement::m_stdDeviationY>();
     registry.registerAttribute<SVGNames::edgeModeAttr, EdgeModeType, &SVGFEGaussianBlurElement::m_edgeMode>();
 }
 
@@ -80,8 +70,8 @@ void SVGFEGaussianBlurElement::parseAttribute(const QualifiedName& name, const A
     if (name == SVGNames::stdDeviationAttr) {
         float x, y;
         if (parseNumberOptionalNumber(value, x, y)) {
-            m_stdDeviationX.setValue(x);
-            m_stdDeviationY.setValue(y);
+            m_stdDeviationX->setBaseValInternal(x);
+            m_stdDeviationY->setBaseValInternal(y);
         }
         return;
     }
index e3387bc..b045028 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "FEGaussianBlur.h"
 #include "SVGAnimatedEnumeration.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGFEConvolveMatrixElement.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 
@@ -37,13 +36,13 @@ public:
     void setStdDeviation(float stdDeviationX, float stdDeviationY);
 
     String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
-    float stdDeviationX() const { return m_stdDeviationX.currentValue(attributeOwnerProxy()); }
-    float stdDeviationY() const { return m_stdDeviationY.currentValue(attributeOwnerProxy()); }
+    float stdDeviationX() const { return m_stdDeviationX->currentValue(); }
+    float stdDeviationY() const { return m_stdDeviationY->currentValue(); }
     EdgeModeType edgeMode() const { return m_edgeMode.currentValue(attributeOwnerProxy()); }
 
     RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> stdDeviationXAnimated() { return m_stdDeviationX.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> stdDeviationYAnimated() { return m_stdDeviationY.animatedProperty(attributeOwnerProxy()); }
+    SVGAnimatedNumber& stdDeviationXAnimated() { return m_stdDeviationX; }
+    SVGAnimatedNumber& stdDeviationYAnimated() { return m_stdDeviationY; }
     RefPtr<SVGAnimatedEnumeration> edgeModeAnimated() { return m_edgeMode.animatedProperty(attributeOwnerProxy()); }
 
 private:
@@ -67,14 +66,11 @@ private:
 
     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
 
-    static const AtomicString& stdDeviationXIdentifier();
-    static const AtomicString& stdDeviationYIdentifier();
-
     AttributeOwnerProxy m_attributeOwnerProxy { *this };
     PropertyRegistry m_propertyRegistry { *this };
     SVGAnimatedStringAttribute m_in1;
-    SVGAnimatedNumberAttribute m_stdDeviationX;
-    SVGAnimatedNumberAttribute m_stdDeviationY;
+    Ref<SVGAnimatedNumber> m_stdDeviationX { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_stdDeviationY { SVGAnimatedNumber::create(this) };
     SVGAnimatedEnumerationAttribute<EdgeModeType> m_edgeMode { EDGEMODE_NONE };
 };
 
index 891fedd..2e6b0ec 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
  * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
  * Copyright (C) 2005 Oliver Hunt <oliver@nerget.com>
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -43,7 +43,19 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(SVGFELightElement);
 SVGFELightElement::SVGFELightElement(const QualifiedName& tagName, Document& document)
     : SVGElement(tagName, document)
 {
-    registerAttributes();
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        PropertyRegistry::registerProperty<SVGNames::azimuthAttr, &SVGFELightElement::m_azimuth>();
+        PropertyRegistry::registerProperty<SVGNames::elevationAttr, &SVGFELightElement::m_elevation>();
+        PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGFELightElement::m_x>();
+        PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGFELightElement::m_y>();
+        PropertyRegistry::registerProperty<SVGNames::zAttr, &SVGFELightElement::m_z>();
+        PropertyRegistry::registerProperty<SVGNames::pointsAtXAttr, &SVGFELightElement::m_pointsAtX>();
+        PropertyRegistry::registerProperty<SVGNames::pointsAtYAttr, &SVGFELightElement::m_pointsAtY>();
+        PropertyRegistry::registerProperty<SVGNames::pointsAtZAttr, &SVGFELightElement::m_pointsAtZ>();
+        PropertyRegistry::registerProperty<SVGNames::specularExponentAttr, &SVGFELightElement::m_specularExponent>();
+        PropertyRegistry::registerProperty<SVGNames::limitingConeAngleAttr, &SVGFELightElement::m_limitingConeAngle>();
+    });
 }
 
 SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement* svgElement)
@@ -55,72 +67,55 @@ SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement* svgElem
     return nullptr;
 }
 
-void SVGFELightElement::registerAttributes()
-{
-    auto& registry = attributeRegistry();
-    if (!registry.isEmpty())
-        return;
-    registry.registerAttribute<SVGNames::azimuthAttr, &SVGFELightElement::m_azimuth>();
-    registry.registerAttribute<SVGNames::elevationAttr, &SVGFELightElement::m_elevation>();
-    registry.registerAttribute<SVGNames::xAttr, &SVGFELightElement::m_x>();
-    registry.registerAttribute<SVGNames::yAttr, &SVGFELightElement::m_y>();
-    registry.registerAttribute<SVGNames::zAttr, &SVGFELightElement::m_z>();
-    registry.registerAttribute<SVGNames::pointsAtXAttr, &SVGFELightElement::m_pointsAtX>();
-    registry.registerAttribute<SVGNames::pointsAtYAttr, &SVGFELightElement::m_pointsAtY>();
-    registry.registerAttribute<SVGNames::pointsAtZAttr, &SVGFELightElement::m_pointsAtZ>();
-    registry.registerAttribute<SVGNames::specularExponentAttr, &SVGFELightElement::m_specularExponent>();
-    registry.registerAttribute<SVGNames::limitingConeAngleAttr, &SVGFELightElement::m_limitingConeAngle>();
-}
-
 void SVGFELightElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == SVGNames::azimuthAttr) {
-        m_azimuth.setValue(value.toFloat());
+        m_azimuth->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::elevationAttr) {
-        m_elevation.setValue(value.toFloat());
+        m_elevation->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::xAttr) {
-        m_x.setValue(value.toFloat());
+        m_x->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::yAttr) {
-        m_y.setValue(value.toFloat());
+        m_y->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::zAttr) {
-        m_z.setValue(value.toFloat());
+        m_z->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::pointsAtXAttr) {
-        m_pointsAtX.setValue(value.toFloat());
+        m_pointsAtX->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::pointsAtYAttr) {
-        m_pointsAtY.setValue(value.toFloat());
+        m_pointsAtY->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::pointsAtZAttr) {
-        m_pointsAtZ.setValue(value.toFloat());
+        m_pointsAtZ->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::specularExponentAttr) {
-        m_specularExponent.setValue(value.toFloat());
+        m_specularExponent->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::limitingConeAngleAttr) {
-        m_limitingConeAngle.setValue(value.toFloat());
+        m_limitingConeAngle->setBaseValInternal(value.toFloat());
         return;
     }
 
@@ -129,7 +124,7 @@ void SVGFELightElement::parseAttribute(const QualifiedName& name, const AtomicSt
 
 void SVGFELightElement::svgAttributeChanged(const QualifiedName& attrName)
 {
-    if (isKnownAttribute(attrName)) {
+    if (PropertyRegistry::isKnownAttribute(attrName)) {
         auto parent = makeRefPtr(parentElement());
         if (!parent)
             return;
index 9be2bfa..1eb4eac 100644 (file)
@@ -23,7 +23,6 @@
 #pragma once
 
 #include "LightSource.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGElement.h"
 
 namespace WebCore {
@@ -36,27 +35,27 @@ public:
     virtual Ref<LightSource> lightSource(SVGFilterBuilder&) const = 0;
     static SVGFELightElement* findLightElement(const SVGElement*);
 
-    float azimuth() const { return m_azimuth.currentValue(attributeOwnerProxy()); }
-    float elevation() const { return m_elevation.currentValue(attributeOwnerProxy()); }
-    float x() const { return m_x.currentValue(attributeOwnerProxy()); }
-    float y() const { return m_y.currentValue(attributeOwnerProxy()); }
-    float z() const { return m_z.currentValue(attributeOwnerProxy()); }
-    float pointsAtX() const { return m_pointsAtX.currentValue(attributeOwnerProxy()); }
-    float pointsAtY() const { return m_pointsAtY.currentValue(attributeOwnerProxy()); }
-    float pointsAtZ() const { return m_pointsAtZ.currentValue(attributeOwnerProxy()); }
-    float specularExponent() const { return m_specularExponent.currentValue(attributeOwnerProxy()); }
-    float limitingConeAngle() const { return m_limitingConeAngle.currentValue(attributeOwnerProxy()); }
+    float azimuth() const { return m_azimuth->currentValue(); }
+    float elevation() const { return m_elevation->currentValue(); }
+    float x() const { return m_x->currentValue(); }
+    float y() const { return m_y->currentValue(); }
+    float z() const { return m_z->currentValue(); }
+    float pointsAtX() const { return m_pointsAtX->currentValue(); }
+    float pointsAtY() const { return m_pointsAtY->currentValue(); }
+    float pointsAtZ() const { return m_pointsAtZ->currentValue(); }
+    float specularExponent() const { return m_specularExponent->currentValue(); }
+    float limitingConeAngle() const { return m_limitingConeAngle->currentValue(); }
 
-    RefPtr<SVGAnimatedNumber> azimuthAnimated() { return m_azimuth.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> elevationAnimated() { return m_elevation.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> zAnimated() { return m_z.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> pointsAtXAnimated() { return m_pointsAtX.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> pointsAtYAnimated() { return m_pointsAtY.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> pointsAtZAnimated() { return m_pointsAtZ.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> specularExponentAnimated() { return m_specularExponent.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> limitingConeAngleAnimated() { return m_limitingConeAngle.animatedProperty(attributeOwnerProxy()); }
+    SVGAnimatedNumber& azimuthAnimated() { return m_azimuth; }
+    SVGAnimatedNumber& elevationAnimated() { return m_elevation; }
+    SVGAnimatedNumber& xAnimated() { return m_x; }
+    SVGAnimatedNumber& yAnimated() { return m_y; }
+    SVGAnimatedNumber& zAnimated() { return m_z; }
+    SVGAnimatedNumber& pointsAtXAnimated() { return m_pointsAtX; }
+    SVGAnimatedNumber& pointsAtYAnimated() { return m_pointsAtY; }
+    SVGAnimatedNumber& pointsAtZAnimated() { return m_pointsAtZ; }
+    SVGAnimatedNumber& specularExponentAnimated() { return m_specularExponent; }
+    SVGAnimatedNumber& limitingConeAngleAnimated() { return m_limitingConeAngle; }
 
 protected:
     SVGFELightElement(const QualifiedName&, Document&);
@@ -65,34 +64,27 @@ protected:
 
 private:
     using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFELightElement, SVGElement>;
-    static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }
-    static void registerAttributes();
     const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; }
 
     using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFELightElement, SVGElement>;
     const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; }
 
-    static bool isKnownAttribute(const QualifiedName& attributeName)
-    {
-        return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName);
-    }
-
     void parseAttribute(const QualifiedName&, const AtomicString&) override;
     void svgAttributeChanged(const QualifiedName&) override;
     void childrenChanged(const ChildChange&) override;
 
     AttributeOwnerProxy m_attributeOwnerProxy { *this };
     PropertyRegistry m_propertyRegistry { *this };
-    SVGAnimatedNumberAttribute m_azimuth;
-    SVGAnimatedNumberAttribute m_elevation;
-    SVGAnimatedNumberAttribute m_x;
-    SVGAnimatedNumberAttribute m_y;
-    SVGAnimatedNumberAttribute m_z;
-    SVGAnimatedNumberAttribute m_pointsAtX;
-    SVGAnimatedNumberAttribute m_pointsAtY;
-    SVGAnimatedNumberAttribute m_pointsAtZ;
-    SVGAnimatedNumberAttribute m_specularExponent { 1 };
-    SVGAnimatedNumberAttribute m_limitingConeAngle;
+    Ref<SVGAnimatedNumber> m_azimuth { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_elevation { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_x { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_y { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_z { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_pointsAtX { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_pointsAtY { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_pointsAtZ { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_specularExponent { SVGAnimatedNumber::create(this, 1) };
+    Ref<SVGAnimatedNumber> m_limitingConeAngle { SVGAnimatedNumber::create(this) };
 };
 
 } // namespace WebCore
index a421739..62ff24a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -36,6 +36,11 @@ inline SVGFEMorphologyElement::SVGFEMorphologyElement(const QualifiedName& tagNa
 {
     ASSERT(hasTagName(SVGNames::feMorphologyTag));
     registerAttributes();
+    
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        PropertyRegistry::registerProperty<SVGNames::radiusAttr, &SVGFEMorphologyElement::m_radiusX, &SVGFEMorphologyElement::m_radiusY>();
+    });
 }
 
 Ref<SVGFEMorphologyElement> SVGFEMorphologyElement::create(const QualifiedName& tagName, Document& document)
@@ -43,22 +48,10 @@ Ref<SVGFEMorphologyElement> SVGFEMorphologyElement::create(const QualifiedName&
     return adoptRef(*new SVGFEMorphologyElement(tagName, document));
 }
 
-const AtomicString& SVGFEMorphologyElement::radiusXIdentifier()
-{
-    static NeverDestroyed<AtomicString> s_identifier("SVGRadiusX", AtomicString::ConstructFromLiteral);
-    return s_identifier;
-}
-
-const AtomicString& SVGFEMorphologyElement::radiusYIdentifier()
-{
-    static NeverDestroyed<AtomicString> s_identifier("SVGRadiusY", AtomicString::ConstructFromLiteral);
-    return s_identifier;
-}
-
 void SVGFEMorphologyElement::setRadius(float x, float y)
 {
-    m_radiusX.setValue(x);
-    m_radiusY.setValue(y);
+    m_radiusX->setBaseValInternal(x);
+    m_radiusY->setBaseValInternal(y);
     invalidate();
 }
 
@@ -69,9 +62,6 @@ void SVGFEMorphologyElement::registerAttributes()
         return;
     registry.registerAttribute<SVGNames::inAttr, &SVGFEMorphologyElement::m_in1>();
     registry.registerAttribute<SVGNames::operatorAttr, MorphologyOperatorType, &SVGFEMorphologyElement::m_svgOperator>();
-    registry.registerAttribute<SVGNames::radiusAttr,
-        &SVGFEMorphologyElement::radiusXIdentifier, &SVGFEMorphologyElement::m_radiusX,
-        &SVGFEMorphologyElement::radiusYIdentifier, &SVGFEMorphologyElement::m_radiusY>();
 }
 
 void SVGFEMorphologyElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -91,8 +81,8 @@ void SVGFEMorphologyElement::parseAttribute(const QualifiedName& name, const Ato
     if (name == SVGNames::radiusAttr) {
         float x, y;
         if (parseNumberOptionalNumber(value, x, y)) {
-            m_radiusX.setValue(x);
-            m_radiusY.setValue(y);
+            m_radiusX->setBaseValInternal(x);
+            m_radiusY->setBaseValInternal(y);
         }
         return;
     }
index 68281b7..ee755fd 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "FEMorphology.h"
 #include "SVGAnimatedEnumeration.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 
 namespace WebCore {
@@ -65,13 +64,13 @@ public:
 
     String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
     MorphologyOperatorType svgOperator() const { return m_svgOperator.currentValue(attributeOwnerProxy()); }
-    float radiusX() const { return m_radiusX.currentValue(attributeOwnerProxy()); }
-    float radiusY() const { return m_radiusY.currentValue(attributeOwnerProxy()); }
+    float radiusX() const { return m_radiusX->currentValue(); }
+    float radiusY() const { return m_radiusY->currentValue(); }
 
     RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
     RefPtr<SVGAnimatedEnumeration> svgOperatorAnimated() { return m_svgOperator.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> radiusXAnimated() { return m_radiusX.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> radiusYAnimated() { return m_radiusY.animatedProperty(attributeOwnerProxy()); }
+    SVGAnimatedNumber& radiusXAnimated() { return m_radiusX; }
+    SVGAnimatedNumber& radiusYAnimated() { return m_radiusY; }
 
 private:
     SVGFEMorphologyElement(const QualifiedName&, Document&);
@@ -95,15 +94,12 @@ private:
     bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
 
-    static const AtomicString& radiusXIdentifier();
-    static const AtomicString& radiusYIdentifier();
-
     AttributeOwnerProxy m_attributeOwnerProxy { *this };
     PropertyRegistry m_propertyRegistry { *this };
     SVGAnimatedStringAttribute m_in1;
     SVGAnimatedEnumerationAttribute<MorphologyOperatorType> m_svgOperator { FEMORPHOLOGY_OPERATOR_ERODE };
-    SVGAnimatedNumberAttribute m_radiusX;
-    SVGAnimatedNumberAttribute m_radiusY;
+    Ref<SVGAnimatedNumber> m_radiusX { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_radiusY { SVGAnimatedNumber::create(this) };
 };
 
 } // namespace WebCore
index e842e75..25b81b0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
  * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -37,6 +37,12 @@ inline SVGFEOffsetElement::SVGFEOffsetElement(const QualifiedName& tagName, Docu
 {
     ASSERT(hasTagName(SVGNames::feOffsetTag));
     registerAttributes();
+    
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        PropertyRegistry::registerProperty<SVGNames::dxAttr, &SVGFEOffsetElement::m_dx>();
+        PropertyRegistry::registerProperty<SVGNames::dyAttr, &SVGFEOffsetElement::m_dy>();
+    });
 }
 
 Ref<SVGFEOffsetElement> SVGFEOffsetElement::create(const QualifiedName& tagName, Document& document)
@@ -50,19 +56,17 @@ void SVGFEOffsetElement::registerAttributes()
     if (!registry.isEmpty())
         return;
     registry.registerAttribute<SVGNames::inAttr, &SVGFEOffsetElement::m_in1>();
-    registry.registerAttribute<SVGNames::dxAttr, &SVGFEOffsetElement::m_dx>();
-    registry.registerAttribute<SVGNames::dyAttr, &SVGFEOffsetElement::m_dy>();
 }
 
 void SVGFEOffsetElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == SVGNames::dxAttr) {
-        m_dx.setValue(value.toFloat());
+        m_dx->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::dyAttr) {
-        m_dy.setValue(value.toFloat());
+        m_dy->setBaseValInternal(value.toFloat());
         return;
     }
 
index 275a9fc..e8fb146 100644 (file)
@@ -21,7 +21,6 @@
 
 #pragma once
 
-#include "SVGAnimatedNumber.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 
 namespace WebCore {
@@ -32,12 +31,12 @@ public:
     static Ref<SVGFEOffsetElement> create(const QualifiedName&, Document&);
 
     String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
-    float dx() const { return m_dx.currentValue(attributeOwnerProxy()); }
-    float dy() const { return m_dy.currentValue(attributeOwnerProxy()); }
+    float dx() const { return m_dx->currentValue(); }
+    float dy() const { return m_dy->currentValue(); }
 
     RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> dxAnimated() { return m_dx.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> dyAnimated() { return m_dy.animatedProperty(attributeOwnerProxy()); }
+    SVGAnimatedNumber& dxAnimated() { return m_dx; }
+    SVGAnimatedNumber& dyAnimated() { return m_dy; }
 
 private:
     SVGFEOffsetElement(const QualifiedName&, Document&);
@@ -63,8 +62,8 @@ private:
     AttributeOwnerProxy m_attributeOwnerProxy { *this };
     PropertyRegistry m_propertyRegistry { *this };
     SVGAnimatedStringAttribute m_in1;
-    SVGAnimatedNumberAttribute m_dx;
-    SVGAnimatedNumberAttribute m_dy;
+    Ref<SVGAnimatedNumber> m_dx { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_dy { SVGAnimatedNumber::create(this) };
 };
 
 } // namespace WebCore
index 8a19d0d..9f1c516 100644 (file)
@@ -40,6 +40,14 @@ inline SVGFESpecularLightingElement::SVGFESpecularLightingElement(const Qualifie
 {
     ASSERT(hasTagName(SVGNames::feSpecularLightingTag));
     registerAttributes();
+    
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        PropertyRegistry::registerProperty<SVGNames::specularConstantAttr, &SVGFESpecularLightingElement::m_specularConstant>();
+        PropertyRegistry::registerProperty<SVGNames::specularExponentAttr, &SVGFESpecularLightingElement::m_specularExponent>();
+        PropertyRegistry::registerProperty<SVGNames::surfaceScaleAttr, &SVGFESpecularLightingElement::m_surfaceScale>();
+        PropertyRegistry::registerProperty<SVGNames::kernelUnitLengthAttr, &SVGFESpecularLightingElement::m_kernelUnitLengthX, &SVGFESpecularLightingElement::m_kernelUnitLengthY>();
+    });
 }
 
 Ref<SVGFESpecularLightingElement> SVGFESpecularLightingElement::create(const QualifiedName& tagName, Document& document)
@@ -47,30 +55,12 @@ Ref<SVGFESpecularLightingElement> SVGFESpecularLightingElement::create(const Qua
     return adoptRef(*new SVGFESpecularLightingElement(tagName, document));
 }
 
-const AtomicString& SVGFESpecularLightingElement::kernelUnitLengthXIdentifier()
-{
-    static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthX", AtomicString::ConstructFromLiteral);
-    return s_identifier;
-}
-
-const AtomicString& SVGFESpecularLightingElement::kernelUnitLengthYIdentifier()
-{
-    static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthY", AtomicString::ConstructFromLiteral);
-    return s_identifier;
-}
-
 void SVGFESpecularLightingElement::registerAttributes()
 {
     auto& registry = attributeRegistry();
     if (!registry.isEmpty())
         return;
     registry.registerAttribute<SVGNames::inAttr, &SVGFESpecularLightingElement::m_in1>();
-    registry.registerAttribute<SVGNames::specularConstantAttr, &SVGFESpecularLightingElement::m_specularConstant>();
-    registry.registerAttribute<SVGNames::specularExponentAttr, &SVGFESpecularLightingElement::m_specularExponent>();
-    registry.registerAttribute<SVGNames::surfaceScaleAttr, &SVGFESpecularLightingElement::m_surfaceScale>();
-    registry.registerAttribute<SVGNames::kernelUnitLengthAttr,
-        &SVGFESpecularLightingElement::kernelUnitLengthXIdentifier, &SVGFESpecularLightingElement::m_kernelUnitLengthX,
-        &SVGFESpecularLightingElement::kernelUnitLengthYIdentifier, &SVGFESpecularLightingElement::m_kernelUnitLengthY>();
 }
 
 void SVGFESpecularLightingElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -81,25 +71,25 @@ void SVGFESpecularLightingElement::parseAttribute(const QualifiedName& name, con
     }
 
     if (name == SVGNames::surfaceScaleAttr) {
-        m_surfaceScale.setValue(value.toFloat());
+        m_surfaceScale->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::specularConstantAttr) {
-        m_specularConstant.setValue(value.toFloat());
+        m_specularConstant->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::specularExponentAttr) {
-        m_specularExponent.setValue(value.toFloat());
+        m_specularExponent->setBaseValInternal(value.toFloat());
         return;
     }
 
     if (name == SVGNames::kernelUnitLengthAttr) {
         float x, y;
         if (parseNumberOptionalNumber(value, x, y)) {
-            m_kernelUnitLengthX.setValue(x);
-            m_kernelUnitLengthY.setValue(y);
+            m_kernelUnitLengthX->setBaseValInternal(x);
+            m_kernelUnitLengthY->setBaseValInternal(y);
         }
         return;
     }
index 7c905aa..bf7bd87 100644 (file)
@@ -23,7 +23,6 @@
 #pragma once
 
 #include "FESpecularLighting.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGFELightElement.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 
@@ -36,18 +35,18 @@ public:
     void lightElementAttributeChanged(const SVGFELightElement*, const QualifiedName&);
 
     String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
-    float specularConstant() const  { return m_specularConstant.currentValue(attributeOwnerProxy()); }
-    float specularExponent() const { return m_specularExponent.currentValue(attributeOwnerProxy()); }
-    float surfaceScale() const { return m_surfaceScale.currentValue(attributeOwnerProxy()); }
-    float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(attributeOwnerProxy()); }
-    float kernelUnitLengthY() const { return m_kernelUnitLengthY.currentValue(attributeOwnerProxy()); }
+    float specularConstant() const { return m_specularConstant->currentValue(); }
+    float specularExponent() const { return m_specularExponent->currentValue(); }
+    float surfaceScale() const { return m_surfaceScale->currentValue(); }
+    float kernelUnitLengthX() const { return m_kernelUnitLengthX->currentValue(); }
+    float kernelUnitLengthY() const { return m_kernelUnitLengthY->currentValue(); }
 
     RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> specularConstantAnimated() { return m_specularConstant.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> specularExponentAnimated() { return m_specularExponent.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> surfaceScaleAnimated() { return m_surfaceScale.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> kernelUnitLengthYAnimated() { return m_kernelUnitLengthY.animatedProperty(attributeOwnerProxy()); }
+    SVGAnimatedNumber& specularConstantAnimated() { return m_specularConstant; }
+    SVGAnimatedNumber& specularExponentAnimated() { return m_specularExponent; }
+    SVGAnimatedNumber& surfaceScaleAnimated() { return m_surfaceScale; }
+    SVGAnimatedNumber& kernelUnitLengthXAnimated() { return m_kernelUnitLengthX; }
+    SVGAnimatedNumber& kernelUnitLengthYAnimated() { return m_kernelUnitLengthY; }
 
 private:
     SVGFESpecularLightingElement(const QualifiedName&, Document&);
@@ -71,17 +70,14 @@ private:
     bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
 
-    static const AtomicString& kernelUnitLengthXIdentifier();
-    static const AtomicString& kernelUnitLengthYIdentifier();
-
     AttributeOwnerProxy m_attributeOwnerProxy { *this };
     PropertyRegistry m_propertyRegistry { *this };
     SVGAnimatedStringAttribute m_in1;
-    SVGAnimatedNumberAttribute m_specularConstant { 1 };
-    SVGAnimatedNumberAttribute m_specularExponent { 1 };
-    SVGAnimatedNumberAttribute m_surfaceScale { 1 };
-    SVGAnimatedNumberAttribute m_kernelUnitLengthX;
-    SVGAnimatedNumberAttribute m_kernelUnitLengthY;
+    Ref<SVGAnimatedNumber> m_specularConstant { SVGAnimatedNumber::create(this, 1) };
+    Ref<SVGAnimatedNumber> m_specularExponent { SVGAnimatedNumber::create(this, 1) };
+    Ref<SVGAnimatedNumber> m_surfaceScale { SVGAnimatedNumber::create(this, 1) };
+    Ref<SVGAnimatedNumber> m_kernelUnitLengthX { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_kernelUnitLengthY { SVGAnimatedNumber::create(this) };
 };
 
 } // namespace WebCore
index 99d8c2d..0e2c48e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
  * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -38,7 +38,9 @@ inline SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagNa
     
     static std::once_flag onceFlag;
     std::call_once(onceFlag, [] {
+        PropertyRegistry::registerProperty<SVGNames::baseFrequencyAttr, &SVGFETurbulenceElement::m_baseFrequencyX, &SVGFETurbulenceElement::m_baseFrequencyY>();
         PropertyRegistry::registerProperty<SVGNames::numOctavesAttr, &SVGFETurbulenceElement::m_numOctaves>();
+        PropertyRegistry::registerProperty<SVGNames::seedAttr, &SVGFETurbulenceElement::m_seed>();
     });
 }
 
@@ -47,27 +49,11 @@ Ref<SVGFETurbulenceElement> SVGFETurbulenceElement::create(const QualifiedName&
     return adoptRef(*new SVGFETurbulenceElement(tagName, document));
 }
 
-const AtomicString& SVGFETurbulenceElement::baseFrequencyXIdentifier()
-{
-    static NeverDestroyed<AtomicString> s_identifier("SVGBaseFrequencyX", AtomicString::ConstructFromLiteral);
-    return s_identifier;
-}
-
-const AtomicString& SVGFETurbulenceElement::baseFrequencyYIdentifier()
-{
-    static NeverDestroyed<AtomicString> s_identifier("SVGBaseFrequencyY", AtomicString::ConstructFromLiteral);
-    return s_identifier;
-}
-
 void SVGFETurbulenceElement::registerAttributes()
 {
     auto& registry = attributeRegistry();
     if (!registry.isEmpty())
         return;
-    registry.registerAttribute<SVGNames::baseFrequencyAttr,
-        &SVGFETurbulenceElement::baseFrequencyXIdentifier, &SVGFETurbulenceElement::m_baseFrequencyX,
-        &SVGFETurbulenceElement::baseFrequencyYIdentifier, &SVGFETurbulenceElement::m_baseFrequencyY>();
-    registry.registerAttribute<SVGNames::seedAttr, &SVGFETurbulenceElement::m_seed>();
     registry.registerAttribute<SVGNames::stitchTilesAttr, SVGStitchOptions, &SVGFETurbulenceElement::m_stitchTiles>();
     registry.registerAttribute<SVGNames::typeAttr, TurbulenceType, &SVGFETurbulenceElement::m_type>();
 }
@@ -91,14 +77,14 @@ void SVGFETurbulenceElement::parseAttribute(const QualifiedName& name, const Ato
     if (name == SVGNames::baseFrequencyAttr) {
         float x, y;
         if (parseNumberOptionalNumber(value, x, y)) {
-            m_baseFrequencyX.setValue(x);
-            m_baseFrequencyY.setValue(y);
+            m_baseFrequencyX->setBaseValInternal(x);
+            m_baseFrequencyY->setBaseValInternal(y);
         }
         return;
     }
 
     if (name == SVGNames::seedAttr) {
-        m_seed.setValue(value.toFloat());
+        m_seed->setBaseValInternal(value.toFloat());
         return;
     }
 
index 11cd7fe..9796a53 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "FETurbulence.h"
 #include "SVGAnimatedEnumeration.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 
 namespace WebCore {
@@ -97,17 +96,17 @@ class SVGFETurbulenceElement final : public SVGFilterPrimitiveStandardAttributes
 public:
     static Ref<SVGFETurbulenceElement> create(const QualifiedName&, Document&);
 
-    float baseFrequencyX() const { return m_baseFrequencyX.currentValue(attributeOwnerProxy()); }
-    float baseFrequencyY() const { return m_baseFrequencyY.currentValue(attributeOwnerProxy()); }
+    float baseFrequencyX() const { return m_baseFrequencyX->currentValue(); }
+    float baseFrequencyY() const { return m_baseFrequencyY->currentValue(); }
     int numOctaves() const { return m_numOctaves->currentValue(); }
-    float seed() const { return m_seed.currentValue(attributeOwnerProxy()); }
+    float seed() const { return m_seed->currentValue(); }
     SVGStitchOptions stitchTiles() const { return m_stitchTiles.currentValue(attributeOwnerProxy()); }
     TurbulenceType type() const { return m_type.currentValue(attributeOwnerProxy()); }
 
-    RefPtr<SVGAnimatedNumber> baseFrequencyXAnimated() { return m_baseFrequencyX.animatedProperty(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> baseFrequencyYAnimated() { return m_baseFrequencyY.animatedProperty(attributeOwnerProxy()); }
+    SVGAnimatedNumber& baseFrequencyXAnimated() { return m_baseFrequencyX; }
+    SVGAnimatedNumber& baseFrequencyYAnimated() { return m_baseFrequencyY; }
     SVGAnimatedInteger& numOctavesAnimated() { return m_numOctaves; }
-    RefPtr<SVGAnimatedNumber> seedAnimated() { return m_seed.animatedProperty(attributeOwnerProxy()); }
+    SVGAnimatedNumber& seedAnimated() { return m_seed; }
     RefPtr<SVGAnimatedEnumeration> stitchTilesAnimated() { return m_stitchTiles.animatedProperty(attributeOwnerProxy()); }
     RefPtr<SVGAnimatedEnumeration> typeAnimated() { return m_type.animatedProperty(attributeOwnerProxy()); }
 
@@ -133,15 +132,12 @@ private:
     bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override;
     RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
 
-    static const AtomicString& baseFrequencyXIdentifier();
-    static const AtomicString& baseFrequencyYIdentifier();
-
     AttributeOwnerProxy m_attributeOwnerProxy { *this };
     PropertyRegistry m_propertyRegistry { *this };
-    SVGAnimatedNumberAttribute m_baseFrequencyX;
-    SVGAnimatedNumberAttribute m_baseFrequencyY;
+    Ref<SVGAnimatedNumber> m_baseFrequencyX { SVGAnimatedNumber::create(this) };
+    Ref<SVGAnimatedNumber> m_baseFrequencyY { SVGAnimatedNumber::create(this) };
     Ref<SVGAnimatedInteger> m_numOctaves { SVGAnimatedInteger::create(this, 1) };
-    SVGAnimatedNumberAttribute m_seed;
+    Ref<SVGAnimatedNumber> m_seed { SVGAnimatedNumber::create(this) };
     SVGAnimatedEnumerationAttribute<SVGStitchOptions> m_stitchTiles { SVG_STITCHTYPE_NOSTITCH };
     SVGAnimatedEnumerationAttribute<TurbulenceType> m_type { TurbulenceType::Turbulence };
 };
index 72dd3f1..bdd7a02 100644 (file)
@@ -24,6 +24,8 @@
 #include "SVGGeometryElement.h"
 
 #include "DOMPoint.h"
+#include "RenderSVGResource.h"
+#include "RenderSVGShape.h"
 #include "SVGDocumentExtensions.h"
 #include "SVGPathUtilities.h"
 #include "SVGPoint.h"
@@ -36,7 +38,10 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(SVGGeometryElement);
 SVGGeometryElement::SVGGeometryElement(const QualifiedName& tagName, Document& document)
     : SVGGraphicsElement(tagName, document)
 {
-    registerAttributes();
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        PropertyRegistry::registerProperty<SVGNames::pathLengthAttr, &SVGGeometryElement::m_pathLength>();
+    });
 }
 
 float SVGGeometryElement::getTotalLength() const
@@ -87,19 +92,11 @@ bool SVGGeometryElement::isPointInStroke(DOMPointInit&& pointInit)
     return renderer->isPointInStroke(point);
 }
 
-void SVGGeometryElement::registerAttributes()
-{
-    auto& registry = attributeRegistry();
-    if (!registry.isEmpty())
-        return;
-    registry.registerAttribute<SVGNames::pathLengthAttr, &SVGGeometryElement::m_pathLength>();
-}
-
 void SVGGeometryElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == SVGNames::pathLengthAttr) {
-        m_pathLength.setValue(value.toFloat());
-        if (m_pathLength.value() < 0)
+        m_pathLength->setBaseValInternal(value.toFloat());
+        if (m_pathLength->baseVal() < 0)
             document().accessSVGExtensions().reportError("A negative value for path attribute <pathLength> is not allowed");
         return;
     }
index b09cbcb..2871f58 100644 (file)
@@ -23,7 +23,6 @@
 #pragma once
 
 #include "Path.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGGraphicsElement.h"
 #include "SVGNames.h"
 
@@ -43,11 +42,10 @@ public:
     bool isPointInStroke(DOMPointInit&&);
 
     using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGGeometryElement, SVGGraphicsElement>;
-    static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }
-
     using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGeometryElement, SVGGraphicsElement>;
 
-    auto pathLengthAnimated() { return m_pathLength.animatedProperty(attributeOwnerProxy()); }
+    float pathLength() const { return m_pathLength->currentValue(); }
+    SVGAnimatedNumber& pathLengthAnimated() { return m_pathLength; }
 
 protected:
     SVGGeometryElement(const QualifiedName&, Document&);
@@ -59,18 +57,11 @@ private:
     bool isSVGGeometryElement() const override { return true; }
 
     const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; }
-    static void registerAttributes();
-
     const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; }
 
-    static bool isKnownAttribute(const QualifiedName& attributeName)
-    {
-        return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName);
-    }
-
     AttributeOwnerProxy m_attributeOwnerProxy { *this };
     PropertyRegistry m_propertyRegistry { *this };
-    SVGAnimatedNumberAttribute m_pathLength;
+    Ref<SVGAnimatedNumber> m_pathLength { SVGAnimatedNumber::create(this) };
 };
 
 } // namespace WebCore
index 2764858..0e9ad2c 100644 (file)
@@ -22,7 +22,6 @@
 #pragma once
 
 #include "Path.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGAnimatedPath.h"
 #include "SVGExternalResourcesRequired.h"
 #include "SVGGeometryElement.h"
index 476d225..621632c 100644 (file)
@@ -25,6 +25,7 @@
 #include "SVGPathSegListValues.h"
 
 #include "SVGPathElement.h"
+#include "SVGPathSegWithContext.h"
 #include "SVGPathUtilities.h"
 
 namespace WebCore {
index 6601121..ba1dab0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
  * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -37,7 +37,11 @@ inline SVGStopElement::SVGStopElement(const QualifiedName& tagName, Document& do
     : SVGElement(tagName, document)
 {
     ASSERT(hasTagName(SVGNames::stopTag));
-    registerAttributes();
+
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        PropertyRegistry::registerProperty<SVGNames::offsetAttr, &SVGStopElement::m_offset>();
+    });
 }
 
 Ref<SVGStopElement> SVGStopElement::create(const QualifiedName& tagName, Document& document)
@@ -45,21 +49,13 @@ Ref<SVGStopElement> SVGStopElement::create(const QualifiedName& tagName, Documen
     return adoptRef(*new SVGStopElement(tagName, document));
 }
 
-void SVGStopElement::registerAttributes()
-{
-    auto& registry = attributeRegistry();
-    if (!registry.isEmpty())
-        return;
-    registry.registerAttribute<SVGNames::offsetAttr, &SVGStopElement::m_offset>();
-}
-
 void SVGStopElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == SVGNames::offsetAttr) {
         if (value.endsWith('%'))
-            m_offset.setValue(value.string().left(value.length() - 1).toFloat() / 100.0f);
+            m_offset->setBaseValInternal(value.string().left(value.length() - 1).toFloat() / 100.0f);
         else
-            m_offset.setValue(value.toFloat());
+            m_offset->setBaseValInternal(value.toFloat());
         return;
     }
 
index 08d9911..f7781fc 100644 (file)
@@ -21,7 +21,6 @@
 
 #pragma once
 
-#include "SVGAnimatedNumber.h"
 #include "SVGElement.h"
 
 namespace WebCore {
@@ -33,25 +32,18 @@ public:
 
     Color stopColorIncludingOpacity() const;
 
-    float offset() { return m_offset.currentValue(attributeOwnerProxy()); }
-    RefPtr<SVGAnimatedNumber> offsetAnimated() { return m_offset.animatedProperty(attributeOwnerProxy()); }
+    float offset() const { return m_offset->currentValue(); }
+    SVGAnimatedNumber& offsetAnimated() { return m_offset; }
 
 private:
     SVGStopElement(const QualifiedName&, Document&);
 
     using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGStopElement, SVGElement>;
-    static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }
-    static void registerAttributes();
     const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; }
 
     using PropertyRegistry = SVGPropertyOwnerRegistry<SVGStopElement, SVGElement>;
     const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; }
 
-    static bool isKnownAttribute(const QualifiedName& attributeName)
-    {
-        return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName);
-    }
-
     void parseAttribute(const QualifiedName&, const AtomicString&) final;
     void svgAttributeChanged(const QualifiedName&) final;
 
@@ -62,7 +54,7 @@ private:
 
     AttributeOwnerProxy m_attributeOwnerProxy { *this };
     PropertyRegistry m_propertyRegistry { *this };
-    SVGAnimatedNumberAttribute m_offset { 0 };
+    Ref<SVGAnimatedNumber> m_offset { SVGAnimatedNumber::create(0) };
 };
 
 } // namespace WebCore
index d08eb70..d3049bb 100644 (file)
@@ -77,6 +77,28 @@ private:
 };
 
 template<typename OwnerType>
+class SVGAnimatedNumberAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedNumber> {
+    using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedNumber>;
+
+public:
+    using Base::Base;
+    using Base::property;
+    template<Ref<SVGAnimatedNumber> OwnerType::*property>
+    constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedNumberAccessor, property>(); }
+
+private:
+    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    {
+        return SVGAnimatedNumberAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive);
+    }
+
+    void appendAnimatedInstance(OwnerType& owner, SVGAttributeAnimator& animator) const final
+    {
+        static_cast<SVGAnimatedNumberAnimator&>(animator).appendAnimatedInstance(property(owner));
+    }
+};
+
+template<typename OwnerType>
 class SVGAnimatedPreserveAspectRatioAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPreserveAspectRatio> {
     using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPreserveAspectRatio>;
     using Base::property;
index fe15045..986a9d8 100644 (file)
@@ -76,6 +76,25 @@ private:
     }
 };
 
+class SVGAnimatedNumberAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedNumber, SVGAnimationNumberFunction> {
+    friend class SVGAnimatedPropertyPairAnimator<SVGAnimatedNumberAnimator, SVGAnimatedNumberAnimator>;
+    friend class SVGAnimatedNumberPairAnimator;
+    using Base = SVGAnimatedPropertyAnimator<SVGAnimatedNumber, SVGAnimationNumberFunction>;
+    using Base::Base;
+
+public:
+    static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedNumber>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
+    {
+        return std::unique_ptr<SVGAnimatedNumberAnimator>(new SVGAnimatedNumberAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
+    }
+
+private:
+    void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final
+    {
+        m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal());
+    }
+};
+
 class SVGAnimatedPreserveAspectRatioAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction> {
     using Base = SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction>;
     using Base::Base;
index 2a0c32e..ea53064 100644 (file)
@@ -29,7 +29,6 @@
 #include "SVGAnimatedEnumeration.h"
 #include "SVGAnimatedLength.h"
 #include "SVGAnimatedLengthList.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGAnimatedNumberList.h"
 #include "SVGAnimatedPointList.h"
 #include "SVGAnimatedPrimitiveProperty.h"
@@ -43,6 +42,7 @@ namespace WebCore {
 
 using SVGAnimatedBoolean = SVGAnimatedPrimitiveProperty<bool>;
 using SVGAnimatedInteger = SVGAnimatedPrimitiveProperty<int>;
+using SVGAnimatedNumber = SVGAnimatedPrimitiveProperty<float>;
 
 using SVGAnimatedRect = SVGAnimatedValueProperty<SVGRect>;
 using SVGAnimatedPreserveAspectRatio = SVGAnimatedValueProperty<SVGPreserveAspectRatio>;
index acda1f5..5669015 100644 (file)
@@ -69,4 +69,39 @@ private:
     }
 };
 
+template<typename OwnerType>
+class SVGAnimatedNumberPairAccessor final : public SVGAnimatedPropertyPairAccessor<OwnerType, SVGAnimatedNumberAccessor<OwnerType>, SVGAnimatedNumberAccessor<OwnerType>> {
+    using Base = SVGAnimatedPropertyPairAccessor<OwnerType, SVGAnimatedNumberAccessor<OwnerType>, SVGAnimatedNumberAccessor<OwnerType>>;
+    using Base::property1;
+    using Base::property2;
+
+public:
+    using Base::Base;
+    template<Ref<SVGAnimatedNumber> OwnerType::*property1, Ref<SVGAnimatedNumber> OwnerType::*property2 >
+    constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedNumberPairAccessor, property1, property2>(); }
+
+private:
+    Optional<String> synchronize(const OwnerType& owner) const final
+    {
+        bool dirty1 = property1(owner)->isDirty();
+        bool dirty2 = property2(owner)->isDirty();
+        if (!(dirty1 || dirty2))
+            return WTF::nullopt;
+
+        String string1 = dirty1 ? *property1(owner)->synchronize() : property1(owner)->baseValAsString();
+        String string2 = dirty2 ? *property2(owner)->synchronize() : property2(owner)->baseValAsString();
+        return string1 == string2 ? string1 : string1 + ", " + string2;
+    }
+
+    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+    {
+        return SVGAnimatedNumberPairAnimator::create(attributeName, property1(owner), property2(owner), animationMode, calcMode, isAccumulated, isAdditive);
+    }
+
+    void appendAnimatedInstance(OwnerType& owner, SVGAttributeAnimator& animator) const final
+    {
+        static_cast<SVGAnimatedNumberPairAnimator&>(animator).appendAnimatedInstance(property1(owner), property2(owner));
+    }
+};
+
 }
index 39bea13..e1f98e4 100644 (file)
@@ -76,4 +76,47 @@ private:
     }
 };
 
+class SVGAnimatedNumberPairAnimator final : public SVGAnimatedPropertyPairAnimator<SVGAnimatedNumberAnimator, SVGAnimatedNumberAnimator> {
+    using Base = SVGAnimatedPropertyPairAnimator<SVGAnimatedNumberAnimator, SVGAnimatedNumberAnimator>;
+    using Base::Base;
+
+public:
+    static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedNumber>& animated1, Ref<SVGAnimatedNumber>& animated2, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
+    {
+        return std::unique_ptr<SVGAnimatedNumberPairAnimator>(new SVGAnimatedNumberPairAnimator(attributeName, animated1, animated2, animationMode, calcMode, isAccumulated, isAdditive));
+    }
+
+private:
+    void setFromAndToValues(SVGElement*, const String& from, const String& to) final
+    {
+        auto pairFrom = SVGPropertyTraits<std::pair<float, float>>::fromString(from);
+        auto pairTo = SVGPropertyTraits<std::pair<float, float>>::fromString(to);
+        
+        m_animatedPropertyAnimator1->m_function.m_from = pairFrom.first;
+        m_animatedPropertyAnimator1->m_function.m_to = pairTo.first;
+        
+        m_animatedPropertyAnimator2->m_function.m_from = pairFrom.second;
+        m_animatedPropertyAnimator2->m_function.m_to = pairTo.second;
+    }
+
+    void setFromAndByValues(SVGElement*, const String& from, const String& by) final
+    {
+        auto pairFrom = SVGPropertyTraits<std::pair<float, float>>::fromString(from);
+        auto pairBy = SVGPropertyTraits<std::pair<float, float>>::fromString(by);
+        
+        m_animatedPropertyAnimator1->m_function.m_from = pairFrom.first;
+        m_animatedPropertyAnimator1->m_function.m_to = pairFrom.first + pairBy.first;
+        
+        m_animatedPropertyAnimator2->m_function.m_from = pairFrom.second;
+        m_animatedPropertyAnimator2->m_function.m_to = pairFrom.second + pairBy.second;
+    }
+
+    void setToAtEndOfDurationValue(const String& toAtEndOfDuration) final
+    {
+        auto pairToAtEndOfDuration = SVGPropertyTraits<std::pair<float, float>>::fromString(toAtEndOfDuration);
+        m_animatedPropertyAnimator1->m_function.m_toAtEndOfDuration = pairToAtEndOfDuration.first;
+        m_animatedPropertyAnimator2->m_function.m_toAtEndOfDuration = pairToAtEndOfDuration.second;
+    }
+};
+
 }
index 127443f..ef2ce6d 100644 (file)
@@ -120,7 +120,47 @@ private:
         m_to += m_from;
     }
 };
-    
+
+class SVGAnimationNumberFunction : public SVGAnimationAdditiveValueFunction<float> {
+    friend class SVGAnimatedNumberPairAnimator;
+
+public:
+    using Base = SVGAnimationAdditiveValueFunction<float>;
+    using Base::Base;
+
+    void setFromAndToValues(SVGElement*, const String& from, const String& to) override
+    {
+        m_from = SVGPropertyTraits<float>::fromString(from);
+        m_to = SVGPropertyTraits<float>::fromString(to);
+    }
+
+    void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override
+    {
+        m_toAtEndOfDuration = SVGPropertyTraits<float>::fromString(toAtEndOfDuration);
+    }
+
+    void progress(SVGElement*, float percentage, unsigned repeatCount, float& animated)
+    {
+        float from = m_animationMode == AnimationMode::To ? animated : m_from;
+        animated = Base::progress(percentage, repeatCount, from, m_to, toAtEndOfDuration(), animated);
+    }
+
+    float calculateDistance(SVGElement*, const String& from, const String& to) const override
+    {
+        float fromNumber = 0;
+        float toNumber = 0;
+        parseNumberFromString(from, fromNumber);
+        parseNumberFromString(to, toNumber);
+        return fabsf(toNumber - fromNumber);
+    }
+
+private:
+    void addFromAndToValues(SVGElement*) override
+    {
+        m_to += m_from;
+    }
+};
+
 class SVGAnimationRectFunction : public SVGAnimationAdditiveValueFunction<FloatRect> {
 public:
     using Base = SVGAnimationAdditiveValueFunction<FloatRect>;
index 7f5867a..a0d25eb 100644 (file)
@@ -28,7 +28,6 @@
 #include "SVGAnimatedEnumeration.h"
 #include "SVGAnimatedLength.h"
 #include "SVGAnimatedLengthList.h"
-#include "SVGAnimatedNumber.h"
 #include "SVGAnimatedNumberList.h"
 #include "SVGAnimatedPointList.h"
 #include "SVGAnimatedString.h"
@@ -74,26 +73,12 @@ public:
         registerAttribute(SVGAnimatedLengthListAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());
     }
 
-    template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedNumberAttribute OwnerType::*attribute>
-    void registerAttribute()
-    {
-        registerAttribute(SVGAnimatedNumberAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());
-    }
-
     template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedNumberListAttribute OwnerType::*attribute>
     void registerAttribute()
     {
         registerAttribute(SVGAnimatedNumberListAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());
     }
 
-    template<const LazyNeverDestroyed<const QualifiedName>& attributeName,
-        const AtomicString& (*identifier)(), SVGAnimatedNumberAttribute OwnerType::*attribute,
-        const AtomicString& (*optionalIdentifier)(), SVGAnimatedNumberAttribute OwnerType::*optionalAttribute>
-    void registerAttribute()
-    {
-        registerAttribute(SVGAnimatedOptionalNumberAttributeAccessor<OwnerType>::template singleton<attributeName, identifier, attribute, optionalIdentifier, optionalAttribute>());
-    }
-
     template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedPointListAttribute OwnerType::*attribute>
     void registerAttribute()
     {
index 7300f0a..eb8e33a 100644 (file)
 
 #pragma once
 
-#include "SVGAnimationFunction.h"
+#include "SVGAnimationAdditiveValueFunctionImpl.h"
 #include "SVGPrimitivePropertyAnimator.h"
 
 namespace WebCore {
 
 using SVGColorAnimator = SVGPrimitivePropertyAnimator<Color, SVGAnimationColorFunction>;
+using SVGNumberAnimator = SVGPrimitivePropertyAnimator<float, SVGAnimationNumberFunction>;
 
 }
index a48ef00..7a7a6e5 100644 (file)
@@ -80,6 +80,11 @@ private:
         return SVGColorAnimator::create(attributeName, WTFMove(property), animationMode, calcMode, isAccumulated, isAdditive);
     }
 
+    static auto createNumberAnimator(const QualifiedName& attributeName, Ref<SVGProperty>&& property, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
+    {
+        return SVGNumberAnimator::create(attributeName,  WTFMove(property), animationMode, calcMode, isAccumulated, isAdditive);
+    }
+
     static const AttributeAnimatorCreator& attributeAnimatorCreator()
     {
         static NeverDestroyed<AttributeAnimatorCreator> map = AttributeAnimatorCreator({
@@ -89,6 +94,13 @@ private:
             { SVGNames::lighting_colorAttr->impl(), std::make_pair(SVGValueProperty<Color>::create, SVGPropertyAnimatorFactory::createColorAnimator) },
             { SVGNames::stop_colorAttr->impl(),     std::make_pair(SVGValueProperty<Color>::create, SVGPropertyAnimatorFactory::createColorAnimator) },
             { SVGNames::strokeAttr->impl(),         std::make_pair(SVGValueProperty<Color>::create, SVGPropertyAnimatorFactory::createColorAnimator) },
+
+            { SVGNames::fill_opacityAttr->impl(),       std::make_pair(SVGValueProperty<float>::create, SVGPropertyAnimatorFactory::createNumberAnimator) },
+            { SVGNames::flood_opacityAttr->impl(),      std::make_pair(SVGValueProperty<float>::create, SVGPropertyAnimatorFactory::createNumberAnimator) },
+            { SVGNames::opacityAttr->impl(),            std::make_pair(SVGValueProperty<float>::create, SVGPropertyAnimatorFactory::createNumberAnimator) },
+            { SVGNames::stop_opacityAttr->impl(),       std::make_pair(SVGValueProperty<float>::create, SVGPropertyAnimatorFactory::createNumberAnimator) },
+            { SVGNames::stroke_miterlimitAttr->impl(),  std::make_pair(SVGValueProperty<float>::create, SVGPropertyAnimatorFactory::createNumberAnimator) },
+            { SVGNames::stroke_opacityAttr->impl(),     std::make_pair(SVGValueProperty<float>::create, SVGPropertyAnimatorFactory::createNumberAnimator) },
         });
         return map;
     }
index 68a5e9d..91bdda4 100644 (file)
@@ -60,7 +60,13 @@ public:
     {
         registerProperty(attributeName, SVGAnimatedIntegerAccessor<OwnerType>::template singleton<property>());
     }
-    
+
+    template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedNumber> OwnerType::*property>
+    static void registerProperty()
+    {
+        registerProperty(attributeName, SVGAnimatedNumberAccessor<OwnerType>::template singleton<property>());
+    }
+
     template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedPreserveAspectRatio> OwnerType::*property>
     static void registerProperty()
     {
@@ -78,6 +84,13 @@ public:
     {
         registerProperty(attributeName, SVGAnimatedIntegerPairAccessor<OwnerType>::template singleton<property1, property2>());
     }
+
+    template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedNumber> OwnerType::*property1, Ref<SVGAnimatedNumber> OwnerType::*property2>
+    static void registerProperty()
+    {
+        registerProperty(attributeName, SVGAnimatedNumberPairAccessor<OwnerType>::template singleton<property1, property2>());
+    }
+
     // Enumerate all the SVGMemberAccessors recursively. The functor will be called and will
     // be given the pair<QualifiedName, SVGMemberAccessor> till the functor returns false.
     template<typename Functor>