Changeset 243266 in webkit
- Timestamp:
- Mar 20, 2019 5:35:50 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 deleted
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r243263 r243266 16 16 * animation/DocumentTimeline.cpp: 17 17 (WebCore::DocumentTimeline::getAnimations const): 18 19 2019-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): 18 201 19 202 2019-03-20 Said Abou-Hallawa <sabouhallawa@apple.com> -
trunk/Source/WebCore/Sources.txt
r243259 r243266 2274 2274 svg/SVGAnimatedLength.cpp 2275 2275 svg/SVGAnimatedLengthList.cpp 2276 svg/SVGAnimatedNumber.cpp2277 2276 svg/SVGAnimatedNumberList.cpp 2278 svg/SVGAnimatedNumberOptionalNumber.cpp2279 2277 svg/SVGAnimatedPath.cpp 2280 2278 svg/SVGAnimatedPointList.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r243259 r243266 281 281 089A8E07128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 089A8E06128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h */; }; 282 282 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 */; };284 283 08B35B17127B6A88005314DD /* SVGAnimatedNumberList.h in Headers */ = {isa = PBXBuildFile; fileRef = 08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */; }; 285 284 08C7A2C710DC7462002D368B /* SVGNames.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 656581E909D1508D000E61D7 /* SVGNames.h */; }; … … 1176 1175 427DA71E13735DFA007C57FB /* JSServiceWorkerInternals.h in Headers */ = {isa = PBXBuildFile; fileRef = 427DA71C13735DFA007C57FB /* JSServiceWorkerInternals.h */; }; 1177 1176 43107BE218CC19DE00CC18E8 /* SelectorPseudoTypeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 43107BE118CC19DE00CC18E8 /* SelectorPseudoTypeMap.h */; }; 1178 431A2F9C13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 431A2F9A13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h */; };1179 1177 432D3FE818A8658400D7DC03 /* SelectorCheckerTestFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 432D3FE718A8658400D7DC03 /* SelectorCheckerTestFunctions.h */; }; 1180 1178 4358E87D1360A2EE00E4748C /* JSSVGFEDropShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4358E87B1360A2EE00E4748C /* JSSVGFEDropShadowElement.h */; }; … … 5660 5658 08A484750E5272C500C3FE76 /* ScriptElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptElement.cpp; sourceTree = "<group>"; }; 5661 5659 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>"; };5663 5660 08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedNumberList.h; sourceTree = "<group>"; }; 5664 5661 08C925170FCC7C4A00480DEC /* FilterEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FilterEffect.cpp; sourceTree = "<group>"; }; … … 7574 7571 427DA71C13735DFA007C57FB /* JSServiceWorkerInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSServiceWorkerInternals.h; sourceTree = "<group>"; }; 7575 7572 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>"; };7578 7573 431A2FD613B7707A007791E4 /* SVGAnimatedLengthList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedLengthList.cpp; sourceTree = "<group>"; }; 7579 7574 432D3FE718A8658400D7DC03 /* SelectorCheckerTestFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorCheckerTestFunctions.h; sourceTree = "<group>"; }; … … 7670 7665 439D334113A6911C00C20F4F /* SVGAnimatedTypeAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTypeAnimator.h; sourceTree = "<group>"; }; 7671 7666 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>"; };7673 7667 43A6266613B3D11000AC94B8 /* SVGAnimatedString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedString.cpp; sourceTree = "<group>"; }; 7674 7668 43B85ED018CBEACE00E31AF4 /* makeSelectorPseudoClassAndCompatibilityElementMap.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = makeSelectorPseudoClassAndCompatibilityElementMap.py; sourceTree = "<group>"; }; … … 24147 24141 089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */, 24148 24142 B22277EB0D00BF1F0071B782 /* SVGAnimatedLengthList.idl */, 24149 43A0F0B013AC7D6D00A5F0A7 /* SVGAnimatedNumber.cpp */,24150 08B35B12127B6A7C005314DD /* SVGAnimatedNumber.h */,24151 24143 B22277EC0D00BF1F0071B782 /* SVGAnimatedNumber.idl */, 24152 24144 4331AC7713B6870000A9E5AE /* SVGAnimatedNumberList.cpp */, 24153 24145 08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */, 24154 24146 B22277ED0D00BF1F0071B782 /* SVGAnimatedNumberList.idl */, 24155 431A2F9B13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp */,24156 431A2F9A13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h */,24157 24147 0863951313B5FE5700BB344D /* SVGAnimatedPath.cpp */, 24158 24148 0863951413B5FE5700BB344D /* SVGAnimatedPath.h */, … … 31932 31922 089021AD126EF5E90092D5EA /* SVGAnimatedLengthList.h in Headers */, 31933 31923 088A0E04126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h in Headers */, 31934 08B35B13127B6A7C005314DD /* SVGAnimatedNumber.h in Headers */,31935 31924 08B35B17127B6A88005314DD /* SVGAnimatedNumberList.h in Headers */, 31936 431A2F9C13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h in Headers */,31937 31925 0863951613B5FE5700BB344D /* SVGAnimatedPath.h in Headers */, 31938 31926 089A8E07128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h in Headers */, -
trunk/Source/WebCore/svg/SVGAnimatedLength.cpp
r242970 r243266 23 23 24 24 #include "SVGAnimateElementBase.h" 25 #include "SVGAnimatedNumber.h"26 25 27 26 namespace WebCore { -
trunk/Source/WebCore/svg/SVGAnimatedLengthList.cpp
r242970 r243266 22 22 23 23 #include "SVGAnimateElementBase.h" 24 #include "SVGAnimatedNumber.h"25 24 26 25 namespace WebCore { -
trunk/Source/WebCore/svg/SVGAnimatedNumberList.cpp
r242970 r243266 23 23 24 24 #include "SVGAnimateElementBase.h" 25 #include "SVGAnimatedNumber.h"26 25 27 26 namespace WebCore { -
trunk/Source/WebCore/svg/SVGAnimatedTransformList.cpp
r242970 r243266 26 26 27 27 #include "SVGAnimateTransformElement.h" 28 #include "SVGAnimatedNumber.h"29 28 #include "SVGNames.h" 30 29 #include "SVGTransformDistance.h" -
trunk/Source/WebCore/svg/SVGAnimatorFactory.h
r243259 r243266 24 24 #include "SVGAnimatedLength.h" 25 25 #include "SVGAnimatedLengthList.h" 26 #include "SVGAnimatedNumber.h"27 26 #include "SVGAnimatedNumberList.h" 28 #include "SVGAnimatedNumberOptionalNumber.h"29 27 #include "SVGAnimatedPath.h" 30 28 #include "SVGAnimatedPointList.h" … … 48 46 case AnimatedInteger: 49 47 case AnimatedIntegerOptionalInteger: 48 case AnimatedNumber: 49 case AnimatedNumberOptionalNumber: 50 50 case AnimatedPreserveAspectRatio: 51 51 case AnimatedRect: … … 60 60 case AnimatedLengthList: 61 61 return std::make_unique<SVGAnimatedLengthListAnimator>(animationElement, contextElement); 62 case AnimatedNumber:63 return std::make_unique<SVGAnimatedNumberAnimator>(animationElement, contextElement);64 62 case AnimatedNumberList: 65 63 return std::make_unique<SVGAnimatedNumberListAnimator>(animationElement, contextElement); 66 case AnimatedNumberOptionalNumber:67 return std::make_unique<SVGAnimatedNumberOptionalNumberAnimator>(animationElement, contextElement);68 64 case AnimatedPath: 69 65 return std::make_unique<SVGAnimatedPathAnimator>(animationElement, contextElement); -
trunk/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp
r234620 r243266 2 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * 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. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 37 37 { 38 38 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 }); 39 48 } 40 49 … … 46 55 registry.registerAttribute<SVGNames::typeAttr, ComponentTransferType, &SVGComponentTransferFunctionElement::m_type>(); 47 56 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>();53 57 } 54 58 … … 71 75 72 76 if (name == SVGNames::slopeAttr) { 73 m_slope .setValue(value.toFloat());77 m_slope->setBaseValInternal(value.toFloat()); 74 78 return; 75 79 } 76 80 77 81 if (name == SVGNames::interceptAttr) { 78 m_intercept .setValue(value.toFloat());82 m_intercept->setBaseValInternal(value.toFloat()); 79 83 return; 80 84 } 81 85 82 86 if (name == SVGNames::amplitudeAttr) { 83 m_amplitude .setValue(value.toFloat());87 m_amplitude->setBaseValInternal(value.toFloat()); 84 88 return; 85 89 } 86 90 87 91 if (name == SVGNames::exponentAttr) { 88 m_exponent .setValue(value.toFloat());92 m_exponent->setBaseValInternal(value.toFloat()); 89 93 return; 90 94 } 91 95 92 96 if (name == SVGNames::offsetAttr) { 93 m_offset .setValue(value.toFloat());97 m_offset->setBaseValInternal(value.toFloat()); 94 98 return; 95 99 } -
trunk/Source/WebCore/svg/SVGComponentTransferFunctionElement.h
r243114 r243266 24 24 #include "FEComponentTransfer.h" 25 25 #include "SVGAnimatedEnumeration.h" 26 #include "SVGAnimatedNumber.h"27 26 #include "SVGAnimatedNumberList.h" 28 27 #include "SVGElement.h" … … 78 77 ComponentTransferType type() const { return m_type.currentValue(attributeOwnerProxy()); } 79 78 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(); } 85 84 86 85 RefPtr<SVGAnimatedEnumeration> typeAnimated() { return m_type.animatedProperty(attributeOwnerProxy()); } 87 86 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; } 93 92 94 93 protected: … … 118 117 SVGAnimatedEnumerationAttribute<ComponentTransferType> m_type { FECOMPONENTTRANSFER_TYPE_IDENTITY }; 119 118 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) }; 125 124 }; 126 125 -
trunk/Source/WebCore/svg/SVGFECompositeElement.cpp
r243185 r243266 2 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * 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. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 37 37 ASSERT(hasTagName(SVGNames::feCompositeTag)); 38 38 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 }); 39 47 } 40 48 … … 52 60 registry.registerAttribute<SVGNames::in2Attr, &SVGFECompositeElement::m_in2>(); 53 61 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>();58 62 } 59 63 … … 78 82 79 83 if (name == SVGNames::k1Attr) { 80 m_k1 .setValue(value.toFloat());84 m_k1->setBaseValInternal(value.toFloat()); 81 85 return; 82 86 } 83 87 84 88 if (name == SVGNames::k2Attr) { 85 m_k2 .setValue(value.toFloat());89 m_k2->setBaseValInternal(value.toFloat()); 86 90 return; 87 91 } 88 92 89 93 if (name == SVGNames::k3Attr) { 90 m_k3 .setValue(value.toFloat());94 m_k3->setBaseValInternal(value.toFloat()); 91 95 return; 92 96 } 93 97 94 98 if (name == SVGNames::k4Attr) { 95 m_k4 .setValue(value.toFloat());99 m_k4->setBaseValInternal(value.toFloat()); 96 100 return; 97 101 } -
trunk/Source/WebCore/svg/SVGFECompositeElement.h
r243185 r243266 24 24 #include "FEComposite.h" 25 25 #include "SVGAnimatedEnumeration.h" 26 #include "SVGAnimatedNumber.h"27 26 #include "SVGFilterPrimitiveStandardAttributes.h" 28 27 … … 89 88 String in2() const { return m_in2.currentValue(attributeOwnerProxy()); } 90 89 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(); } 95 94 96 95 RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } 97 96 RefPtr<SVGAnimatedString> in2Animated() { return m_in2.animatedProperty(attributeOwnerProxy()); } 98 97 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; } 103 102 104 103 private: … … 129 128 SVGAnimatedStringAttribute m_in2; 130 129 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) }; 135 134 }; 136 135 -
trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp
r243185 r243266 45 45 std::call_once(onceFlag, [] { 46 46 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>(); 47 49 PropertyRegistry::registerProperty<SVGNames::targetXAttr, &SVGFEConvolveMatrixElement::m_targetX>(); 48 50 PropertyRegistry::registerProperty<SVGNames::targetYAttr, &SVGFEConvolveMatrixElement::m_targetY>(); 51 PropertyRegistry::registerProperty<SVGNames::kernelUnitLengthAttr, &SVGFEConvolveMatrixElement::m_kernelUnitLengthX, &SVGFEConvolveMatrixElement::m_kernelUnitLengthY>(); 49 52 PropertyRegistry::registerProperty<SVGNames::preserveAlphaAttr, &SVGFEConvolveMatrixElement::m_preserveAlpha>(); 50 53 }); … … 56 59 } 57 60 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 70 61 void SVGFEConvolveMatrixElement::registerAttributes() 71 62 { … … 75 66 registry.registerAttribute<SVGNames::inAttr, &SVGFEConvolveMatrixElement::m_in1>(); 76 67 registry.registerAttribute<SVGNames::kernelMatrixAttr, &SVGFEConvolveMatrixElement::m_kernelMatrix>(); 77 registry.registerAttribute<SVGNames::divisorAttr, &SVGFEConvolveMatrixElement::m_divisor>();78 registry.registerAttribute<SVGNames::biasAttr, &SVGFEConvolveMatrixElement::m_bias>();79 68 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>();83 69 } 84 70 … … 120 106 float divisor = value.toFloat(); 121 107 if (divisor) 122 m_divisor .setValue(divisor);108 m_divisor->setBaseValInternal(divisor); 123 109 else 124 110 document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing divisor=\"" + value + "\". Filtered element will not be displayed."); … … 127 113 128 114 if (name == SVGNames::biasAttr) { 129 m_bias .setValue(value.toFloat());115 m_bias->setBaseValInternal(value.toFloat()); 130 116 return; 131 117 } … … 144 130 float x, y; 145 131 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); 148 134 } else 149 135 document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing kernelUnitLength=\"" + value + "\". Filtered element will not be displayed."); … … 195 181 void SVGFEConvolveMatrixElement::setKernelUnitLength(float x, float y) 196 182 { 197 m_kernelUnitLengthX .setValue(x);198 m_kernelUnitLengthY .setValue(y);183 m_kernelUnitLengthX->setBaseValInternal(x); 184 m_kernelUnitLengthY->setBaseValInternal(y); 199 185 invalidate(); 200 186 } -
trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.h
r243185 r243266 72 72 int orderY() const { return m_orderY->currentValue(); } 73 73 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(); } 76 76 int targetX() const { return m_targetX->currentValue(); } 77 77 int targetY() const { return m_targetY->currentValue(); } 78 78 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(); } 81 81 bool preserveAlpha() const { return m_preserveAlpha->currentValue(); } 82 82 … … 85 85 SVGAnimatedInteger& orderYAnimated() { return m_orderY; } 86 86 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; } 89 89 SVGAnimatedInteger& targetXAnimated() { return m_targetX; } 90 90 SVGAnimatedInteger& targetYAnimated() { return m_targetY; } 91 91 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; } 94 94 SVGAnimatedBoolean& preserveAlphaAnimated() { return m_preserveAlpha; } 95 95 … … 116 116 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 117 117 118 static const AtomicString& kernelUnitLengthXIdentifier();119 static const AtomicString& kernelUnitLengthYIdentifier();120 121 118 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 122 119 PropertyRegistry m_propertyRegistry { *this }; … … 125 122 Ref<SVGAnimatedInteger> m_orderY { SVGAnimatedInteger::create(this) }; 126 123 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) }; 129 126 Ref<SVGAnimatedInteger> m_targetX { SVGAnimatedInteger::create(this) }; 130 127 Ref<SVGAnimatedInteger> m_targetY { SVGAnimatedInteger::create(this) }; 131 128 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) }; 134 131 Ref<SVGAnimatedBoolean> m_preserveAlpha { SVGAnimatedBoolean::create(this) }; 135 132 }; -
trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
r243185 r243266 40 40 ASSERT(hasTagName(SVGNames::feDiffuseLightingTag)); 41 41 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 }); 42 49 } 43 50 … … 45 52 { 46 53 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;59 54 } 60 55 … … 65 60 return; 66 61 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>();72 62 } 73 63 … … 80 70 81 71 if (name == SVGNames::surfaceScaleAttr) { 82 m_surfaceScale .setValue(value.toFloat());72 m_surfaceScale->setBaseValInternal(value.toFloat()); 83 73 return; 84 74 } 85 75 86 76 if (name == SVGNames::diffuseConstantAttr) { 87 m_diffuseConstant .setValue(value.toFloat());77 m_diffuseConstant->setBaseValInternal(value.toFloat()); 88 78 return; 89 79 } … … 92 82 float x, y; 93 83 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); 96 86 } 97 87 return; -
trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.h
r243185 r243266 38 38 39 39 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(); } 44 44 45 45 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; } 50 50 51 51 private: … … 71 71 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 72 72 73 static const AtomicString& kernelUnitLengthXIdentifier();74 static const AtomicString& kernelUnitLengthYIdentifier();75 76 73 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 77 74 PropertyRegistry m_propertyRegistry { *this }; 78 75 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) }; 83 80 }; 84 81 -
trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp
r243185 r243266 1 1 /* 2 2 * 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. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 36 36 ASSERT(hasTagName(SVGNames::feDisplacementMapTag)); 37 37 registerAttributes(); 38 39 static std::once_flag onceFlag; 40 std::call_once(onceFlag, [] { 41 PropertyRegistry::registerProperty<SVGNames::scaleAttr, &SVGFEDisplacementMapElement::m_scale>(); 42 }); 38 43 } 39 44 … … 52 57 registry.registerAttribute<SVGNames::xChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_xChannelSelector>(); 53 58 registry.registerAttribute<SVGNames::yChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_yChannelSelector>(); 54 registry.registerAttribute<SVGNames::scaleAttr, &SVGFEDisplacementMapElement::m_scale>();55 59 } 56 60 … … 82 86 83 87 if (name == SVGNames::scaleAttr) { 84 m_scale .setValue(value.toFloat());88 m_scale->setBaseValInternal(value.toFloat()); 85 89 return; 86 90 } -
trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.h
r243185 r243266 23 23 #include "FEDisplacementMap.h" 24 24 #include "SVGAnimatedEnumeration.h" 25 #include "SVGAnimatedNumber.h"26 25 #include "SVGFilterPrimitiveStandardAttributes.h" 27 26 … … 76 75 ChannelSelectorType xChannelSelector() const { return m_xChannelSelector.currentValue(attributeOwnerProxy()); } 77 76 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(); } 79 78 80 79 RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } … … 82 81 RefPtr<SVGAnimatedEnumeration> xChannelSelectorAnimated() { return m_xChannelSelector.animatedProperty(attributeOwnerProxy()); } 83 82 RefPtr<SVGAnimatedEnumeration> yChannelSelectorAnimated() { return m_yChannelSelector.animatedProperty(attributeOwnerProxy()); } 84 RefPtr<SVGAnimatedNumber> scaleAnimated() { return m_scale.animatedProperty(attributeOwnerProxy()); }83 SVGAnimatedNumber& scaleAnimated() { return m_scale; } 85 84 86 85 private: … … 112 111 SVGAnimatedEnumerationAttribute<ChannelSelectorType> m_xChannelSelector { CHANNEL_A }; 113 112 SVGAnimatedEnumerationAttribute<ChannelSelectorType> m_yChannelSelector { CHANNEL_A }; 114 SVGAnimatedNumberAttribute m_scale;113 Ref<SVGAnimatedNumber> m_scale { SVGAnimatedNumber::create(this) }; 115 114 }; 116 115 -
trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp
r243185 r243266 1 1 /* 2 2 * 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. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 38 38 ASSERT(hasTagName(SVGNames::feDropShadowTag)); 39 39 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 }); 40 47 } 41 48 … … 45 52 } 46 53 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 59 54 void SVGFEDropShadowElement::setStdDeviation(float x, float y) 60 55 { 61 m_stdDeviationX .setValue(x);62 m_stdDeviationY .setValue(y);56 m_stdDeviationX->setBaseValInternal(x); 57 m_stdDeviationY->setBaseValInternal(y); 63 58 invalidate(); 64 59 } … … 70 65 return; 71 66 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>();77 67 } 78 68 … … 82 72 float x, y; 83 73 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); 86 76 } 87 77 return; … … 94 84 95 85 if (name == SVGNames::dxAttr) { 96 m_dx .setValue(value.toFloat());86 m_dx->setBaseValInternal(value.toFloat()); 97 87 return; 98 88 } 99 89 100 90 if (name == SVGNames::dyAttr) { 101 m_dy .setValue(value.toFloat());91 m_dy->setBaseValInternal(value.toFloat()); 102 92 return; 103 93 } -
trunk/Source/WebCore/svg/SVGFEDropShadowElement.h
r243185 r243266 22 22 23 23 #include "FEDropShadow.h" 24 #include "SVGAnimatedNumber.h"25 24 #include "SVGFilterPrimitiveStandardAttributes.h" 26 25 … … 35 34 36 35 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(); } 41 40 42 41 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; } 47 46 48 47 private: … … 67 66 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 68 67 69 static const AtomicString& stdDeviationXIdentifier();70 static const AtomicString& stdDeviationYIdentifier();71 72 68 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 73 69 PropertyRegistry m_propertyRegistry { *this }; 74 70 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) }; 79 75 }; 80 76 -
trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp
r243185 r243266 2 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * 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. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 38 38 ASSERT(hasTagName(SVGNames::feGaussianBlurTag)); 39 39 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 }); 40 45 } 41 46 … … 45 50 } 46 51 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 59 52 void SVGFEGaussianBlurElement::setStdDeviation(float x, float y) 60 53 { 61 m_stdDeviationX .setValue(x);62 m_stdDeviationY .setValue(y);54 m_stdDeviationX->setBaseValInternal(x); 55 m_stdDeviationY->setBaseValInternal(y); 63 56 invalidate(); 64 57 } … … 70 63 return; 71 64 registry.registerAttribute<SVGNames::inAttr, &SVGFEGaussianBlurElement::m_in1>(); 72 registry.registerAttribute<SVGNames::stdDeviationAttr,73 &SVGFEGaussianBlurElement::stdDeviationXIdentifier, &SVGFEGaussianBlurElement::m_stdDeviationX,74 &SVGFEGaussianBlurElement::stdDeviationYIdentifier, &SVGFEGaussianBlurElement::m_stdDeviationY>();75 65 registry.registerAttribute<SVGNames::edgeModeAttr, EdgeModeType, &SVGFEGaussianBlurElement::m_edgeMode>(); 76 66 } … … 81 71 float x, y; 82 72 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); 85 75 } 86 76 return; -
trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.h
r243185 r243266 24 24 #include "FEGaussianBlur.h" 25 25 #include "SVGAnimatedEnumeration.h" 26 #include "SVGAnimatedNumber.h"27 26 #include "SVGFEConvolveMatrixElement.h" 28 27 #include "SVGFilterPrimitiveStandardAttributes.h" … … 38 37 39 38 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(); } 42 41 EdgeModeType edgeMode() const { return m_edgeMode.currentValue(attributeOwnerProxy()); } 43 42 44 43 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; } 47 46 RefPtr<SVGAnimatedEnumeration> edgeModeAnimated() { return m_edgeMode.animatedProperty(attributeOwnerProxy()); } 48 47 … … 68 67 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 69 68 70 static const AtomicString& stdDeviationXIdentifier();71 static const AtomicString& stdDeviationYIdentifier();72 73 69 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 74 70 PropertyRegistry m_propertyRegistry { *this }; 75 71 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) }; 78 74 SVGAnimatedEnumerationAttribute<EdgeModeType> m_edgeMode { EDGEMODE_NONE }; 79 75 }; -
trunk/Source/WebCore/svg/SVGFELightElement.cpp
r234620 r243266 3 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 4 4 * 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. 6 6 * 7 7 * This library is free software; you can redistribute it and/or … … 44 44 : SVGElement(tagName, document) 45 45 { 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 }); 47 59 } 48 60 … … 56 68 } 57 69 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 75 70 void SVGFELightElement::parseAttribute(const QualifiedName& name, const AtomicString& value) 76 71 { 77 72 if (name == SVGNames::azimuthAttr) { 78 m_azimuth .setValue(value.toFloat());73 m_azimuth->setBaseValInternal(value.toFloat()); 79 74 return; 80 75 } 81 76 82 77 if (name == SVGNames::elevationAttr) { 83 m_elevation .setValue(value.toFloat());78 m_elevation->setBaseValInternal(value.toFloat()); 84 79 return; 85 80 } 86 81 87 82 if (name == SVGNames::xAttr) { 88 m_x .setValue(value.toFloat());83 m_x->setBaseValInternal(value.toFloat()); 89 84 return; 90 85 } 91 86 92 87 if (name == SVGNames::yAttr) { 93 m_y .setValue(value.toFloat());88 m_y->setBaseValInternal(value.toFloat()); 94 89 return; 95 90 } 96 91 97 92 if (name == SVGNames::zAttr) { 98 m_z .setValue(value.toFloat());93 m_z->setBaseValInternal(value.toFloat()); 99 94 return; 100 95 } 101 96 102 97 if (name == SVGNames::pointsAtXAttr) { 103 m_pointsAtX .setValue(value.toFloat());98 m_pointsAtX->setBaseValInternal(value.toFloat()); 104 99 return; 105 100 } 106 101 107 102 if (name == SVGNames::pointsAtYAttr) { 108 m_pointsAtY .setValue(value.toFloat());103 m_pointsAtY->setBaseValInternal(value.toFloat()); 109 104 return; 110 105 } 111 106 112 107 if (name == SVGNames::pointsAtZAttr) { 113 m_pointsAtZ .setValue(value.toFloat());108 m_pointsAtZ->setBaseValInternal(value.toFloat()); 114 109 return; 115 110 } 116 111 117 112 if (name == SVGNames::specularExponentAttr) { 118 m_specularExponent .setValue(value.toFloat());113 m_specularExponent->setBaseValInternal(value.toFloat()); 119 114 return; 120 115 } 121 116 122 117 if (name == SVGNames::limitingConeAngleAttr) { 123 m_limitingConeAngle .setValue(value.toFloat());118 m_limitingConeAngle->setBaseValInternal(value.toFloat()); 124 119 return; 125 120 } … … 130 125 void SVGFELightElement::svgAttributeChanged(const QualifiedName& attrName) 131 126 { 132 if ( isKnownAttribute(attrName)) {127 if (PropertyRegistry::isKnownAttribute(attrName)) { 133 128 auto parent = makeRefPtr(parentElement()); 134 129 if (!parent) -
trunk/Source/WebCore/svg/SVGFELightElement.h
r243114 r243266 24 24 25 25 #include "LightSource.h" 26 #include "SVGAnimatedNumber.h"27 26 #include "SVGElement.h" 28 27 … … 37 36 static SVGFELightElement* findLightElement(const SVGElement*); 38 37 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(); } 49 48 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; } 60 59 61 60 protected: … … 66 65 private: 67 66 using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFELightElement, SVGElement>; 68 static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }69 static void registerAttributes();70 67 const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } 71 68 72 69 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFELightElement, SVGElement>; 73 70 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 }79 71 80 72 void parseAttribute(const QualifiedName&, const AtomicString&) override; … … 84 76 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 85 77 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) }; 96 88 }; 97 89 -
trunk/Source/WebCore/svg/SVGFEMorphologyElement.cpp
r243185 r243266 1 1 /* 2 2 * 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. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 37 37 ASSERT(hasTagName(SVGNames::feMorphologyTag)); 38 38 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 }); 39 44 } 40 45 … … 44 49 } 45 50 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 58 51 void SVGFEMorphologyElement::setRadius(float x, float y) 59 52 { 60 m_radiusX .setValue(x);61 m_radiusY .setValue(y);53 m_radiusX->setBaseValInternal(x); 54 m_radiusY->setBaseValInternal(y); 62 55 invalidate(); 63 56 } … … 70 63 registry.registerAttribute<SVGNames::inAttr, &SVGFEMorphologyElement::m_in1>(); 71 64 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>();75 65 } 76 66 … … 92 82 float x, y; 93 83 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); 96 86 } 97 87 return; -
trunk/Source/WebCore/svg/SVGFEMorphologyElement.h
r243185 r243266 23 23 #include "FEMorphology.h" 24 24 #include "SVGAnimatedEnumeration.h" 25 #include "SVGAnimatedNumber.h"26 25 #include "SVGFilterPrimitiveStandardAttributes.h" 27 26 … … 66 65 String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } 67 66 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(); } 70 69 71 70 RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } 72 71 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; } 75 74 76 75 private: … … 96 95 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 97 96 98 static const AtomicString& radiusXIdentifier();99 static const AtomicString& radiusYIdentifier();100 101 97 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 102 98 PropertyRegistry m_propertyRegistry { *this }; 103 99 SVGAnimatedStringAttribute m_in1; 104 100 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) }; 107 103 }; 108 104 -
trunk/Source/WebCore/svg/SVGFEOffsetElement.cpp
r243185 r243266 2 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * 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. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 38 38 ASSERT(hasTagName(SVGNames::feOffsetTag)); 39 39 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 }); 40 46 } 41 47 … … 51 57 return; 52 58 registry.registerAttribute<SVGNames::inAttr, &SVGFEOffsetElement::m_in1>(); 53 registry.registerAttribute<SVGNames::dxAttr, &SVGFEOffsetElement::m_dx>();54 registry.registerAttribute<SVGNames::dyAttr, &SVGFEOffsetElement::m_dy>();55 59 } 56 60 … … 58 62 { 59 63 if (name == SVGNames::dxAttr) { 60 m_dx .setValue(value.toFloat());64 m_dx->setBaseValInternal(value.toFloat()); 61 65 return; 62 66 } 63 67 64 68 if (name == SVGNames::dyAttr) { 65 m_dy .setValue(value.toFloat());69 m_dy->setBaseValInternal(value.toFloat()); 66 70 return; 67 71 } -
trunk/Source/WebCore/svg/SVGFEOffsetElement.h
r243185 r243266 22 22 #pragma once 23 23 24 #include "SVGAnimatedNumber.h"25 24 #include "SVGFilterPrimitiveStandardAttributes.h" 26 25 … … 33 32 34 33 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(); } 37 36 38 37 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; } 41 40 42 41 private: … … 64 63 PropertyRegistry m_propertyRegistry { *this }; 65 64 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) }; 68 67 }; 69 68 -
trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp
r243185 r243266 41 41 ASSERT(hasTagName(SVGNames::feSpecularLightingTag)); 42 42 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 }); 43 51 } 44 52 … … 46 54 { 47 55 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;60 56 } 61 57 … … 66 62 return; 67 63 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>();74 64 } 75 65 … … 82 72 83 73 if (name == SVGNames::surfaceScaleAttr) { 84 m_surfaceScale .setValue(value.toFloat());74 m_surfaceScale->setBaseValInternal(value.toFloat()); 85 75 return; 86 76 } 87 77 88 78 if (name == SVGNames::specularConstantAttr) { 89 m_specularConstant .setValue(value.toFloat());79 m_specularConstant->setBaseValInternal(value.toFloat()); 90 80 return; 91 81 } 92 82 93 83 if (name == SVGNames::specularExponentAttr) { 94 m_specularExponent .setValue(value.toFloat());84 m_specularExponent->setBaseValInternal(value.toFloat()); 95 85 return; 96 86 } … … 99 89 float x, y; 100 90 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); 103 93 } 104 94 return; -
trunk/Source/WebCore/svg/SVGFESpecularLightingElement.h
r243185 r243266 24 24 25 25 #include "FESpecularLighting.h" 26 #include "SVGAnimatedNumber.h"27 26 #include "SVGFELightElement.h" 28 27 #include "SVGFilterPrimitiveStandardAttributes.h" … … 37 36 38 37 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(); } 44 43 45 44 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; } 51 50 52 51 private: … … 72 71 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 73 72 74 static const AtomicString& kernelUnitLengthXIdentifier();75 static const AtomicString& kernelUnitLengthYIdentifier();76 77 73 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 78 74 PropertyRegistry m_propertyRegistry { *this }; 79 75 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) }; 85 81 }; 86 82 -
trunk/Source/WebCore/svg/SVGFETurbulenceElement.cpp
r243185 r243266 2 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * 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. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 39 39 static std::once_flag onceFlag; 40 40 std::call_once(onceFlag, [] { 41 PropertyRegistry::registerProperty<SVGNames::baseFrequencyAttr, &SVGFETurbulenceElement::m_baseFrequencyX, &SVGFETurbulenceElement::m_baseFrequencyY>(); 41 42 PropertyRegistry::registerProperty<SVGNames::numOctavesAttr, &SVGFETurbulenceElement::m_numOctaves>(); 43 PropertyRegistry::registerProperty<SVGNames::seedAttr, &SVGFETurbulenceElement::m_seed>(); 42 44 }); 43 45 } … … 48 50 } 49 51 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 62 52 void SVGFETurbulenceElement::registerAttributes() 63 53 { … … 65 55 if (!registry.isEmpty()) 66 56 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>();71 57 registry.registerAttribute<SVGNames::stitchTilesAttr, SVGStitchOptions, &SVGFETurbulenceElement::m_stitchTiles>(); 72 58 registry.registerAttribute<SVGNames::typeAttr, TurbulenceType, &SVGFETurbulenceElement::m_type>(); … … 92 78 float x, y; 93 79 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); 96 82 } 97 83 return; … … 99 85 100 86 if (name == SVGNames::seedAttr) { 101 m_seed .setValue(value.toFloat());87 m_seed->setBaseValInternal(value.toFloat()); 102 88 return; 103 89 } -
trunk/Source/WebCore/svg/SVGFETurbulenceElement.h
r243185 r243266 24 24 #include "FETurbulence.h" 25 25 #include "SVGAnimatedEnumeration.h" 26 #include "SVGAnimatedNumber.h"27 26 #include "SVGFilterPrimitiveStandardAttributes.h" 28 27 … … 98 97 static Ref<SVGFETurbulenceElement> create(const QualifiedName&, Document&); 99 98 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(); } 102 101 int numOctaves() const { return m_numOctaves->currentValue(); } 103 float seed() const { return m_seed .currentValue(attributeOwnerProxy()); }102 float seed() const { return m_seed->currentValue(); } 104 103 SVGStitchOptions stitchTiles() const { return m_stitchTiles.currentValue(attributeOwnerProxy()); } 105 104 TurbulenceType type() const { return m_type.currentValue(attributeOwnerProxy()); } 106 105 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; } 109 108 SVGAnimatedInteger& numOctavesAnimated() { return m_numOctaves; } 110 RefPtr<SVGAnimatedNumber> seedAnimated() { return m_seed.animatedProperty(attributeOwnerProxy()); }109 SVGAnimatedNumber& seedAnimated() { return m_seed; } 111 110 RefPtr<SVGAnimatedEnumeration> stitchTilesAnimated() { return m_stitchTiles.animatedProperty(attributeOwnerProxy()); } 112 111 RefPtr<SVGAnimatedEnumeration> typeAnimated() { return m_type.animatedProperty(attributeOwnerProxy()); } … … 134 133 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; 135 134 136 static const AtomicString& baseFrequencyXIdentifier();137 static const AtomicString& baseFrequencyYIdentifier();138 139 135 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 140 136 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) }; 143 139 Ref<SVGAnimatedInteger> m_numOctaves { SVGAnimatedInteger::create(this, 1) }; 144 SVGAnimatedNumberAttribute m_seed;140 Ref<SVGAnimatedNumber> m_seed { SVGAnimatedNumber::create(this) }; 145 141 SVGAnimatedEnumerationAttribute<SVGStitchOptions> m_stitchTiles { SVG_STITCHTYPE_NOSTITCH }; 146 142 SVGAnimatedEnumerationAttribute<TurbulenceType> m_type { TurbulenceType::Turbulence }; -
trunk/Source/WebCore/svg/SVGGeometryElement.cpp
r234620 r243266 25 25 26 26 #include "DOMPoint.h" 27 #include "RenderSVGResource.h" 28 #include "RenderSVGShape.h" 27 29 #include "SVGDocumentExtensions.h" 28 30 #include "SVGPathUtilities.h" … … 37 39 : SVGGraphicsElement(tagName, document) 38 40 { 39 registerAttributes(); 41 static std::once_flag onceFlag; 42 std::call_once(onceFlag, [] { 43 PropertyRegistry::registerProperty<SVGNames::pathLengthAttr, &SVGGeometryElement::m_pathLength>(); 44 }); 40 45 } 41 46 … … 88 93 } 89 94 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 98 95 void SVGGeometryElement::parseAttribute(const QualifiedName& name, const AtomicString& value) 99 96 { 100 97 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) 103 100 document().accessSVGExtensions().reportError("A negative value for path attribute <pathLength> is not allowed"); 104 101 return; -
trunk/Source/WebCore/svg/SVGGeometryElement.h
r243114 r243266 24 24 25 25 #include "Path.h" 26 #include "SVGAnimatedNumber.h"27 26 #include "SVGGraphicsElement.h" 28 27 #include "SVGNames.h" … … 44 43 45 44 using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGGeometryElement, SVGGraphicsElement>; 46 static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }47 48 45 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGeometryElement, SVGGraphicsElement>; 49 46 50 auto pathLengthAnimated() { return m_pathLength.animatedProperty(attributeOwnerProxy()); } 47 float pathLength() const { return m_pathLength->currentValue(); } 48 SVGAnimatedNumber& pathLengthAnimated() { return m_pathLength; } 51 49 52 50 protected: … … 60 58 61 59 const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } 62 static void registerAttributes();63 64 60 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 }70 61 71 62 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 72 63 PropertyRegistry m_propertyRegistry { *this }; 73 SVGAnimatedNumberAttribute m_pathLength;64 Ref<SVGAnimatedNumber> m_pathLength { SVGAnimatedNumber::create(this) }; 74 65 }; 75 66 -
trunk/Source/WebCore/svg/SVGPathElement.h
r243121 r243266 23 23 24 24 #include "Path.h" 25 #include "SVGAnimatedNumber.h"26 25 #include "SVGAnimatedPath.h" 27 26 #include "SVGExternalResourcesRequired.h" -
trunk/Source/WebCore/svg/SVGPathSegListValues.cpp
r229830 r243266 26 26 27 27 #include "SVGPathElement.h" 28 #include "SVGPathSegWithContext.h" 28 29 #include "SVGPathUtilities.h" 29 30 -
trunk/Source/WebCore/svg/SVGStopElement.cpp
r238094 r243266 2 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * 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. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 38 38 { 39 39 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 }); 41 45 } 42 46 … … 46 50 } 47 51 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 56 52 void SVGStopElement::parseAttribute(const QualifiedName& name, const AtomicString& value) 57 53 { 58 54 if (name == SVGNames::offsetAttr) { 59 55 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); 61 57 else 62 m_offset .setValue(value.toFloat());58 m_offset->setBaseValInternal(value.toFloat()); 63 59 return; 64 60 } -
trunk/Source/WebCore/svg/SVGStopElement.h
r243114 r243266 22 22 #pragma once 23 23 24 #include "SVGAnimatedNumber.h"25 24 #include "SVGElement.h" 26 25 … … 34 33 Color stopColorIncludingOpacity() const; 35 34 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; } 38 37 39 38 private: … … 41 40 42 41 using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGStopElement, SVGElement>; 43 static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }44 static void registerAttributes();45 42 const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } 46 43 47 44 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGStopElement, SVGElement>; 48 45 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 }54 46 55 47 void parseAttribute(const QualifiedName&, const AtomicString&) final; … … 63 55 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 64 56 PropertyRegistry m_propertyRegistry { *this }; 65 SVGAnimatedNumberAttribute m_offset { 0};57 Ref<SVGAnimatedNumber> m_offset { SVGAnimatedNumber::create(0) }; 66 58 }; 67 59 -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h
r243185 r243266 78 78 79 79 template<typename OwnerType> 80 class SVGAnimatedNumberAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedNumber> { 81 using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedNumber>; 82 83 public: 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 89 private: 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 101 template<typename OwnerType> 80 102 class SVGAnimatedPreserveAspectRatioAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPreserveAspectRatio> { 81 103 using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPreserveAspectRatio>; -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h
r243185 r243266 77 77 }; 78 78 79 class 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 85 public: 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 91 private: 92 void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final 93 { 94 m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal()); 95 } 96 }; 97 79 98 class SVGAnimatedPreserveAspectRatioAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction> { 80 99 using Base = SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction>; -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h
r243185 r243266 30 30 #include "SVGAnimatedLength.h" 31 31 #include "SVGAnimatedLengthList.h" 32 #include "SVGAnimatedNumber.h"33 32 #include "SVGAnimatedNumberList.h" 34 33 #include "SVGAnimatedPointList.h" … … 44 43 using SVGAnimatedBoolean = SVGAnimatedPrimitiveProperty<bool>; 45 44 using SVGAnimatedInteger = SVGAnimatedPrimitiveProperty<int>; 45 using SVGAnimatedNumber = SVGAnimatedPrimitiveProperty<float>; 46 46 47 47 using SVGAnimatedRect = SVGAnimatedValueProperty<SVGRect>; -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessorImpl.h
r243036 r243266 70 70 }; 71 71 72 template<typename OwnerType> 73 class 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 78 public: 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 83 private: 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 72 107 } -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h
r243036 r243266 77 77 }; 78 78 79 class SVGAnimatedNumberPairAnimator final : public SVGAnimatedPropertyPairAnimator<SVGAnimatedNumberAnimator, SVGAnimatedNumberAnimator> { 80 using Base = SVGAnimatedPropertyPairAnimator<SVGAnimatedNumberAnimator, SVGAnimatedNumberAnimator>; 81 using Base::Base; 82 83 public: 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 89 private: 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 79 122 } -
trunk/Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.h
r243259 r243266 121 121 } 122 122 }; 123 123 124 class SVGAnimationNumberFunction : public SVGAnimationAdditiveValueFunction<float> { 125 friend class SVGAnimatedNumberPairAnimator; 126 127 public: 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 157 private: 158 void addFromAndToValues(SVGElement*) override 159 { 160 m_to += m_from; 161 } 162 }; 163 124 164 class SVGAnimationRectFunction : public SVGAnimationAdditiveValueFunction<FloatRect> { 125 165 public: -
trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h
r243185 r243266 29 29 #include "SVGAnimatedLength.h" 30 30 #include "SVGAnimatedLengthList.h" 31 #include "SVGAnimatedNumber.h"32 31 #include "SVGAnimatedNumberList.h" 33 32 #include "SVGAnimatedPointList.h" … … 75 74 } 76 75 77 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedNumberAttribute OwnerType::*attribute>78 void registerAttribute()79 {80 registerAttribute(SVGAnimatedNumberAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());81 }82 83 76 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedNumberListAttribute OwnerType::*attribute> 84 77 void registerAttribute() 85 78 { 86 79 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>());95 80 } 96 81 -
trunk/Source/WebCore/svg/properties/SVGPrimitivePropertyAnimatorImpl.h
r243259 r243266 26 26 #pragma once 27 27 28 #include "SVGAnimation Function.h"28 #include "SVGAnimationAdditiveValueFunctionImpl.h" 29 29 #include "SVGPrimitivePropertyAnimator.h" 30 30 … … 32 32 33 33 using SVGColorAnimator = SVGPrimitivePropertyAnimator<Color, SVGAnimationColorFunction>; 34 using SVGNumberAnimator = SVGPrimitivePropertyAnimator<float, SVGAnimationNumberFunction>; 34 35 35 36 } -
trunk/Source/WebCore/svg/properties/SVGPropertyAnimatorFactory.h
r243259 r243266 81 81 } 82 82 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 83 88 static const AttributeAnimatorCreator& attributeAnimatorCreator() 84 89 { … … 90 95 { SVGNames::stop_colorAttr->impl(), std::make_pair(SVGValueProperty<Color>::create, SVGPropertyAnimatorFactory::createColorAnimator) }, 91 96 { 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) }, 92 104 }); 93 105 return map; -
trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h
r243185 r243266 61 61 registerProperty(attributeName, SVGAnimatedIntegerAccessor<OwnerType>::template singleton<property>()); 62 62 } 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 64 70 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedPreserveAspectRatio> OwnerType::*property> 65 71 static void registerProperty() … … 79 85 registerProperty(attributeName, SVGAnimatedIntegerPairAccessor<OwnerType>::template singleton<property1, property2>()); 80 86 } 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 81 94 // Enumerate all the SVGMemberAccessors recursively. The functor will be called and will 82 95 // be given the pair<QualifiedName, SVGMemberAccessor> till the functor returns false.
Note: See TracChangeset
for help on using the changeset viewer.