Changeset 243266 in webkit


Ignore:
Timestamp:
Mar 20, 2019 5:35:50 PM (5 years ago)
Author:
Said Abou-Hallawa
Message:

DumpRenderTree crashes under WebAnimation::isRelevant when running imported/mozilla/css-transitions/test_document-get-animations.html in GuardMalloc
https://bugs.webkit.org/show_bug.cgi?id=196028
<rdar://problem/46842707>

Patch by Antoine Quint <Antoine Quint> 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):

Location:
trunk/Source/WebCore
Files:
4 deleted
48 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r243263 r243266  
    1616        * animation/DocumentTimeline.cpp:
    1717        (WebCore::DocumentTimeline::getAnimations const):
     18
     192019-03-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
     20
     21        Remove the SVG property tear off objects for SVGAnimatedNumber
     22        https://bugs.webkit.org/show_bug.cgi?id=196037
     23
     24        Reviewed by Simon Fraser.
     25
     26        -- Define SVGAnimatedNumber to be SVGAnimatedPrimitiveProperty<float>.
     27
     28        -- Add SVGAnimatedNumberAccessor to associate an attribute name with a
     29           pointer to an SVGAnimatedNumber. Given a pointer to an SVGElement,
     30           this accessor will and create an animator for the animated property.
     31
     32        -- Add SVGAnimatedNumberPairAccessor to associate an attribute name
     33           with a pair of pointers to SVGAnimatedNumbers. Given a pointer to an
     34           SVGElement, this accessor will and create an animator for these
     35           animated properties.
     36
     37        -- Add SVGAnimatedNumberAnimator to animated an SVGAnimatedNumber.
     38
     39        -- Add SVGAnimatedNumberPairAnimator to animated a pair of SVGAnimatedNumbers.
     40
     41        -- Add SVGAnimationNumberFunction which will be responsible for progressing
     42           a float over a period of time.
     43
     44        -- Define SVGNumberAnimator to be SVGPrimitivePropertyAnimator<float,
     45           SVGAnimationNumberFunction>. SVGNumberAnimator will be responsible
     46           for animating attributes with no reflecting animated properties, e.g.
     47           "fill-opacity".
     48
     49        * Sources.txt:
     50        * WebCore.xcodeproj/project.pbxproj:
     51        * svg/SVGAnimatedLength.cpp:
     52        * svg/SVGAnimatedLengthList.cpp:
     53        * svg/SVGAnimatedNumber.cpp: Removed.
     54        * svg/SVGAnimatedNumber.h: Removed.
     55        * svg/SVGAnimatedNumberList.cpp:
     56        * svg/SVGAnimatedNumberOptionalNumber.cpp: Removed.
     57        * svg/SVGAnimatedNumberOptionalNumber.h: Removed.
     58        * svg/SVGAnimatedTransformList.cpp:
     59        * svg/SVGAnimatorFactory.h:
     60        (WebCore::SVGAnimatorFactory::create):
     61        * svg/SVGComponentTransferFunctionElement.cpp:
     62        (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
     63        (WebCore::SVGComponentTransferFunctionElement::registerAttributes):
     64        (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
     65        * svg/SVGComponentTransferFunctionElement.h:
     66        (WebCore::SVGComponentTransferFunctionElement::slope const):
     67        (WebCore::SVGComponentTransferFunctionElement::intercept const):
     68        (WebCore::SVGComponentTransferFunctionElement::amplitude const):
     69        (WebCore::SVGComponentTransferFunctionElement::exponent const):
     70        (WebCore::SVGComponentTransferFunctionElement::offset const):
     71        (WebCore::SVGComponentTransferFunctionElement::slopeAnimated):
     72        (WebCore::SVGComponentTransferFunctionElement::interceptAnimated):
     73        (WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated):
     74        (WebCore::SVGComponentTransferFunctionElement::exponentAnimated):
     75        (WebCore::SVGComponentTransferFunctionElement::offsetAnimated):
     76        * svg/SVGFECompositeElement.cpp:
     77        (WebCore::SVGFECompositeElement::SVGFECompositeElement):
     78        (WebCore::SVGFECompositeElement::registerAttributes):
     79        (WebCore::SVGFECompositeElement::parseAttribute):
     80        * svg/SVGFECompositeElement.h:
     81        * svg/SVGFEConvolveMatrixElement.cpp:
     82        (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
     83        (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
     84        (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
     85        (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength):
     86        (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier): Deleted.
     87        (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier): Deleted.
     88        * svg/SVGFEConvolveMatrixElement.h:
     89        * svg/SVGFEDiffuseLightingElement.cpp:
     90        (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
     91        (WebCore::SVGFEDiffuseLightingElement::registerAttributes):
     92        (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
     93        (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier): Deleted.
     94        (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier): Deleted.
     95        * svg/SVGFEDiffuseLightingElement.h:
     96        * svg/SVGFEDisplacementMapElement.cpp:
     97        (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
     98        (WebCore::SVGFEDisplacementMapElement::registerAttributes):
     99        (WebCore::SVGFEDisplacementMapElement::parseAttribute):
     100        * svg/SVGFEDisplacementMapElement.h:
     101        * svg/SVGFEDropShadowElement.cpp:
     102        (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
     103        (WebCore::SVGFEDropShadowElement::setStdDeviation):
     104        (WebCore::SVGFEDropShadowElement::registerAttributes):
     105        (WebCore::SVGFEDropShadowElement::parseAttribute):
     106        (WebCore::SVGFEDropShadowElement::stdDeviationXIdentifier): Deleted.
     107        (WebCore::SVGFEDropShadowElement::stdDeviationYIdentifier): Deleted.
     108        * svg/SVGFEDropShadowElement.h:
     109        * svg/SVGFEGaussianBlurElement.cpp:
     110        (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
     111        (WebCore::SVGFEGaussianBlurElement::setStdDeviation):
     112        (WebCore::SVGFEGaussianBlurElement::registerAttributes):
     113        (WebCore::SVGFEGaussianBlurElement::parseAttribute):
     114        (WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier): Deleted.
     115        (WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier): Deleted.
     116        * svg/SVGFEGaussianBlurElement.h:
     117        * svg/SVGFELightElement.cpp:
     118        (WebCore::SVGFELightElement::SVGFELightElement):
     119        (WebCore::SVGFELightElement::parseAttribute):
     120        (WebCore::SVGFELightElement::svgAttributeChanged):
     121        (WebCore::SVGFELightElement::registerAttributes): Deleted.
     122        * svg/SVGFELightElement.h:
     123        (WebCore::SVGFELightElement::azimuth const):
     124        (WebCore::SVGFELightElement::elevation const):
     125        (WebCore::SVGFELightElement::x const):
     126        (WebCore::SVGFELightElement::y const):
     127        (WebCore::SVGFELightElement::z const):
     128        (WebCore::SVGFELightElement::pointsAtX const):
     129        (WebCore::SVGFELightElement::pointsAtY const):
     130        (WebCore::SVGFELightElement::pointsAtZ const):
     131        (WebCore::SVGFELightElement::specularExponent const):
     132        (WebCore::SVGFELightElement::limitingConeAngle const):
     133        (WebCore::SVGFELightElement::azimuthAnimated):
     134        (WebCore::SVGFELightElement::elevationAnimated):
     135        (WebCore::SVGFELightElement::xAnimated):
     136        (WebCore::SVGFELightElement::yAnimated):
     137        (WebCore::SVGFELightElement::zAnimated):
     138        (WebCore::SVGFELightElement::pointsAtXAnimated):
     139        (WebCore::SVGFELightElement::pointsAtYAnimated):
     140        (WebCore::SVGFELightElement::pointsAtZAnimated):
     141        (WebCore::SVGFELightElement::specularExponentAnimated):
     142        (WebCore::SVGFELightElement::limitingConeAngleAnimated):
     143        (WebCore::SVGFELightElement::attributeRegistry): Deleted.
     144        (WebCore::SVGFELightElement::isKnownAttribute): Deleted.
     145        * svg/SVGFEMorphologyElement.cpp:
     146        (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
     147        (WebCore::SVGFEMorphologyElement::setRadius):
     148        (WebCore::SVGFEMorphologyElement::registerAttributes):
     149        (WebCore::SVGFEMorphologyElement::parseAttribute):
     150        (WebCore::SVGFEMorphologyElement::radiusXIdentifier): Deleted.
     151        (WebCore::SVGFEMorphologyElement::radiusYIdentifier): Deleted.
     152        * svg/SVGFEMorphologyElement.h:
     153        * svg/SVGFEOffsetElement.cpp:
     154        (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
     155        (WebCore::SVGFEOffsetElement::registerAttributes):
     156        (WebCore::SVGFEOffsetElement::parseAttribute):
     157        * svg/SVGFEOffsetElement.h:
     158        * svg/SVGFESpecularLightingElement.cpp:
     159        (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
     160        (WebCore::SVGFESpecularLightingElement::registerAttributes):
     161        (WebCore::SVGFESpecularLightingElement::parseAttribute):
     162        (WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier): Deleted.
     163        (WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier): Deleted.
     164        * svg/SVGFESpecularLightingElement.h:
     165        * svg/SVGFETurbulenceElement.cpp:
     166        (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
     167        (WebCore::SVGFETurbulenceElement::registerAttributes):
     168        (WebCore::SVGFETurbulenceElement::parseAttribute):
     169        (WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier): Deleted.
     170        (WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier): Deleted.
     171        * svg/SVGFETurbulenceElement.h:
     172        * svg/SVGGeometryElement.cpp:
     173        (WebCore::SVGGeometryElement::SVGGeometryElement):
     174        (WebCore::SVGGeometryElement::parseAttribute):
     175        (WebCore::SVGGeometryElement::registerAttributes): Deleted.
     176        * svg/SVGGeometryElement.h:
     177        (WebCore::SVGGeometryElement::pathLength const):
     178        (WebCore::SVGGeometryElement::pathLengthAnimated):
     179        (WebCore::SVGGeometryElement::attributeRegistry): Deleted.
     180        (WebCore::SVGGeometryElement::isKnownAttribute): Deleted.
     181        * svg/SVGPathElement.h:
     182        * svg/SVGStopElement.cpp:
     183        (WebCore::SVGStopElement::SVGStopElement):
     184        (WebCore::SVGStopElement::parseAttribute):
     185        (WebCore::SVGStopElement::registerAttributes): Deleted.
     186        * svg/SVGStopElement.h:
     187        * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
     188        * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
     189        * svg/properties/SVGAnimatedPropertyImpl.h:
     190        * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
     191        * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
     192        * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
     193        (WebCore::SVGAnimationNumberFunction::progress):
     194        * svg/properties/SVGAttributeRegistry.h:
     195        * svg/properties/SVGPrimitivePropertyAnimatorImpl.h:
     196        * svg/properties/SVGPropertyAnimatorCreator.h:
     197        (WebCore::SVGPropertyAnimatorCreator::createNumberAnimator):
     198        (WebCore::SVGPropertyAnimatorCreator::attributeAnimatorCreator):
     199        * svg/properties/SVGPropertyOwnerRegistry.h:
     200        (WebCore::SVGPropertyOwnerRegistry::registerProperty):
    18201
    192022019-03-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
  • trunk/Source/WebCore/Sources.txt

    r243259 r243266  
    22742274svg/SVGAnimatedLength.cpp
    22752275svg/SVGAnimatedLengthList.cpp
    2276 svg/SVGAnimatedNumber.cpp
    22772276svg/SVGAnimatedNumberList.cpp
    2278 svg/SVGAnimatedNumberOptionalNumber.cpp
    22792277svg/SVGAnimatedPath.cpp
    22802278svg/SVGAnimatedPointList.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r243259 r243266  
    281281                089A8E07128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 089A8E06128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h */; };
    282282                08A484780E5272C500C3FE76 /* ScriptElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08A484760E5272C500C3FE76 /* ScriptElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
    283                 08B35B13127B6A7C005314DD /* SVGAnimatedNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 08B35B12127B6A7C005314DD /* SVGAnimatedNumber.h */; };
    284283                08B35B17127B6A88005314DD /* SVGAnimatedNumberList.h in Headers */ = {isa = PBXBuildFile; fileRef = 08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */; };
    285284                08C7A2C710DC7462002D368B /* SVGNames.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 656581E909D1508D000E61D7 /* SVGNames.h */; };
     
    11761175                427DA71E13735DFA007C57FB /* JSServiceWorkerInternals.h in Headers */ = {isa = PBXBuildFile; fileRef = 427DA71C13735DFA007C57FB /* JSServiceWorkerInternals.h */; };
    11771176                43107BE218CC19DE00CC18E8 /* SelectorPseudoTypeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 43107BE118CC19DE00CC18E8 /* SelectorPseudoTypeMap.h */; };
    1178                 431A2F9C13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 431A2F9A13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h */; };
    11791177                432D3FE818A8658400D7DC03 /* SelectorCheckerTestFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 432D3FE718A8658400D7DC03 /* SelectorCheckerTestFunctions.h */; };
    11801178                4358E87D1360A2EE00E4748C /* JSSVGFEDropShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4358E87B1360A2EE00E4748C /* JSSVGFEDropShadowElement.h */; };
     
    56605658                08A484750E5272C500C3FE76 /* ScriptElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptElement.cpp; sourceTree = "<group>"; };
    56615659                08A484760E5272C500C3FE76 /* ScriptElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptElement.h; sourceTree = "<group>"; };
    5662                 08B35B12127B6A7C005314DD /* SVGAnimatedNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedNumber.h; sourceTree = "<group>"; };
    56635660                08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedNumberList.h; sourceTree = "<group>"; };
    56645661                08C925170FCC7C4A00480DEC /* FilterEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FilterEffect.cpp; sourceTree = "<group>"; };
     
    75747571                427DA71C13735DFA007C57FB /* JSServiceWorkerInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSServiceWorkerInternals.h; sourceTree = "<group>"; };
    75757572                43107BE118CC19DE00CC18E8 /* SelectorPseudoTypeMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorPseudoTypeMap.h; sourceTree = "<group>"; };
    7576                 431A2F9A13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedNumberOptionalNumber.h; sourceTree = "<group>"; };
    7577                 431A2F9B13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumberOptionalNumber.cpp; sourceTree = "<group>"; };
    75787573                431A2FD613B7707A007791E4 /* SVGAnimatedLengthList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedLengthList.cpp; sourceTree = "<group>"; };
    75797574                432D3FE718A8658400D7DC03 /* SelectorCheckerTestFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorCheckerTestFunctions.h; sourceTree = "<group>"; };
     
    76707665                439D334113A6911C00C20F4F /* SVGAnimatedTypeAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTypeAnimator.h; sourceTree = "<group>"; };
    76717666                439D334213A6911C00C20F4F /* SVGAnimatorFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatorFactory.h; sourceTree = "<group>"; };
    7672                 43A0F0B013AC7D6D00A5F0A7 /* SVGAnimatedNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumber.cpp; sourceTree = "<group>"; };
    76737667                43A6266613B3D11000AC94B8 /* SVGAnimatedString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedString.cpp; sourceTree = "<group>"; };
    76747668                43B85ED018CBEACE00E31AF4 /* makeSelectorPseudoClassAndCompatibilityElementMap.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = makeSelectorPseudoClassAndCompatibilityElementMap.py; sourceTree = "<group>"; };
     
    2414724141                                089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */,
    2414824142                                B22277EB0D00BF1F0071B782 /* SVGAnimatedLengthList.idl */,
    24149                                 43A0F0B013AC7D6D00A5F0A7 /* SVGAnimatedNumber.cpp */,
    24150                                 08B35B12127B6A7C005314DD /* SVGAnimatedNumber.h */,
    2415124143                                B22277EC0D00BF1F0071B782 /* SVGAnimatedNumber.idl */,
    2415224144                                4331AC7713B6870000A9E5AE /* SVGAnimatedNumberList.cpp */,
    2415324145                                08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */,
    2415424146                                B22277ED0D00BF1F0071B782 /* SVGAnimatedNumberList.idl */,
    24155                                 431A2F9B13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp */,
    24156                                 431A2F9A13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h */,
    2415724147                                0863951313B5FE5700BB344D /* SVGAnimatedPath.cpp */,
    2415824148                                0863951413B5FE5700BB344D /* SVGAnimatedPath.h */,
     
    3193231922                                089021AD126EF5E90092D5EA /* SVGAnimatedLengthList.h in Headers */,
    3193331923                                088A0E04126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h in Headers */,
    31934                                 08B35B13127B6A7C005314DD /* SVGAnimatedNumber.h in Headers */,
    3193531924                                08B35B17127B6A88005314DD /* SVGAnimatedNumberList.h in Headers */,
    31936                                 431A2F9C13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h in Headers */,
    3193731925                                0863951613B5FE5700BB344D /* SVGAnimatedPath.h in Headers */,
    3193831926                                089A8E07128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h in Headers */,
  • trunk/Source/WebCore/svg/SVGAnimatedLength.cpp

    r242970 r243266  
    2323
    2424#include "SVGAnimateElementBase.h"
    25 #include "SVGAnimatedNumber.h"
    2625
    2726namespace WebCore {
  • trunk/Source/WebCore/svg/SVGAnimatedLengthList.cpp

    r242970 r243266  
    2222
    2323#include "SVGAnimateElementBase.h"
    24 #include "SVGAnimatedNumber.h"
    2524
    2625namespace WebCore {
  • trunk/Source/WebCore/svg/SVGAnimatedNumberList.cpp

    r242970 r243266  
    2323
    2424#include "SVGAnimateElementBase.h"
    25 #include "SVGAnimatedNumber.h"
    2625
    2726namespace WebCore {
  • trunk/Source/WebCore/svg/SVGAnimatedTransformList.cpp

    r242970 r243266  
    2626
    2727#include "SVGAnimateTransformElement.h"
    28 #include "SVGAnimatedNumber.h"
    2928#include "SVGNames.h"
    3029#include "SVGTransformDistance.h"
  • trunk/Source/WebCore/svg/SVGAnimatorFactory.h

    r243259 r243266  
    2424#include "SVGAnimatedLength.h"
    2525#include "SVGAnimatedLengthList.h"
    26 #include "SVGAnimatedNumber.h"
    2726#include "SVGAnimatedNumberList.h"
    28 #include "SVGAnimatedNumberOptionalNumber.h"
    2927#include "SVGAnimatedPath.h"
    3028#include "SVGAnimatedPointList.h"
     
    4846        case AnimatedInteger:
    4947        case AnimatedIntegerOptionalInteger:
     48        case AnimatedNumber:
     49        case AnimatedNumberOptionalNumber:
    5050        case AnimatedPreserveAspectRatio:
    5151        case AnimatedRect:
     
    6060        case AnimatedLengthList:
    6161            return std::make_unique<SVGAnimatedLengthListAnimator>(animationElement, contextElement);
    62         case AnimatedNumber:
    63             return std::make_unique<SVGAnimatedNumberAnimator>(animationElement, contextElement);
    6462        case AnimatedNumberList:
    6563            return std::make_unique<SVGAnimatedNumberListAnimator>(animationElement, contextElement);
    66         case AnimatedNumberOptionalNumber:
    67             return std::make_unique<SVGAnimatedNumberOptionalNumberAnimator>(animationElement, contextElement);
    6864        case AnimatedPath:
    6965            return std::make_unique<SVGAnimatedPathAnimator>(animationElement, contextElement);
  • trunk/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp

    r234620 r243266  
    22 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
    33 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
    4  * Copyright (C) 2018 Apple Inc. All rights reserved.
     4 * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
    55 *
    66 * This library is free software; you can redistribute it and/or
     
    3737{
    3838    registerAttributes();
     39   
     40    static std::once_flag onceFlag;
     41    std::call_once(onceFlag, [] {
     42        PropertyRegistry::registerProperty<SVGNames::slopeAttr, &SVGComponentTransferFunctionElement::m_slope>();
     43        PropertyRegistry::registerProperty<SVGNames::interceptAttr, &SVGComponentTransferFunctionElement::m_intercept>();
     44        PropertyRegistry::registerProperty<SVGNames::amplitudeAttr, &SVGComponentTransferFunctionElement::m_amplitude>();
     45        PropertyRegistry::registerProperty<SVGNames::exponentAttr, &SVGComponentTransferFunctionElement::m_exponent>();
     46        PropertyRegistry::registerProperty<SVGNames::offsetAttr, &SVGComponentTransferFunctionElement::m_offset>();
     47    });
    3948}
    4049
     
    4655    registry.registerAttribute<SVGNames::typeAttr, ComponentTransferType, &SVGComponentTransferFunctionElement::m_type>();
    4756    registry.registerAttribute<SVGNames::tableValuesAttr, &SVGComponentTransferFunctionElement::m_tableValues>();
    48     registry.registerAttribute<SVGNames::slopeAttr, &SVGComponentTransferFunctionElement::m_slope>();
    49     registry.registerAttribute<SVGNames::interceptAttr, &SVGComponentTransferFunctionElement::m_intercept>();
    50     registry.registerAttribute<SVGNames::amplitudeAttr, &SVGComponentTransferFunctionElement::m_amplitude>();
    51     registry.registerAttribute<SVGNames::exponentAttr, &SVGComponentTransferFunctionElement::m_exponent>();
    52     registry.registerAttribute<SVGNames::offsetAttr, &SVGComponentTransferFunctionElement::m_offset>();
    5357}
    5458
     
    7175
    7276    if (name == SVGNames::slopeAttr) {
    73         m_slope.setValue(value.toFloat());
     77        m_slope->setBaseValInternal(value.toFloat());
    7478        return;
    7579    }
    7680
    7781    if (name == SVGNames::interceptAttr) {
    78         m_intercept.setValue(value.toFloat());
     82        m_intercept->setBaseValInternal(value.toFloat());
    7983        return;
    8084    }
    8185
    8286    if (name == SVGNames::amplitudeAttr) {
    83         m_amplitude.setValue(value.toFloat());
     87        m_amplitude->setBaseValInternal(value.toFloat());
    8488        return;
    8589    }
    8690
    8791    if (name == SVGNames::exponentAttr) {
    88         m_exponent.setValue(value.toFloat());
     92        m_exponent->setBaseValInternal(value.toFloat());
    8993        return;
    9094    }
    9195
    9296    if (name == SVGNames::offsetAttr) {
    93         m_offset.setValue(value.toFloat());
     97        m_offset->setBaseValInternal(value.toFloat());
    9498        return;
    9599    }
  • trunk/Source/WebCore/svg/SVGComponentTransferFunctionElement.h

    r243114 r243266  
    2424#include "FEComponentTransfer.h"
    2525#include "SVGAnimatedEnumeration.h"
    26 #include "SVGAnimatedNumber.h"
    2726#include "SVGAnimatedNumberList.h"
    2827#include "SVGElement.h"
     
    7877    ComponentTransferType type() const { return m_type.currentValue(attributeOwnerProxy()); }
    7978    const SVGNumberListValues& tableValues() const { return m_tableValues.currentValue(attributeOwnerProxy()); }
    80     float slope() const { return m_slope.currentValue(attributeOwnerProxy()); }
    81     float intercept() const { return m_intercept.currentValue(attributeOwnerProxy()); }
    82     float amplitude() const { return m_amplitude.currentValue(attributeOwnerProxy()); }
    83     float exponent() const { return m_exponent.currentValue(attributeOwnerProxy()); }
    84     float offset() const { return m_offset.currentValue(attributeOwnerProxy()); }
     79    float slope() const { return m_slope->currentValue(); }
     80    float intercept() const { return m_intercept->currentValue(); }
     81    float amplitude() const { return m_amplitude->currentValue(); }
     82    float exponent() const { return m_exponent->currentValue(); }
     83    float offset() const { return m_offset->currentValue(); }
    8584
    8685    RefPtr<SVGAnimatedEnumeration> typeAnimated() { return m_type.animatedProperty(attributeOwnerProxy()); }
    8786    RefPtr<SVGAnimatedNumberList> tableValuesAnimated() { return m_tableValues.animatedProperty(attributeOwnerProxy()); }
    88     RefPtr<SVGAnimatedNumber> slopeAnimated() { return m_slope.animatedProperty(attributeOwnerProxy()); }
    89     RefPtr<SVGAnimatedNumber> interceptAnimated() { return m_intercept.animatedProperty(attributeOwnerProxy()); }
    90     RefPtr<SVGAnimatedNumber> amplitudeAnimated() { return m_amplitude.animatedProperty(attributeOwnerProxy()); }
    91     RefPtr<SVGAnimatedNumber> exponentAnimated() { return m_exponent.animatedProperty(attributeOwnerProxy()); }
    92     RefPtr<SVGAnimatedNumber> offsetAnimated() { return m_offset.animatedProperty(attributeOwnerProxy()); }
     87    SVGAnimatedNumber& slopeAnimated() { return m_slope; }
     88    SVGAnimatedNumber& interceptAnimated() { return m_intercept; }
     89    SVGAnimatedNumber& amplitudeAnimated() { return m_amplitude; }
     90    SVGAnimatedNumber& exponentAnimated() { return m_exponent; }
     91    SVGAnimatedNumber& offsetAnimated() { return m_offset; }
    9392
    9493protected:
     
    118117    SVGAnimatedEnumerationAttribute<ComponentTransferType> m_type { FECOMPONENTTRANSFER_TYPE_IDENTITY };
    119118    SVGAnimatedNumberListAttribute m_tableValues;
    120     SVGAnimatedNumberAttribute m_slope { 1 };
    121     SVGAnimatedNumberAttribute m_intercept;
    122     SVGAnimatedNumberAttribute m_amplitude { 1 };
    123     SVGAnimatedNumberAttribute m_exponent { 1 };
    124     SVGAnimatedNumberAttribute m_offset;
     119    Ref<SVGAnimatedNumber> m_slope { SVGAnimatedNumber::create(this, 1) };
     120    Ref<SVGAnimatedNumber> m_intercept { SVGAnimatedNumber::create(this) };
     121    Ref<SVGAnimatedNumber> m_amplitude { SVGAnimatedNumber::create(this, 1) };
     122    Ref<SVGAnimatedNumber> m_exponent { SVGAnimatedNumber::create(this, 1) };
     123    Ref<SVGAnimatedNumber> m_offset { SVGAnimatedNumber::create(this) };
    125124};
    126125
  • trunk/Source/WebCore/svg/SVGFECompositeElement.cpp

    r243185 r243266  
    22 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
    33 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
    4  * Copyright (C) 2018 Apple Inc. All rights reserved.
     4 * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
    55 *
    66 * This library is free software; you can redistribute it and/or
     
    3737    ASSERT(hasTagName(SVGNames::feCompositeTag));
    3838    registerAttributes();
     39   
     40    static std::once_flag onceFlag;
     41    std::call_once(onceFlag, [] {
     42        PropertyRegistry::registerProperty<SVGNames::k1Attr, &SVGFECompositeElement::m_k1>();
     43        PropertyRegistry::registerProperty<SVGNames::k2Attr, &SVGFECompositeElement::m_k2>();
     44        PropertyRegistry::registerProperty<SVGNames::k3Attr, &SVGFECompositeElement::m_k3>();
     45        PropertyRegistry::registerProperty<SVGNames::k4Attr, &SVGFECompositeElement::m_k4>();
     46    });
    3947}
    4048
     
    5260    registry.registerAttribute<SVGNames::in2Attr, &SVGFECompositeElement::m_in2>();
    5361    registry.registerAttribute<SVGNames::operatorAttr, CompositeOperationType, &SVGFECompositeElement::m_svgOperator>();
    54     registry.registerAttribute<SVGNames::k1Attr, &SVGFECompositeElement::m_k1>();
    55     registry.registerAttribute<SVGNames::k2Attr, &SVGFECompositeElement::m_k2>();
    56     registry.registerAttribute<SVGNames::k3Attr, &SVGFECompositeElement::m_k3>();
    57     registry.registerAttribute<SVGNames::k4Attr, &SVGFECompositeElement::m_k4>();
    5862}
    5963
     
    7882
    7983    if (name == SVGNames::k1Attr) {
    80         m_k1.setValue(value.toFloat());
     84        m_k1->setBaseValInternal(value.toFloat());
    8185        return;
    8286    }
    8387
    8488    if (name == SVGNames::k2Attr) {
    85         m_k2.setValue(value.toFloat());
     89        m_k2->setBaseValInternal(value.toFloat());
    8690        return;
    8791    }
    8892
    8993    if (name == SVGNames::k3Attr) {
    90         m_k3.setValue(value.toFloat());
     94        m_k3->setBaseValInternal(value.toFloat());
    9195        return;
    9296    }
    9397
    9498    if (name == SVGNames::k4Attr) {
    95         m_k4.setValue(value.toFloat());
     99        m_k4->setBaseValInternal(value.toFloat());
    96100        return;
    97101    }
  • trunk/Source/WebCore/svg/SVGFECompositeElement.h

    r243185 r243266  
    2424#include "FEComposite.h"
    2525#include "SVGAnimatedEnumeration.h"
    26 #include "SVGAnimatedNumber.h"
    2726#include "SVGFilterPrimitiveStandardAttributes.h"
    2827
     
    8988    String in2() const { return m_in2.currentValue(attributeOwnerProxy()); }
    9089    CompositeOperationType svgOperator() const { return m_svgOperator.currentValue(attributeOwnerProxy()); }
    91     float k1() const { return m_k1.currentValue(attributeOwnerProxy()); }
    92     float k2() const { return m_k2.currentValue(attributeOwnerProxy()); }
    93     float k3() const { return m_k3.currentValue(attributeOwnerProxy()); }
    94     float k4() const { return m_k4.currentValue(attributeOwnerProxy()); }
     90    float k1() const { return m_k1->currentValue(); }
     91    float k2() const { return m_k2->currentValue(); }
     92    float k3() const { return m_k3->currentValue(); }
     93    float k4() const { return m_k4->currentValue(); }
    9594
    9695    RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
    9796    RefPtr<SVGAnimatedString> in2Animated() { return m_in2.animatedProperty(attributeOwnerProxy()); }
    9897    RefPtr<SVGAnimatedEnumeration> svgOperatorAnimated() { return m_svgOperator.animatedProperty(attributeOwnerProxy()); }
    99     RefPtr<SVGAnimatedNumber> k1Animated() { return m_k1.animatedProperty(attributeOwnerProxy()); }
    100     RefPtr<SVGAnimatedNumber> k2Animated() { return m_k2.animatedProperty(attributeOwnerProxy()); }
    101     RefPtr<SVGAnimatedNumber> k3Animated() { return m_k3.animatedProperty(attributeOwnerProxy()); }
    102     RefPtr<SVGAnimatedNumber> k4Animated() { return m_k4.animatedProperty(attributeOwnerProxy()); }
     98    SVGAnimatedNumber& k1Animated() { return m_k1; }
     99    SVGAnimatedNumber& k2Animated() { return m_k2; }
     100    SVGAnimatedNumber& k3Animated() { return m_k3; }
     101    SVGAnimatedNumber& k4Animated() { return m_k4; }
    103102
    104103private:
     
    129128    SVGAnimatedStringAttribute m_in2;
    130129    SVGAnimatedEnumerationAttribute<CompositeOperationType> m_svgOperator { FECOMPOSITE_OPERATOR_OVER };
    131     SVGAnimatedNumberAttribute m_k1;
    132     SVGAnimatedNumberAttribute m_k2;
    133     SVGAnimatedNumberAttribute m_k3;
    134     SVGAnimatedNumberAttribute m_k4;
     130    Ref<SVGAnimatedNumber> m_k1 { SVGAnimatedNumber::create(this) };
     131    Ref<SVGAnimatedNumber> m_k2 { SVGAnimatedNumber::create(this) };
     132    Ref<SVGAnimatedNumber> m_k3 { SVGAnimatedNumber::create(this) };
     133    Ref<SVGAnimatedNumber> m_k4 { SVGAnimatedNumber::create(this) };
    135134};
    136135
  • trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp

    r243185 r243266  
    4545    std::call_once(onceFlag, [] {
    4646        PropertyRegistry::registerProperty<SVGNames::orderAttr, &SVGFEConvolveMatrixElement::m_orderX, &SVGFEConvolveMatrixElement::m_orderY>();
     47        PropertyRegistry::registerProperty<SVGNames::divisorAttr, &SVGFEConvolveMatrixElement::m_divisor>();
     48        PropertyRegistry::registerProperty<SVGNames::biasAttr, &SVGFEConvolveMatrixElement::m_bias>();
    4749        PropertyRegistry::registerProperty<SVGNames::targetXAttr, &SVGFEConvolveMatrixElement::m_targetX>();
    4850        PropertyRegistry::registerProperty<SVGNames::targetYAttr, &SVGFEConvolveMatrixElement::m_targetY>();
     51        PropertyRegistry::registerProperty<SVGNames::kernelUnitLengthAttr, &SVGFEConvolveMatrixElement::m_kernelUnitLengthX, &SVGFEConvolveMatrixElement::m_kernelUnitLengthY>();
    4952        PropertyRegistry::registerProperty<SVGNames::preserveAlphaAttr, &SVGFEConvolveMatrixElement::m_preserveAlpha>();
    5053    });
     
    5659}
    5760
    58 const AtomicString& SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier()
    59 {
    60     static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthX", AtomicString::ConstructFromLiteral);
    61     return s_identifier;
    62 }
    63 
    64 const AtomicString& SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier()
    65 {
    66     static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthY", AtomicString::ConstructFromLiteral);
    67     return s_identifier;
    68 }
    69 
    7061void SVGFEConvolveMatrixElement::registerAttributes()
    7162{
     
    7566    registry.registerAttribute<SVGNames::inAttr, &SVGFEConvolveMatrixElement::m_in1>();
    7667    registry.registerAttribute<SVGNames::kernelMatrixAttr, &SVGFEConvolveMatrixElement::m_kernelMatrix>();
    77     registry.registerAttribute<SVGNames::divisorAttr, &SVGFEConvolveMatrixElement::m_divisor>();
    78     registry.registerAttribute<SVGNames::biasAttr, &SVGFEConvolveMatrixElement::m_bias>();
    7968    registry.registerAttribute<SVGNames::edgeModeAttr, EdgeModeType, &SVGFEConvolveMatrixElement::m_edgeMode>();
    80     registry.registerAttribute<SVGNames::kernelUnitLengthAttr,
    81         &SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier, &SVGFEConvolveMatrixElement::m_kernelUnitLengthX,
    82         &SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier, &SVGFEConvolveMatrixElement::m_kernelUnitLengthY>();
    8369}
    8470
     
    120106        float divisor = value.toFloat();
    121107        if (divisor)
    122             m_divisor.setValue(divisor);
     108            m_divisor->setBaseValInternal(divisor);
    123109        else
    124110            document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing divisor=\"" + value + "\". Filtered element will not be displayed.");
     
    127113   
    128114    if (name == SVGNames::biasAttr) {
    129         m_bias.setValue(value.toFloat());
     115        m_bias->setBaseValInternal(value.toFloat());
    130116        return;
    131117    }
     
    144130        float x, y;
    145131        if (parseNumberOptionalNumber(value, x, y) && x > 0 && y > 0) {
    146             m_kernelUnitLengthX.setValue(x);
    147             m_kernelUnitLengthY.setValue(y);
     132            m_kernelUnitLengthX->setBaseValInternal(x);
     133            m_kernelUnitLengthY->setBaseValInternal(y);
    148134        } else
    149135            document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing kernelUnitLength=\"" + value + "\". Filtered element will not be displayed.");
     
    195181void SVGFEConvolveMatrixElement::setKernelUnitLength(float x, float y)
    196182{
    197     m_kernelUnitLengthX.setValue(x);
    198     m_kernelUnitLengthY.setValue(y);
     183    m_kernelUnitLengthX->setBaseValInternal(x);
     184    m_kernelUnitLengthY->setBaseValInternal(y);
    199185    invalidate();
    200186}
  • trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.h

    r243185 r243266  
    7272    int orderY() const { return m_orderY->currentValue(); }
    7373    const SVGNumberListValues& kernelMatrix() const { return m_kernelMatrix.currentValue(attributeOwnerProxy()); }
    74     float divisor() const { return m_divisor.currentValue(attributeOwnerProxy()); }
    75     float bias() const { return m_bias.currentValue(attributeOwnerProxy()); }
     74    float divisor() const { return m_divisor->currentValue(); }
     75    float bias() const { return m_bias->currentValue(); }
    7676    int targetX() const { return m_targetX->currentValue(); }
    7777    int targetY() const { return m_targetY->currentValue(); }
    7878    EdgeModeType edgeMode() const { return m_edgeMode.currentValue(attributeOwnerProxy()); }
    79     float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(attributeOwnerProxy()); }
    80     float kernelUnitLengthY() const { return m_kernelUnitLengthY.currentValue(attributeOwnerProxy()); }
     79    float kernelUnitLengthX() const { return m_kernelUnitLengthX->currentValue(); }
     80    float kernelUnitLengthY() const { return m_kernelUnitLengthY->currentValue(); }
    8181    bool preserveAlpha() const { return m_preserveAlpha->currentValue(); }
    8282
     
    8585    SVGAnimatedInteger& orderYAnimated() { return m_orderY; }
    8686    RefPtr<SVGAnimatedNumberList> kernelMatrixAnimated() { return m_kernelMatrix.animatedProperty(attributeOwnerProxy()); }
    87     RefPtr<SVGAnimatedNumber> divisorAnimated() { return m_divisor.animatedProperty(attributeOwnerProxy()); }
    88     RefPtr<SVGAnimatedNumber> biasAnimated() { return m_bias.animatedProperty(attributeOwnerProxy()); }
     87    SVGAnimatedNumber& divisorAnimated() { return m_divisor; }
     88    SVGAnimatedNumber& biasAnimated() { return m_bias; }
    8989    SVGAnimatedInteger& targetXAnimated() { return m_targetX; }
    9090    SVGAnimatedInteger& targetYAnimated() { return m_targetY; }
    9191    RefPtr<SVGAnimatedEnumeration> edgeModeAnimated() { return m_edgeMode.animatedProperty(attributeOwnerProxy()); }
    92     RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(attributeOwnerProxy()); }
    93     RefPtr<SVGAnimatedNumber> kernelUnitLengthYAnimated() { return m_kernelUnitLengthY.animatedProperty(attributeOwnerProxy()); }
     92    SVGAnimatedNumber& kernelUnitLengthXAnimated() { return m_kernelUnitLengthX; }
     93    SVGAnimatedNumber& kernelUnitLengthYAnimated() { return m_kernelUnitLengthY; }
    9494    SVGAnimatedBoolean& preserveAlphaAnimated() { return m_preserveAlpha; }
    9595
     
    116116    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    117117
    118     static const AtomicString& kernelUnitLengthXIdentifier();
    119     static const AtomicString& kernelUnitLengthYIdentifier();
    120 
    121118    AttributeOwnerProxy m_attributeOwnerProxy { *this };
    122119    PropertyRegistry m_propertyRegistry { *this };
     
    125122    Ref<SVGAnimatedInteger> m_orderY { SVGAnimatedInteger::create(this) };
    126123    SVGAnimatedNumberListAttribute m_kernelMatrix;
    127     SVGAnimatedNumberAttribute m_divisor;
    128     SVGAnimatedNumberAttribute m_bias;
     124    Ref<SVGAnimatedNumber> m_divisor { SVGAnimatedNumber::create(this) };
     125    Ref<SVGAnimatedNumber> m_bias { SVGAnimatedNumber::create(this) };
    129126    Ref<SVGAnimatedInteger> m_targetX { SVGAnimatedInteger::create(this) };
    130127    Ref<SVGAnimatedInteger> m_targetY { SVGAnimatedInteger::create(this) };
    131128    SVGAnimatedEnumerationAttribute<EdgeModeType> m_edgeMode { EDGEMODE_DUPLICATE };
    132     SVGAnimatedNumberAttribute m_kernelUnitLengthX;
    133     SVGAnimatedNumberAttribute m_kernelUnitLengthY;
     129    Ref<SVGAnimatedNumber> m_kernelUnitLengthX { SVGAnimatedNumber::create(this) };
     130    Ref<SVGAnimatedNumber> m_kernelUnitLengthY { SVGAnimatedNumber::create(this) };
    134131    Ref<SVGAnimatedBoolean> m_preserveAlpha { SVGAnimatedBoolean::create(this) };
    135132};
  • trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp

    r243185 r243266  
    4040    ASSERT(hasTagName(SVGNames::feDiffuseLightingTag));
    4141    registerAttributes();
     42
     43    static std::once_flag onceFlag;
     44    std::call_once(onceFlag, [] {
     45        PropertyRegistry::registerProperty<SVGNames::diffuseConstantAttr, &SVGFEDiffuseLightingElement::m_diffuseConstant>();
     46        PropertyRegistry::registerProperty<SVGNames::surfaceScaleAttr, &SVGFEDiffuseLightingElement::m_surfaceScale>();
     47        PropertyRegistry::registerProperty<SVGNames::kernelUnitLengthAttr, &SVGFEDiffuseLightingElement::m_kernelUnitLengthX, &SVGFEDiffuseLightingElement::m_kernelUnitLengthY>();
     48    });
    4249}
    4350
     
    4552{
    4653    return adoptRef(*new SVGFEDiffuseLightingElement(tagName, document));
    47 }
    48 
    49 const AtomicString& SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier()
    50 {
    51     static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthX", AtomicString::ConstructFromLiteral);
    52     return s_identifier;
    53 }
    54 
    55 const AtomicString& SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier()
    56 {
    57     static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthY", AtomicString::ConstructFromLiteral);
    58     return s_identifier;
    5954}
    6055
     
    6560        return;
    6661    registry.registerAttribute<SVGNames::inAttr, &SVGFEDiffuseLightingElement::m_in1>();
    67     registry.registerAttribute<SVGNames::diffuseConstantAttr, &SVGFEDiffuseLightingElement::m_diffuseConstant>();
    68     registry.registerAttribute<SVGNames::surfaceScaleAttr, &SVGFEDiffuseLightingElement::m_surfaceScale>();
    69     registry.registerAttribute<SVGNames::kernelUnitLengthAttr,
    70         &SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier, &SVGFEDiffuseLightingElement::m_kernelUnitLengthX,
    71         &SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier, &SVGFEDiffuseLightingElement::m_kernelUnitLengthY>();
    7262}
    7363
     
    8070
    8171    if (name == SVGNames::surfaceScaleAttr) {
    82         m_surfaceScale.setValue(value.toFloat());
     72        m_surfaceScale->setBaseValInternal(value.toFloat());
    8373        return;
    8474    }
    8575
    8676    if (name == SVGNames::diffuseConstantAttr) {
    87         m_diffuseConstant.setValue(value.toFloat());
     77        m_diffuseConstant->setBaseValInternal(value.toFloat());
    8878        return;
    8979    }
     
    9282        float x, y;
    9383        if (parseNumberOptionalNumber(value, x, y)) {
    94             m_kernelUnitLengthX.setValue(x);
    95             m_kernelUnitLengthY.setValue(y);
     84            m_kernelUnitLengthX->setBaseValInternal(x);
     85            m_kernelUnitLengthY->setBaseValInternal(y);
    9686        }
    9787        return;
  • trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.h

    r243185 r243266  
    3838
    3939    String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
    40     float diffuseConstant() const { return m_diffuseConstant.currentValue(attributeOwnerProxy()); }
    41     float surfaceScale() const { return m_surfaceScale.currentValue(attributeOwnerProxy()); }
    42     float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(attributeOwnerProxy()); }
    43     float kernelUnitLengthY() const { return m_kernelUnitLengthY.currentValue(attributeOwnerProxy()); }
     40    float diffuseConstant() const { return m_diffuseConstant->currentValue(); }
     41    float surfaceScale() const { return m_surfaceScale->currentValue(); }
     42    float kernelUnitLengthX() const { return m_kernelUnitLengthX->currentValue(); }
     43    float kernelUnitLengthY() const { return m_kernelUnitLengthY->currentValue(); }
    4444
    4545    RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
    46     RefPtr<SVGAnimatedNumber> diffuseConstantAnimated() { return m_diffuseConstant.animatedProperty(attributeOwnerProxy()); }
    47     RefPtr<SVGAnimatedNumber> surfaceScaleAnimated() { return m_surfaceScale.animatedProperty(attributeOwnerProxy()); }
    48     RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(attributeOwnerProxy()); }
    49     RefPtr<SVGAnimatedNumber> kernelUnitLengthYAnimated() { return m_kernelUnitLengthY.animatedProperty(attributeOwnerProxy()); }
     46    SVGAnimatedNumber& diffuseConstantAnimated() { return m_diffuseConstant; }
     47    SVGAnimatedNumber& surfaceScaleAnimated() { return m_surfaceScale; }
     48    SVGAnimatedNumber& kernelUnitLengthXAnimated() { return m_kernelUnitLengthX; }
     49    SVGAnimatedNumber& kernelUnitLengthYAnimated() { return m_kernelUnitLengthY; }
    5050
    5151private:
     
    7171    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    7272
    73     static const AtomicString& kernelUnitLengthXIdentifier();
    74     static const AtomicString& kernelUnitLengthYIdentifier();
    75 
    7673    AttributeOwnerProxy m_attributeOwnerProxy { *this };
    7774    PropertyRegistry m_propertyRegistry { *this };
    7875    SVGAnimatedStringAttribute m_in1;
    79     SVGAnimatedNumberAttribute m_diffuseConstant { 1 };
    80     SVGAnimatedNumberAttribute m_surfaceScale { 1 };
    81     SVGAnimatedNumberAttribute m_kernelUnitLengthX;
    82     SVGAnimatedNumberAttribute m_kernelUnitLengthY;
     76    Ref<SVGAnimatedNumber> m_diffuseConstant { SVGAnimatedNumber::create(this, 1) };
     77    Ref<SVGAnimatedNumber> m_surfaceScale { SVGAnimatedNumber::create(this, 1) };
     78    Ref<SVGAnimatedNumber> m_kernelUnitLengthX { SVGAnimatedNumber::create(this) };
     79    Ref<SVGAnimatedNumber> m_kernelUnitLengthY { SVGAnimatedNumber::create(this) };
    8380};
    8481
  • trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp

    r243185 r243266  
    11/*
    22 * Copyright (C) 2006 Oliver Hunt <oliver@nerget.com>
    3  * Copyright (C) 2018 Apple Inc. All rights reserved.
     3 * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
    44 *
    55 * This library is free software; you can redistribute it and/or
     
    3636    ASSERT(hasTagName(SVGNames::feDisplacementMapTag));
    3737    registerAttributes();
     38   
     39    static std::once_flag onceFlag;
     40    std::call_once(onceFlag, [] {
     41        PropertyRegistry::registerProperty<SVGNames::scaleAttr, &SVGFEDisplacementMapElement::m_scale>();
     42    });
    3843}
    3944
     
    5257    registry.registerAttribute<SVGNames::xChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_xChannelSelector>();
    5358    registry.registerAttribute<SVGNames::yChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_yChannelSelector>();
    54     registry.registerAttribute<SVGNames::scaleAttr, &SVGFEDisplacementMapElement::m_scale>();
    5559}
    5660
     
    8286
    8387    if (name == SVGNames::scaleAttr) {
    84         m_scale.setValue(value.toFloat());
     88        m_scale->setBaseValInternal(value.toFloat());
    8589        return;
    8690    }
  • trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.h

    r243185 r243266  
    2323#include "FEDisplacementMap.h"
    2424#include "SVGAnimatedEnumeration.h"
    25 #include "SVGAnimatedNumber.h"
    2625#include "SVGFilterPrimitiveStandardAttributes.h"
    2726
     
    7675    ChannelSelectorType xChannelSelector() const { return m_xChannelSelector.currentValue(attributeOwnerProxy()); }
    7776    ChannelSelectorType yChannelSelector() const { return m_yChannelSelector.currentValue(attributeOwnerProxy()); }
    78     float scale() const { return m_scale.currentValue(attributeOwnerProxy()); }
     77    float scale() const { return m_scale->currentValue(); }
    7978
    8079    RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
     
    8281    RefPtr<SVGAnimatedEnumeration> xChannelSelectorAnimated() { return m_xChannelSelector.animatedProperty(attributeOwnerProxy()); }
    8382    RefPtr<SVGAnimatedEnumeration> yChannelSelectorAnimated() { return m_yChannelSelector.animatedProperty(attributeOwnerProxy()); }
    84     RefPtr<SVGAnimatedNumber> scaleAnimated() { return m_scale.animatedProperty(attributeOwnerProxy()); }
     83    SVGAnimatedNumber& scaleAnimated() { return m_scale; }
    8584
    8685private:
     
    112111    SVGAnimatedEnumerationAttribute<ChannelSelectorType> m_xChannelSelector { CHANNEL_A };
    113112    SVGAnimatedEnumerationAttribute<ChannelSelectorType> m_yChannelSelector { CHANNEL_A };
    114     SVGAnimatedNumberAttribute m_scale;
     113    Ref<SVGAnimatedNumber> m_scale { SVGAnimatedNumber::create(this) };
    115114};
    116115
  • trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp

    r243185 r243266  
    11/*
    22 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
    3  * Copyright (C) 2018 Apple Inc. All rights reserved.
     3 * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
    44 *
    55 * This library is free software; you can redistribute it and/or
     
    3838    ASSERT(hasTagName(SVGNames::feDropShadowTag));
    3939    registerAttributes();
     40   
     41    static std::once_flag onceFlag;
     42    std::call_once(onceFlag, [] {
     43        PropertyRegistry::registerProperty<SVGNames::dxAttr, &SVGFEDropShadowElement::m_dx>();
     44        PropertyRegistry::registerProperty<SVGNames::dyAttr, &SVGFEDropShadowElement::m_dy>();
     45        PropertyRegistry::registerProperty<SVGNames::stdDeviationAttr, &SVGFEDropShadowElement::m_stdDeviationX, &SVGFEDropShadowElement::m_stdDeviationY>();
     46    });
    4047}
    4148
     
    4552}
    4653
    47 const AtomicString& SVGFEDropShadowElement::stdDeviationXIdentifier()
    48 {
    49     static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationX", AtomicString::ConstructFromLiteral);
    50     return s_identifier;
    51 }
    52 
    53 const AtomicString& SVGFEDropShadowElement::stdDeviationYIdentifier()
    54 {
    55     static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationY", AtomicString::ConstructFromLiteral);
    56     return s_identifier;
    57 }
    58 
    5954void SVGFEDropShadowElement::setStdDeviation(float x, float y)
    6055{
    61     m_stdDeviationX.setValue(x);
    62     m_stdDeviationY.setValue(y);
     56    m_stdDeviationX->setBaseValInternal(x);
     57    m_stdDeviationY->setBaseValInternal(y);
    6358    invalidate();
    6459}
     
    7065        return;
    7166    registry.registerAttribute<SVGNames::inAttr, &SVGFEDropShadowElement::m_in1>();
    72     registry.registerAttribute<SVGNames::dxAttr, &SVGFEDropShadowElement::m_dx>();
    73     registry.registerAttribute<SVGNames::dyAttr, &SVGFEDropShadowElement::m_dy>();
    74     registry.registerAttribute<SVGNames::stdDeviationAttr,
    75         &SVGFEDropShadowElement::stdDeviationXIdentifier, &SVGFEDropShadowElement::m_stdDeviationX,
    76         &SVGFEDropShadowElement::stdDeviationYIdentifier, &SVGFEDropShadowElement::m_stdDeviationY>();
    7767}
    7868
     
    8272        float x, y;
    8373        if (parseNumberOptionalNumber(value, x, y)) {
    84             m_stdDeviationX.setValue(x);
    85             m_stdDeviationY.setValue(y);
     74            m_stdDeviationX->setBaseValInternal(x);
     75            m_stdDeviationY->setBaseValInternal(y);
    8676        }
    8777        return;
     
    9484
    9585    if (name == SVGNames::dxAttr) {
    96         m_dx.setValue(value.toFloat());
     86        m_dx->setBaseValInternal(value.toFloat());
    9787        return;
    9888    }
    9989
    10090    if (name == SVGNames::dyAttr) {
    101         m_dy.setValue(value.toFloat());
     91        m_dy->setBaseValInternal(value.toFloat());
    10292        return;
    10393    }
  • trunk/Source/WebCore/svg/SVGFEDropShadowElement.h

    r243185 r243266  
    2222
    2323#include "FEDropShadow.h"
    24 #include "SVGAnimatedNumber.h"
    2524#include "SVGFilterPrimitiveStandardAttributes.h"
    2625
     
    3534
    3635    String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
    37     float dx() const { return m_dx.currentValue(attributeOwnerProxy()); }
    38     float dy() const { return m_dy.currentValue(attributeOwnerProxy()); }
    39     float stdDeviationX() const { return m_stdDeviationX.currentValue(attributeOwnerProxy()); }
    40     float stdDeviationY() const { return m_stdDeviationY.currentValue(attributeOwnerProxy()); }
     36    float dx() const { return m_dx->currentValue(); }
     37    float dy() const { return m_dy->currentValue(); }
     38    float stdDeviationX() const { return m_stdDeviationX->currentValue(); }
     39    float stdDeviationY() const { return m_stdDeviationY->currentValue(); }
    4140
    4241    RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
    43     RefPtr<SVGAnimatedNumber> dxAnimated() { return m_dx.animatedProperty(attributeOwnerProxy()); }
    44     RefPtr<SVGAnimatedNumber> dyAnimated() { return m_dy.animatedProperty(attributeOwnerProxy()); }
    45     RefPtr<SVGAnimatedNumber> stdDeviationXAnimated() { return m_stdDeviationX.animatedProperty(attributeOwnerProxy()); }
    46     RefPtr<SVGAnimatedNumber> stdDeviationYAnimated() { return m_stdDeviationY.animatedProperty(attributeOwnerProxy()); }
     42    SVGAnimatedNumber& dxAnimated() { return m_dx; }
     43    SVGAnimatedNumber& dyAnimated() { return m_dy; }
     44    SVGAnimatedNumber& stdDeviationXAnimated() { return m_stdDeviationX; }
     45    SVGAnimatedNumber& stdDeviationYAnimated() { return m_stdDeviationY; }
    4746
    4847private:
     
    6766    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    6867
    69     static const AtomicString& stdDeviationXIdentifier();
    70     static const AtomicString& stdDeviationYIdentifier();
    71 
    7268    AttributeOwnerProxy m_attributeOwnerProxy { *this };
    7369    PropertyRegistry m_propertyRegistry { *this };
    7470    SVGAnimatedStringAttribute m_in1;
    75     SVGAnimatedNumberAttribute m_dx { 2 };
    76     SVGAnimatedNumberAttribute m_dy { 2 };
    77     SVGAnimatedNumberAttribute m_stdDeviationX { 2 };
    78     SVGAnimatedNumberAttribute m_stdDeviationY { 2 };
     71    Ref<SVGAnimatedNumber> m_dx { SVGAnimatedNumber::create(this, 2) };
     72    Ref<SVGAnimatedNumber> m_dy { SVGAnimatedNumber::create(this, 2) };
     73    Ref<SVGAnimatedNumber> m_stdDeviationX { SVGAnimatedNumber::create(this, 2) };
     74    Ref<SVGAnimatedNumber> m_stdDeviationY { SVGAnimatedNumber::create(this, 2) };
    7975};
    8076   
  • trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp

    r243185 r243266  
    22 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
    33 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
    4  * Copyright (C) 2018 Apple Inc. All rights reserved.
     4 * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
    55 *
    66 * This library is free software; you can redistribute it and/or
     
    3838    ASSERT(hasTagName(SVGNames::feGaussianBlurTag));
    3939    registerAttributes();
     40
     41    static std::once_flag onceFlag;
     42    std::call_once(onceFlag, [] {
     43        PropertyRegistry::registerProperty<SVGNames::stdDeviationAttr, &SVGFEGaussianBlurElement::m_stdDeviationX, &SVGFEGaussianBlurElement::m_stdDeviationY>();
     44    });
    4045}
    4146
     
    4550}
    4651
    47 const AtomicString& SVGFEGaussianBlurElement::stdDeviationXIdentifier()
    48 {
    49     static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationX", AtomicString::ConstructFromLiteral);
    50     return s_identifier;
    51 }
    52 
    53 const AtomicString& SVGFEGaussianBlurElement::stdDeviationYIdentifier()
    54 {
    55     static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationY", AtomicString::ConstructFromLiteral);
    56     return s_identifier;
    57 }
    58 
    5952void SVGFEGaussianBlurElement::setStdDeviation(float x, float y)
    6053{
    61     m_stdDeviationX.setValue(x);
    62     m_stdDeviationY.setValue(y);
     54    m_stdDeviationX->setBaseValInternal(x);
     55    m_stdDeviationY->setBaseValInternal(y);
    6356    invalidate();
    6457}
     
    7063        return;
    7164    registry.registerAttribute<SVGNames::inAttr, &SVGFEGaussianBlurElement::m_in1>();
    72     registry.registerAttribute<SVGNames::stdDeviationAttr,
    73         &SVGFEGaussianBlurElement::stdDeviationXIdentifier, &SVGFEGaussianBlurElement::m_stdDeviationX,
    74         &SVGFEGaussianBlurElement::stdDeviationYIdentifier, &SVGFEGaussianBlurElement::m_stdDeviationY>();
    7565    registry.registerAttribute<SVGNames::edgeModeAttr, EdgeModeType, &SVGFEGaussianBlurElement::m_edgeMode>();
    7666}
     
    8171        float x, y;
    8272        if (parseNumberOptionalNumber(value, x, y)) {
    83             m_stdDeviationX.setValue(x);
    84             m_stdDeviationY.setValue(y);
     73            m_stdDeviationX->setBaseValInternal(x);
     74            m_stdDeviationY->setBaseValInternal(y);
    8575        }
    8676        return;
  • trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.h

    r243185 r243266  
    2424#include "FEGaussianBlur.h"
    2525#include "SVGAnimatedEnumeration.h"
    26 #include "SVGAnimatedNumber.h"
    2726#include "SVGFEConvolveMatrixElement.h"
    2827#include "SVGFilterPrimitiveStandardAttributes.h"
     
    3837
    3938    String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
    40     float stdDeviationX() const { return m_stdDeviationX.currentValue(attributeOwnerProxy()); }
    41     float stdDeviationY() const { return m_stdDeviationY.currentValue(attributeOwnerProxy()); }
     39    float stdDeviationX() const { return m_stdDeviationX->currentValue(); }
     40    float stdDeviationY() const { return m_stdDeviationY->currentValue(); }
    4241    EdgeModeType edgeMode() const { return m_edgeMode.currentValue(attributeOwnerProxy()); }
    4342
    4443    RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
    45     RefPtr<SVGAnimatedNumber> stdDeviationXAnimated() { return m_stdDeviationX.animatedProperty(attributeOwnerProxy()); }
    46     RefPtr<SVGAnimatedNumber> stdDeviationYAnimated() { return m_stdDeviationY.animatedProperty(attributeOwnerProxy()); }
     44    SVGAnimatedNumber& stdDeviationXAnimated() { return m_stdDeviationX; }
     45    SVGAnimatedNumber& stdDeviationYAnimated() { return m_stdDeviationY; }
    4746    RefPtr<SVGAnimatedEnumeration> edgeModeAnimated() { return m_edgeMode.animatedProperty(attributeOwnerProxy()); }
    4847
     
    6867    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    6968
    70     static const AtomicString& stdDeviationXIdentifier();
    71     static const AtomicString& stdDeviationYIdentifier();
    72 
    7369    AttributeOwnerProxy m_attributeOwnerProxy { *this };
    7470    PropertyRegistry m_propertyRegistry { *this };
    7571    SVGAnimatedStringAttribute m_in1;
    76     SVGAnimatedNumberAttribute m_stdDeviationX;
    77     SVGAnimatedNumberAttribute m_stdDeviationY;
     72    Ref<SVGAnimatedNumber> m_stdDeviationX { SVGAnimatedNumber::create(this) };
     73    Ref<SVGAnimatedNumber> m_stdDeviationY { SVGAnimatedNumber::create(this) };
    7874    SVGAnimatedEnumerationAttribute<EdgeModeType> m_edgeMode { EDGEMODE_NONE };
    7975};
  • trunk/Source/WebCore/svg/SVGFELightElement.cpp

    r234620 r243266  
    33 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
    44 * Copyright (C) 2005 Oliver Hunt <oliver@nerget.com>
    5  * Copyright (C) 2018 Apple Inc. All rights reserved.
     5 * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
    66 *
    77 * This library is free software; you can redistribute it and/or
     
    4444    : SVGElement(tagName, document)
    4545{
    46     registerAttributes();
     46    static std::once_flag onceFlag;
     47    std::call_once(onceFlag, [] {
     48        PropertyRegistry::registerProperty<SVGNames::azimuthAttr, &SVGFELightElement::m_azimuth>();
     49        PropertyRegistry::registerProperty<SVGNames::elevationAttr, &SVGFELightElement::m_elevation>();
     50        PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGFELightElement::m_x>();
     51        PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGFELightElement::m_y>();
     52        PropertyRegistry::registerProperty<SVGNames::zAttr, &SVGFELightElement::m_z>();
     53        PropertyRegistry::registerProperty<SVGNames::pointsAtXAttr, &SVGFELightElement::m_pointsAtX>();
     54        PropertyRegistry::registerProperty<SVGNames::pointsAtYAttr, &SVGFELightElement::m_pointsAtY>();
     55        PropertyRegistry::registerProperty<SVGNames::pointsAtZAttr, &SVGFELightElement::m_pointsAtZ>();
     56        PropertyRegistry::registerProperty<SVGNames::specularExponentAttr, &SVGFELightElement::m_specularExponent>();
     57        PropertyRegistry::registerProperty<SVGNames::limitingConeAngleAttr, &SVGFELightElement::m_limitingConeAngle>();
     58    });
    4759}
    4860
     
    5668}
    5769
    58 void SVGFELightElement::registerAttributes()
    59 {
    60     auto& registry = attributeRegistry();
    61     if (!registry.isEmpty())
    62         return;
    63     registry.registerAttribute<SVGNames::azimuthAttr, &SVGFELightElement::m_azimuth>();
    64     registry.registerAttribute<SVGNames::elevationAttr, &SVGFELightElement::m_elevation>();
    65     registry.registerAttribute<SVGNames::xAttr, &SVGFELightElement::m_x>();
    66     registry.registerAttribute<SVGNames::yAttr, &SVGFELightElement::m_y>();
    67     registry.registerAttribute<SVGNames::zAttr, &SVGFELightElement::m_z>();
    68     registry.registerAttribute<SVGNames::pointsAtXAttr, &SVGFELightElement::m_pointsAtX>();
    69     registry.registerAttribute<SVGNames::pointsAtYAttr, &SVGFELightElement::m_pointsAtY>();
    70     registry.registerAttribute<SVGNames::pointsAtZAttr, &SVGFELightElement::m_pointsAtZ>();
    71     registry.registerAttribute<SVGNames::specularExponentAttr, &SVGFELightElement::m_specularExponent>();
    72     registry.registerAttribute<SVGNames::limitingConeAngleAttr, &SVGFELightElement::m_limitingConeAngle>();
    73 }
    74 
    7570void SVGFELightElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
    7671{
    7772    if (name == SVGNames::azimuthAttr) {
    78         m_azimuth.setValue(value.toFloat());
     73        m_azimuth->setBaseValInternal(value.toFloat());
    7974        return;
    8075    }
    8176
    8277    if (name == SVGNames::elevationAttr) {
    83         m_elevation.setValue(value.toFloat());
     78        m_elevation->setBaseValInternal(value.toFloat());
    8479        return;
    8580    }
    8681
    8782    if (name == SVGNames::xAttr) {
    88         m_x.setValue(value.toFloat());
     83        m_x->setBaseValInternal(value.toFloat());
    8984        return;
    9085    }
    9186
    9287    if (name == SVGNames::yAttr) {
    93         m_y.setValue(value.toFloat());
     88        m_y->setBaseValInternal(value.toFloat());
    9489        return;
    9590    }
    9691
    9792    if (name == SVGNames::zAttr) {
    98         m_z.setValue(value.toFloat());
     93        m_z->setBaseValInternal(value.toFloat());
    9994        return;
    10095    }
    10196
    10297    if (name == SVGNames::pointsAtXAttr) {
    103         m_pointsAtX.setValue(value.toFloat());
     98        m_pointsAtX->setBaseValInternal(value.toFloat());
    10499        return;
    105100    }
    106101
    107102    if (name == SVGNames::pointsAtYAttr) {
    108         m_pointsAtY.setValue(value.toFloat());
     103        m_pointsAtY->setBaseValInternal(value.toFloat());
    109104        return;
    110105    }
    111106
    112107    if (name == SVGNames::pointsAtZAttr) {
    113         m_pointsAtZ.setValue(value.toFloat());
     108        m_pointsAtZ->setBaseValInternal(value.toFloat());
    114109        return;
    115110    }
    116111
    117112    if (name == SVGNames::specularExponentAttr) {
    118         m_specularExponent.setValue(value.toFloat());
     113        m_specularExponent->setBaseValInternal(value.toFloat());
    119114        return;
    120115    }
    121116
    122117    if (name == SVGNames::limitingConeAngleAttr) {
    123         m_limitingConeAngle.setValue(value.toFloat());
     118        m_limitingConeAngle->setBaseValInternal(value.toFloat());
    124119        return;
    125120    }
     
    130125void SVGFELightElement::svgAttributeChanged(const QualifiedName& attrName)
    131126{
    132     if (isKnownAttribute(attrName)) {
     127    if (PropertyRegistry::isKnownAttribute(attrName)) {
    133128        auto parent = makeRefPtr(parentElement());
    134129        if (!parent)
  • trunk/Source/WebCore/svg/SVGFELightElement.h

    r243114 r243266  
    2424
    2525#include "LightSource.h"
    26 #include "SVGAnimatedNumber.h"
    2726#include "SVGElement.h"
    2827
     
    3736    static SVGFELightElement* findLightElement(const SVGElement*);
    3837
    39     float azimuth() const { return m_azimuth.currentValue(attributeOwnerProxy()); }
    40     float elevation() const { return m_elevation.currentValue(attributeOwnerProxy()); }
    41     float x() const { return m_x.currentValue(attributeOwnerProxy()); }
    42     float y() const { return m_y.currentValue(attributeOwnerProxy()); }
    43     float z() const { return m_z.currentValue(attributeOwnerProxy()); }
    44     float pointsAtX() const { return m_pointsAtX.currentValue(attributeOwnerProxy()); }
    45     float pointsAtY() const { return m_pointsAtY.currentValue(attributeOwnerProxy()); }
    46     float pointsAtZ() const { return m_pointsAtZ.currentValue(attributeOwnerProxy()); }
    47     float specularExponent() const { return m_specularExponent.currentValue(attributeOwnerProxy()); }
    48     float limitingConeAngle() const { return m_limitingConeAngle.currentValue(attributeOwnerProxy()); }
     38    float azimuth() const { return m_azimuth->currentValue(); }
     39    float elevation() const { return m_elevation->currentValue(); }
     40    float x() const { return m_x->currentValue(); }
     41    float y() const { return m_y->currentValue(); }
     42    float z() const { return m_z->currentValue(); }
     43    float pointsAtX() const { return m_pointsAtX->currentValue(); }
     44    float pointsAtY() const { return m_pointsAtY->currentValue(); }
     45    float pointsAtZ() const { return m_pointsAtZ->currentValue(); }
     46    float specularExponent() const { return m_specularExponent->currentValue(); }
     47    float limitingConeAngle() const { return m_limitingConeAngle->currentValue(); }
    4948
    50     RefPtr<SVGAnimatedNumber> azimuthAnimated() { return m_azimuth.animatedProperty(attributeOwnerProxy()); }
    51     RefPtr<SVGAnimatedNumber> elevationAnimated() { return m_elevation.animatedProperty(attributeOwnerProxy()); }
    52     RefPtr<SVGAnimatedNumber> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); }
    53     RefPtr<SVGAnimatedNumber> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); }
    54     RefPtr<SVGAnimatedNumber> zAnimated() { return m_z.animatedProperty(attributeOwnerProxy()); }
    55     RefPtr<SVGAnimatedNumber> pointsAtXAnimated() { return m_pointsAtX.animatedProperty(attributeOwnerProxy()); }
    56     RefPtr<SVGAnimatedNumber> pointsAtYAnimated() { return m_pointsAtY.animatedProperty(attributeOwnerProxy()); }
    57     RefPtr<SVGAnimatedNumber> pointsAtZAnimated() { return m_pointsAtZ.animatedProperty(attributeOwnerProxy()); }
    58     RefPtr<SVGAnimatedNumber> specularExponentAnimated() { return m_specularExponent.animatedProperty(attributeOwnerProxy()); }
    59     RefPtr<SVGAnimatedNumber> limitingConeAngleAnimated() { return m_limitingConeAngle.animatedProperty(attributeOwnerProxy()); }
     49    SVGAnimatedNumber& azimuthAnimated() { return m_azimuth; }
     50    SVGAnimatedNumber& elevationAnimated() { return m_elevation; }
     51    SVGAnimatedNumber& xAnimated() { return m_x; }
     52    SVGAnimatedNumber& yAnimated() { return m_y; }
     53    SVGAnimatedNumber& zAnimated() { return m_z; }
     54    SVGAnimatedNumber& pointsAtXAnimated() { return m_pointsAtX; }
     55    SVGAnimatedNumber& pointsAtYAnimated() { return m_pointsAtY; }
     56    SVGAnimatedNumber& pointsAtZAnimated() { return m_pointsAtZ; }
     57    SVGAnimatedNumber& specularExponentAnimated() { return m_specularExponent; }
     58    SVGAnimatedNumber& limitingConeAngleAnimated() { return m_limitingConeAngle; }
    6059
    6160protected:
     
    6665private:
    6766    using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFELightElement, SVGElement>;
    68     static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }
    69     static void registerAttributes();
    7067    const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; }
    7168
    7269    using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFELightElement, SVGElement>;
    7370    const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; }
    74 
    75     static bool isKnownAttribute(const QualifiedName& attributeName)
    76     {
    77         return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName);
    78     }
    7971
    8072    void parseAttribute(const QualifiedName&, const AtomicString&) override;
     
    8476    AttributeOwnerProxy m_attributeOwnerProxy { *this };
    8577    PropertyRegistry m_propertyRegistry { *this };
    86     SVGAnimatedNumberAttribute m_azimuth;
    87     SVGAnimatedNumberAttribute m_elevation;
    88     SVGAnimatedNumberAttribute m_x;
    89     SVGAnimatedNumberAttribute m_y;
    90     SVGAnimatedNumberAttribute m_z;
    91     SVGAnimatedNumberAttribute m_pointsAtX;
    92     SVGAnimatedNumberAttribute m_pointsAtY;
    93     SVGAnimatedNumberAttribute m_pointsAtZ;
    94     SVGAnimatedNumberAttribute m_specularExponent { 1 };
    95     SVGAnimatedNumberAttribute m_limitingConeAngle;
     78    Ref<SVGAnimatedNumber> m_azimuth { SVGAnimatedNumber::create(this) };
     79    Ref<SVGAnimatedNumber> m_elevation { SVGAnimatedNumber::create(this) };
     80    Ref<SVGAnimatedNumber> m_x { SVGAnimatedNumber::create(this) };
     81    Ref<SVGAnimatedNumber> m_y { SVGAnimatedNumber::create(this) };
     82    Ref<SVGAnimatedNumber> m_z { SVGAnimatedNumber::create(this) };
     83    Ref<SVGAnimatedNumber> m_pointsAtX { SVGAnimatedNumber::create(this) };
     84    Ref<SVGAnimatedNumber> m_pointsAtY { SVGAnimatedNumber::create(this) };
     85    Ref<SVGAnimatedNumber> m_pointsAtZ { SVGAnimatedNumber::create(this) };
     86    Ref<SVGAnimatedNumber> m_specularExponent { SVGAnimatedNumber::create(this, 1) };
     87    Ref<SVGAnimatedNumber> m_limitingConeAngle { SVGAnimatedNumber::create(this) };
    9688};
    9789
  • trunk/Source/WebCore/svg/SVGFEMorphologyElement.cpp

    r243185 r243266  
    11/*
    22 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
    3  * Copyright (C) 2018 Apple Inc. All rights reserved.
     3 * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
    44 *
    55 * This library is free software; you can redistribute it and/or
     
    3737    ASSERT(hasTagName(SVGNames::feMorphologyTag));
    3838    registerAttributes();
     39   
     40    static std::once_flag onceFlag;
     41    std::call_once(onceFlag, [] {
     42        PropertyRegistry::registerProperty<SVGNames::radiusAttr, &SVGFEMorphologyElement::m_radiusX, &SVGFEMorphologyElement::m_radiusY>();
     43    });
    3944}
    4045
     
    4449}
    4550
    46 const AtomicString& SVGFEMorphologyElement::radiusXIdentifier()
    47 {
    48     static NeverDestroyed<AtomicString> s_identifier("SVGRadiusX", AtomicString::ConstructFromLiteral);
    49     return s_identifier;
    50 }
    51 
    52 const AtomicString& SVGFEMorphologyElement::radiusYIdentifier()
    53 {
    54     static NeverDestroyed<AtomicString> s_identifier("SVGRadiusY", AtomicString::ConstructFromLiteral);
    55     return s_identifier;
    56 }
    57 
    5851void SVGFEMorphologyElement::setRadius(float x, float y)
    5952{
    60     m_radiusX.setValue(x);
    61     m_radiusY.setValue(y);
     53    m_radiusX->setBaseValInternal(x);
     54    m_radiusY->setBaseValInternal(y);
    6255    invalidate();
    6356}
     
    7063    registry.registerAttribute<SVGNames::inAttr, &SVGFEMorphologyElement::m_in1>();
    7164    registry.registerAttribute<SVGNames::operatorAttr, MorphologyOperatorType, &SVGFEMorphologyElement::m_svgOperator>();
    72     registry.registerAttribute<SVGNames::radiusAttr,
    73         &SVGFEMorphologyElement::radiusXIdentifier, &SVGFEMorphologyElement::m_radiusX,
    74         &SVGFEMorphologyElement::radiusYIdentifier, &SVGFEMorphologyElement::m_radiusY>();
    7565}
    7666
     
    9282        float x, y;
    9383        if (parseNumberOptionalNumber(value, x, y)) {
    94             m_radiusX.setValue(x);
    95             m_radiusY.setValue(y);
     84            m_radiusX->setBaseValInternal(x);
     85            m_radiusY->setBaseValInternal(y);
    9686        }
    9787        return;
  • trunk/Source/WebCore/svg/SVGFEMorphologyElement.h

    r243185 r243266  
    2323#include "FEMorphology.h"
    2424#include "SVGAnimatedEnumeration.h"
    25 #include "SVGAnimatedNumber.h"
    2625#include "SVGFilterPrimitiveStandardAttributes.h"
    2726
     
    6665    String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
    6766    MorphologyOperatorType svgOperator() const { return m_svgOperator.currentValue(attributeOwnerProxy()); }
    68     float radiusX() const { return m_radiusX.currentValue(attributeOwnerProxy()); }
    69     float radiusY() const { return m_radiusY.currentValue(attributeOwnerProxy()); }
     67    float radiusX() const { return m_radiusX->currentValue(); }
     68    float radiusY() const { return m_radiusY->currentValue(); }
    7069
    7170    RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
    7271    RefPtr<SVGAnimatedEnumeration> svgOperatorAnimated() { return m_svgOperator.animatedProperty(attributeOwnerProxy()); }
    73     RefPtr<SVGAnimatedNumber> radiusXAnimated() { return m_radiusX.animatedProperty(attributeOwnerProxy()); }
    74     RefPtr<SVGAnimatedNumber> radiusYAnimated() { return m_radiusY.animatedProperty(attributeOwnerProxy()); }
     72    SVGAnimatedNumber& radiusXAnimated() { return m_radiusX; }
     73    SVGAnimatedNumber& radiusYAnimated() { return m_radiusY; }
    7574
    7675private:
     
    9695    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    9796
    98     static const AtomicString& radiusXIdentifier();
    99     static const AtomicString& radiusYIdentifier();
    100 
    10197    AttributeOwnerProxy m_attributeOwnerProxy { *this };
    10298    PropertyRegistry m_propertyRegistry { *this };
    10399    SVGAnimatedStringAttribute m_in1;
    104100    SVGAnimatedEnumerationAttribute<MorphologyOperatorType> m_svgOperator { FEMORPHOLOGY_OPERATOR_ERODE };
    105     SVGAnimatedNumberAttribute m_radiusX;
    106     SVGAnimatedNumberAttribute m_radiusY;
     101    Ref<SVGAnimatedNumber> m_radiusX { SVGAnimatedNumber::create(this) };
     102    Ref<SVGAnimatedNumber> m_radiusY { SVGAnimatedNumber::create(this) };
    107103};
    108104
  • trunk/Source/WebCore/svg/SVGFEOffsetElement.cpp

    r243185 r243266  
    22 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
    33 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
    4  * Copyright (C) 2018 Apple Inc. All rights reserved.
     4 * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
    55 *
    66 * This library is free software; you can redistribute it and/or
     
    3838    ASSERT(hasTagName(SVGNames::feOffsetTag));
    3939    registerAttributes();
     40   
     41    static std::once_flag onceFlag;
     42    std::call_once(onceFlag, [] {
     43        PropertyRegistry::registerProperty<SVGNames::dxAttr, &SVGFEOffsetElement::m_dx>();
     44        PropertyRegistry::registerProperty<SVGNames::dyAttr, &SVGFEOffsetElement::m_dy>();
     45    });
    4046}
    4147
     
    5157        return;
    5258    registry.registerAttribute<SVGNames::inAttr, &SVGFEOffsetElement::m_in1>();
    53     registry.registerAttribute<SVGNames::dxAttr, &SVGFEOffsetElement::m_dx>();
    54     registry.registerAttribute<SVGNames::dyAttr, &SVGFEOffsetElement::m_dy>();
    5559}
    5660
     
    5862{
    5963    if (name == SVGNames::dxAttr) {
    60         m_dx.setValue(value.toFloat());
     64        m_dx->setBaseValInternal(value.toFloat());
    6165        return;
    6266    }
    6367
    6468    if (name == SVGNames::dyAttr) {
    65         m_dy.setValue(value.toFloat());
     69        m_dy->setBaseValInternal(value.toFloat());
    6670        return;
    6771    }
  • trunk/Source/WebCore/svg/SVGFEOffsetElement.h

    r243185 r243266  
    2222#pragma once
    2323
    24 #include "SVGAnimatedNumber.h"
    2524#include "SVGFilterPrimitiveStandardAttributes.h"
    2625
     
    3332
    3433    String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
    35     float dx() const { return m_dx.currentValue(attributeOwnerProxy()); }
    36     float dy() const { return m_dy.currentValue(attributeOwnerProxy()); }
     34    float dx() const { return m_dx->currentValue(); }
     35    float dy() const { return m_dy->currentValue(); }
    3736
    3837    RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
    39     RefPtr<SVGAnimatedNumber> dxAnimated() { return m_dx.animatedProperty(attributeOwnerProxy()); }
    40     RefPtr<SVGAnimatedNumber> dyAnimated() { return m_dy.animatedProperty(attributeOwnerProxy()); }
     38    SVGAnimatedNumber& dxAnimated() { return m_dx; }
     39    SVGAnimatedNumber& dyAnimated() { return m_dy; }
    4140
    4241private:
     
    6463    PropertyRegistry m_propertyRegistry { *this };
    6564    SVGAnimatedStringAttribute m_in1;
    66     SVGAnimatedNumberAttribute m_dx;
    67     SVGAnimatedNumberAttribute m_dy;
     65    Ref<SVGAnimatedNumber> m_dx { SVGAnimatedNumber::create(this) };
     66    Ref<SVGAnimatedNumber> m_dy { SVGAnimatedNumber::create(this) };
    6867};
    6968
  • trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp

    r243185 r243266  
    4141    ASSERT(hasTagName(SVGNames::feSpecularLightingTag));
    4242    registerAttributes();
     43   
     44    static std::once_flag onceFlag;
     45    std::call_once(onceFlag, [] {
     46        PropertyRegistry::registerProperty<SVGNames::specularConstantAttr, &SVGFESpecularLightingElement::m_specularConstant>();
     47        PropertyRegistry::registerProperty<SVGNames::specularExponentAttr, &SVGFESpecularLightingElement::m_specularExponent>();
     48        PropertyRegistry::registerProperty<SVGNames::surfaceScaleAttr, &SVGFESpecularLightingElement::m_surfaceScale>();
     49        PropertyRegistry::registerProperty<SVGNames::kernelUnitLengthAttr, &SVGFESpecularLightingElement::m_kernelUnitLengthX, &SVGFESpecularLightingElement::m_kernelUnitLengthY>();
     50    });
    4351}
    4452
     
    4654{
    4755    return adoptRef(*new SVGFESpecularLightingElement(tagName, document));
    48 }
    49 
    50 const AtomicString& SVGFESpecularLightingElement::kernelUnitLengthXIdentifier()
    51 {
    52     static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthX", AtomicString::ConstructFromLiteral);
    53     return s_identifier;
    54 }
    55 
    56 const AtomicString& SVGFESpecularLightingElement::kernelUnitLengthYIdentifier()
    57 {
    58     static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthY", AtomicString::ConstructFromLiteral);
    59     return s_identifier;
    6056}
    6157
     
    6662        return;
    6763    registry.registerAttribute<SVGNames::inAttr, &SVGFESpecularLightingElement::m_in1>();
    68     registry.registerAttribute<SVGNames::specularConstantAttr, &SVGFESpecularLightingElement::m_specularConstant>();
    69     registry.registerAttribute<SVGNames::specularExponentAttr, &SVGFESpecularLightingElement::m_specularExponent>();
    70     registry.registerAttribute<SVGNames::surfaceScaleAttr, &SVGFESpecularLightingElement::m_surfaceScale>();
    71     registry.registerAttribute<SVGNames::kernelUnitLengthAttr,
    72         &SVGFESpecularLightingElement::kernelUnitLengthXIdentifier, &SVGFESpecularLightingElement::m_kernelUnitLengthX,
    73         &SVGFESpecularLightingElement::kernelUnitLengthYIdentifier, &SVGFESpecularLightingElement::m_kernelUnitLengthY>();
    7464}
    7565
     
    8272
    8373    if (name == SVGNames::surfaceScaleAttr) {
    84         m_surfaceScale.setValue(value.toFloat());
     74        m_surfaceScale->setBaseValInternal(value.toFloat());
    8575        return;
    8676    }
    8777
    8878    if (name == SVGNames::specularConstantAttr) {
    89         m_specularConstant.setValue(value.toFloat());
     79        m_specularConstant->setBaseValInternal(value.toFloat());
    9080        return;
    9181    }
    9282
    9383    if (name == SVGNames::specularExponentAttr) {
    94         m_specularExponent.setValue(value.toFloat());
     84        m_specularExponent->setBaseValInternal(value.toFloat());
    9585        return;
    9686    }
     
    9989        float x, y;
    10090        if (parseNumberOptionalNumber(value, x, y)) {
    101             m_kernelUnitLengthX.setValue(x);
    102             m_kernelUnitLengthY.setValue(y);
     91            m_kernelUnitLengthX->setBaseValInternal(x);
     92            m_kernelUnitLengthY->setBaseValInternal(y);
    10393        }
    10494        return;
  • trunk/Source/WebCore/svg/SVGFESpecularLightingElement.h

    r243185 r243266  
    2424
    2525#include "FESpecularLighting.h"
    26 #include "SVGAnimatedNumber.h"
    2726#include "SVGFELightElement.h"
    2827#include "SVGFilterPrimitiveStandardAttributes.h"
     
    3736
    3837    String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
    39     float specularConstant() const  { return m_specularConstant.currentValue(attributeOwnerProxy()); }
    40     float specularExponent() const { return m_specularExponent.currentValue(attributeOwnerProxy()); }
    41     float surfaceScale() const { return m_surfaceScale.currentValue(attributeOwnerProxy()); }
    42     float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(attributeOwnerProxy()); }
    43     float kernelUnitLengthY() const { return m_kernelUnitLengthY.currentValue(attributeOwnerProxy()); }
     38    float specularConstant() const { return m_specularConstant->currentValue(); }
     39    float specularExponent() const { return m_specularExponent->currentValue(); }
     40    float surfaceScale() const { return m_surfaceScale->currentValue(); }
     41    float kernelUnitLengthX() const { return m_kernelUnitLengthX->currentValue(); }
     42    float kernelUnitLengthY() const { return m_kernelUnitLengthY->currentValue(); }
    4443
    4544    RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); }
    46     RefPtr<SVGAnimatedNumber> specularConstantAnimated() { return m_specularConstant.animatedProperty(attributeOwnerProxy()); }
    47     RefPtr<SVGAnimatedNumber> specularExponentAnimated() { return m_specularExponent.animatedProperty(attributeOwnerProxy()); }
    48     RefPtr<SVGAnimatedNumber> surfaceScaleAnimated() { return m_surfaceScale.animatedProperty(attributeOwnerProxy()); }
    49     RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(attributeOwnerProxy()); }
    50     RefPtr<SVGAnimatedNumber> kernelUnitLengthYAnimated() { return m_kernelUnitLengthY.animatedProperty(attributeOwnerProxy()); }
     45    SVGAnimatedNumber& specularConstantAnimated() { return m_specularConstant; }
     46    SVGAnimatedNumber& specularExponentAnimated() { return m_specularExponent; }
     47    SVGAnimatedNumber& surfaceScaleAnimated() { return m_surfaceScale; }
     48    SVGAnimatedNumber& kernelUnitLengthXAnimated() { return m_kernelUnitLengthX; }
     49    SVGAnimatedNumber& kernelUnitLengthYAnimated() { return m_kernelUnitLengthY; }
    5150
    5251private:
     
    7271    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    7372
    74     static const AtomicString& kernelUnitLengthXIdentifier();
    75     static const AtomicString& kernelUnitLengthYIdentifier();
    76 
    7773    AttributeOwnerProxy m_attributeOwnerProxy { *this };
    7874    PropertyRegistry m_propertyRegistry { *this };
    7975    SVGAnimatedStringAttribute m_in1;
    80     SVGAnimatedNumberAttribute m_specularConstant { 1 };
    81     SVGAnimatedNumberAttribute m_specularExponent { 1 };
    82     SVGAnimatedNumberAttribute m_surfaceScale { 1 };
    83     SVGAnimatedNumberAttribute m_kernelUnitLengthX;
    84     SVGAnimatedNumberAttribute m_kernelUnitLengthY;
     76    Ref<SVGAnimatedNumber> m_specularConstant { SVGAnimatedNumber::create(this, 1) };
     77    Ref<SVGAnimatedNumber> m_specularExponent { SVGAnimatedNumber::create(this, 1) };
     78    Ref<SVGAnimatedNumber> m_surfaceScale { SVGAnimatedNumber::create(this, 1) };
     79    Ref<SVGAnimatedNumber> m_kernelUnitLengthX { SVGAnimatedNumber::create(this) };
     80    Ref<SVGAnimatedNumber> m_kernelUnitLengthY { SVGAnimatedNumber::create(this) };
    8581};
    8682
  • trunk/Source/WebCore/svg/SVGFETurbulenceElement.cpp

    r243185 r243266  
    22 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
    33 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
    4  * Copyright (C) 2018 Apple Inc. All rights reserved.
     4 * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
    55 *
    66 * This library is free software; you can redistribute it and/or
     
    3939    static std::once_flag onceFlag;
    4040    std::call_once(onceFlag, [] {
     41        PropertyRegistry::registerProperty<SVGNames::baseFrequencyAttr, &SVGFETurbulenceElement::m_baseFrequencyX, &SVGFETurbulenceElement::m_baseFrequencyY>();
    4142        PropertyRegistry::registerProperty<SVGNames::numOctavesAttr, &SVGFETurbulenceElement::m_numOctaves>();
     43        PropertyRegistry::registerProperty<SVGNames::seedAttr, &SVGFETurbulenceElement::m_seed>();
    4244    });
    4345}
     
    4850}
    4951
    50 const AtomicString& SVGFETurbulenceElement::baseFrequencyXIdentifier()
    51 {
    52     static NeverDestroyed<AtomicString> s_identifier("SVGBaseFrequencyX", AtomicString::ConstructFromLiteral);
    53     return s_identifier;
    54 }
    55 
    56 const AtomicString& SVGFETurbulenceElement::baseFrequencyYIdentifier()
    57 {
    58     static NeverDestroyed<AtomicString> s_identifier("SVGBaseFrequencyY", AtomicString::ConstructFromLiteral);
    59     return s_identifier;
    60 }
    61 
    6252void SVGFETurbulenceElement::registerAttributes()
    6353{
     
    6555    if (!registry.isEmpty())
    6656        return;
    67     registry.registerAttribute<SVGNames::baseFrequencyAttr,
    68         &SVGFETurbulenceElement::baseFrequencyXIdentifier, &SVGFETurbulenceElement::m_baseFrequencyX,
    69         &SVGFETurbulenceElement::baseFrequencyYIdentifier, &SVGFETurbulenceElement::m_baseFrequencyY>();
    70     registry.registerAttribute<SVGNames::seedAttr, &SVGFETurbulenceElement::m_seed>();
    7157    registry.registerAttribute<SVGNames::stitchTilesAttr, SVGStitchOptions, &SVGFETurbulenceElement::m_stitchTiles>();
    7258    registry.registerAttribute<SVGNames::typeAttr, TurbulenceType, &SVGFETurbulenceElement::m_type>();
     
    9278        float x, y;
    9379        if (parseNumberOptionalNumber(value, x, y)) {
    94             m_baseFrequencyX.setValue(x);
    95             m_baseFrequencyY.setValue(y);
     80            m_baseFrequencyX->setBaseValInternal(x);
     81            m_baseFrequencyY->setBaseValInternal(y);
    9682        }
    9783        return;
     
    9985
    10086    if (name == SVGNames::seedAttr) {
    101         m_seed.setValue(value.toFloat());
     87        m_seed->setBaseValInternal(value.toFloat());
    10288        return;
    10389    }
  • trunk/Source/WebCore/svg/SVGFETurbulenceElement.h

    r243185 r243266  
    2424#include "FETurbulence.h"
    2525#include "SVGAnimatedEnumeration.h"
    26 #include "SVGAnimatedNumber.h"
    2726#include "SVGFilterPrimitiveStandardAttributes.h"
    2827
     
    9897    static Ref<SVGFETurbulenceElement> create(const QualifiedName&, Document&);
    9998
    100     float baseFrequencyX() const { return m_baseFrequencyX.currentValue(attributeOwnerProxy()); }
    101     float baseFrequencyY() const { return m_baseFrequencyY.currentValue(attributeOwnerProxy()); }
     99    float baseFrequencyX() const { return m_baseFrequencyX->currentValue(); }
     100    float baseFrequencyY() const { return m_baseFrequencyY->currentValue(); }
    102101    int numOctaves() const { return m_numOctaves->currentValue(); }
    103     float seed() const { return m_seed.currentValue(attributeOwnerProxy()); }
     102    float seed() const { return m_seed->currentValue(); }
    104103    SVGStitchOptions stitchTiles() const { return m_stitchTiles.currentValue(attributeOwnerProxy()); }
    105104    TurbulenceType type() const { return m_type.currentValue(attributeOwnerProxy()); }
    106105
    107     RefPtr<SVGAnimatedNumber> baseFrequencyXAnimated() { return m_baseFrequencyX.animatedProperty(attributeOwnerProxy()); }
    108     RefPtr<SVGAnimatedNumber> baseFrequencyYAnimated() { return m_baseFrequencyY.animatedProperty(attributeOwnerProxy()); }
     106    SVGAnimatedNumber& baseFrequencyXAnimated() { return m_baseFrequencyX; }
     107    SVGAnimatedNumber& baseFrequencyYAnimated() { return m_baseFrequencyY; }
    109108    SVGAnimatedInteger& numOctavesAnimated() { return m_numOctaves; }
    110     RefPtr<SVGAnimatedNumber> seedAnimated() { return m_seed.animatedProperty(attributeOwnerProxy()); }
     109    SVGAnimatedNumber& seedAnimated() { return m_seed; }
    111110    RefPtr<SVGAnimatedEnumeration> stitchTilesAnimated() { return m_stitchTiles.animatedProperty(attributeOwnerProxy()); }
    112111    RefPtr<SVGAnimatedEnumeration> typeAnimated() { return m_type.animatedProperty(attributeOwnerProxy()); }
     
    134133    RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
    135134
    136     static const AtomicString& baseFrequencyXIdentifier();
    137     static const AtomicString& baseFrequencyYIdentifier();
    138 
    139135    AttributeOwnerProxy m_attributeOwnerProxy { *this };
    140136    PropertyRegistry m_propertyRegistry { *this };
    141     SVGAnimatedNumberAttribute m_baseFrequencyX;
    142     SVGAnimatedNumberAttribute m_baseFrequencyY;
     137    Ref<SVGAnimatedNumber> m_baseFrequencyX { SVGAnimatedNumber::create(this) };
     138    Ref<SVGAnimatedNumber> m_baseFrequencyY { SVGAnimatedNumber::create(this) };
    143139    Ref<SVGAnimatedInteger> m_numOctaves { SVGAnimatedInteger::create(this, 1) };
    144     SVGAnimatedNumberAttribute m_seed;
     140    Ref<SVGAnimatedNumber> m_seed { SVGAnimatedNumber::create(this) };
    145141    SVGAnimatedEnumerationAttribute<SVGStitchOptions> m_stitchTiles { SVG_STITCHTYPE_NOSTITCH };
    146142    SVGAnimatedEnumerationAttribute<TurbulenceType> m_type { TurbulenceType::Turbulence };
  • trunk/Source/WebCore/svg/SVGGeometryElement.cpp

    r234620 r243266  
    2525
    2626#include "DOMPoint.h"
     27#include "RenderSVGResource.h"
     28#include "RenderSVGShape.h"
    2729#include "SVGDocumentExtensions.h"
    2830#include "SVGPathUtilities.h"
     
    3739    : SVGGraphicsElement(tagName, document)
    3840{
    39     registerAttributes();
     41    static std::once_flag onceFlag;
     42    std::call_once(onceFlag, [] {
     43        PropertyRegistry::registerProperty<SVGNames::pathLengthAttr, &SVGGeometryElement::m_pathLength>();
     44    });
    4045}
    4146
     
    8893}
    8994
    90 void SVGGeometryElement::registerAttributes()
    91 {
    92     auto& registry = attributeRegistry();
    93     if (!registry.isEmpty())
    94         return;
    95     registry.registerAttribute<SVGNames::pathLengthAttr, &SVGGeometryElement::m_pathLength>();
    96 }
    97 
    9895void SVGGeometryElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
    9996{
    10097    if (name == SVGNames::pathLengthAttr) {
    101         m_pathLength.setValue(value.toFloat());
    102         if (m_pathLength.value() < 0)
     98        m_pathLength->setBaseValInternal(value.toFloat());
     99        if (m_pathLength->baseVal() < 0)
    103100            document().accessSVGExtensions().reportError("A negative value for path attribute <pathLength> is not allowed");
    104101        return;
  • trunk/Source/WebCore/svg/SVGGeometryElement.h

    r243114 r243266  
    2424
    2525#include "Path.h"
    26 #include "SVGAnimatedNumber.h"
    2726#include "SVGGraphicsElement.h"
    2827#include "SVGNames.h"
     
    4443
    4544    using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGGeometryElement, SVGGraphicsElement>;
    46     static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }
    47 
    4845    using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGeometryElement, SVGGraphicsElement>;
    4946
    50     auto pathLengthAnimated() { return m_pathLength.animatedProperty(attributeOwnerProxy()); }
     47    float pathLength() const { return m_pathLength->currentValue(); }
     48    SVGAnimatedNumber& pathLengthAnimated() { return m_pathLength; }
    5149
    5250protected:
     
    6058
    6159    const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; }
    62     static void registerAttributes();
    63 
    6460    const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; }
    65 
    66     static bool isKnownAttribute(const QualifiedName& attributeName)
    67     {
    68         return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName);
    69     }
    7061
    7162    AttributeOwnerProxy m_attributeOwnerProxy { *this };
    7263    PropertyRegistry m_propertyRegistry { *this };
    73     SVGAnimatedNumberAttribute m_pathLength;
     64    Ref<SVGAnimatedNumber> m_pathLength { SVGAnimatedNumber::create(this) };
    7465};
    7566
  • trunk/Source/WebCore/svg/SVGPathElement.h

    r243121 r243266  
    2323
    2424#include "Path.h"
    25 #include "SVGAnimatedNumber.h"
    2625#include "SVGAnimatedPath.h"
    2726#include "SVGExternalResourcesRequired.h"
  • trunk/Source/WebCore/svg/SVGPathSegListValues.cpp

    r229830 r243266  
    2626
    2727#include "SVGPathElement.h"
     28#include "SVGPathSegWithContext.h"
    2829#include "SVGPathUtilities.h"
    2930
  • trunk/Source/WebCore/svg/SVGStopElement.cpp

    r238094 r243266  
    22 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
    33 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
    4  * Copyright (C) 2018 Apple Inc. All rights reserved.
     4 * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
    55 *
    66 * This library is free software; you can redistribute it and/or
     
    3838{
    3939    ASSERT(hasTagName(SVGNames::stopTag));
    40     registerAttributes();
     40
     41    static std::once_flag onceFlag;
     42    std::call_once(onceFlag, [] {
     43        PropertyRegistry::registerProperty<SVGNames::offsetAttr, &SVGStopElement::m_offset>();
     44    });
    4145}
    4246
     
    4650}
    4751
    48 void SVGStopElement::registerAttributes()
    49 {
    50     auto& registry = attributeRegistry();
    51     if (!registry.isEmpty())
    52         return;
    53     registry.registerAttribute<SVGNames::offsetAttr, &SVGStopElement::m_offset>();
    54 }
    55 
    5652void SVGStopElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
    5753{
    5854    if (name == SVGNames::offsetAttr) {
    5955        if (value.endsWith('%'))
    60             m_offset.setValue(value.string().left(value.length() - 1).toFloat() / 100.0f);
     56            m_offset->setBaseValInternal(value.string().left(value.length() - 1).toFloat() / 100.0f);
    6157        else
    62             m_offset.setValue(value.toFloat());
     58            m_offset->setBaseValInternal(value.toFloat());
    6359        return;
    6460    }
  • trunk/Source/WebCore/svg/SVGStopElement.h

    r243114 r243266  
    2222#pragma once
    2323
    24 #include "SVGAnimatedNumber.h"
    2524#include "SVGElement.h"
    2625
     
    3433    Color stopColorIncludingOpacity() const;
    3534
    36     float offset() { return m_offset.currentValue(attributeOwnerProxy()); }
    37     RefPtr<SVGAnimatedNumber> offsetAnimated() { return m_offset.animatedProperty(attributeOwnerProxy()); }
     35    float offset() const { return m_offset->currentValue(); }
     36    SVGAnimatedNumber& offsetAnimated() { return m_offset; }
    3837
    3938private:
     
    4140
    4241    using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGStopElement, SVGElement>;
    43     static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }
    44     static void registerAttributes();
    4542    const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; }
    4643
    4744    using PropertyRegistry = SVGPropertyOwnerRegistry<SVGStopElement, SVGElement>;
    4845    const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; }
    49 
    50     static bool isKnownAttribute(const QualifiedName& attributeName)
    51     {
    52         return AttributeOwnerProxy::isKnownAttribute(attributeName) || PropertyRegistry::isKnownAttribute(attributeName);
    53     }
    5446
    5547    void parseAttribute(const QualifiedName&, const AtomicString&) final;
     
    6355    AttributeOwnerProxy m_attributeOwnerProxy { *this };
    6456    PropertyRegistry m_propertyRegistry { *this };
    65     SVGAnimatedNumberAttribute m_offset { 0 };
     57    Ref<SVGAnimatedNumber> m_offset { SVGAnimatedNumber::create(0) };
    6658};
    6759
  • trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h

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

    r243185 r243266  
    7777};
    7878
     79class SVGAnimatedNumberAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedNumber, SVGAnimationNumberFunction> {
     80    friend class SVGAnimatedPropertyPairAnimator<SVGAnimatedNumberAnimator, SVGAnimatedNumberAnimator>;
     81    friend class SVGAnimatedNumberPairAnimator;
     82    using Base = SVGAnimatedPropertyAnimator<SVGAnimatedNumber, SVGAnimationNumberFunction>;
     83    using Base::Base;
     84
     85public:
     86    static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedNumber>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     87    {
     88        return std::unique_ptr<SVGAnimatedNumberAnimator>(new SVGAnimatedNumberAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive));
     89    }
     90
     91private:
     92    void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final
     93    {
     94        m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal());
     95    }
     96};
     97
    7998class SVGAnimatedPreserveAspectRatioAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction> {
    8099    using Base = SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction>;
  • trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h

    r243185 r243266  
    3030#include "SVGAnimatedLength.h"
    3131#include "SVGAnimatedLengthList.h"
    32 #include "SVGAnimatedNumber.h"
    3332#include "SVGAnimatedNumberList.h"
    3433#include "SVGAnimatedPointList.h"
     
    4443using SVGAnimatedBoolean = SVGAnimatedPrimitiveProperty<bool>;
    4544using SVGAnimatedInteger = SVGAnimatedPrimitiveProperty<int>;
     45using SVGAnimatedNumber = SVGAnimatedPrimitiveProperty<float>;
    4646
    4747using SVGAnimatedRect = SVGAnimatedValueProperty<SVGRect>;
  • trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessorImpl.h

    r243036 r243266  
    7070};
    7171
     72template<typename OwnerType>
     73class SVGAnimatedNumberPairAccessor final : public SVGAnimatedPropertyPairAccessor<OwnerType, SVGAnimatedNumberAccessor<OwnerType>, SVGAnimatedNumberAccessor<OwnerType>> {
     74    using Base = SVGAnimatedPropertyPairAccessor<OwnerType, SVGAnimatedNumberAccessor<OwnerType>, SVGAnimatedNumberAccessor<OwnerType>>;
     75    using Base::property1;
     76    using Base::property2;
     77
     78public:
     79    using Base::Base;
     80    template<Ref<SVGAnimatedNumber> OwnerType::*property1, Ref<SVGAnimatedNumber> OwnerType::*property2 >
     81    constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedNumberPairAccessor, property1, property2>(); }
     82
     83private:
     84    Optional<String> synchronize(const OwnerType& owner) const final
     85    {
     86        bool dirty1 = property1(owner)->isDirty();
     87        bool dirty2 = property2(owner)->isDirty();
     88        if (!(dirty1 || dirty2))
     89            return WTF::nullopt;
     90
     91        String string1 = dirty1 ? *property1(owner)->synchronize() : property1(owner)->baseValAsString();
     92        String string2 = dirty2 ? *property2(owner)->synchronize() : property2(owner)->baseValAsString();
     93        return string1 == string2 ? string1 : string1 + ", " + string2;
     94    }
     95
     96    std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
     97    {
     98        return SVGAnimatedNumberPairAnimator::create(attributeName, property1(owner), property2(owner), animationMode, calcMode, isAccumulated, isAdditive);
     99    }
     100
     101    void appendAnimatedInstance(OwnerType& owner, SVGAttributeAnimator& animator) const final
     102    {
     103        static_cast<SVGAnimatedNumberPairAnimator&>(animator).appendAnimatedInstance(property1(owner), property2(owner));
     104    }
     105};
     106
    72107}
  • trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h

    r243036 r243266  
    7777};
    7878
     79class SVGAnimatedNumberPairAnimator final : public SVGAnimatedPropertyPairAnimator<SVGAnimatedNumberAnimator, SVGAnimatedNumberAnimator> {
     80    using Base = SVGAnimatedPropertyPairAnimator<SVGAnimatedNumberAnimator, SVGAnimatedNumberAnimator>;
     81    using Base::Base;
     82
     83public:
     84    static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedNumber>& animated1, Ref<SVGAnimatedNumber>& animated2, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     85    {
     86        return std::unique_ptr<SVGAnimatedNumberPairAnimator>(new SVGAnimatedNumberPairAnimator(attributeName, animated1, animated2, animationMode, calcMode, isAccumulated, isAdditive));
     87    }
     88
     89private:
     90    void setFromAndToValues(SVGElement*, const String& from, const String& to) final
     91    {
     92        auto pairFrom = SVGPropertyTraits<std::pair<float, float>>::fromString(from);
     93        auto pairTo = SVGPropertyTraits<std::pair<float, float>>::fromString(to);
     94       
     95        m_animatedPropertyAnimator1->m_function.m_from = pairFrom.first;
     96        m_animatedPropertyAnimator1->m_function.m_to = pairTo.first;
     97       
     98        m_animatedPropertyAnimator2->m_function.m_from = pairFrom.second;
     99        m_animatedPropertyAnimator2->m_function.m_to = pairTo.second;
     100    }
     101
     102    void setFromAndByValues(SVGElement*, const String& from, const String& by) final
     103    {
     104        auto pairFrom = SVGPropertyTraits<std::pair<float, float>>::fromString(from);
     105        auto pairBy = SVGPropertyTraits<std::pair<float, float>>::fromString(by);
     106       
     107        m_animatedPropertyAnimator1->m_function.m_from = pairFrom.first;
     108        m_animatedPropertyAnimator1->m_function.m_to = pairFrom.first + pairBy.first;
     109       
     110        m_animatedPropertyAnimator2->m_function.m_from = pairFrom.second;
     111        m_animatedPropertyAnimator2->m_function.m_to = pairFrom.second + pairBy.second;
     112    }
     113
     114    void setToAtEndOfDurationValue(const String& toAtEndOfDuration) final
     115    {
     116        auto pairToAtEndOfDuration = SVGPropertyTraits<std::pair<float, float>>::fromString(toAtEndOfDuration);
     117        m_animatedPropertyAnimator1->m_function.m_toAtEndOfDuration = pairToAtEndOfDuration.first;
     118        m_animatedPropertyAnimator2->m_function.m_toAtEndOfDuration = pairToAtEndOfDuration.second;
     119    }
     120};
     121
    79122}
  • trunk/Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.h

    r243259 r243266  
    121121    }
    122122};
    123    
     123
     124class SVGAnimationNumberFunction : public SVGAnimationAdditiveValueFunction<float> {
     125    friend class SVGAnimatedNumberPairAnimator;
     126
     127public:
     128    using Base = SVGAnimationAdditiveValueFunction<float>;
     129    using Base::Base;
     130
     131    void setFromAndToValues(SVGElement*, const String& from, const String& to) override
     132    {
     133        m_from = SVGPropertyTraits<float>::fromString(from);
     134        m_to = SVGPropertyTraits<float>::fromString(to);
     135    }
     136
     137    void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override
     138    {
     139        m_toAtEndOfDuration = SVGPropertyTraits<float>::fromString(toAtEndOfDuration);
     140    }
     141
     142    void progress(SVGElement*, float percentage, unsigned repeatCount, float& animated)
     143    {
     144        float from = m_animationMode == AnimationMode::To ? animated : m_from;
     145        animated = Base::progress(percentage, repeatCount, from, m_to, toAtEndOfDuration(), animated);
     146    }
     147
     148    float calculateDistance(SVGElement*, const String& from, const String& to) const override
     149    {
     150        float fromNumber = 0;
     151        float toNumber = 0;
     152        parseNumberFromString(from, fromNumber);
     153        parseNumberFromString(to, toNumber);
     154        return fabsf(toNumber - fromNumber);
     155    }
     156
     157private:
     158    void addFromAndToValues(SVGElement*) override
     159    {
     160        m_to += m_from;
     161    }
     162};
     163
    124164class SVGAnimationRectFunction : public SVGAnimationAdditiveValueFunction<FloatRect> {
    125165public:
  • trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h

    r243185 r243266  
    2929#include "SVGAnimatedLength.h"
    3030#include "SVGAnimatedLengthList.h"
    31 #include "SVGAnimatedNumber.h"
    3231#include "SVGAnimatedNumberList.h"
    3332#include "SVGAnimatedPointList.h"
     
    7574    }
    7675
    77     template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedNumberAttribute OwnerType::*attribute>
    78     void registerAttribute()
    79     {
    80         registerAttribute(SVGAnimatedNumberAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());
    81     }
    82 
    8376    template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedNumberListAttribute OwnerType::*attribute>
    8477    void registerAttribute()
    8578    {
    8679        registerAttribute(SVGAnimatedNumberListAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());
    87     }
    88 
    89     template<const LazyNeverDestroyed<const QualifiedName>& attributeName,
    90         const AtomicString& (*identifier)(), SVGAnimatedNumberAttribute OwnerType::*attribute,
    91         const AtomicString& (*optionalIdentifier)(), SVGAnimatedNumberAttribute OwnerType::*optionalAttribute>
    92     void registerAttribute()
    93     {
    94         registerAttribute(SVGAnimatedOptionalNumberAttributeAccessor<OwnerType>::template singleton<attributeName, identifier, attribute, optionalIdentifier, optionalAttribute>());
    9580    }
    9681
  • trunk/Source/WebCore/svg/properties/SVGPrimitivePropertyAnimatorImpl.h

    r243259 r243266  
    2626#pragma once
    2727
    28 #include "SVGAnimationFunction.h"
     28#include "SVGAnimationAdditiveValueFunctionImpl.h"
    2929#include "SVGPrimitivePropertyAnimator.h"
    3030
     
    3232
    3333using SVGColorAnimator = SVGPrimitivePropertyAnimator<Color, SVGAnimationColorFunction>;
     34using SVGNumberAnimator = SVGPrimitivePropertyAnimator<float, SVGAnimationNumberFunction>;
    3435
    3536}
  • trunk/Source/WebCore/svg/properties/SVGPropertyAnimatorFactory.h

    r243259 r243266  
    8181    }
    8282
     83    static auto createNumberAnimator(const QualifiedName& attributeName, Ref<SVGProperty>&& property, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
     84    {
     85        return SVGNumberAnimator::create(attributeName,  WTFMove(property), animationMode, calcMode, isAccumulated, isAdditive);
     86    }
     87
    8388    static const AttributeAnimatorCreator& attributeAnimatorCreator()
    8489    {
     
    9095            { SVGNames::stop_colorAttr->impl(),     std::make_pair(SVGValueProperty<Color>::create, SVGPropertyAnimatorFactory::createColorAnimator) },
    9196            { SVGNames::strokeAttr->impl(),         std::make_pair(SVGValueProperty<Color>::create, SVGPropertyAnimatorFactory::createColorAnimator) },
     97
     98            { SVGNames::fill_opacityAttr->impl(),       std::make_pair(SVGValueProperty<float>::create, SVGPropertyAnimatorFactory::createNumberAnimator) },
     99            { SVGNames::flood_opacityAttr->impl(),      std::make_pair(SVGValueProperty<float>::create, SVGPropertyAnimatorFactory::createNumberAnimator) },
     100            { SVGNames::opacityAttr->impl(),            std::make_pair(SVGValueProperty<float>::create, SVGPropertyAnimatorFactory::createNumberAnimator) },
     101            { SVGNames::stop_opacityAttr->impl(),       std::make_pair(SVGValueProperty<float>::create, SVGPropertyAnimatorFactory::createNumberAnimator) },
     102            { SVGNames::stroke_miterlimitAttr->impl(),  std::make_pair(SVGValueProperty<float>::create, SVGPropertyAnimatorFactory::createNumberAnimator) },
     103            { SVGNames::stroke_opacityAttr->impl(),     std::make_pair(SVGValueProperty<float>::create, SVGPropertyAnimatorFactory::createNumberAnimator) },
    92104        });
    93105        return map;
  • trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h

    r243185 r243266  
    6161        registerProperty(attributeName, SVGAnimatedIntegerAccessor<OwnerType>::template singleton<property>());
    6262    }
    63    
     63
     64    template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedNumber> OwnerType::*property>
     65    static void registerProperty()
     66    {
     67        registerProperty(attributeName, SVGAnimatedNumberAccessor<OwnerType>::template singleton<property>());
     68    }
     69
    6470    template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedPreserveAspectRatio> OwnerType::*property>
    6571    static void registerProperty()
     
    7985        registerProperty(attributeName, SVGAnimatedIntegerPairAccessor<OwnerType>::template singleton<property1, property2>());
    8086    }
     87
     88    template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedNumber> OwnerType::*property1, Ref<SVGAnimatedNumber> OwnerType::*property2>
     89    static void registerProperty()
     90    {
     91        registerProperty(attributeName, SVGAnimatedNumberPairAccessor<OwnerType>::template singleton<property1, property2>());
     92    }
     93
    8194    // Enumerate all the SVGMemberAccessors recursively. The functor will be called and will
    8295    // be given the pair<QualifiedName, SVGMemberAccessor> till the functor returns false.
Note: See TracChangeset for help on using the changeset viewer.