Changeset 243036 in webkit
- Timestamp:
- Mar 16, 2019 12:42:41 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 added
- 4 deleted
- 26 edited
- 17 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r243035 r243036 1 2019-03-16 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Remove the SVG property tear off objects for SVGAnimatedInteger 4 https://bugs.webkit.org/show_bug.cgi?id=195722 5 6 Reviewed by Simon Fraser. 7 8 Instead of saving a raw integer value in the SVGElement and then wrapping 9 the pointer to this raw data in a tear off object, we will represent the 10 integer as Ref<SVGAnimatedInteger> in SVGElement. This will make the 11 representation of the property in IDL file match the C++ header file. 12 13 When the DOM requests the SVGAnimatedInteger, we get return a reference 14 to the new animated property. When the rendering code asks for the current 15 value of the this animated property, we return the animVal() or the 16 baseVal() depending on whether the property is animating or not. 17 18 A pointer to a member in the SVGElement will be registered along with the 19 associated attribute name in SVGPropertyRegistry. Registering the property 20 creates an SVGMemberAccessor and links to the associated attribute. The 21 function of SVGMemberAccessor is to retrieve the value of the property 22 given a pointer to an SVGElement. 23 24 SVGPropertyRegistry manages all the properties of SVGElement. It takes 25 into account the inherited properties as well. 26 27 SVGElement will have a virtual method called propertyRegistry(). Every 28 superclass will override this method to return a reference to its registry 29 which includes all the registered properties of this class and its bases. 30 31 One important function of the SVGPropertyRegistry and SVGAccessor is they 32 create the appropriate SVGAttributeAnimator for this property. 33 34 SVGAttributeAnimator is just a connection between the animated property 35 and SVGAnimationFunction. SVGAnimationFunction calculates the values of 36 the animated property within a time interval. SVGAnimatedPropertyAnimator 37 updates animVal of the animated property and invalidates the associated 38 SVGElement and all the instances that references this element. 39 40 The plan is to remove all the SVG tear off objects like what this patch 41 does for SVGAnimatedInteger. So for a period of time the old code and the 42 new code will co-exist together. These things to consider when reviewing 43 this patch: 44 45 -- SVGAnimatedElementBase was re-factored to use SVGAttributeAnimationControllerBase 46 which is inherited by SVGLegacyAttributeAnimationController and 47 SVGAttributeAnimationController. The tear-off properties code which uses 48 SVGAnimatedType now lives in SVGLegacyAttributeAnimationController. The 49 new code was added to SVGAttributeAnimationController. The plan is to 50 remove the three animation controllers and to move the code of 51 SVGAttributeAnimationController to SVGAnimatedElementBase when all the tear 52 off code is removed. 53 54 -- SVGElement now keeps two registries one for the tear-off world and the 55 other for the new world. Eventually we need to get rid of tear-off registry. 56 57 -- SVGElement will differentiate between the type of the property by the 58 the method isAnimatedAttribute(). 59 60 * Sources.txt: 61 * WebCore.xcodeproj/project.pbxproj: 62 * bindings/scripts/CodeGeneratorJS.pm: 63 (GenerateHeader): 64 * svg/SVGAnimateElementBase.cpp: 65 (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): 66 (WebCore::SVGAnimateElementBase::attributeAnimationController): 67 (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists): 68 (WebCore::SVGAnimateElementBase::hasValidAttributeType const): 69 (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const): 70 (WebCore::SVGAnimateElementBase::calculateAnimatedValue): 71 (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): 72 (WebCore::SVGAnimateElementBase::calculateFromAndToValues): 73 (WebCore::SVGAnimateElementBase::calculateFromAndByValues): 74 (WebCore::SVGAnimateElementBase::resetAnimatedType): 75 (WebCore::SVGAnimateElementBase::clearAnimatedType): 76 (WebCore::SVGAnimateElementBase::applyResultsToTarget): 77 (WebCore::SVGAnimateElementBase::isAdditive const): 78 (WebCore::SVGAnimateElementBase::calculateDistance): 79 (WebCore::SVGAnimateElementBase::setTargetElement): 80 (WebCore::SVGAnimateElementBase::setAttributeName): 81 (WebCore::SVGAnimateElementBase::resetAnimation): 82 (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const): 83 (WebCore::SVGAnimateElementBase::hasValidAttributeType): Deleted. 84 (WebCore::propertyTypesAreConsistent): Deleted. 85 (WebCore::applyCSSPropertyToTarget): Deleted. 86 (WebCore::removeCSSPropertyFromTarget): Deleted. 87 (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. 88 (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. 89 (WebCore::notifyTargetAboutAnimValChange): Deleted. 90 (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. 91 (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition const): Deleted. 92 (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): Deleted. 93 (WebCore::SVGAnimateElementBase::ensureAnimator): Deleted. 94 * svg/SVGAnimateElementBase.h: 95 * svg/SVGAnimateMotionElement.cpp: 96 (WebCore::SVGAnimateMotionElement::hasValidAttributeType const): 97 (WebCore::SVGAnimateMotionElement::hasValidAttributeName const): 98 (WebCore::SVGAnimateMotionElement::hasValidAttributeType): Deleted. 99 (WebCore::SVGAnimateMotionElement::hasValidAttributeName): Deleted. 100 * svg/SVGAnimateMotionElement.h: 101 * svg/SVGAnimateTransformElement.cpp: 102 (WebCore::SVGAnimateTransformElement::hasValidAttributeType const): 103 (WebCore::SVGAnimateTransformElement::hasValidAttributeType): Deleted. 104 * svg/SVGAnimateTransformElement.h: 105 * svg/SVGAnimatedInteger.cpp: Removed. 106 * svg/SVGAnimatedInteger.h: Removed. 107 * svg/SVGAnimatedIntegerOptionalInteger.cpp: Removed. 108 * svg/SVGAnimatedIntegerOptionalInteger.h: Removed. 109 * svg/SVGAnimatedPointList.h: 110 * svg/SVGAnimationElement.cpp: 111 (WebCore::SVGAnimationElement::setAttributeType): 112 (WebCore::SVGAnimationElement::resetAnimation): 113 (WebCore::SVGAnimationElement::resetAnimatedPropertyType): Deleted. 114 (WebCore::SVGAnimationElement::setTargetElement): Deleted. 115 (WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Deleted. 116 * svg/SVGAnimationElement.h: 117 (WebCore::SVGAnimationElement::attributeType const): 118 (WebCore::SVGAnimationElement::hasInvalidCSSAttributeType const): Deleted. 119 * svg/SVGAnimatorFactory.h: 120 (WebCore::SVGAnimatorFactory::create): 121 * svg/SVGAttributeAnimationController.cpp: Added. 122 (WebCore::SVGAttributeAnimationController::SVGAttributeAnimationController): 123 (WebCore::SVGAttributeAnimationController::animator const): 124 (WebCore::SVGAttributeAnimationController::isDiscreteAnimator const): 125 (WebCore::SVGAttributeAnimationController::isAdditive const): 126 (WebCore::SVGAttributeAnimationController::hasValidAttributeType const): 127 (WebCore::SVGAttributeAnimationController::calculateFromAndToValues): 128 (WebCore::SVGAttributeAnimationController::calculateFromAndByValues): 129 (WebCore::SVGAttributeAnimationController::calculateToAtEndOfDurationValue): 130 (WebCore::SVGAttributeAnimationController::resetAnimatedType): 131 (WebCore::SVGAttributeAnimationController::calculateAnimatedValue): 132 (WebCore::SVGAttributeAnimationController::applyResultsToTarget): 133 (WebCore::SVGAttributeAnimationController::clearAnimatedType): 134 (WebCore::SVGAttributeAnimationController::calculateDistance): 135 * svg/SVGAttributeAnimationController.h: Added. 136 (WebCore::SVGAttributeAnimationController::animatorIfExists const): 137 * svg/SVGAttributeAnimationControllerBase.cpp: Added. 138 (WebCore::SVGAttributeAnimationControllerBase::SVGAttributeAnimationControllerBase): 139 (WebCore::SVGAttributeAnimationControllerBase::determineAnimatedPropertyType): 140 * svg/SVGAttributeAnimationControllerBase.h: Added. 141 * svg/SVGElement.cpp: 142 (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): 143 (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): 144 (WebCore::SVGElement::commitPropertyChange): 145 (WebCore::SVGElement::isAnimatedPropertyAttribute const): 146 (WebCore::SVGElement::isAnimatedAttribute const): 147 (WebCore::SVGElement::createAnimator): 148 * svg/SVGElement.h: 149 (WebCore::SVGElement::propertyRegistry const): 150 * svg/SVGFEConvolveMatrixElement.cpp: 151 (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement): 152 (WebCore::SVGFEConvolveMatrixElement::registerAttributes): 153 (WebCore::SVGFEConvolveMatrixElement::parseAttribute): 154 (WebCore::SVGFEConvolveMatrixElement::setOrder): 155 (WebCore::SVGFEConvolveMatrixElement::orderXIdentifier): Deleted. 156 (WebCore::SVGFEConvolveMatrixElement::orderYIdentifier): Deleted. 157 * svg/SVGFEConvolveMatrixElement.h: 158 * svg/SVGFETurbulenceElement.cpp: 159 (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement): 160 (WebCore::SVGFETurbulenceElement::registerAttributes): 161 (WebCore::SVGFETurbulenceElement::parseAttribute): 162 (WebCore::SVGFETurbulenceElement::svgAttributeChanged): 163 * svg/SVGFETurbulenceElement.h: 164 * svg/SVGFilterElement.h: 165 * svg/SVGLegacyAttributeAnimationController.cpp: Added. 166 (WebCore::SVGLegacyAttributeAnimationController::SVGLegacyAttributeAnimationController): 167 (WebCore::SVGLegacyAttributeAnimationController::animatedTypeAnimator): 168 (WebCore::SVGLegacyAttributeAnimationController::isAdditive const): 169 (WebCore::SVGLegacyAttributeAnimationController::hasValidAttributeType const): 170 (WebCore::SVGLegacyAttributeAnimationController::calculateFromAndToValues): 171 (WebCore::SVGLegacyAttributeAnimationController::calculateFromAndByValues): 172 (WebCore::SVGLegacyAttributeAnimationController::calculateToAtEndOfDurationValue): 173 (WebCore::propertyTypesAreConsistent): 174 (WebCore::SVGLegacyAttributeAnimationController::resetAnimatedType): 175 (WebCore::SVGLegacyAttributeAnimationController::calculateAnimatedValue): 176 (WebCore::applyCSSPropertyToTarget): 177 (WebCore::removeCSSPropertyFromTarget): 178 (WebCore::applyCSSPropertyToTargetAndInstances): 179 (WebCore::removeCSSPropertyFromTargetAndInstances): 180 (WebCore::notifyTargetAboutAnimValChange): 181 (WebCore::notifyTargetAndInstancesAboutAnimValChange): 182 (WebCore::SVGLegacyAttributeAnimationController::applyResultsToTarget): 183 (WebCore::SVGLegacyAttributeAnimationController::clearAnimatedType): 184 (WebCore::SVGLegacyAttributeAnimationController::calculateDistance): 185 * svg/SVGLegacyAttributeAnimationController.h: Added. 186 * svg/animation/SVGSMILElement.cpp: 187 (WebCore::SVGSMILElement::hasValidAttributeName const): 188 (WebCore::SVGSMILElement::hasValidAttributeName): Deleted. 189 * svg/animation/SVGSMILElement.h: 190 * svg/properties/SVGAnimatedPrimitiveProperty.h: Added. 191 (WebCore::SVGAnimatedPrimitiveProperty::create): 192 (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal): 193 (WebCore::SVGAnimatedPrimitiveProperty::setBaseValInternal): 194 (WebCore::SVGAnimatedPrimitiveProperty::baseVal const): 195 (WebCore::SVGAnimatedPrimitiveProperty::setAnimVal): 196 (WebCore::SVGAnimatedPrimitiveProperty::animVal const): 197 (WebCore::SVGAnimatedPrimitiveProperty::animVal): 198 (WebCore::SVGAnimatedPrimitiveProperty::currentValue const): 199 (WebCore::SVGAnimatedPrimitiveProperty::SVGAnimatedPrimitiveProperty): 200 * svg/properties/SVGAnimatedProperty.cpp: Added. 201 (WebCore::SVGAnimatedProperty::owner const): 202 (WebCore::SVGAnimatedProperty::commitPropertyChange): 203 * svg/properties/SVGAnimatedProperty.h: Added. 204 (WebCore::SVGAnimatedProperty::isAttached const): 205 (WebCore::SVGAnimatedProperty::detach): 206 (WebCore::SVGAnimatedProperty::contextElement const): 207 (WebCore::SVGAnimatedProperty::baseValAsString const): 208 (WebCore::SVGAnimatedProperty::animValAsString const): 209 (WebCore::SVGAnimatedProperty::isDirty const): 210 (WebCore::SVGAnimatedProperty::setDirty): 211 (WebCore::SVGAnimatedProperty::synchronize): 212 (WebCore::SVGAnimatedProperty::isAnimating const): 213 (WebCore::SVGAnimatedProperty::startAnimation): 214 (WebCore::SVGAnimatedProperty::stopAnimation): 215 (WebCore::SVGAnimatedProperty::instanceStartAnimation): 216 (WebCore::SVGAnimatedProperty::instanceStopAnimation): 217 (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): 218 * svg/properties/SVGAnimatedPropertyAccessor.h: Added. 219 * svg/properties/SVGAnimatedPropertyAccessorImpl.h: Added. 220 * svg/properties/SVGAnimatedPropertyAnimator.h: Added. 221 (WebCore::SVGAnimatedPropertyAnimator::appendAnimatedInstance): 222 (WebCore::SVGAnimatedPropertyAnimator::SVGAnimatedPropertyAnimator): 223 * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: Added. 224 * svg/properties/SVGAnimatedPropertyImpl.h: Added. 225 * svg/properties/SVGAnimatedPropertyPairAccessor.h: Added. 226 (WebCore::SVGAnimatedPropertyPairAccessor::SVGAnimatedPropertyPairAccessor): 227 (WebCore::SVGAnimatedPropertyPairAccessor::singleton): 228 (WebCore::SVGAnimatedPropertyPairAccessor::property1 const): 229 (WebCore::SVGAnimatedPropertyPairAccessor::property2 const): 230 * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h: Added. 231 * svg/properties/SVGAnimatedPropertyPairAnimator.h: Added. 232 (WebCore::SVGAnimatedPropertyPairAnimator::appendAnimatedInstance): 233 (WebCore::SVGAnimatedPropertyPairAnimator::SVGAnimatedPropertyPairAnimator): 234 * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: Added. 235 * svg/properties/SVGAnimationAdditiveFunction.h: Added. 236 (WebCore::SVGAnimationAdditiveFunction::SVGAnimationAdditiveFunction): 237 (WebCore::SVGAnimationAdditiveFunction::progress): 238 * svg/properties/SVGAnimationAdditiveValueFunction.h: Added. 239 (WebCore::SVGAnimationAdditiveValueFunction::toAtEndOfDuration const): 240 * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: Added. 241 (WebCore::SVGAnimationIntegerFunction::progress): 242 * svg/properties/SVGAnimationFunction.h: Added. 243 (WebCore::SVGAnimationFunction::isDiscrete const): 244 (WebCore::SVGAnimationFunction::calculateDistance const): 245 (WebCore::SVGAnimationFunction::SVGAnimationFunction): 246 (WebCore::SVGAnimationFunction::addFromAndToValues): 247 * svg/properties/SVGAttributeAnimator.cpp: Added. 248 (WebCore::SVGAttributeAnimator::applyAnimatedPropertyChange): 249 * svg/properties/SVGAttributeAnimator.h: Added. 250 (WebCore::SVGAttributeAnimator::SVGAttributeAnimator): 251 (WebCore::SVGAttributeAnimator::isDiscrete const): 252 (WebCore::SVGAttributeAnimator::setFromAndToValues): 253 (WebCore::SVGAttributeAnimator::setFromAndByValues): 254 (WebCore::SVGAttributeAnimator::setToAtEndOfDurationValue): 255 (WebCore::SVGAttributeAnimator::calculateDistance const): 256 * svg/properties/SVGAttributeOwnerProxy.cpp: 257 * svg/properties/SVGAttributeOwnerProxy.h: 258 * svg/properties/SVGAttributeRegistry.h: 259 * svg/properties/SVGMemberAccessor.h: Added. 260 (WebCore::SVGMemberAccessor::detach const): 261 (WebCore::SVGMemberAccessor::isAnimatedProperty const): 262 (WebCore::SVGMemberAccessor::isAnimatedLength const): 263 (WebCore::SVGMemberAccessor::matches const): 264 (WebCore::SVGMemberAccessor::synchronize const): 265 (WebCore::SVGMemberAccessor::createAnimator const): 266 (WebCore::SVGMemberAccessor::appendAnimatedInstance const): 267 * svg/properties/SVGPointerMemberAccessor.h: Added. 268 (WebCore::SVGPointerMemberAccessor::SVGPointerMemberAccessor): 269 (WebCore::SVGPointerMemberAccessor::property const): 270 (WebCore::SVGPointerMemberAccessor::singleton): 271 * svg/properties/SVGProperty.h: Added. 272 * svg/properties/SVGPropertyOwner.h: Added. 273 (WebCore::SVGPropertyOwner::owner const): 274 (WebCore::SVGPropertyOwner::attributeContextElement const): 275 (WebCore::SVGPropertyOwner::commitPropertyChange): 276 * svg/properties/SVGPropertyOwnerRegistry.h: Added. 277 (WebCore::SVGPropertyOwnerRegistry::SVGPropertyOwnerRegistry): 278 (WebCore::SVGPropertyOwnerRegistry::registerProperty): 279 (WebCore::SVGPropertyOwnerRegistry::enumerateRecursively): 280 (WebCore::SVGPropertyOwnerRegistry::isKnownAttribute): 281 (WebCore::SVGPropertyOwnerRegistry::enumerateRecursivelyBaseTypes): 282 (WebCore::SVGPropertyOwnerRegistry::findAccessor): 283 * svg/properties/SVGPropertyRegistry.h: Added. 284 1 285 2019-03-16 Ryosuke Niwa <rniwa@webkit.org> 2 286 -
trunk/Source/WebCore/Sources.txt
r243014 r243036 2274 2274 svg/SVGAnimatedColor.cpp 2275 2275 svg/SVGAnimatedEnumeration.cpp 2276 svg/SVGAnimatedInteger.cpp2277 svg/SVGAnimatedIntegerOptionalInteger.cpp2278 2276 svg/SVGAnimatedLength.cpp 2279 2277 svg/SVGAnimatedLengthList.cpp … … 2289 2287 svg/SVGAnimatedTypeAnimator.cpp 2290 2288 svg/SVGAnimationElement.cpp 2289 svg/SVGAttributeAnimationController.cpp 2290 svg/SVGAttributeAnimationControllerBase.cpp 2291 2291 svg/SVGCircleElement.cpp 2292 2292 svg/SVGClipPathElement.cpp … … 2346 2346 svg/SVGImageLoader.cpp 2347 2347 svg/SVGLangSpace.cpp 2348 svg/SVGLegacyAttributeAnimationController.cpp 2348 2349 svg/SVGLengthContext.cpp 2349 2350 svg/SVGLengthListValues.cpp … … 2425 2426 2426 2427 svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp 2428 svg/properties/SVGAnimatedProperty.cpp 2429 svg/properties/SVGAttributeAnimator.cpp 2427 2430 svg/properties/SVGAttributeOwnerProxy.cpp 2428 2431 svg/properties/SVGLegacyAnimatedProperty.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r243014 r243036 243 243 081AA8DA1111237E002AB06E /* SVGElementRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 081AA8D91111237E002AB06E /* SVGElementRareData.h */; }; 244 244 081EBF3B0FD34F4100DA7559 /* SVGFilterBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 081EBF390FD34F4100DA7559 /* SVGFilterBuilder.h */; }; 245 0823D159127AD6AC000EBC95 /* SVGAnimatedInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */; };246 245 08250939128BD4D800E2ED8E /* SVGAnimatedTransformList.h in Headers */ = {isa = PBXBuildFile; fileRef = 08250938128BD4D800E2ED8E /* SVGAnimatedTransformList.h */; }; 247 246 082DE42D1292621600D923DF /* SVGPathSegWithContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 082DE42C1292621600D923DF /* SVGPathSegWithContext.h */; }; … … 2137 2136 71E2183A17359FB8006E6E4D /* PlugInsResources.h in Headers */ = {isa = PBXBuildFile; fileRef = 71E2183817359FB8006E6E4D /* PlugInsResources.h */; }; 2138 2137 71E2C42621C935280024F8C8 /* AnimationEffectPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 71E2C42421C9351D0024F8C8 /* AnimationEffectPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2139 71E623D1151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 71E623CF151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h */; };2140 2138 71EADCD822087E720065A45F /* PointerID.h in Headers */ = {isa = PBXBuildFile; fileRef = 71EADCD622087E6D0065A45F /* PointerID.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2141 2139 71EFCEDC202B38A900D7C411 /* AnimationEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71EFCED7202B388D00D7C411 /* AnimationEffect.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5606 5604 081EBF380FD34F4100DA7559 /* SVGFilterBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFilterBuilder.cpp; sourceTree = "<group>"; }; 5607 5605 081EBF390FD34F4100DA7559 /* SVGFilterBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFilterBuilder.h; sourceTree = "<group>"; }; 5608 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedInteger.h; sourceTree = "<group>"; };5609 5606 08250938128BD4D800E2ED8E /* SVGAnimatedTransformList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTransformList.h; sourceTree = "<group>"; }; 5610 5607 082DE42C1292621600D923DF /* SVGPathSegWithContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegWithContext.h; sourceTree = "<group>"; }; … … 7693 7690 43EDD67C1B485DBF00640E75 /* CombinedFiltersAlphabet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CombinedFiltersAlphabet.cpp; sourceTree = "<group>"; }; 7694 7691 43EDD67D1B485DBF00640E75 /* CombinedFiltersAlphabet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CombinedFiltersAlphabet.h; sourceTree = "<group>"; }; 7695 43F6FD9513BCD0B100224052 /* SVGAnimatedInteger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedInteger.cpp; sourceTree = "<group>"; };7696 7692 4415292C0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLPlugInImageElement.h; sourceTree = "<group>"; }; 7697 7693 4415292D0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLPlugInImageElement.cpp; sourceTree = "<group>"; }; … … 8673 8669 55AF14E31EAAC59B0026EEAA /* UTIRegistry.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UTIRegistry.cpp; sourceTree = "<group>"; }; 8674 8670 55AF14E41EAAC59B0026EEAA /* UTIRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UTIRegistry.h; sourceTree = "<group>"; }; 8671 55BE0257223B29C00032F08A /* SVGPropertyRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPropertyRegistry.h; sourceTree = "<group>"; }; 8672 55BE0259223B29C10032F08A /* SVGAnimationAdditiveValueFunctionImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimationAdditiveValueFunctionImpl.h; sourceTree = "<group>"; }; 8673 55BE025A223B29C20032F08A /* SVGPointerMemberAccessor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPointerMemberAccessor.h; sourceTree = "<group>"; }; 8674 55BE025B223B29C20032F08A /* SVGAnimationFunction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimationFunction.h; sourceTree = "<group>"; }; 8675 55BE025C223B29C30032F08A /* SVGPropertyOwnerRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPropertyOwnerRegistry.h; sourceTree = "<group>"; }; 8676 55BE025D223B29C40032F08A /* SVGAnimatedProperty.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedProperty.cpp; sourceTree = "<group>"; }; 8677 55BE025E223B29C40032F08A /* SVGAnimatedPropertyPairAccessor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyPairAccessor.h; sourceTree = "<group>"; }; 8678 55BE025F223B29C50032F08A /* SVGAnimationAdditiveFunction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimationAdditiveFunction.h; sourceTree = "<group>"; }; 8675 8679 55D408F71A7C631800C78450 /* SVGImageClients.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageClients.h; sourceTree = "<group>"; }; 8676 8680 55D70D20223B009100044B8E /* SVGLegacyAnimatedProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGLegacyAnimatedProperty.h; sourceTree = "<group>"; }; … … 8678 8682 55D70D22223B00EA00044B8E /* SVGLegacyProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGLegacyProperty.h; sourceTree = "<group>"; }; 8679 8683 55EC95972069C92D007DD0A9 /* PaintFrequencyTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaintFrequencyTracker.h; sourceTree = "<group>"; }; 8684 55EE5354223B29E900FBA944 /* SVGMemberAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMemberAccessor.h; sourceTree = "<group>"; }; 8685 55EE5356223B29F700FBA944 /* SVGAnimatedPropertyAnimatorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyAnimatorImpl.h; sourceTree = "<group>"; }; 8686 55EE5357223B29F800FBA944 /* SVGAnimatedPrimitiveProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPrimitiveProperty.h; sourceTree = "<group>"; }; 8687 55EE5358223B29F900FBA944 /* SVGAnimatedPropertyAccessorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyAccessorImpl.h; sourceTree = "<group>"; }; 8688 55EE5359223B29FA00FBA944 /* SVGAnimatedPropertyAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyAccessor.h; sourceTree = "<group>"; }; 8689 55EE535A223B29FB00FBA944 /* SVGAnimatedPropertyAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyAnimator.h; sourceTree = "<group>"; }; 8690 55EE535B223B2A0C00FBA944 /* SVGAnimatedPropertyPairAnimatorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyPairAnimatorImpl.h; sourceTree = "<group>"; }; 8691 55EE535C223B2A0D00FBA944 /* SVGAnimatedPropertyImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyImpl.h; sourceTree = "<group>"; }; 8692 55EE535D223B2A0D00FBA944 /* SVGAnimatedPropertyPairAccessorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyPairAccessorImpl.h; sourceTree = "<group>"; }; 8693 55EE535E223B2A0E00FBA944 /* SVGAnimationAdditiveValueFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimationAdditiveValueFunction.h; sourceTree = "<group>"; }; 8694 55EE535F223B2A0F00FBA944 /* SVGAnimatedPropertyPairAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyPairAnimator.h; sourceTree = "<group>"; }; 8695 55EE5360223B2A2100FBA944 /* SVGPropertyOwner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyOwner.h; sourceTree = "<group>"; }; 8696 55EE5361223B2A2200FBA944 /* SVGAttributeAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAttributeAnimator.cpp; sourceTree = "<group>"; }; 8697 55EE5362223B2A2300FBA944 /* SVGAnimatedProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedProperty.h; sourceTree = "<group>"; }; 8698 55EE5363223B2A2400FBA944 /* SVGProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGProperty.h; sourceTree = "<group>"; }; 8699 55EE5364223B2A2400FBA944 /* SVGAttributeAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAttributeAnimator.h; sourceTree = "<group>"; }; 8680 8700 55FA7FEF210FA386005AEFE7 /* SVGAttribute.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAttribute.h; sourceTree = "<group>"; }; 8681 8701 55FA7FF4210FB688005AEFE7 /* SVGAttributeAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAttributeAccessor.h; sourceTree = "<group>"; }; … … 9480 9500 71E2183917359FB8006E6E4D /* PlugInsResourcesData.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = PlugInsResourcesData.cpp; path = DerivedSources/WebCore/PlugInsResourcesData.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; 9481 9501 71E2C42421C9351D0024F8C8 /* AnimationEffectPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationEffectPhase.h; sourceTree = "<group>"; }; 9482 71E623CE151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedIntegerOptionalInteger.cpp; sourceTree = "<group>"; };9483 71E623CF151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedIntegerOptionalInteger.h; sourceTree = "<group>"; };9484 9502 71EADCD622087E6D0065A45F /* PointerID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PointerID.h; sourceTree = "<group>"; }; 9485 9503 71EFCED6202B388C00D7C411 /* AnimationEffect.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AnimationEffect.idl; sourceTree = "<group>"; }; … … 9489 9507 71F936F71DD4F99B00922CC7 /* tracks-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "tracks-support.js"; sourceTree = "<group>"; }; 9490 9508 71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedEnumerationPropertyTearOff.h; sourceTree = "<group>"; }; 9509 723F97BC2238EE08007F079C /* SVGAttributeAnimationController.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAttributeAnimationController.cpp; sourceTree = "<group>"; }; 9510 723F97BD2238EE08007F079C /* SVGAttributeAnimationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAttributeAnimationController.h; sourceTree = "<group>"; }; 9511 723F97BE2239512D007F079C /* SVGLegacyAttributeAnimationController.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLegacyAttributeAnimationController.cpp; sourceTree = "<group>"; }; 9512 723F97BF2239512D007F079C /* SVGLegacyAttributeAnimationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGLegacyAttributeAnimationController.h; sourceTree = "<group>"; }; 9513 723F97C022396B88007F079C /* SVGAttributeAnimationControllerBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAttributeAnimationControllerBase.h; sourceTree = "<group>"; }; 9514 723F97C122397725007F079C /* SVGAttributeAnimationControllerBase.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAttributeAnimationControllerBase.cpp; sourceTree = "<group>"; }; 9491 9515 724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EXTBlendMinMax.cpp; sourceTree = "<group>"; }; 9492 9516 724ED32A1A3A7E5400F5F13C /* EXTBlendMinMax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXTBlendMinMax.h; sourceTree = "<group>"; }; … … 16187 16211 55FA7FFC2110F813005AEFE7 /* SVGAnimatedPathSegListPropertyTearOff.cpp */, 16188 16212 089A8E06128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h */, 16213 55EE5357223B29F800FBA944 /* SVGAnimatedPrimitiveProperty.h */, 16214 55BE025D223B29C40032F08A /* SVGAnimatedProperty.cpp */, 16215 55EE5362223B2A2300FBA944 /* SVGAnimatedProperty.h */, 16216 55EE5359223B29FA00FBA944 /* SVGAnimatedPropertyAccessor.h */, 16217 55EE5358223B29F900FBA944 /* SVGAnimatedPropertyAccessorImpl.h */, 16218 55EE535A223B29FB00FBA944 /* SVGAnimatedPropertyAnimator.h */, 16219 55EE5356223B29F700FBA944 /* SVGAnimatedPropertyAnimatorImpl.h */, 16189 16220 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */, 16221 55EE535C223B2A0D00FBA944 /* SVGAnimatedPropertyImpl.h */, 16222 55BE025E223B29C40032F08A /* SVGAnimatedPropertyPairAccessor.h */, 16223 55EE535D223B2A0D00FBA944 /* SVGAnimatedPropertyPairAccessorImpl.h */, 16224 55EE535F223B2A0F00FBA944 /* SVGAnimatedPropertyPairAnimator.h */, 16225 55EE535B223B2A0C00FBA944 /* SVGAnimatedPropertyPairAnimatorImpl.h */, 16190 16226 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */, 16191 16227 55FA7FFE21110E6E005AEFE7 /* SVGAnimatedPropertyType.h */, 16192 16228 08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */, 16193 16229 085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */, 16230 55BE025F223B29C50032F08A /* SVGAnimationAdditiveFunction.h */, 16231 55EE535E223B2A0E00FBA944 /* SVGAnimationAdditiveValueFunction.h */, 16232 55BE0259223B29C10032F08A /* SVGAnimationAdditiveValueFunctionImpl.h */, 16233 55BE025B223B29C20032F08A /* SVGAnimationFunction.h */, 16194 16234 55FA7FEF210FA386005AEFE7 /* SVGAttribute.h */, 16195 16235 55FA7FF4210FB688005AEFE7 /* SVGAttributeAccessor.h */, 16236 55EE5361223B2A2200FBA944 /* SVGAttributeAnimator.cpp */, 16237 55EE5364223B2A2400FBA944 /* SVGAttributeAnimator.h */, 16196 16238 7A3EBEAC21BF0921000D043D /* SVGAttributeOwnerProxy.cpp */, 16197 16239 55346AF021150FAF0059BCDD /* SVGAttributeOwnerProxy.h */, … … 16204 16246 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */, 16205 16247 08CA3D4312894A3800FFF260 /* SVGMatrixTearOff.h */, 16248 55EE5354223B29E900FBA944 /* SVGMemberAccessor.h */, 16249 55BE025A223B29C20032F08A /* SVGPointerMemberAccessor.h */, 16250 55EE5363223B2A2400FBA944 /* SVGProperty.h */, 16251 55EE5360223B2A2100FBA944 /* SVGPropertyOwner.h */, 16252 55BE025C223B29C30032F08A /* SVGPropertyOwnerRegistry.h */, 16253 55BE0257223B29C00032F08A /* SVGPropertyRegistry.h */, 16206 16254 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */, 16207 16255 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */, … … 24074 24122 08D46CE2127AD5FC0089694B /* SVGAnimatedEnumeration.h */, 24075 24123 B22277E80D00BF1F0071B782 /* SVGAnimatedEnumeration.idl */, 24076 43F6FD9513BCD0B100224052 /* SVGAnimatedInteger.cpp */,24077 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */,24078 24124 B22277E90D00BF1F0071B782 /* SVGAnimatedInteger.idl */, 24079 71E623CE151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.cpp */,24080 71E623CF151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h */,24081 24125 4381763A13A697D4007D1187 /* SVGAnimatedLength.cpp */, 24082 24126 089021A8126EF5DE0092D5EA /* SVGAnimatedLength.h */, … … 24127 24171 B22278030D00BF1F0071B782 /* SVGAnimationElement.idl */, 24128 24172 439D334213A6911C00C20F4F /* SVGAnimatorFactory.h */, 24173 723F97BC2238EE08007F079C /* SVGAttributeAnimationController.cpp */, 24174 723F97BD2238EE08007F079C /* SVGAttributeAnimationController.h */, 24175 723F97C122397725007F079C /* SVGAttributeAnimationControllerBase.cpp */, 24176 723F97C022396B88007F079C /* SVGAttributeAnimationControllerBase.h */, 24129 24177 B22278040D00BF1F0071B782 /* svgattrs.in */, 24130 24178 B22278050D00BF1F0071B782 /* SVGCircleElement.cpp */, … … 24296 24344 B22278990D00BF200071B782 /* SVGLangSpace.cpp */, 24297 24345 B222789A0D00BF200071B782 /* SVGLangSpace.h */, 24346 723F97BE2239512D007F079C /* SVGLegacyAttributeAnimationController.cpp */, 24347 723F97BF2239512D007F079C /* SVGLegacyAttributeAnimationController.h */, 24298 24348 7CE58D511DD7B09300128552 /* SVGLength.h */, 24299 24349 B222789E0D00BF200071B782 /* SVGLength.idl */, … … 31863 31913 08D46CE3127AD5FC0089694B /* SVGAnimatedEnumeration.h in Headers */, 31864 31914 71FB967B1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h in Headers */, 31865 0823D159127AD6AC000EBC95 /* SVGAnimatedInteger.h in Headers */,31866 71E623D1151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h in Headers */,31867 31915 089021A9126EF5DE0092D5EA /* SVGAnimatedLength.h in Headers */, 31868 31916 089021AD126EF5E90092D5EA /* SVGAnimatedLengthList.h in Headers */, -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r242278 r243036 2500 2500 } 2501 2501 2502 $headerIncludes{"$interfaceName.h"} = 1 if $hasParent && $interface->extendedAttributes->{JSGenerateToNativeObject};2503 2504 2502 $headerIncludes{"SVGElement.h"} = 1 if $className =~ /^JSSVG/; 2505 2503 … … 2513 2511 2514 2512 if ($codeGenerator->IsSVGAnimatedType($interface->type)) { 2515 $headerIncludes{" $interfaceName.h"} = 1;2513 $headerIncludes{"SVGAnimatedPropertyImpl.h"} = 1; 2516 2514 } else { 2515 $headerIncludes{"$interfaceName.h"} = 1 if $hasParent && $interface->extendedAttributes->{JSGenerateToNativeObject}; 2517 2516 # Implementation class forward declaration 2518 2517 if (IsDOMGlobalObject($interface)) { … … 2564 2563 push(@headerContent, " }\n\n"); 2565 2564 } else { 2566 AddIncludesForImplementationTypeInHeader($implType); 2565 if (!$codeGenerator->IsSVGAnimatedType($interface->type)) { 2566 AddIncludesForImplementationTypeInHeader($implType); 2567 } 2567 2568 push(@headerContent, " static $className* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<$implType>&& impl)\n"); 2568 2569 push(@headerContent, " {\n"); -
trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp
r242970 r243036 2 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 4 * Copyright (C) 2008 Apple Inc. All rights reserved.4 * Copyright (C) 2008-2019 Apple Inc. All rights reserved. 5 5 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 6 6 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved. … … 25 25 #include "SVGAnimateElementBase.h" 26 26 27 #include "CSSPropertyNames.h"28 #include "CSSPropertyParser.h"29 27 #include "QualifiedName.h" 30 #include "RenderObject.h" 31 #include "SVGAnimatorFactory.h" 28 #include "SVGAttributeAnimationController.h" 32 29 #include "SVGElement.h" 30 #include "SVGLegacyAttributeAnimationController.h" 33 31 #include "SVGNames.h" 34 #include "StyleProperties.h"35 32 #include <wtf/IsoMallocInlines.h> 36 33 … … 41 38 SVGAnimateElementBase::SVGAnimateElementBase(const QualifiedName& tagName, Document& document) 42 39 : SVGAnimationElement(tagName, document) 43 , m_animatedPropertyType(AnimatedString)44 40 { 45 41 ASSERT(hasTagName(SVGNames::animateTag) || hasTagName(SVGNames::setTag) || hasTagName(SVGNames::animateColorTag) || hasTagName(SVGNames::animateTransformTag)); … … 48 44 SVGAnimateElementBase::~SVGAnimateElementBase() = default; 49 45 50 bool SVGAnimateElementBase::hasValidAttributeType()46 SVGAttributeAnimationControllerBase& SVGAnimateElementBase::attributeAnimationController() 51 47 { 52 if (!this->targetElement()) 48 ASSERT(targetElement()); 49 ASSERT(!hasInvalidCSSAttributeType()); 50 51 if (!m_attributeAnimationController) { 52 if (targetElement()->isAnimatedPropertyAttribute(attributeName())) 53 m_attributeAnimationController = std::make_unique<SVGAttributeAnimationController>(*this, *targetElement()); 54 else 55 m_attributeAnimationController = std::make_unique<SVGLegacyAttributeAnimationController>(*this, *targetElement()); 56 } 57 58 return *m_attributeAnimationController; 59 } 60 61 bool SVGAnimateElementBase::hasValidAttributeType() const 62 { 63 if (!targetElement() || hasInvalidCSSAttributeType()) 53 64 return false; 54 65 55 return m_animatedPropertyType != AnimatedUnknown && !hasInvalidCSSAttributeType(); 66 if (determineAnimatedPropertyType(*targetElement()) != AnimatedUnknown) 67 return true; 68 69 return targetElement()->isAnimatedPropertyAttribute(attributeName()); 56 70 } 57 71 58 72 AnimatedPropertyType SVGAnimateElementBase::determineAnimatedPropertyType(SVGElement& targetElement) const 59 73 { 60 auto propertyTypes = targetElement.animatedPropertyTypesForAttribute(attributeName()); 61 if (propertyTypes.isEmpty()) 62 return AnimatedUnknown; 63 64 ASSERT(propertyTypes.size() <= 2); 65 AnimatedPropertyType type = propertyTypes[0]; 66 if (hasTagName(SVGNames::animateColorTag) && type != AnimatedColor) 67 return AnimatedUnknown; 68 69 // Animations of transform lists are not allowed for <animate> or <set> 70 // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties 71 if (type == AnimatedTransformList && !hasTagName(SVGNames::animateTransformTag)) 72 return AnimatedUnknown; 73 74 // Fortunately there's just one special case needed here: SVGMarkerElements orientAttr, which 75 // corresponds to SVGAnimatedAngle orientAngle and SVGAnimatedEnumeration orientType. We have to 76 // figure out whose value to change here. 77 if (targetElement.hasTagName(SVGNames::markerTag) && type == AnimatedAngle) { 78 ASSERT(propertyTypes.size() == 2); 79 ASSERT(propertyTypes[0] == AnimatedAngle); 80 ASSERT(propertyTypes[1] == AnimatedEnumeration); 81 } else if (propertyTypes.size() == 2) 82 ASSERT(propertyTypes[0] == propertyTypes[1]); 83 84 return type; 74 return SVGAttributeAnimationControllerBase::determineAnimatedPropertyType(*this, targetElement, attributeName()); 85 75 } 86 76 87 77 void SVGAnimateElementBase::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement) 88 78 { 89 ASSERT(resultElement); 90 auto targetElement = makeRefPtr(this->targetElement()); 91 if (!targetElement) 79 if (!targetElement()) 92 80 return; 93 94 const QualifiedName& attributeName = this->attributeName(); 95 ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement.get(), attributeName); 96 97 if (shouldApply == DontApplyAnimation) 98 return; 99 100 ASSERT(m_animatedPropertyType == determineAnimatedPropertyType(*targetElement)); 101 102 ASSERT(percentage >= 0 && percentage <= 1); 103 ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag)); 104 ASSERT(m_animatedPropertyType != AnimatedUnknown); 105 ASSERT(m_animator); 106 ASSERT(m_animator->type() == m_animatedPropertyType); 107 ASSERT(m_fromType); 108 ASSERT(m_fromType->type() == m_animatedPropertyType); 109 ASSERT(m_toType); 110 111 if (shouldApply == ApplyXMLAnimation || shouldApply == ApplyXMLandCSSAnimation) { 112 // SVG DOM animVal animation code-path. 113 if (m_animator->findAnimatedPropertiesForAttributeName(*targetElement, attributeName).isEmpty()) 114 return; 115 } 116 117 SVGAnimateElementBase& resultAnimationElement = downcast<SVGAnimateElementBase>(*resultElement); 118 ASSERT(resultAnimationElement.m_animatedType); 119 ASSERT(resultAnimationElement.m_animatedPropertyType == m_animatedPropertyType); 120 121 if (hasTagName(SVGNames::setTag)) 122 percentage = 1; 123 124 if (calcMode() == CalcMode::Discrete) 125 percentage = percentage < 0.5 ? 0 : 1; 126 127 // Target element might have changed. 128 m_animator->setContextElement(targetElement.get()); 129 130 // Be sure to detach list wrappers before we modfiy their underlying value. If we'd do 131 // if after calculateAnimatedValue() ran the cached pointers in the list propery tear 132 // offs would point nowhere, and we couldn't create copies of those values anymore, 133 // while detaching. This is covered by assertions, moving this down would fire them. 134 if (!m_animatedProperties.isEmpty()) 135 m_animator->animValWillChange(m_animatedProperties); 136 137 // Values-animation accumulates using the last values entry corresponding to the end of duration time. 138 SVGAnimatedType* toAtEndOfDurationType = m_toAtEndOfDurationType ? m_toAtEndOfDurationType.get() : m_toType.get(); 139 m_animator->calculateAnimatedValue(percentage, repeatCount, m_fromType.get(), m_toType.get(), toAtEndOfDurationType, resultAnimationElement.m_animatedType.get()); 81 attributeAnimationController().calculateAnimatedValue(percentage, repeatCount, resultElement); 140 82 } 141 83 142 84 bool SVGAnimateElementBase::calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) 143 85 { 144 if ( toAtEndOfDurationString.isEmpty())86 if (!targetElement()) 145 87 return false; 146 m_toAtEndOfDurationType = ensureAnimator()->constructFromString(toAtEndOfDurationString); 147 return true; 88 return attributeAnimationController().calculateToAtEndOfDurationValue(toAtEndOfDurationString); 148 89 } 149 90 150 91 bool SVGAnimateElementBase::calculateFromAndToValues(const String& fromString, const String& toString) 151 92 { 152 if (!t his->targetElement())93 if (!targetElement()) 153 94 return false; 154 155 determinePropertyValueTypes(fromString, toString); 156 ensureAnimator()->calculateFromAndToValues(m_fromType, m_toType, fromString, toString); 157 ASSERT(m_animatedPropertyType == m_animator->type()); 158 return true; 95 return attributeAnimationController().calculateFromAndToValues(fromString, toString); 159 96 } 160 97 … … 163 100 if (!this->targetElement()) 164 101 return false; 165 166 if (animationMode() == AnimationMode::By && !isAdditive()) 167 return false; 168 169 // from-by animation may only be used with attributes that support addition (e.g. most numeric attributes). 170 if (animationMode() == AnimationMode::FromBy && !animatedPropertyTypeSupportsAddition()) 171 return false; 172 173 ASSERT(!hasTagName(SVGNames::setTag)); 174 175 determinePropertyValueTypes(fromString, byString); 176 ensureAnimator()->calculateFromAndByValues(m_fromType, m_toType, fromString, byString); 177 ASSERT(m_animatedPropertyType == m_animator->type()); 178 return true; 102 return attributeAnimationController().calculateFromAndByValues(fromString, byString); 179 103 } 180 181 #ifndef NDEBUG182 static inline bool propertyTypesAreConsistent(AnimatedPropertyType expectedPropertyType, const SVGElementAnimatedPropertyList& animatedTypes)183 {184 for (auto& type : animatedTypes) {185 for (auto& property : type.properties) {186 if (expectedPropertyType != property->animatedPropertyType()) {187 // This is the only allowed inconsistency. SVGAnimatedAngleAnimator handles both SVGAnimatedAngle & SVGAnimatedEnumeration for markers orient attribute.188 if (expectedPropertyType == AnimatedAngle && property->animatedPropertyType() == AnimatedEnumeration)189 return true;190 return false;191 }192 }193 }194 195 return true;196 }197 #endif198 104 199 105 void SVGAnimateElementBase::resetAnimatedType() 200 106 { 201 SVGAnimatedTypeAnimator* animator = ensureAnimator(); 202 ASSERT(m_animatedPropertyType == animator->type()); 203 204 auto targetElement = makeRefPtr(this->targetElement()); 205 if (!targetElement) 107 if (!targetElement()) 206 108 return; 207 208 const QualifiedName& attributeName = this->attributeName(); 209 ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement.get(), attributeName); 210 211 if (shouldApply == DontApplyAnimation) 212 return; 213 214 if (shouldApply == ApplyXMLAnimation || shouldApply == ApplyXMLandCSSAnimation) { 215 // SVG DOM animVal animation code-path. 216 m_animatedProperties = animator->findAnimatedPropertiesForAttributeName(*targetElement, attributeName); 217 if (m_animatedProperties.isEmpty()) 218 return; 219 220 ASSERT(propertyTypesAreConsistent(m_animatedPropertyType, m_animatedProperties)); 221 if (!m_animatedType) 222 m_animatedType = animator->startAnimValAnimation(m_animatedProperties); 223 else { 224 animator->resetAnimValToBaseVal(m_animatedProperties, *m_animatedType); 225 animator->animValDidChange(m_animatedProperties); 226 } 227 return; 228 } 229 230 // CSS properties animation code-path. 231 ASSERT(m_animatedProperties.isEmpty()); 232 String baseValue; 233 234 if (shouldApply == ApplyCSSAnimation) { 235 ASSERT(SVGAnimationElement::isTargetAttributeCSSProperty(targetElement.get(), attributeName)); 236 computeCSSPropertyValue(targetElement.get(), cssPropertyID(attributeName.localName()), baseValue); 237 } 238 239 if (!m_animatedType) 240 m_animatedType = animator->constructFromString(baseValue); 241 else 242 m_animatedType->setValueAsString(attributeName, baseValue); 243 } 244 245 static inline void applyCSSPropertyToTarget(SVGElement& targetElement, CSSPropertyID id, const String& value) 246 { 247 ASSERT(!targetElement.m_deletionHasBegun); 248 249 if (!targetElement.ensureAnimatedSMILStyleProperties().setProperty(id, value, false)) 250 return; 251 252 targetElement.invalidateStyle(); 253 } 254 255 static inline void removeCSSPropertyFromTarget(SVGElement& targetElement, CSSPropertyID id) 256 { 257 ASSERT(!targetElement.m_deletionHasBegun); 258 targetElement.ensureAnimatedSMILStyleProperties().removeProperty(id); 259 targetElement.invalidateStyle(); 260 } 261 262 static inline void applyCSSPropertyToTargetAndInstances(SVGElement& targetElement, const QualifiedName& attributeName, const String& valueAsString) 263 { 264 // FIXME: Do we really need to check both isConnected and !parentNode? 265 if (attributeName == anyQName() || !targetElement.isConnected() || !targetElement.parentNode()) 266 return; 267 268 CSSPropertyID id = cssPropertyID(attributeName.localName()); 269 270 SVGElement::InstanceUpdateBlocker blocker(targetElement); 271 applyCSSPropertyToTarget(targetElement, id, valueAsString); 272 273 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. 274 for (auto* instance : targetElement.instances()) 275 applyCSSPropertyToTarget(*instance, id, valueAsString); 276 } 277 278 static inline void removeCSSPropertyFromTargetAndInstances(SVGElement& targetElement, const QualifiedName& attributeName) 279 { 280 // FIXME: Do we really need to check both isConnected and !parentNode? 281 if (attributeName == anyQName() || !targetElement.isConnected() || !targetElement.parentNode()) 282 return; 283 284 CSSPropertyID id = cssPropertyID(attributeName.localName()); 285 286 SVGElement::InstanceUpdateBlocker blocker(targetElement); 287 removeCSSPropertyFromTarget(targetElement, id); 288 289 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. 290 for (auto* instance : targetElement.instances()) 291 removeCSSPropertyFromTarget(*instance, id); 292 } 293 294 static inline void notifyTargetAboutAnimValChange(SVGElement& targetElement, const QualifiedName& attributeName) 295 { 296 ASSERT(!targetElement.m_deletionHasBegun); 297 targetElement.svgAttributeChanged(attributeName); 298 } 299 300 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement& targetElement, const QualifiedName& attributeName) 301 { 302 if (attributeName == anyQName() || !targetElement.isConnected() || !targetElement.parentNode()) 303 return; 304 305 SVGElement::InstanceUpdateBlocker blocker(targetElement); 306 notifyTargetAboutAnimValChange(targetElement, attributeName); 307 308 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. 309 for (auto* instance : targetElement.instances()) 310 notifyTargetAboutAnimValChange(*instance, attributeName); 109 attributeAnimationController().resetAnimatedType(); 311 110 } 312 111 313 112 void SVGAnimateElementBase::clearAnimatedType(SVGElement* targetElement) 314 113 { 315 if (! m_animatedType)114 if (!targetElement) 316 115 return; 317 116 318 // If the SVGAnimatedType is a list type, e.g. SVGLengthListValues, the wrappers of the 319 // animated properties have to be detached from the items in the list before it's deleted. 320 if (!m_animatedProperties.isEmpty()) 321 m_animator->animValWillChange(m_animatedProperties); 322 323 if (!targetElement) { 324 m_animatedType = nullptr; 325 return; 326 } 327 328 if (m_animatedProperties.isEmpty()) { 329 // CSS properties animation code-path. 330 removeCSSPropertyFromTargetAndInstances(*targetElement, attributeName()); 331 m_animatedType = nullptr; 332 return; 333 } 334 335 ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName()); 336 if (shouldApply == ApplyXMLandCSSAnimation) 337 removeCSSPropertyFromTargetAndInstances(*targetElement, attributeName()); 338 339 // SVG DOM animVal animation code-path. 340 if (m_animator) { 341 m_animator->stopAnimValAnimation(m_animatedProperties); 342 notifyTargetAndInstancesAboutAnimValChange(*targetElement, attributeName()); 343 } 344 345 m_animatedProperties.clear(); 346 m_animatedType = nullptr; 117 if (auto* controller = attributeAnimationControllerIfExists()) 118 controller->clearAnimatedType(targetElement); 347 119 } 348 120 349 121 void SVGAnimateElementBase::applyResultsToTarget() 350 122 { 351 ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag)); 352 ASSERT(m_animatedPropertyType != AnimatedUnknown); 353 ASSERT(m_animator); 354 355 // Early exit if our animated type got destroyed by a previous endedActiveInterval(). 356 if (!m_animatedType) 123 if (!targetElement()) 357 124 return; 358 359 auto targetElement = makeRefPtr(this->targetElement()); 360 const QualifiedName& attributeName = this->attributeName(); 361 362 ASSERT(targetElement); 363 364 if (m_animatedProperties.isEmpty()) { 365 // CSS properties animation code-path. 366 // Convert the result of the animation to a String and apply it as CSS property on the target & all instances. 367 applyCSSPropertyToTargetAndInstances(*targetElement, attributeName, m_animatedType->valueAsString()); 368 return; 369 } 370 371 // We do update the style and the animation property independent of each other. 372 ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement.get(), attributeName); 373 if (shouldApply == ApplyXMLandCSSAnimation) 374 applyCSSPropertyToTargetAndInstances(*targetElement, attributeName, m_animatedType->valueAsString()); 375 376 // SVG DOM animVal animation code-path. 377 // At this point the SVG DOM values are already changed, unlike for CSS. 378 // We only have to trigger update notifications here. 379 m_animator->animValDidChange(m_animatedProperties); 380 notifyTargetAndInstancesAboutAnimValChange(*targetElement, attributeName); 381 } 382 383 bool SVGAnimateElementBase::animatedPropertyTypeSupportsAddition() const 384 { 385 // Spec: http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties. 386 switch (m_animatedPropertyType) { 387 case AnimatedBoolean: 388 case AnimatedEnumeration: 389 case AnimatedPreserveAspectRatio: 390 case AnimatedString: 391 case AnimatedUnknown: 392 return false; 393 case AnimatedAngle: 394 case AnimatedColor: 395 case AnimatedInteger: 396 case AnimatedIntegerOptionalInteger: 397 case AnimatedLength: 398 case AnimatedLengthList: 399 case AnimatedNumber: 400 case AnimatedNumberList: 401 case AnimatedNumberOptionalNumber: 402 case AnimatedPath: 403 case AnimatedPoints: 404 case AnimatedRect: 405 case AnimatedTransformList: 406 return true; 407 default: 408 RELEASE_ASSERT_NOT_REACHED(); 409 return true; 410 } 125 attributeAnimationController().applyResultsToTarget(); 411 126 } 412 127 … … 414 129 { 415 130 if (animationMode() == AnimationMode::By || animationMode() == AnimationMode::FromBy) { 416 if (!animatedPropertyTypeSupportsAddition()) 417 return false; 131 if (auto* controller = attributeAnimationControllerIfExists()) { 132 if (!controller->isAdditive()) 133 return false; 134 } 418 135 } 419 136 … … 424 141 { 425 142 // FIXME: A return value of float is not enough to support paced animations on lists. 426 if (!t his->targetElement())143 if (!targetElement()) 427 144 return -1; 428 145 429 return ensureAnimator()->calculateDistance(fromString, toString);146 return attributeAnimationController().calculateDistance(fromString, toString); 430 147 } 431 148 … … 433 150 { 434 151 SVGAnimationElement::setTargetElement(target); 435 resetAnimat edPropertyType();152 resetAnimation(); 436 153 } 437 154 … … 439 156 { 440 157 SVGSMILElement::setAttributeName(attributeName); 441 checkInvalidCSSAttributeType(targetElement()); 442 resetAnimatedPropertyType(); 158 resetAnimation(); 443 159 } 444 160 445 void SVGAnimateElementBase::resetAnimat edPropertyType()161 void SVGAnimateElementBase::resetAnimation() 446 162 { 447 SVGAnimationElement::resetAnimatedPropertyType(); 448 ASSERT(!m_animatedType); 449 m_fromType = nullptr; 450 m_toType = nullptr; 451 m_toAtEndOfDurationType = nullptr; 452 m_animator = nullptr; 453 m_animatedPropertyType = targetElement() ? determineAnimatedPropertyType(*targetElement()) : AnimatedString; 163 SVGAnimationElement::resetAnimation(); 164 m_attributeAnimationController = nullptr; 165 m_hasInvalidCSSAttributeType = WTF::nullopt; 454 166 } 455 167 456 SVGAnimatedTypeAnimator* SVGAnimateElementBase::ensureAnimator() 168 bool SVGAnimateElementBase::hasInvalidCSSAttributeType() const 457 169 { 458 if (!m_animator) 459 m_animator = SVGAnimatorFactory::create(this, targetElement(), m_animatedPropertyType); 460 ASSERT(m_animatedPropertyType == m_animator->type()); 461 return m_animator.get(); 170 if (!targetElement()) 171 return false; 172 173 if (!m_hasInvalidCSSAttributeType) 174 m_hasInvalidCSSAttributeType = hasValidAttributeName() && attributeType() == AttributeType::CSS && !isTargetAttributeCSSProperty(targetElement(), attributeName()); 175 176 return m_hasInvalidCSSAttributeType.value(); 462 177 } 463 178 -
trunk/Source/WebCore/svg/SVGAnimateElementBase.h
r229694 r243036 24 24 #pragma once 25 25 26 #include "SVGAnimatedType.h"27 #include "SVGAnimatedTypeAnimator.h"28 26 #include "SVGAnimationElement.h" 29 27 #include "SVGNames.h" 30 28 31 29 namespace WebCore { 30 31 class SVGAttributeAnimationControllerBase; 32 32 33 33 class SVGAnimateElementBase : public SVGAnimationElement { … … 36 36 virtual ~SVGAnimateElementBase(); 37 37 38 SVGAttributeAnimationControllerBase& attributeAnimationController(); 39 SVGAttributeAnimationControllerBase* attributeAnimationControllerIfExists() const { return m_attributeAnimationController.get(); } 40 38 41 AnimatedPropertyType determineAnimatedPropertyType(SVGElement&) const; 39 42 40 43 protected: 41 44 SVGAnimateElementBase(const QualifiedName&, Document&); 45 46 bool hasValidAttributeType() const override; 42 47 43 48 void resetAnimatedType() override; … … 54 59 void setTargetElement(SVGElement*) override; 55 60 void setAttributeName(const QualifiedName&) override; 56 void resetAnimatedPropertyType() override; 57 58 AnimatedPropertyType m_animatedPropertyType; 61 void resetAnimation() override; 59 62 60 63 private: 61 SVGAnimatedTypeAnimator* ensureAnimator(); 62 bool animatedPropertyTypeSupportsAddition() const; 64 bool hasInvalidCSSAttributeType() const; 63 65 64 bool hasValidAttributeType() override; 65 66 std::unique_ptr<SVGAnimatedType> m_fromType; 67 std::unique_ptr<SVGAnimatedType> m_toType; 68 std::unique_ptr<SVGAnimatedType> m_toAtEndOfDurationType; 69 std::unique_ptr<SVGAnimatedType> m_animatedType; 70 71 SVGElementAnimatedPropertyList m_animatedProperties; 72 std::unique_ptr<SVGAnimatedTypeAnimator> m_animator; 66 mutable Optional<bool> m_hasInvalidCSSAttributeType; 67 std::unique_ptr<SVGAttributeAnimationControllerBase> m_attributeAnimationController; 73 68 }; 74 69 -
trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp
r242970 r243036 58 58 } 59 59 60 bool SVGAnimateMotionElement::hasValidAttributeType() 60 bool SVGAnimateMotionElement::hasValidAttributeType() const 61 61 { 62 62 auto targetElement = makeRefPtr(this->targetElement()); … … 91 91 } 92 92 93 bool SVGAnimateMotionElement::hasValidAttributeName() 93 bool SVGAnimateMotionElement::hasValidAttributeName() const 94 94 { 95 95 // AnimateMotion does not use attributeName so it is always valid. -
trunk/Source/WebCore/svg/SVGAnimateMotionElement.h
r229694 r243036 37 37 SVGAnimateMotionElement(const QualifiedName&, Document&); 38 38 39 bool hasValidAttributeType() override;40 bool hasValidAttributeName() override;39 bool hasValidAttributeType() const override; 40 bool hasValidAttributeName() const override; 41 41 42 42 void parseAttribute(const QualifiedName&, const AtomicString&) override; -
trunk/Source/WebCore/svg/SVGAnimateTransformElement.cpp
r229694 r243036 44 44 } 45 45 46 bool SVGAnimateTransformElement::hasValidAttributeType() 46 bool SVGAnimateTransformElement::hasValidAttributeType() const 47 47 { 48 48 if (!this->targetElement()) … … 52 52 return false; 53 53 54 return m_animatedPropertyType == AnimatedTransformList;54 return SVGAnimateElementBase::hasValidAttributeType(); 55 55 } 56 56 -
trunk/Source/WebCore/svg/SVGAnimateTransformElement.h
r229694 r243036 40 40 SVGAnimateTransformElement(const QualifiedName&, Document&); 41 41 42 bool hasValidAttributeType() final;42 bool hasValidAttributeType() const final; 43 43 void parseAttribute(const QualifiedName&, const AtomicString&) final; 44 44 -
trunk/Source/WebCore/svg/SVGAnimatedPointList.h
r234620 r243036 23 23 #include "SVGAnimatedListPropertyTearOff.h" 24 24 #include "SVGAnimatedTypeAnimator.h" 25 #include "SVGAttribute.h" 26 #include "SVGAttributeAccessor.h" 25 27 #include "SVGPointList.h" 26 28 -
trunk/Source/WebCore/svg/SVGAnimationElement.cpp
r242970 r243036 306 306 else 307 307 m_attributeType = AttributeType::Auto; 308 checkInvalidCSSAttributeType(targetElement());309 308 } 310 309 … … 668 667 m_toPropertyValueType = InheritValue; 669 668 } 670 void SVGAnimationElement::resetAnimat edPropertyType()669 void SVGAnimationElement::resetAnimation() 671 670 { 672 671 m_lastValuesAnimationFrom = String(); … … 674 673 } 675 674 676 void SVGAnimationElement::setTargetElement(SVGElement* target) 677 { 678 SVGSMILElement::setTargetElement(target); 679 checkInvalidCSSAttributeType(target); 680 } 681 682 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) 683 { 684 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attributeType() == AttributeType::CSS && !isTargetAttributeCSSProperty(target, attributeName()); 685 } 686 687 } 675 } -
trunk/Source/WebCore/svg/SVGAnimationElement.h
r242970 r243036 37 37 class TimeContainer; 38 38 39 enum class AnimationMode : uint8_t {40 None,41 FromTo,42 FromBy,43 To,44 By,45 Values,46 Path // Used by AnimateMotion.47 };48 49 39 // If we have 'currentColor' or 'inherit' as animation value, we need to grab 50 40 // the value during the animation since the value can be animated itself. 51 41 enum AnimatedPropertyValueType { RegularPropertyValue, CurrentColorValue, InheritValue }; 52 53 enum class CalcMode : uint8_t { Discrete, Linear, Paced, Spline };54 42 55 43 class SVGAnimationElement : public SVGSMILElement, public SVGExternalResourcesRequired, public SVGTests { … … 147 135 } 148 136 137 enum class AttributeType : uint8_t { CSS, XML, Auto }; 138 AttributeType attributeType() const { return m_attributeType; } 139 140 void computeCSSPropertyValue(SVGElement*, CSSPropertyID, String& value); 141 virtual void determinePropertyValueTypes(const String& from, const String& to); 142 149 143 protected: 150 144 SVGAnimationElement(const QualifiedName&, Document&); … … 154 148 const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } 155 149 156 void computeCSSPropertyValue(SVGElement*, CSSPropertyID, String& value); 157 virtual void determinePropertyValueTypes(const String& from, const String& to); 158 virtual void resetAnimatedPropertyType(); 150 virtual void resetAnimation(); 159 151 160 152 static bool isSupportedAttribute(const QualifiedName&); … … 162 154 void svgAttributeChanged(const QualifiedName&) override; 163 155 164 enum class AttributeType { CSS, XML, Auto };165 AttributeType attributeType() const { return m_attributeType; }166 167 156 String toValue() const; 168 157 String byValue() const; … … 178 167 AnimatedPropertyValueType m_toPropertyValueType { RegularPropertyValue }; 179 168 180 void setTargetElement(SVGElement*) override;181 169 void setAttributeName(const QualifiedName&) override { } 182 bool hasInvalidCSSAttributeType() const { return m_hasInvalidCSSAttributeType; }183 void checkInvalidCSSAttributeType(SVGElement*);184 170 185 171 virtual void updateAnimationMode(); … … 219 205 String m_lastValuesAnimationFrom; 220 206 String m_lastValuesAnimationTo; 221 bool m_hasInvalidCSSAttributeType { false };222 207 CalcMode m_calcMode { CalcMode::Linear }; 223 208 AnimationMode m_animationMode { AnimationMode::None }; -
trunk/Source/WebCore/svg/SVGAnimatorFactory.h
r208668 r243036 24 24 #include "SVGAnimatedColor.h" 25 25 #include "SVGAnimatedEnumeration.h" 26 #include "SVGAnimatedInteger.h"27 #include "SVGAnimatedIntegerOptionalInteger.h"28 26 #include "SVGAnimatedLength.h" 29 27 #include "SVGAnimatedLengthList.h" … … 59 57 return std::make_unique<SVGAnimatedEnumerationAnimator>(animationElement, contextElement); 60 58 case AnimatedInteger: 61 return std::make_unique<SVGAnimatedIntegerAnimator>(animationElement, contextElement);59 return nullptr; 62 60 case AnimatedIntegerOptionalInteger: 63 return std::make_unique<SVGAnimatedIntegerOptionalIntegerAnimator>(animationElement, contextElement);61 return nullptr; 64 62 case AnimatedLength: 65 63 return std::make_unique<SVGAnimatedLengthAnimator>(animationElement, contextElement); -
trunk/Source/WebCore/svg/SVGAttributeAnimationController.h
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "SVGAnimatedPropertyType.h" 29 #include <wtf/WeakPtr.h> 28 #include "SVGAttributeAnimationControllerBase.h" 30 29 31 30 namespace WebCore { 32 31 33 class SVGA ttribute;32 class SVGAnimationElement; 34 33 class SVGElement; 35 class SVG LegacyAnimatedProperty;34 class SVGSMILElement; 36 35 37 class SVGAttribute OwnerProxy{36 class SVGAttributeAnimationController : public SVGAttributeAnimationControllerBase { 38 37 public: 39 SVGAttributeOwnerProxy(SVGElement&); 38 SVGAttributeAnimationController(SVGAnimationElement&, SVGElement&); 39 40 private: 41 SVGAttributeAnimator* animator() const; 42 SVGAttributeAnimator* animatorIfExists() const { return m_animator.get(); } 40 43 41 virtual ~SVGAttributeOwnerProxy() = default; 44 void resetAnimatedType() override; 45 void clearAnimatedType(SVGElement* targetElement) override; 46 47 bool calculateFromAndToValues(const String& fromString, const String& toString) override; 48 bool calculateFromAndByValues(const String& fromString, const String& byString) override; 49 bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) override; 42 50 43 SVGElement& element() const;51 void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement) override; 44 52 45 virtual void synchronizeAttributes() const = 0; 46 virtual void synchronizeAttribute(const QualifiedName&) const = 0; 53 void applyResultsToTarget() override; 54 float calculateDistance(const String& fromString, const String& toString) override; 55 56 bool isAdditive() const override; 57 bool hasValidAttributeType() const override; 47 58 48 virtual Vector<AnimatedPropertyType> animatedTypes(const QualifiedName&) const = 0;59 bool isDiscreteAnimator() const; 49 60 50 virtual RefPtr<SVGLegacyAnimatedProperty> lookupOrCreateAnimatedProperty(const SVGAttribute&) const = 0; 51 virtual RefPtr<SVGLegacyAnimatedProperty> lookupAnimatedProperty(const SVGAttribute&) const = 0; 52 virtual Vector<RefPtr<SVGLegacyAnimatedProperty>> lookupOrCreateAnimatedProperties(const QualifiedName&) const = 0; 53 54 protected: 55 WeakPtr<SVGElement> m_element; 61 mutable std::unique_ptr<SVGAttributeAnimator> m_animator; 56 62 }; 57 63 58 } 64 } // namespace WebCore -
trunk/Source/WebCore/svg/SVGAttributeAnimationControllerBase.h
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "SVGAnimatedPropertyType.h"29 #include <wtf/WeakPtr.h>30 31 28 namespace WebCore { 32 29 33 class SVGA ttribute;30 class SVGAnimationElement; 34 31 class SVGElement; 35 class SVG LegacyAnimatedProperty;32 class SVGSMILElement; 36 33 37 class SVGAttribute OwnerProxy{34 class SVGAttributeAnimationControllerBase { 38 35 public: 39 SVGAttributeOwnerProxy(SVGElement&); 36 SVGAttributeAnimationControllerBase(SVGAnimationElement&, SVGElement&); 37 virtual ~SVGAttributeAnimationControllerBase() = default; 40 38 41 virtual ~SVGAttributeOwnerProxy() = default;39 static AnimatedPropertyType determineAnimatedPropertyType(const SVGAnimationElement&, SVGElement&, const QualifiedName&); 42 40 43 SVGElement& element() const; 41 virtual bool isAdditive() const = 0; 42 virtual bool hasValidAttributeType() const = 0; 43 44 virtual void resetAnimatedType() = 0; 45 virtual void clearAnimatedType(SVGElement* targetElement) = 0; 46 47 virtual bool calculateFromAndToValues(const String& fromString, const String& toString) = 0; 48 virtual bool calculateFromAndByValues(const String& fromString, const String& byString) = 0; 49 virtual bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) = 0; 44 50 45 virtual void synchronizeAttributes() const = 0; 46 virtual void synchronizeAttribute(const QualifiedName&) const = 0; 47 48 virtual Vector<AnimatedPropertyType> animatedTypes(const QualifiedName&) const = 0; 49 50 virtual RefPtr<SVGLegacyAnimatedProperty> lookupOrCreateAnimatedProperty(const SVGAttribute&) const = 0; 51 virtual RefPtr<SVGLegacyAnimatedProperty> lookupAnimatedProperty(const SVGAttribute&) const = 0; 52 virtual Vector<RefPtr<SVGLegacyAnimatedProperty>> lookupOrCreateAnimatedProperties(const QualifiedName&) const = 0; 53 51 virtual void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement) = 0; 52 virtual void applyResultsToTarget() = 0; 53 54 virtual float calculateDistance(const String& fromString, const String& toString) = 0; 55 54 56 protected: 55 WeakPtr<SVGElement> m_element; 57 SVGAnimationElement& m_animationElement; 58 SVGElement& m_targetElement; 56 59 }; 57 60 58 } 61 } // namespace WebCore 62 -
trunk/Source/WebCore/svg/SVGElement.cpp
r240305 r243036 701 701 svgElement->synchronizeAttributes(); 702 702 svgElement->elementData()->setAnimatedSVGAttributesAreDirty(false); 703 704 // FIXME: Delete the SVG tear off properties code from this function 705 706 // SVGPropertyRegistry::synchronizeAllAttributes() returns the new values of 707 // the properties which have changed but not committed yet. 708 auto map = svgElement->propertyRegistry().synchronizeAllAttributes(); 709 for (const auto& entry : map) 710 svgElement->setSynchronizedLazyAttribute(entry.key, entry.value); 703 711 } 704 712 … … 707 715 if (!elementData() || !elementData()->animatedSVGAttributesAreDirty()) 708 716 return; 717 718 // FIXME: Delete the SVG tear off properties code from this function 709 719 710 720 SVGElement* nonConstThis = const_cast<SVGElement*>(this); 711 721 if (name == anyQName()) 712 722 synchronizeAllAnimatedSVGAttribute(nonConstThis); 713 else 723 else if (isAnimatedPropertyAttribute(name)) { 724 // If the value of the property has changed, serialize the new value to the attribute. 725 if (auto value = propertyRegistry().synchronize(name)) 726 nonConstThis->setSynchronizedLazyAttribute(name, *value); 727 } else 714 728 nonConstThis->synchronizeAttribute(name); 729 } 730 731 void SVGElement::commitPropertyChange(SVGAnimatedProperty& animatedProperty) 732 { 733 QualifiedName attributeName = propertyRegistry().animatedPropertyAttributeName(animatedProperty); 734 setSynchronizedLazyAttribute(attributeName, animatedProperty.baseValAsString()); 735 736 invalidateSVGAttributes(); 737 svgAttributeChanged(attributeName); 738 } 739 740 bool SVGElement::isAnimatedPropertyAttribute(const QualifiedName& attributeName) const 741 { 742 return propertyRegistry().isAnimatedPropertyAttribute(attributeName); 743 } 744 745 bool SVGElement::isAnimatedAttribute(const QualifiedName& attributeName) const 746 { 747 return isAnimatedPropertyAttribute(attributeName); 748 } 749 750 std::unique_ptr<SVGAttributeAnimator> SVGElement::createAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) 751 { 752 auto animator = propertyRegistry().createAnimator(attributeName, animationMode, calcMode, isAccumulated, isAdditive); 753 if (!animator) 754 return animator; 755 for (auto* instance : instances()) 756 instance->propertyRegistry().appendAnimatedInstance(attributeName, *animator); 757 return animator; 715 758 } 716 759 -
trunk/Source/WebCore/svg/SVGElement.h
r242978 r243036 23 23 #pragma once 24 24 25 #include "SVGAnimated String.h"25 #include "SVGAnimatedPropertyImpl.h" 26 26 #include "SVGAttributeOwnerProxy.h" 27 27 #include "SVGLangSpace.h" … … 29 29 #include "SVGNames.h" 30 30 #include "SVGParsingError.h" 31 #include "SVGPropertyOwnerRegistry.h" 31 32 #include "StyledElement.h" 32 33 #include <wtf/HashMap.h> … … 47 48 void mapAttributeToCSSProperty(HashMap<AtomicStringImpl*, CSSPropertyID>* propertyNameToIdMap, const QualifiedName& attrName); 48 49 49 class SVGElement : public StyledElement, public SVGLangSpace, public CanMakeWeakPtr<SVGElement> {50 class SVGElement : public StyledElement, public SVGLangSpace, public SVGPropertyOwner, public CanMakeWeakPtr<SVGElement> { 50 51 WTF_MAKE_ISO_ALLOCATED(SVGElement); 51 52 public: … … 151 152 Vector<RefPtr<SVGLegacyAnimatedProperty>> lookupOrCreateAnimatedProperties(const QualifiedName& name) { return attributeOwnerProxy().lookupOrCreateAnimatedProperties(name); } 152 153 154 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGElement>; 155 virtual const SVGPropertyRegistry& propertyRegistry() const { return m_propertyRegistry; } 156 157 bool isAnimatedPropertyAttribute(const QualifiedName&) const; 158 bool isAnimatedAttribute(const QualifiedName&) const; 159 160 void commitPropertyChange() override { } 161 void commitPropertyChange(SVGAnimatedProperty&); 162 163 const SVGElement* attributeContextElement() const override { return this; } 164 std::unique_ptr<SVGAttributeAnimator> createAnimator(const QualifiedName&, AnimationMode, CalcMode, bool isAccumulated, bool isAdditive); 165 153 166 // These are needed for the RenderTree, animation and DOM. 154 167 const auto& className() const { return m_className.currentValue(attributeOwnerProxy()); } … … 205 218 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 206 219 SVGAnimatedStringAttribute m_className; 220 221 PropertyRegistry m_propertyRegistry { *this }; 207 222 }; 208 223 -
trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp
r234620 r243036 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 … … 41 41 ASSERT(hasTagName(SVGNames::feConvolveMatrixTag)); 42 42 registerAttributes(); 43 44 static std::once_flag onceFlag; 45 std::call_once(onceFlag, [] { 46 PropertyRegistry::registerProperty<SVGNames::orderAttr, &SVGFEConvolveMatrixElement::m_orderX, &SVGFEConvolveMatrixElement::m_orderY>(); 47 PropertyRegistry::registerProperty<SVGNames::targetXAttr, &SVGFEConvolveMatrixElement::m_targetX>(); 48 PropertyRegistry::registerProperty<SVGNames::targetYAttr, &SVGFEConvolveMatrixElement::m_targetY>(); 49 }); 43 50 } 44 51 … … 60 67 } 61 68 62 const AtomicString& SVGFEConvolveMatrixElement::orderXIdentifier()63 {64 static NeverDestroyed<AtomicString> s_identifier("SVGOrderX", AtomicString::ConstructFromLiteral);65 return s_identifier;66 }67 68 const AtomicString& SVGFEConvolveMatrixElement::orderYIdentifier()69 {70 static NeverDestroyed<AtomicString> s_identifier("SVGOrderY", AtomicString::ConstructFromLiteral);71 return s_identifier;72 }73 74 69 void SVGFEConvolveMatrixElement::registerAttributes() 75 70 { … … 78 73 return; 79 74 registry.registerAttribute<SVGNames::inAttr, &SVGFEConvolveMatrixElement::m_in1>(); 80 registry.registerAttribute<SVGNames::orderAttr,81 &SVGFEConvolveMatrixElement::orderXIdentifier, &SVGFEConvolveMatrixElement::m_orderX,82 &SVGFEConvolveMatrixElement::orderYIdentifier, &SVGFEConvolveMatrixElement::m_orderY>();83 75 registry.registerAttribute<SVGNames::kernelMatrixAttr, &SVGFEConvolveMatrixElement::m_kernelMatrix>(); 84 76 registry.registerAttribute<SVGNames::divisorAttr, &SVGFEConvolveMatrixElement::m_divisor>(); 85 77 registry.registerAttribute<SVGNames::biasAttr, &SVGFEConvolveMatrixElement::m_bias>(); 86 registry.registerAttribute<SVGNames::targetXAttr, &SVGFEConvolveMatrixElement::m_targetX>();87 registry.registerAttribute<SVGNames::targetYAttr, &SVGFEConvolveMatrixElement::m_targetY>();88 78 registry.registerAttribute<SVGNames::edgeModeAttr, EdgeModeType, &SVGFEConvolveMatrixElement::m_edgeMode>(); 89 79 registry.registerAttribute<SVGNames::kernelUnitLengthAttr, … … 103 93 float x, y; 104 94 if (parseNumberOptionalNumber(value, x, y) && x >= 1 && y >= 1) { 105 m_orderX .setValue(x);106 m_orderY .setValue(y);95 m_orderX->setBaseValInternal(x); 96 m_orderY->setBaseValInternal(y); 107 97 } else 108 98 document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing order=\"" + value + "\". Filtered element will not be displayed."); … … 142 132 143 133 if (name == SVGNames::targetXAttr) { 144 m_targetX .setValue(value.string().toUIntStrict());134 m_targetX->setBaseValInternal(value.string().toUIntStrict()); 145 135 return; 146 136 } 147 137 148 138 if (name == SVGNames::targetYAttr) { 149 m_targetY .setValue(value.string().toUIntStrict());139 m_targetY->setBaseValInternal(value.string().toUIntStrict()); 150 140 return; 151 141 } … … 198 188 void SVGFEConvolveMatrixElement::setOrder(float x, float y) 199 189 { 200 m_orderX .setValue(x);201 m_orderY .setValue(y);190 m_orderX->setBaseValInternal(x); 191 m_orderY->setBaseValInternal(y); 202 192 invalidate(); 203 193 } -
trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.h
r234620 r243036 22 22 23 23 #include "FEConvolveMatrix.h" 24 #include "SVGAnimatedBoolean.h"25 #include "SVGAnimatedEnumeration.h"26 #include "SVGAnimatedInteger.h"27 #include "SVGAnimatedNumber.h"28 #include "SVGAnimatedNumberList.h"29 24 #include "SVGFilterPrimitiveStandardAttributes.h" 30 25 … … 74 69 75 70 String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } 76 int orderX() const { return m_orderX .currentValue(attributeOwnerProxy()); }77 int orderY() const { return m_orderY .currentValue(attributeOwnerProxy()); }71 int orderX() const { return m_orderX->currentValue(); } 72 int orderY() const { return m_orderY->currentValue(); } 78 73 const SVGNumberListValues& kernelMatrix() const { return m_kernelMatrix.currentValue(attributeOwnerProxy()); } 79 74 float divisor() const { return m_divisor.currentValue(attributeOwnerProxy()); } 80 75 float bias() const { return m_bias.currentValue(attributeOwnerProxy()); } 81 int targetX() const { return m_targetX .currentValue(attributeOwnerProxy()); }82 int targetY() const { return m_targetY .currentValue(attributeOwnerProxy()); }76 int targetX() const { return m_targetX->currentValue(); } 77 int targetY() const { return m_targetY->currentValue(); } 83 78 EdgeModeType edgeMode() const { return m_edgeMode.currentValue(attributeOwnerProxy()); } 84 79 float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(attributeOwnerProxy()); } … … 87 82 88 83 RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } 89 RefPtr<SVGAnimatedInteger> orderXAnimated() { return m_orderX.animatedProperty(attributeOwnerProxy()); }90 RefPtr<SVGAnimatedInteger> orderYAnimated() { return m_orderY.animatedProperty(attributeOwnerProxy()); }84 SVGAnimatedInteger& orderXAnimated() { return m_orderX; } 85 SVGAnimatedInteger& orderYAnimated() { return m_orderY; } 91 86 RefPtr<SVGAnimatedNumberList> kernelMatrixAnimated() { return m_kernelMatrix.animatedProperty(attributeOwnerProxy()); } 92 87 RefPtr<SVGAnimatedNumber> divisorAnimated() { return m_divisor.animatedProperty(attributeOwnerProxy()); } 93 88 RefPtr<SVGAnimatedNumber> biasAnimated() { return m_bias.animatedProperty(attributeOwnerProxy()); } 94 RefPtr<SVGAnimatedInteger> targetXAnimated() { return m_targetX.animatedProperty(attributeOwnerProxy()); }95 RefPtr<SVGAnimatedInteger> targetYAnimated() { return m_targetY.animatedProperty(attributeOwnerProxy()); }89 SVGAnimatedInteger& targetXAnimated() { return m_targetX; } 90 SVGAnimatedInteger& targetYAnimated() { return m_targetY; } 96 91 RefPtr<SVGAnimatedEnumeration> edgeModeAnimated() { return m_edgeMode.animatedProperty(attributeOwnerProxy()); } 97 92 RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(attributeOwnerProxy()); } … … 106 101 static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } 107 102 static void registerAttributes(); 103 104 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEConvolveMatrixElement, SVGFilterPrimitiveStandardAttributes>; 105 const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } 108 106 109 107 const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } … … 114 112 RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; 115 113 116 static const AtomicString& orderXIdentifier();117 static const AtomicString& orderYIdentifier();118 114 static const AtomicString& kernelUnitLengthXIdentifier(); 119 115 static const AtomicString& kernelUnitLengthYIdentifier(); 120 116 121 117 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 118 PropertyRegistry m_propertyRegistry { *this }; 119 122 120 SVGAnimatedStringAttribute m_in1; 123 SVGAnimatedIntegerAttribute m_orderX;124 SVGAnimatedIntegerAttribute m_orderY;121 Ref<SVGAnimatedInteger> m_orderX { SVGAnimatedInteger::create(this) }; 122 Ref<SVGAnimatedInteger> m_orderY { SVGAnimatedInteger::create(this) }; 125 123 SVGAnimatedNumberListAttribute m_kernelMatrix; 126 124 SVGAnimatedNumberAttribute m_divisor; 127 125 SVGAnimatedNumberAttribute m_bias; 128 SVGAnimatedIntegerAttribute m_targetX;129 SVGAnimatedIntegerAttribute m_targetY;126 Ref<SVGAnimatedInteger> m_targetX { SVGAnimatedInteger::create(this) }; 127 Ref<SVGAnimatedInteger> m_targetY { SVGAnimatedInteger::create(this) }; 130 128 SVGAnimatedEnumerationAttribute<EdgeModeType> m_edgeMode { EDGEMODE_DUPLICATE }; 131 129 SVGAnimatedNumberAttribute m_kernelUnitLengthX; -
trunk/Source/WebCore/svg/SVGFETurbulenceElement.cpp
r234620 r243036 36 36 ASSERT(hasTagName(SVGNames::feTurbulenceTag)); 37 37 registerAttributes(); 38 39 static std::once_flag onceFlag; 40 std::call_once(onceFlag, [] { 41 PropertyRegistry::registerProperty<SVGNames::numOctavesAttr, &SVGFETurbulenceElement::m_numOctaves>(); 42 }); 38 43 } 39 44 … … 63 68 &SVGFETurbulenceElement::baseFrequencyXIdentifier, &SVGFETurbulenceElement::m_baseFrequencyX, 64 69 &SVGFETurbulenceElement::baseFrequencyYIdentifier, &SVGFETurbulenceElement::m_baseFrequencyY>(); 65 registry.registerAttribute<SVGNames::numOctavesAttr, &SVGFETurbulenceElement::m_numOctaves>();66 70 registry.registerAttribute<SVGNames::seedAttr, &SVGFETurbulenceElement::m_seed>(); 67 71 registry.registerAttribute<SVGNames::stitchTilesAttr, SVGStitchOptions, &SVGFETurbulenceElement::m_stitchTiles>(); … … 100 104 101 105 if (name == SVGNames::numOctavesAttr) { 102 m_numOctaves .setValue(value.string().toUIntStrict());106 m_numOctaves->setBaseValInternal(value.string().toUIntStrict()); 103 107 return; 104 108 } … … 127 131 void SVGFETurbulenceElement::svgAttributeChanged(const QualifiedName& attrName) 128 132 { 129 if (isKnownAttribute(attrName) ) {133 if (isKnownAttribute(attrName) || PropertyRegistry::isKnownAttribute(attrName)) { 130 134 InstanceInvalidationGuard guard(*this); 131 135 primitiveAttributeChanged(attrName); -
trunk/Source/WebCore/svg/SVGFETurbulenceElement.h
r234620 r243036 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 … … 24 24 #include "FETurbulence.h" 25 25 #include "SVGAnimatedEnumeration.h" 26 #include "SVGAnimatedInteger.h"27 26 #include "SVGAnimatedNumber.h" 28 27 #include "SVGFilterPrimitiveStandardAttributes.h" … … 101 100 float baseFrequencyX() const { return m_baseFrequencyX.currentValue(attributeOwnerProxy()); } 102 101 float baseFrequencyY() const { return m_baseFrequencyY.currentValue(attributeOwnerProxy()); } 103 int numOctaves() const { return m_numOctaves .currentValue(attributeOwnerProxy()); }102 int numOctaves() const { return m_numOctaves->currentValue(); } 104 103 float seed() const { return m_seed.currentValue(attributeOwnerProxy()); } 105 104 SVGStitchOptions stitchTiles() const { return m_stitchTiles.currentValue(attributeOwnerProxy()); } … … 108 107 RefPtr<SVGAnimatedNumber> baseFrequencyXAnimated() { return m_baseFrequencyX.animatedProperty(attributeOwnerProxy()); } 109 108 RefPtr<SVGAnimatedNumber> baseFrequencyYAnimated() { return m_baseFrequencyY.animatedProperty(attributeOwnerProxy()); } 110 RefPtr<SVGAnimatedInteger> numOctavesAnimated() { return m_numOctaves.animatedProperty(attributeOwnerProxy()); }109 SVGAnimatedInteger& numOctavesAnimated() { return m_numOctaves; } 111 110 RefPtr<SVGAnimatedNumber> seedAnimated() { return m_seed.animatedProperty(attributeOwnerProxy()); } 112 111 RefPtr<SVGAnimatedEnumeration> stitchTilesAnimated() { return m_stitchTiles.animatedProperty(attributeOwnerProxy()); } … … 120 119 static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } 121 120 static void registerAttributes(); 121 122 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFETurbulenceElement, SVGFilterPrimitiveStandardAttributes>; 123 const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } 122 124 123 125 const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } … … 132 134 133 135 AttributeOwnerProxy m_attributeOwnerProxy { *this }; 136 PropertyRegistry m_propertyRegistry { *this }; 134 137 SVGAnimatedNumberAttribute m_baseFrequencyX; 135 138 SVGAnimatedNumberAttribute m_baseFrequencyY; 136 SVGAnimatedIntegerAttribute m_numOctaves { 1};139 Ref<SVGAnimatedInteger> m_numOctaves { SVGAnimatedInteger::create(this, 1) }; 137 140 SVGAnimatedNumberAttribute m_seed; 138 141 SVGAnimatedEnumerationAttribute<SVGStitchOptions> m_stitchTiles { SVG_STITCHTYPE_NOSTITCH }; -
trunk/Source/WebCore/svg/SVGFilterElement.h
r236447 r243036 25 25 26 26 #include "SVGAnimatedEnumeration.h" 27 #include "SVGAnimatedInteger.h"28 27 #include "SVGAnimatedLength.h" 29 28 #include "SVGElement.h" -
trunk/Source/WebCore/svg/SVGLegacyAttributeAnimationController.cpp
r243035 r243036 1 1 /* 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 4 * Copyright (C) 2008 Apple Inc. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 6 * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 7 3 * 8 * This library is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Library General Public 10 * License as published by the Free Software Foundation; either 11 * version 2 of the License, or (at your option) any later version. 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 12 * 13 * This library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Library General Public License for more details. 17 * 18 * You should have received a copy of the GNU Library General Public License 19 * along with this library; see the file COPYING.LIB. If not, write to 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 * Boston, MA 02110-1301, USA. 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 24 */ 23 25 24 26 #include "config.h" 25 #include "SVG AnimateElementBase.h"27 #include "SVGLegacyAttributeAnimationController.h" 26 28 27 29 #include "CSSPropertyNames.h" 28 30 #include "CSSPropertyParser.h" 29 31 #include "QualifiedName.h" 30 #include "RenderObject.h" 32 #include "SVGAnimateElementBase.h" 33 #include "SVGAnimationElement.h" 31 34 #include "SVGAnimatorFactory.h" 32 35 #include "SVGElement.h" … … 37 40 namespace WebCore { 38 41 39 WTF_MAKE_ISO_ALLOCATED_IMPL(SVGAnimateElementBase); 40 41 SVGAnimateElementBase::SVGAnimateElementBase(const QualifiedName& tagName, Document& document) 42 : SVGAnimationElement(tagName, document) 43 , m_animatedPropertyType(AnimatedString) 44 { 45 ASSERT(hasTagName(SVGNames::animateTag) || hasTagName(SVGNames::setTag) || hasTagName(SVGNames::animateColorTag) || hasTagName(SVGNames::animateTransformTag)); 46 } 47 48 SVGAnimateElementBase::~SVGAnimateElementBase() = default; 49 50 bool SVGAnimateElementBase::hasValidAttributeType() 51 { 52 if (!this->targetElement()) 53 return false; 54 55 return m_animatedPropertyType != AnimatedUnknown && !hasInvalidCSSAttributeType(); 56 } 57 58 AnimatedPropertyType SVGAnimateElementBase::determineAnimatedPropertyType(SVGElement& targetElement) const 59 { 60 auto propertyTypes = targetElement.animatedPropertyTypesForAttribute(attributeName()); 61 if (propertyTypes.isEmpty()) 62 return AnimatedUnknown; 63 64 ASSERT(propertyTypes.size() <= 2); 65 AnimatedPropertyType type = propertyTypes[0]; 66 if (hasTagName(SVGNames::animateColorTag) && type != AnimatedColor) 67 return AnimatedUnknown; 68 69 // Animations of transform lists are not allowed for <animate> or <set> 70 // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties 71 if (type == AnimatedTransformList && !hasTagName(SVGNames::animateTransformTag)) 72 return AnimatedUnknown; 73 74 // Fortunately there's just one special case needed here: SVGMarkerElements orientAttr, which 75 // corresponds to SVGAnimatedAngle orientAngle and SVGAnimatedEnumeration orientType. We have to 76 // figure out whose value to change here. 77 if (targetElement.hasTagName(SVGNames::markerTag) && type == AnimatedAngle) { 78 ASSERT(propertyTypes.size() == 2); 79 ASSERT(propertyTypes[0] == AnimatedAngle); 80 ASSERT(propertyTypes[1] == AnimatedEnumeration); 81 } else if (propertyTypes.size() == 2) 82 ASSERT(propertyTypes[0] == propertyTypes[1]); 83 84 return type; 85 } 86 87 void SVGAnimateElementBase::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement) 88 { 89 ASSERT(resultElement); 90 auto targetElement = makeRefPtr(this->targetElement()); 91 if (!targetElement) 92 return; 93 94 const QualifiedName& attributeName = this->attributeName(); 95 ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement.get(), attributeName); 96 97 if (shouldApply == DontApplyAnimation) 98 return; 99 100 ASSERT(m_animatedPropertyType == determineAnimatedPropertyType(*targetElement)); 101 102 ASSERT(percentage >= 0 && percentage <= 1); 103 ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag)); 104 ASSERT(m_animatedPropertyType != AnimatedUnknown); 105 ASSERT(m_animator); 106 ASSERT(m_animator->type() == m_animatedPropertyType); 107 ASSERT(m_fromType); 108 ASSERT(m_fromType->type() == m_animatedPropertyType); 109 ASSERT(m_toType); 110 111 if (shouldApply == ApplyXMLAnimation || shouldApply == ApplyXMLandCSSAnimation) { 112 // SVG DOM animVal animation code-path. 113 if (m_animator->findAnimatedPropertiesForAttributeName(*targetElement, attributeName).isEmpty()) 114 return; 115 } 116 117 SVGAnimateElementBase& resultAnimationElement = downcast<SVGAnimateElementBase>(*resultElement); 118 ASSERT(resultAnimationElement.m_animatedType); 119 ASSERT(resultAnimationElement.m_animatedPropertyType == m_animatedPropertyType); 120 121 if (hasTagName(SVGNames::setTag)) 122 percentage = 1; 123 124 if (calcMode() == CalcMode::Discrete) 125 percentage = percentage < 0.5 ? 0 : 1; 126 127 // Target element might have changed. 128 m_animator->setContextElement(targetElement.get()); 129 130 // Be sure to detach list wrappers before we modfiy their underlying value. If we'd do 131 // if after calculateAnimatedValue() ran the cached pointers in the list propery tear 132 // offs would point nowhere, and we couldn't create copies of those values anymore, 133 // while detaching. This is covered by assertions, moving this down would fire them. 134 if (!m_animatedProperties.isEmpty()) 135 m_animator->animValWillChange(m_animatedProperties); 136 137 // Values-animation accumulates using the last values entry corresponding to the end of duration time. 138 SVGAnimatedType* toAtEndOfDurationType = m_toAtEndOfDurationType ? m_toAtEndOfDurationType.get() : m_toType.get(); 139 m_animator->calculateAnimatedValue(percentage, repeatCount, m_fromType.get(), m_toType.get(), toAtEndOfDurationType, resultAnimationElement.m_animatedType.get()); 140 } 141 142 bool SVGAnimateElementBase::calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) 143 { 144 if (toAtEndOfDurationString.isEmpty()) 145 return false; 146 m_toAtEndOfDurationType = ensureAnimator()->constructFromString(toAtEndOfDurationString); 147 return true; 148 } 149 150 bool SVGAnimateElementBase::calculateFromAndToValues(const String& fromString, const String& toString) 151 { 152 if (!this->targetElement()) 153 return false; 154 155 determinePropertyValueTypes(fromString, toString); 156 ensureAnimator()->calculateFromAndToValues(m_fromType, m_toType, fromString, toString); 42 SVGLegacyAttributeAnimationController::SVGLegacyAttributeAnimationController(SVGAnimationElement& animationElement, SVGElement& targetElement) 43 : SVGAttributeAnimationControllerBase(animationElement, targetElement) 44 , m_animatedPropertyType(determineAnimatedPropertyType(animationElement, targetElement, animationElement.attributeName())) 45 { 46 } 47 48 SVGAnimatedTypeAnimator& SVGLegacyAttributeAnimationController::animatedTypeAnimator() 49 { 50 if (!m_animator) 51 m_animator = SVGAnimatorFactory::create(&m_animationElement, &m_targetElement, m_animatedPropertyType); 157 52 ASSERT(m_animatedPropertyType == m_animator->type()); 158 return true; 159 } 160 161 bool SVGAnimateElementBase::calculateFromAndByValues(const String& fromString, const String& byString) 162 { 163 if (!this->targetElement()) 164 return false; 165 166 if (animationMode() == AnimationMode::By && !isAdditive()) 167 return false; 168 169 // from-by animation may only be used with attributes that support addition (e.g. most numeric attributes). 170 if (animationMode() == AnimationMode::FromBy && !animatedPropertyTypeSupportsAddition()) 171 return false; 172 173 ASSERT(!hasTagName(SVGNames::setTag)); 174 175 determinePropertyValueTypes(fromString, byString); 176 ensureAnimator()->calculateFromAndByValues(m_fromType, m_toType, fromString, byString); 177 ASSERT(m_animatedPropertyType == m_animator->type()); 178 return true; 179 } 180 181 #ifndef NDEBUG 182 static inline bool propertyTypesAreConsistent(AnimatedPropertyType expectedPropertyType, const SVGElementAnimatedPropertyList& animatedTypes) 183 { 184 for (auto& type : animatedTypes) { 185 for (auto& property : type.properties) { 186 if (expectedPropertyType != property->animatedPropertyType()) { 187 // This is the only allowed inconsistency. SVGAnimatedAngleAnimator handles both SVGAnimatedAngle & SVGAnimatedEnumeration for markers orient attribute. 188 if (expectedPropertyType == AnimatedAngle && property->animatedPropertyType() == AnimatedEnumeration) 189 return true; 190 return false; 191 } 192 } 193 } 194 195 return true; 196 } 197 #endif 198 199 void SVGAnimateElementBase::resetAnimatedType() 200 { 201 SVGAnimatedTypeAnimator* animator = ensureAnimator(); 202 ASSERT(m_animatedPropertyType == animator->type()); 203 204 auto targetElement = makeRefPtr(this->targetElement()); 205 if (!targetElement) 206 return; 207 208 const QualifiedName& attributeName = this->attributeName(); 209 ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement.get(), attributeName); 210 211 if (shouldApply == DontApplyAnimation) 212 return; 213 214 if (shouldApply == ApplyXMLAnimation || shouldApply == ApplyXMLandCSSAnimation) { 215 // SVG DOM animVal animation code-path. 216 m_animatedProperties = animator->findAnimatedPropertiesForAttributeName(*targetElement, attributeName); 217 if (m_animatedProperties.isEmpty()) 218 return; 219 220 ASSERT(propertyTypesAreConsistent(m_animatedPropertyType, m_animatedProperties)); 221 if (!m_animatedType) 222 m_animatedType = animator->startAnimValAnimation(m_animatedProperties); 223 else { 224 animator->resetAnimValToBaseVal(m_animatedProperties, *m_animatedType); 225 animator->animValDidChange(m_animatedProperties); 226 } 227 return; 228 } 229 230 // CSS properties animation code-path. 231 ASSERT(m_animatedProperties.isEmpty()); 232 String baseValue; 233 234 if (shouldApply == ApplyCSSAnimation) { 235 ASSERT(SVGAnimationElement::isTargetAttributeCSSProperty(targetElement.get(), attributeName)); 236 computeCSSPropertyValue(targetElement.get(), cssPropertyID(attributeName.localName()), baseValue); 237 } 238 239 if (!m_animatedType) 240 m_animatedType = animator->constructFromString(baseValue); 241 else 242 m_animatedType->setValueAsString(attributeName, baseValue); 243 } 244 245 static inline void applyCSSPropertyToTarget(SVGElement& targetElement, CSSPropertyID id, const String& value) 246 { 247 ASSERT(!targetElement.m_deletionHasBegun); 248 249 if (!targetElement.ensureAnimatedSMILStyleProperties().setProperty(id, value, false)) 250 return; 251 252 targetElement.invalidateStyle(); 253 } 254 255 static inline void removeCSSPropertyFromTarget(SVGElement& targetElement, CSSPropertyID id) 256 { 257 ASSERT(!targetElement.m_deletionHasBegun); 258 targetElement.ensureAnimatedSMILStyleProperties().removeProperty(id); 259 targetElement.invalidateStyle(); 260 } 261 262 static inline void applyCSSPropertyToTargetAndInstances(SVGElement& targetElement, const QualifiedName& attributeName, const String& valueAsString) 263 { 264 // FIXME: Do we really need to check both isConnected and !parentNode? 265 if (attributeName == anyQName() || !targetElement.isConnected() || !targetElement.parentNode()) 266 return; 267 268 CSSPropertyID id = cssPropertyID(attributeName.localName()); 269 270 SVGElement::InstanceUpdateBlocker blocker(targetElement); 271 applyCSSPropertyToTarget(targetElement, id, valueAsString); 272 273 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. 274 for (auto* instance : targetElement.instances()) 275 applyCSSPropertyToTarget(*instance, id, valueAsString); 276 } 277 278 static inline void removeCSSPropertyFromTargetAndInstances(SVGElement& targetElement, const QualifiedName& attributeName) 279 { 280 // FIXME: Do we really need to check both isConnected and !parentNode? 281 if (attributeName == anyQName() || !targetElement.isConnected() || !targetElement.parentNode()) 282 return; 283 284 CSSPropertyID id = cssPropertyID(attributeName.localName()); 285 286 SVGElement::InstanceUpdateBlocker blocker(targetElement); 287 removeCSSPropertyFromTarget(targetElement, id); 288 289 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. 290 for (auto* instance : targetElement.instances()) 291 removeCSSPropertyFromTarget(*instance, id); 292 } 293 294 static inline void notifyTargetAboutAnimValChange(SVGElement& targetElement, const QualifiedName& attributeName) 295 { 296 ASSERT(!targetElement.m_deletionHasBegun); 297 targetElement.svgAttributeChanged(attributeName); 298 } 299 300 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement& targetElement, const QualifiedName& attributeName) 301 { 302 if (attributeName == anyQName() || !targetElement.isConnected() || !targetElement.parentNode()) 303 return; 304 305 SVGElement::InstanceUpdateBlocker blocker(targetElement); 306 notifyTargetAboutAnimValChange(targetElement, attributeName); 307 308 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. 309 for (auto* instance : targetElement.instances()) 310 notifyTargetAboutAnimValChange(*instance, attributeName); 311 } 312 313 void SVGAnimateElementBase::clearAnimatedType(SVGElement* targetElement) 314 { 315 if (!m_animatedType) 316 return; 317 318 // If the SVGAnimatedType is a list type, e.g. SVGLengthListValues, the wrappers of the 319 // animated properties have to be detached from the items in the list before it's deleted. 320 if (!m_animatedProperties.isEmpty()) 321 m_animator->animValWillChange(m_animatedProperties); 322 323 if (!targetElement) { 324 m_animatedType = nullptr; 325 return; 326 } 327 328 if (m_animatedProperties.isEmpty()) { 329 // CSS properties animation code-path. 330 removeCSSPropertyFromTargetAndInstances(*targetElement, attributeName()); 331 m_animatedType = nullptr; 332 return; 333 } 334 335 ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName()); 336 if (shouldApply == ApplyXMLandCSSAnimation) 337 removeCSSPropertyFromTargetAndInstances(*targetElement, attributeName()); 338 339 // SVG DOM animVal animation code-path. 340 if (m_animator) { 341 m_animator->stopAnimValAnimation(m_animatedProperties); 342 notifyTargetAndInstancesAboutAnimValChange(*targetElement, attributeName()); 343 } 344 345 m_animatedProperties.clear(); 346 m_animatedType = nullptr; 347 } 348 349 void SVGAnimateElementBase::applyResultsToTarget() 350 { 351 ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag)); 352 ASSERT(m_animatedPropertyType != AnimatedUnknown); 353 ASSERT(m_animator); 354 355 // Early exit if our animated type got destroyed by a previous endedActiveInterval(). 356 if (!m_animatedType) 357 return; 358 359 auto targetElement = makeRefPtr(this->targetElement()); 360 const QualifiedName& attributeName = this->attributeName(); 361 362 ASSERT(targetElement); 363 364 if (m_animatedProperties.isEmpty()) { 365 // CSS properties animation code-path. 366 // Convert the result of the animation to a String and apply it as CSS property on the target & all instances. 367 applyCSSPropertyToTargetAndInstances(*targetElement, attributeName, m_animatedType->valueAsString()); 368 return; 369 } 370 371 // We do update the style and the animation property independent of each other. 372 ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement.get(), attributeName); 373 if (shouldApply == ApplyXMLandCSSAnimation) 374 applyCSSPropertyToTargetAndInstances(*targetElement, attributeName, m_animatedType->valueAsString()); 375 376 // SVG DOM animVal animation code-path. 377 // At this point the SVG DOM values are already changed, unlike for CSS. 378 // We only have to trigger update notifications here. 379 m_animator->animValDidChange(m_animatedProperties); 380 notifyTargetAndInstancesAboutAnimValChange(*targetElement, attributeName); 381 } 382 383 bool SVGAnimateElementBase::animatedPropertyTypeSupportsAddition() const 53 return *m_animator; 54 } 55 56 bool SVGLegacyAttributeAnimationController::isAdditive() const 384 57 { 385 58 // Spec: http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties. … … 411 84 } 412 85 413 bool SVGAnimateElementBase::isAdditive() const 414 { 415 if (animationMode() == AnimationMode::By || animationMode() == AnimationMode::FromBy) { 416 if (!animatedPropertyTypeSupportsAddition()) 417 return false; 418 } 419 420 return SVGAnimationElement::isAdditive(); 421 } 422 423 float SVGAnimateElementBase::calculateDistance(const String& fromString, const String& toString) 424 { 425 // FIXME: A return value of float is not enough to support paced animations on lists. 426 if (!this->targetElement()) 427 return -1; 428 429 return ensureAnimator()->calculateDistance(fromString, toString); 430 } 431 432 void SVGAnimateElementBase::setTargetElement(SVGElement* target) 433 { 434 SVGAnimationElement::setTargetElement(target); 435 resetAnimatedPropertyType(); 436 } 437 438 void SVGAnimateElementBase::setAttributeName(const QualifiedName& attributeName) 439 { 440 SVGSMILElement::setAttributeName(attributeName); 441 checkInvalidCSSAttributeType(targetElement()); 442 resetAnimatedPropertyType(); 443 } 444 445 void SVGAnimateElementBase::resetAnimatedPropertyType() 446 { 447 SVGAnimationElement::resetAnimatedPropertyType(); 448 ASSERT(!m_animatedType); 449 m_fromType = nullptr; 450 m_toType = nullptr; 451 m_toAtEndOfDurationType = nullptr; 452 m_animator = nullptr; 453 m_animatedPropertyType = targetElement() ? determineAnimatedPropertyType(*targetElement()) : AnimatedString; 454 } 455 456 SVGAnimatedTypeAnimator* SVGAnimateElementBase::ensureAnimator() 457 { 458 if (!m_animator) 459 m_animator = SVGAnimatorFactory::create(this, targetElement(), m_animatedPropertyType); 86 bool SVGLegacyAttributeAnimationController::hasValidAttributeType() const 87 { 88 return m_animatedPropertyType != AnimatedUnknown; 89 } 90 91 bool SVGLegacyAttributeAnimationController::calculateFromAndToValues(const String& fromString, const String& toString) 92 { 93 m_animationElement.determinePropertyValueTypes(fromString, toString); 94 animatedTypeAnimator().calculateFromAndToValues(m_fromType, m_toType, fromString, toString); 460 95 ASSERT(m_animatedPropertyType == m_animator->type()); 461 return m_animator.get(); 462 } 463 464 } // namespace WebCore 96 return true; 97 } 98 99 bool SVGLegacyAttributeAnimationController::calculateFromAndByValues(const String& fromString, const String& byString) 100 { 101 if (m_animationElement.animationMode() == AnimationMode::By && !isAdditive()) 102 return false; 103 104 // from-by animation may only be used with attributes that support addition (e.g. most numeric attributes). 105 if (m_animationElement.animationMode() == AnimationMode::FromBy && !isAdditive()) 106 return false; 107 108 m_animationElement.determinePropertyValueTypes(fromString, byString); 109 animatedTypeAnimator().calculateFromAndByValues(m_fromType, m_toType, fromString, byString); 110 ASSERT(m_animatedPropertyType == m_animator->type()); 111 return true; 112 } 113 114 bool SVGLegacyAttributeAnimationController::calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) 115 { 116 if (toAtEndOfDurationString.isEmpty()) 117 return false; 118 m_toAtEndOfDurationType = animatedTypeAnimator().constructFromString(toAtEndOfDurationString); 119 return true; 120 } 121 122 #ifndef NDEBUG 123 static inline bool propertyTypesAreConsistent(AnimatedPropertyType expectedPropertyType, const SVGElementAnimatedPropertyList& animatedTypes) 124 { 125 for (auto& type : animatedTypes) { 126 for (auto& property : type.properties) { 127 if (expectedPropertyType != property->animatedPropertyType()) { 128 // This is the only allowed inconsistency. SVGAnimatedAngleAnimator handles both SVGAnimatedAngle & SVGAnimatedEnumeration for markers orient attribute. 129 if (expectedPropertyType == AnimatedAngle && property->animatedPropertyType() == AnimatedEnumeration) 130 return true; 131 return false; 132 } 133 } 134 } 135 136 return true; 137 } 138 #endif 139 140 void SVGLegacyAttributeAnimationController::resetAnimatedType() 141 { 142 SVGAnimatedTypeAnimator& animator = animatedTypeAnimator(); 143 ASSERT(m_animatedPropertyType == animator.type()); 144 145 const QualifiedName& attributeName = m_animationElement.attributeName(); 146 SVGAnimationElement::ShouldApplyAnimation shouldApply = m_animationElement.shouldApplyAnimation(&m_targetElement, attributeName); 147 148 if (shouldApply == SVGAnimationElement::DontApplyAnimation) 149 return; 150 151 if (shouldApply == SVGAnimationElement::ApplyXMLAnimation || shouldApply == SVGAnimationElement::ApplyXMLandCSSAnimation) { 152 // SVG DOM animVal animation code-path. 153 m_animatedProperties = animator.findAnimatedPropertiesForAttributeName(m_targetElement, attributeName); 154 if (m_animatedProperties.isEmpty()) 155 return; 156 157 ASSERT(propertyTypesAreConsistent(m_animatedPropertyType, m_animatedProperties)); 158 if (!m_animatedType) 159 m_animatedType = animator.startAnimValAnimation(m_animatedProperties); 160 else { 161 animator.resetAnimValToBaseVal(m_animatedProperties, *m_animatedType); 162 animator.animValDidChange(m_animatedProperties); 163 } 164 return; 165 } 166 167 // CSS properties animation code-path. 168 ASSERT(m_animatedProperties.isEmpty()); 169 String baseValue; 170 171 if (shouldApply == SVGAnimationElement::ApplyCSSAnimation) { 172 ASSERT(SVGAnimationElement::isTargetAttributeCSSProperty(&m_targetElement, attributeName)); 173 m_animationElement.computeCSSPropertyValue(&m_targetElement, cssPropertyID(attributeName.localName()), baseValue); 174 } 175 176 if (!m_animatedType) 177 m_animatedType = animator.constructFromString(baseValue); 178 else 179 m_animatedType->setValueAsString(attributeName, baseValue); 180 } 181 182 void SVGLegacyAttributeAnimationController::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement) 183 { 184 ASSERT(resultElement); 185 186 const QualifiedName& attributeName = m_animationElement.attributeName(); 187 SVGAnimationElement::ShouldApplyAnimation shouldApply = m_animationElement.shouldApplyAnimation(&m_targetElement, attributeName); 188 189 if (shouldApply == SVGAnimationElement::DontApplyAnimation) 190 return; 191 192 ASSERT(m_animatedPropertyType == determineAnimatedPropertyType(m_animationElement, m_targetElement, attributeName)); 193 194 ASSERT(percentage >= 0 && percentage <= 1); 195 ASSERT(m_animatedPropertyType != AnimatedTransformList || m_animationElement.hasTagName(SVGNames::animateTransformTag)); 196 ASSERT(m_animatedPropertyType != AnimatedUnknown); 197 ASSERT(m_animator); 198 ASSERT(m_animator->type() == m_animatedPropertyType); 199 ASSERT(m_fromType); 200 ASSERT(m_fromType->type() == m_animatedPropertyType); 201 ASSERT(m_toType); 202 203 if (shouldApply == SVGAnimationElement::ApplyXMLAnimation || shouldApply == SVGAnimationElement::ApplyXMLandCSSAnimation) { 204 // SVG DOM animVal animation code-path. 205 if (m_animator->findAnimatedPropertiesForAttributeName(m_targetElement, attributeName).isEmpty()) 206 return; 207 } 208 209 SVGAnimateElementBase& resultAnimationElement = downcast<SVGAnimateElementBase>(*resultElement); 210 SVGLegacyAttributeAnimationController& resultAnimationController = static_cast<SVGLegacyAttributeAnimationController&>(resultAnimationElement.attributeAnimationController()); 211 212 ASSERT(resultAnimationController.m_animatedType); 213 ASSERT(resultAnimationController.m_animatedPropertyType == m_animatedPropertyType); 214 215 if (m_animationElement.hasTagName(SVGNames::setTag)) 216 percentage = 1; 217 218 if (m_animationElement.calcMode() == CalcMode::Discrete) 219 percentage = percentage < 0.5 ? 0 : 1; 220 221 // Target element might have changed. 222 m_animator->setContextElement(&m_targetElement); 223 224 // Be sure to detach list wrappers before we modfiy their underlying value. If we'd do 225 // if after calculateAnimatedValue() ran the cached pointers in the list propery tear 226 // offs would point nowhere, and we couldn't create copies of those values anymore, 227 // while detaching. This is covered by assertions, moving this down would fire them. 228 if (!m_animatedProperties.isEmpty()) 229 m_animator->animValWillChange(m_animatedProperties); 230 231 // Values-animation accumulates using the last values entry corresponding to the end of duration time. 232 SVGAnimatedType* toAtEndOfDurationType = m_toAtEndOfDurationType ? m_toAtEndOfDurationType.get() : m_toType.get(); 233 m_animator->calculateAnimatedValue(percentage, repeatCount, m_fromType.get(), m_toType.get(), toAtEndOfDurationType, resultAnimationController.m_animatedType.get()); 234 } 235 236 static inline void applyCSSPropertyToTarget(SVGElement& targetElement, CSSPropertyID id, const String& value) 237 { 238 ASSERT(!targetElement.m_deletionHasBegun); 239 240 if (!targetElement.ensureAnimatedSMILStyleProperties().setProperty(id, value, false)) 241 return; 242 243 targetElement.invalidateStyle(); 244 } 245 246 static inline void removeCSSPropertyFromTarget(SVGElement& targetElement, CSSPropertyID id) 247 { 248 ASSERT(!targetElement.m_deletionHasBegun); 249 targetElement.ensureAnimatedSMILStyleProperties().removeProperty(id); 250 targetElement.invalidateStyle(); 251 } 252 253 static inline void applyCSSPropertyToTargetAndInstances(SVGElement& targetElement, const QualifiedName& attributeName, const String& valueAsString) 254 { 255 // FIXME: Do we really need to check both isConnected and !parentNode? 256 if (attributeName == anyQName() || !targetElement.isConnected() || !targetElement.parentNode()) 257 return; 258 259 CSSPropertyID id = cssPropertyID(attributeName.localName()); 260 261 SVGElement::InstanceUpdateBlocker blocker(targetElement); 262 applyCSSPropertyToTarget(targetElement, id, valueAsString); 263 264 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. 265 for (auto* instance : targetElement.instances()) 266 applyCSSPropertyToTarget(*instance, id, valueAsString); 267 } 268 269 static inline void removeCSSPropertyFromTargetAndInstances(SVGElement& targetElement, const QualifiedName& attributeName) 270 { 271 // FIXME: Do we really need to check both isConnected and !parentNode? 272 if (attributeName == anyQName() || !targetElement.isConnected() || !targetElement.parentNode()) 273 return; 274 275 CSSPropertyID id = cssPropertyID(attributeName.localName()); 276 277 SVGElement::InstanceUpdateBlocker blocker(targetElement); 278 removeCSSPropertyFromTarget(targetElement, id); 279 280 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. 281 for (auto* instance : targetElement.instances()) 282 removeCSSPropertyFromTarget(*instance, id); 283 } 284 285 static inline void notifyTargetAboutAnimValChange(SVGElement& targetElement, const QualifiedName& attributeName) 286 { 287 ASSERT(!targetElement.m_deletionHasBegun); 288 targetElement.svgAttributeChanged(attributeName); 289 } 290 291 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement& targetElement, const QualifiedName& attributeName) 292 { 293 if (attributeName == anyQName() || !targetElement.isConnected() || !targetElement.parentNode()) 294 return; 295 296 SVGElement::InstanceUpdateBlocker blocker(targetElement); 297 notifyTargetAboutAnimValChange(targetElement, attributeName); 298 299 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. 300 for (auto* instance : targetElement.instances()) 301 notifyTargetAboutAnimValChange(*instance, attributeName); 302 } 303 304 void SVGLegacyAttributeAnimationController::applyResultsToTarget() 305 { 306 ASSERT(m_animatedPropertyType != AnimatedTransformList || m_animationElement.hasTagName(SVGNames::animateTransformTag)); 307 ASSERT(m_animatedPropertyType != AnimatedUnknown); 308 ASSERT(m_animator); 309 310 // Early exit if our animated type got destroyed by a previous endedActiveInterval(). 311 if (!m_animatedType) 312 return; 313 314 const QualifiedName& attributeName = m_animationElement.attributeName(); 315 316 if (m_animatedProperties.isEmpty()) { 317 // CSS properties animation code-path. 318 // Convert the result of the animation to a String and apply it as CSS property on the target & all instances. 319 applyCSSPropertyToTargetAndInstances(m_targetElement, attributeName, m_animatedType->valueAsString()); 320 return; 321 } 322 323 // We do update the style and the animation property independent of each other. 324 SVGAnimationElement::ShouldApplyAnimation shouldApply = m_animationElement.shouldApplyAnimation(&m_targetElement, attributeName); 325 if (shouldApply == SVGAnimationElement::ApplyXMLandCSSAnimation) 326 applyCSSPropertyToTargetAndInstances(m_targetElement, attributeName, m_animatedType->valueAsString()); 327 328 // SVG DOM animVal animation code-path. 329 // At this point the SVG DOM values are already changed, unlike for CSS. 330 // We only have to trigger update notifications here. 331 m_animator->animValDidChange(m_animatedProperties); 332 notifyTargetAndInstancesAboutAnimValChange(m_targetElement, attributeName); 333 } 334 335 void SVGLegacyAttributeAnimationController::clearAnimatedType(SVGElement* targetElement) 336 { 337 if (!m_animatedType) 338 return; 339 340 // If the SVGAnimatedType is a list type, e.g. SVGLengthListValues, the wrappers of the 341 // animated properties have to be detached from the items in the list before it's deleted. 342 if (!m_animatedProperties.isEmpty()) 343 m_animator->animValWillChange(m_animatedProperties); 344 345 if (!targetElement) { 346 m_animatedType = nullptr; 347 return; 348 } 349 350 const QualifiedName& attributeName = m_animationElement.attributeName(); 351 352 if (m_animatedProperties.isEmpty()) { 353 // CSS properties animation code-path. 354 removeCSSPropertyFromTargetAndInstances(*targetElement, m_animationElement.attributeName()); 355 m_animatedType = nullptr; 356 return; 357 } 358 359 SVGAnimationElement::ShouldApplyAnimation shouldApply = m_animationElement.shouldApplyAnimation(targetElement, attributeName); 360 if (shouldApply == SVGAnimationElement::ApplyXMLandCSSAnimation) 361 removeCSSPropertyFromTargetAndInstances(*targetElement, attributeName); 362 363 // SVG DOM animVal animation code-path. 364 if (m_animator) { 365 m_animator->stopAnimValAnimation(m_animatedProperties); 366 notifyTargetAndInstancesAboutAnimValChange(*targetElement, attributeName); 367 } 368 369 m_animatedProperties.clear(); 370 m_animatedType = nullptr; 371 } 372 373 float SVGLegacyAttributeAnimationController::calculateDistance(const String& fromString, const String& toString) 374 { 375 return animatedTypeAnimator().calculateDistance(fromString, toString); 376 } 377 378 } 379 -
trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp
r240237 r243036 310 310 } 311 311 312 bool SVGSMILElement::hasValidAttributeName() 312 bool SVGSMILElement::hasValidAttributeName() const 313 313 { 314 314 return attributeName() != anyQName(); -
trunk/Source/WebCore/svg/animation/SVGSMILElement.h
r229694 r243036 52 52 void removedFromAncestor(RemovalType, ContainerNode&) override; 53 53 54 virtual bool hasValidAttributeType() = 0;55 virtual bool hasValidAttributeName() ;54 virtual bool hasValidAttributeType() const = 0; 55 virtual bool hasValidAttributeName() const; 56 56 virtual void animationAttributeChanged() = 0; 57 57 -
trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 25 25 26 26 #include "config.h" 27 #include "SVGAttributeOwnerProxy.h" 27 #include "SVGAnimatedProperty.h" 28 29 #include "SVGElement.h" 28 30 29 31 namespace WebCore { 30 32 31 SVGAttributeOwnerProxy::SVGAttributeOwnerProxy(SVGElement& element) 32 : m_element(makeWeakPtr(element)) 33 SVGPropertyOwner* SVGAnimatedProperty::owner() const 33 34 { 35 return m_contextElement; 34 36 } 35 37 36 SVGElement& SVGAttributeOwnerProxy::element() const 38 void SVGAnimatedProperty::commitPropertyChange() 37 39 { 38 return *m_element; 40 if (!m_contextElement) 41 return; 42 m_contextElement->commitPropertyChange(*this); 39 43 } 40 44 -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessor.h
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #include "config.h" 27 #include "SVGAttributeOwnerProxy.h" 26 #pragma once 27 28 #include "SVGPointerMemberAccessor.h" 28 29 29 30 namespace WebCore { 30 31 31 SVGAttributeOwnerProxy::SVGAttributeOwnerProxy(SVGElement& element) 32 : m_element(makeWeakPtr(element)) 33 { 34 } 32 template<typename OwnerType, typename AnimatedPropertyType> 33 class SVGAnimatedPropertyAccessor : public SVGPointerMemberAccessor<OwnerType, AnimatedPropertyType> { 34 using Base = SVGPointerMemberAccessor<OwnerType, AnimatedPropertyType>; 35 35 36 SVGElement& SVGAttributeOwnerProxy::element() const 37 { 38 return *m_element; 39 } 36 public: 37 using Base::Base; 38 using Base::singleton; 39 using Base::property; 40 using AnimatedProperty = AnimatedPropertyType; 41 42 bool matches(const OwnerType& owner, const SVGAnimatedProperty& animatedProperty) const override 43 { 44 return property(owner).ptr() == &animatedProperty; 45 } 46 47 private: 48 bool isAnimatedProperty() const override { return true; } 49 }; 40 50 41 51 } -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "SVGAnimatedPropertyType.h" 29 #include <wtf/WeakPtr.h> 28 #include "SVGAnimatedPropertyAccessor.h" 29 #include "SVGAnimatedPropertyAnimatorImpl.h" 30 #include "SVGAnimatedPropertyImpl.h" 31 #include "SVGNames.h" 30 32 31 33 namespace WebCore { 32 34 33 class SVGAttribute; 34 class SVG Element;35 class SVGLegacyAnimatedProperty;35 template<typename OwnerType> 36 class SVGAnimatedIntegerAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedInteger> { 37 using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedInteger>; 36 38 37 class SVGAttributeOwnerProxy {38 39 public: 39 SVGAttributeOwnerProxy(SVGElement&); 40 using Base::Base; 41 using Base::property; 42 template<Ref<SVGAnimatedInteger> OwnerType::*property> 43 constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedIntegerAccessor, property>(); } 40 44 41 virtual ~SVGAttributeOwnerProxy() = default; 45 private: 46 std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final 47 { 48 return SVGAnimatedIntegerAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); 49 } 42 50 43 SVGElement& element() const; 44 45 virtual void synchronizeAttributes() const = 0; 46 virtual void synchronizeAttribute(const QualifiedName&) const = 0; 47 48 virtual Vector<AnimatedPropertyType> animatedTypes(const QualifiedName&) const = 0; 49 50 virtual RefPtr<SVGLegacyAnimatedProperty> lookupOrCreateAnimatedProperty(const SVGAttribute&) const = 0; 51 virtual RefPtr<SVGLegacyAnimatedProperty> lookupAnimatedProperty(const SVGAttribute&) const = 0; 52 virtual Vector<RefPtr<SVGLegacyAnimatedProperty>> lookupOrCreateAnimatedProperties(const QualifiedName&) const = 0; 53 54 protected: 55 WeakPtr<SVGElement> m_element; 51 void appendAnimatedInstance(OwnerType& owner, SVGAttributeAnimator& animator) const final 52 { 53 static_cast<SVGAnimatedIntegerAnimator&>(animator).appendAnimatedInstance(property(owner)); 54 } 56 55 }; 57 56 -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "SVGAnimatedPropertyType.h" 29 #include <wtf/WeakPtr.h> 28 #include "SVGAnimatedPropertyAnimator.h" 29 #include "SVGAnimatedPropertyImpl.h" 30 #include "SVGAnimationAdditiveValueFunctionImpl.h" 30 31 31 32 namespace WebCore { 32 33 33 class SVGAttribute; 34 class SVGElement; 35 class SVGLegacyAnimatedProperty; 34 class SVGAnimatedIntegerPairAnimator; 36 35 37 class SVGAttributeOwnerProxy { 36 template<typename AnimatedPropertyAnimator1, typename AnimatedPropertyAnimator2> 37 class SVGAnimatedPropertyPairAnimator; 38 39 class SVGAnimatedIntegerAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedInteger, SVGAnimationIntegerFunction> { 40 friend class SVGAnimatedPropertyPairAnimator<SVGAnimatedIntegerAnimator, SVGAnimatedIntegerAnimator>; 41 friend class SVGAnimatedIntegerPairAnimator; 42 using Base = SVGAnimatedPropertyAnimator<SVGAnimatedInteger, SVGAnimationIntegerFunction>; 43 using Base::Base; 44 38 45 public: 39 SVGAttributeOwnerProxy(SVGElement&); 46 static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedInteger>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) 47 { 48 return std::unique_ptr<SVGAnimatedIntegerAnimator>(new SVGAnimatedIntegerAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); 49 } 40 50 41 virtual ~SVGAttributeOwnerProxy() = default; 42 43 SVGElement& element() const; 44 45 virtual void synchronizeAttributes() const = 0; 46 virtual void synchronizeAttribute(const QualifiedName&) const = 0; 47 48 virtual Vector<AnimatedPropertyType> animatedTypes(const QualifiedName&) const = 0; 49 50 virtual RefPtr<SVGLegacyAnimatedProperty> lookupOrCreateAnimatedProperty(const SVGAttribute&) const = 0; 51 virtual RefPtr<SVGLegacyAnimatedProperty> lookupAnimatedProperty(const SVGAttribute&) const = 0; 52 virtual Vector<RefPtr<SVGLegacyAnimatedProperty>> lookupOrCreateAnimatedProperties(const QualifiedName&) const = 0; 53 54 protected: 55 WeakPtr<SVGElement> m_element; 51 private: 52 void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final 53 { 54 m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal()); 55 } 56 56 }; 57 57 -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #include "config.h" 27 #include "SVGAttributeOwnerProxy.h" 26 #pragma once 27 28 #include "SVGAnimatedAngle.h" 29 #include "SVGAnimatedBoolean.h" 30 #include "SVGAnimatedEnumeration.h" 31 #include "SVGAnimatedLength.h" 32 #include "SVGAnimatedLengthList.h" 33 #include "SVGAnimatedNumber.h" 34 #include "SVGAnimatedNumberList.h" 35 #include "SVGAnimatedPointList.h" 36 #include "SVGAnimatedPreserveAspectRatio.h" 37 #include "SVGAnimatedPrimitiveProperty.h" 38 #include "SVGAnimatedRect.h" 39 #include "SVGAnimatedString.h" 40 #include "SVGAnimatedTransformList.h" 28 41 29 42 namespace WebCore { 30 43 31 SVGAttributeOwnerProxy::SVGAttributeOwnerProxy(SVGElement& element) 32 : m_element(makeWeakPtr(element)) 33 { 34 } 35 36 SVGElement& SVGAttributeOwnerProxy::element() const 37 { 38 return *m_element; 39 } 44 using SVGAnimatedInteger = SVGAnimatedPrimitiveProperty<int>; 40 45 41 46 } -
trunk/Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunction.h
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #include "config.h" 27 #include "SVGAttributeOwnerProxy.h" 26 #pragma once 27 28 #include "SVGAnimationAdditiveFunction.h" 28 29 29 30 namespace WebCore { 30 31 31 SVGAttributeOwnerProxy::SVGAttributeOwnerProxy(SVGElement& element) 32 : m_element(makeWeakPtr(element)) 33 { 34 } 32 template<typename ValueType> 33 class SVGAnimationAdditiveValueFunction : public SVGAnimationAdditiveFunction { 34 public: 35 using SVGAnimationAdditiveFunction::SVGAnimationAdditiveFunction; 36 37 protected: 38 ValueType toAtEndOfDuration() const { return m_toAtEndOfDuration ? *m_toAtEndOfDuration : m_to; } 35 39 36 SVGElement& SVGAttributeOwnerProxy::element() const 37 { 38 return *m_element;39 } 40 ValueType m_from; 41 ValueType m_to; 42 Optional<ValueType> m_toAtEndOfDuration; 43 }; 40 44 41 45 } -
trunk/Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.h
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "SVGAnimat edPropertyType.h"29 #include <wtf/WeakPtr.h>28 #include "SVGAnimationAdditiveValueFunction.h" 29 #include "SVGPropertyTraits.h" 30 30 31 31 namespace WebCore { 32 32 33 class SVGAttribute; 34 class SVGElement; 35 class SVGLegacyAnimatedProperty; 33 class SVGAnimationIntegerFunction : public SVGAnimationAdditiveValueFunction<int> { 34 friend class SVGAnimatedIntegerPairAnimator; 36 35 37 class SVGAttributeOwnerProxy {38 36 public: 39 SVGAttributeOwnerProxy(SVGElement&); 37 using Base = SVGAnimationAdditiveValueFunction<int>; 38 using Base::Base; 40 39 41 virtual ~SVGAttributeOwnerProxy() = default; 40 void setFromAndToValues(SVGElement*, const String& from, const String& to) override 41 { 42 m_from = SVGPropertyTraits<int>::fromString(from); 43 m_to = SVGPropertyTraits<int>::fromString(to); 44 } 42 45 43 SVGElement& element() const; 46 void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override 47 { 48 m_toAtEndOfDuration = SVGPropertyTraits<int>::fromString(toAtEndOfDuration); 49 } 44 50 45 virtual void synchronizeAttributes() const = 0; 46 virtual void synchronizeAttribute(const QualifiedName&) const = 0; 51 void progress(SVGElement*, float percentage, unsigned repeatCount, int& animated) 52 { 53 animated = static_cast<int>(roundf(Base::progress(percentage, repeatCount, m_from, m_to, toAtEndOfDuration(), animated))); 54 } 47 55 48 virtual Vector<AnimatedPropertyType> animatedTypes(const QualifiedName&) const = 0; 56 float calculateDistance(SVGElement*, const String& from, const String& to) const override 57 { 58 return std::abs(to.toIntStrict() - from.toIntStrict()); 59 } 49 60 50 virtual RefPtr<SVGLegacyAnimatedProperty> lookupOrCreateAnimatedProperty(const SVGAttribute&) const = 0; 51 virtual RefPtr<SVGLegacyAnimatedProperty> lookupAnimatedProperty(const SVGAttribute&) const = 0; 52 virtual Vector<RefPtr<SVGLegacyAnimatedProperty>> lookupOrCreateAnimatedProperties(const QualifiedName&) const = 0; 53 54 protected: 55 WeakPtr<SVGElement> m_element; 61 private: 62 void addFromAndToValues(SVGElement*) override 63 { 64 m_to += m_from; 65 } 56 66 }; 57 67 -
trunk/Source/WebCore/svg/properties/SVGAnimationFunction.h
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #include "config.h" 27 #include "SVGAttributeOwnerProxy.h" 26 #pragma once 28 27 29 28 namespace WebCore { 30 29 31 SVGAttributeOwnerProxy::SVGAttributeOwnerProxy(SVGElement& element) 32 : m_element(makeWeakPtr(element)) 33 { 34 } 30 class SVGAnimationFunction { 31 public: 32 virtual ~SVGAnimationFunction() = default; 35 33 36 SVGElement& SVGAttributeOwnerProxy::element() const 37 { 38 return *m_element; 39 } 34 virtual bool isDiscrete() const { return false; } 35 36 virtual void setFromAndToValues(SVGElement* targetElement, const String&, const String&) = 0; 37 virtual void setFromAndByValues(SVGElement* targetElement, const String&, const String&) = 0; 38 virtual void setToAtEndOfDurationValue(const String&) = 0; 39 40 virtual float calculateDistance(SVGElement*, const String&, const String&) const { return -1; } 41 protected: 42 SVGAnimationFunction(AnimationMode animationMode) 43 : m_animationMode(animationMode) 44 { 45 } 46 47 virtual void addFromAndToValues(SVGElement*) { } 48 49 AnimationMode m_animationMode; 50 }; 40 51 41 52 } -
trunk/Source/WebCore/svg/properties/SVGAttributeAnimator.cpp
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 25 25 26 26 #include "config.h" 27 #include "SVGAttributeOwnerProxy.h" 27 #include "SVGAttributeAnimator.h" 28 29 #include "CSSComputedStyleDeclaration.h" 30 #include "CSSPropertyParser.h" 31 #include "SVGElement.h" 28 32 29 33 namespace WebCore { 30 34 31 SVGAttributeOwnerProxy::SVGAttributeOwnerProxy(SVGElement& element) 32 : m_element(makeWeakPtr(element)) 35 void SVGAttributeAnimator::applyAnimatedPropertyChange(SVGElement* element, const QualifiedName& attributeName) 33 36 { 37 ASSERT(!element->m_deletionHasBegun); 38 element->svgAttributeChanged(attributeName); 34 39 } 35 40 36 SVGElement& SVGAttributeOwnerProxy::element() const 41 void SVGAttributeAnimator::applyAnimatedPropertyChange(SVGElement* targetElement) 37 42 { 38 return *m_element; 43 ASSERT(targetElement); 44 ASSERT(m_attributeName != anyQName()); 45 46 // FIXME: Do we really need to check both isConnected and !parentNode? 47 if (!targetElement->isConnected() || !targetElement->parentNode()) 48 return; 49 50 SVGElement::InstanceUpdateBlocker blocker(*targetElement); 51 applyAnimatedPropertyChange(targetElement, m_attributeName); 52 53 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. 54 for (auto* instance : targetElement->instances()) 55 applyAnimatedPropertyChange(instance, m_attributeName); 39 56 } 40 57 -
trunk/Source/WebCore/svg/properties/SVGAttributeAnimator.h
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "SVGAnimatedPropertyType.h" 29 #include <wtf/WeakPtr.h> 28 #include "CSSPropertyNames.h" 29 #include "QualifiedName.h" 30 #include <wtf/RefCounted.h> 31 #include <wtf/StdLibExtras.h> 30 32 31 33 namespace WebCore { 32 34 33 class SVGAttribute;34 35 class SVGElement; 35 class SVGLegacyAnimatedProperty;36 36 37 class SVGAttributeOwnerProxy { 37 enum class AnimationMode : uint8_t { 38 None, 39 FromTo, 40 FromBy, 41 To, 42 By, 43 Values, 44 Path 45 }; 46 47 enum class CalcMode : uint8_t { 48 Discrete, 49 Linear, 50 Paced, 51 Spline 52 }; 53 54 class SVGAttributeAnimator { 38 55 public: 39 SVGAttributeOwnerProxy(SVGElement&); 56 SVGAttributeAnimator(const QualifiedName& attributeName) 57 : m_attributeName(attributeName) 58 { 59 } 40 60 41 virtual ~SVGAttribute OwnerProxy() = default;61 virtual ~SVGAttributeAnimator() = default; 42 62 43 SVGElement& element() const;63 virtual bool isDiscrete() const { return false; } 44 64 45 virtual void synchronizeAttributes() const = 0; 46 virtual void synchronizeAttribute(const QualifiedName&) const = 0; 65 virtual void setFromAndToValues(SVGElement*, const String&, const String&) { } 66 virtual void setFromAndByValues(SVGElement*, const String&, const String&) { } 67 virtual void setToAtEndOfDurationValue(const String&) { } 47 68 48 virtual Vector<AnimatedPropertyType> animatedTypes(const QualifiedName&) const = 0; 69 virtual void start(SVGElement*) = 0; 70 virtual void progress(SVGElement*, float, unsigned) = 0; 71 virtual void apply(SVGElement*) = 0; 72 virtual void stop(SVGElement* targetElement) = 0; 49 73 50 virtual RefPtr<SVGLegacyAnimatedProperty> lookupOrCreateAnimatedProperty(const SVGAttribute&) const = 0; 51 virtual RefPtr<SVGLegacyAnimatedProperty> lookupAnimatedProperty(const SVGAttribute&) const = 0; 52 virtual Vector<RefPtr<SVGLegacyAnimatedProperty>> lookupOrCreateAnimatedProperties(const QualifiedName&) const = 0; 74 virtual float calculateDistance(SVGElement*, const String&, const String&) const { return -1; } 53 75 54 76 protected: 55 WeakPtr<SVGElement> m_element; 77 static void applyAnimatedPropertyChange(SVGElement*, const QualifiedName&); 78 79 void applyAnimatedPropertyChange(SVGElement*); 80 81 const QualifiedName& m_attributeName; 56 82 }; 57 83 -
trunk/Source/WebCore/svg/properties/SVGAttributeOwnerProxy.cpp
r239490 r243036 27 27 #include "SVGAttributeOwnerProxy.h" 28 28 29 #include "SVGElement.h" 30 29 31 namespace WebCore { 30 32 -
trunk/Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h
r242978 r243036 26 26 #pragma once 27 27 28 #include "QualifiedName.h" 28 29 #include "SVGAnimatedPropertyType.h" 29 30 #include <wtf/WeakPtr.h> -
trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h
r242978 r243036 28 28 #include "SVGAnimatedBoolean.h" 29 29 #include "SVGAnimatedEnumeration.h" 30 #include "SVGAnimatedInteger.h"31 30 #include "SVGAnimatedLength.h" 32 31 #include "SVGAnimatedLengthList.h" … … 81 80 } 82 81 83 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedIntegerAttribute OwnerType::*attribute>84 void registerAttribute()85 {86 registerAttribute(SVGAnimatedIntegerAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());87 }88 89 template<const LazyNeverDestroyed<const QualifiedName>& attributeName,90 const AtomicString& (*identifier)(), SVGAnimatedIntegerAttribute OwnerType::*attribute,91 const AtomicString& (*optionalIdentifier)(), SVGAnimatedIntegerAttribute OwnerType::*optionalAttribute>92 void registerAttribute()93 {94 registerAttribute(SVGAnimatedOptionalIntegerAttributeAccessor<OwnerType>::template singleton<attributeName, identifier, attribute, optionalIdentifier, optionalAttribute>());95 }96 97 82 template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedLengthAttribute OwnerType::*attribute> 98 83 void registerAttribute() -
trunk/Source/WebCore/svg/properties/SVGMemberAccessor.h
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include " SVGAnimatedPropertyType.h"29 #include <wtf/WeakPtr.h>28 #include "QualifiedName.h" 29 #include "SVGAttributeAnimator.h" 30 30 31 31 namespace WebCore { 32 32 33 class SVGAttribute; 34 class SVGElement; 35 class SVGLegacyAnimatedProperty; 33 class SVGAnimatedProperty; 36 34 37 class SVGAttributeOwnerProxy { 35 template<typename OwnerType> 36 class SVGMemberAccessor { 37 WTF_MAKE_FAST_ALLOCATED; 38 38 public: 39 SVGAttributeOwnerProxy(SVGElement&);39 virtual ~SVGMemberAccessor() = default; 40 40 41 virtual ~SVGAttributeOwnerProxy() = default; 41 virtual void detach(const OwnerType&) const { } 42 virtual bool isAnimatedProperty() const { return false; } 43 virtual bool isAnimatedLength() const { return false; } 42 44 43 SVGElement& element() const; 45 virtual bool matches(const OwnerType&, const SVGAnimatedProperty&) const { return false; } 46 virtual Optional<String> synchronize(const OwnerType&) const { return WTF::nullopt; } 44 47 45 virtual void synchronizeAttributes() const = 0; 46 virtual void synchronizeAttribute(const QualifiedName&) const = 0; 47 48 virtual Vector<AnimatedPropertyType> animatedTypes(const QualifiedName&) const = 0; 49 50 virtual RefPtr<SVGLegacyAnimatedProperty> lookupOrCreateAnimatedProperty(const SVGAttribute&) const = 0; 51 virtual RefPtr<SVGLegacyAnimatedProperty> lookupAnimatedProperty(const SVGAttribute&) const = 0; 52 virtual Vector<RefPtr<SVGLegacyAnimatedProperty>> lookupOrCreateAnimatedProperties(const QualifiedName&) const = 0; 48 virtual std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType&, const QualifiedName&, AnimationMode, CalcMode, bool, bool) const { return nullptr; } 49 virtual void appendAnimatedInstance(OwnerType&, SVGAttributeAnimator&) const { } 53 50 54 51 protected: 55 WeakPtr<SVGElement> m_element;52 SVGMemberAccessor() = default; 56 53 }; 57 54 58 } 55 } // namespace WebCore -
trunk/Source/WebCore/svg/properties/SVGPointerMemberAccessor.h
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "SVGAnimatedPropertyType.h" 29 #include <wtf/WeakPtr.h> 28 #include "SVGMemberAccessor.h" 30 29 31 30 namespace WebCore { 32 31 33 class SVGAttribute; 34 class SVG Element;35 class SVGLegacyAnimatedProperty;32 template<typename OwnerType, typename PropertyType> 33 class SVGPointerMemberAccessor : public SVGMemberAccessor<OwnerType> { 34 using Base = SVGMemberAccessor<OwnerType>; 36 35 37 class SVGAttributeOwnerProxy {38 36 public: 39 SVGAttributeOwnerProxy(SVGElement&); 37 SVGPointerMemberAccessor(Ref<PropertyType> OwnerType::*property) 38 : m_property(property) 39 { 40 } 40 41 41 virtual ~SVGAttributeOwnerProxy() = default; 42 Ref<PropertyType>& property(OwnerType& owner) const { return owner.*m_property; } 43 const Ref<PropertyType>& property(const OwnerType& owner) const { return owner.*m_property; } 42 44 43 SVGElement& element() const; 45 void detach(const OwnerType& owner) const override 46 { 47 property(owner)->detach(); 48 } 44 49 45 virtual void synchronizeAttributes() const = 0; 46 virtual void synchronizeAttribute(const QualifiedName&) const = 0; 47 48 virtual Vector<AnimatedPropertyType> animatedTypes(const QualifiedName&) const = 0; 49 50 virtual RefPtr<SVGLegacyAnimatedProperty> lookupOrCreateAnimatedProperty(const SVGAttribute&) const = 0; 51 virtual RefPtr<SVGLegacyAnimatedProperty> lookupAnimatedProperty(const SVGAttribute&) const = 0; 52 virtual Vector<RefPtr<SVGLegacyAnimatedProperty>> lookupOrCreateAnimatedProperties(const QualifiedName&) const = 0; 50 Optional<String> synchronize(const OwnerType& owner) const override 51 { 52 return property(owner)->synchronize(); 53 } 53 54 54 55 protected: 55 WeakPtr<SVGElement> m_element; 56 template<typename AccessorType, Ref<PropertyType> OwnerType::*property> 57 static const SVGMemberAccessor<OwnerType>& singleton() 58 { 59 static NeverDestroyed<AccessorType> propertyAccessor { property }; 60 return propertyAccessor; 61 } 62 63 Ref<PropertyType> OwnerType::*m_property; 56 64 }; 57 65 -
trunk/Source/WebCore/svg/properties/SVGPropertyOwner.h
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #include "config.h" 27 #include "SVGAttributeOwnerProxy.h" 26 #pragma once 28 27 29 28 namespace WebCore { 30 29 31 SVGAttributeOwnerProxy::SVGAttributeOwnerProxy(SVGElement& element) 32 : m_element(makeWeakPtr(element)) 33 { 34 } 30 class SVGPropertyOwner { 31 public: 32 virtual ~SVGPropertyOwner() = default; 35 33 36 SVGElement& SVGAttributeOwnerProxy::element() const 37 { 38 return *m_element; 39 } 34 virtual SVGPropertyOwner* owner() const { return nullptr; } 35 36 virtual const SVGElement* attributeContextElement() const 37 { 38 if (!owner()) 39 return nullptr; 40 return owner()->attributeContextElement(); 41 } 42 43 virtual void commitPropertyChange() 44 { 45 if (!owner()) 46 return; 47 owner()->commitPropertyChange(); 48 } 49 50 protected: 51 SVGPropertyOwner() = default; 52 }; 40 53 41 54 } -
trunk/Source/WebCore/svg/properties/SVGPropertyRegistry.h
r243035 r243036 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #include "config.h" 27 #include "SVGAttributeOwnerProxy.h" 26 #pragma once 27 28 #include "SVGAttributeAnimator.h" 28 29 29 30 namespace WebCore { 30 31 31 SVGAttributeOwnerProxy::SVGAttributeOwnerProxy(SVGElement& element) 32 : m_element(makeWeakPtr(element)) 33 { 34 } 32 class SVGAnimatedProperty; 35 33 36 SVGElement& SVGAttributeOwnerProxy::element() const 37 { 38 return *m_element; 39 } 34 class SVGPropertyRegistry { 35 public: 36 SVGPropertyRegistry() = default; 37 virtual ~SVGPropertyRegistry() = default; 38 39 virtual void detachAllProperties() const = 0; 40 virtual QualifiedName animatedPropertyAttributeName(const SVGAnimatedProperty&) const = 0; 41 virtual Optional<String> synchronize(const QualifiedName&) const = 0; 42 virtual HashMap<QualifiedName, String> synchronizeAllAttributes() const = 0; 43 44 virtual bool isAnimatedPropertyAttribute(const QualifiedName&) const = 0; 45 virtual std::unique_ptr<SVGAttributeAnimator> createAnimator(const QualifiedName&, AnimationMode, CalcMode, bool isAccumulated, bool isAdditive) const = 0; 46 virtual void appendAnimatedInstance(const QualifiedName& attributeName, SVGAttributeAnimator&) const = 0; 47 }; 40 48 41 49 }
Note: See TracChangeset
for help on using the changeset viewer.