Source/WebCore/ChangeLog

 12011-07-09 Nikolas Zimmermann <nzimmermann@rim.com>
 2
 3 Add a possibility to retrieve the associated SVGAnimatedProperty object for a certain XML attribute
 4 https://bugs.webkit.org/show_bug.cgi?id=63797
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 In order to prepare animVal support we need a way to map a given SVG DOM attribute to a SVGAnimatedProperty.
 9 eg. SVGNames::xAttr -> SVGRectElement::xAnimated(), etc. This will be needed to update the animVal of the
 10 SVGAnimatedProperty, if an animation is running. It would required adding a new method to all SVG* classes
 11 that define animated properties. Unfortunately we already have lots of repeated code in methods like
 12 synchronizeProperty / fillAttributeToPropertyTypeMap. Look at SVGRectElement for example:
 13
 14 void SVGRectElement::synchronizeProperty(const QualifiedName& attrName)
 15 {
 16 if (attrName == anyQName()) {
 17 synchronizeX();
 18 synchronizeY();
 19 ...
 20 }
 21
 22 if (attrName == SVGNames::xAttr) {
 23 synchronizeX();
 24 return;
 25 }
 26
 27 if (attrName == SVGNames::yAttr) {
 28 synchronizeY();
 29 return;
 30 }
 31 ...
 32 }
 33
 34 or
 35
 36 void SVGRectElement::fillAttributeToPropertyTypeMap()
 37 {
 38 AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
 39
 40 SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
 41 attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
 42 attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
 43 ...
 44 }
 45
 46 These lookups are all performed dynamically. Each synchronizeProperty() call does a lot of comparisons.
 47 fillAttributeToPropertyTypeMap() isn't that bad as the result is cached in a static HashMap per-SVGRectElement.
 48 There's no reason to do these things dynamically!
 49
 50 Inspired by JSC, I'm adding a "static const SVGPropertyInfo s_fooPropertyInfo" object for each animated SVG property.
 51 For example, for SVGRectElements SVGAnimatedLength x property we're storing:
 52 - "AnimatedPropertyType type" (AnimatedLength -- note the enum was named AnimatedAttributeType, I renamed it to AnimatedPropertyType for clarity)
 53 - "const QualifiedName& attributeName" (SVGNames::xAttr)
 54 - "const AtomicString& propertyIdentifier" (SVGNames::xAttr.localName() -- only different if N-wrappers map to a single XML DOM attribute, eg. orientAttr)
 55 - "SynchronizeProperty synchronizeProperty" (callback to SVGRectElement::synchronizeX)
 56 - "LookupOrCreateWrapperForAnimatedProperty lookupOrCreateWrapperForAnimatedProperty" (callback to SVGRectElement::xAnimated)
 57
 58 Using this information, we can replace all the various synchronizeProperty/fillAttributeToPropertyMap implementations, with a single one in SVGElement.
 59 All these are auto-generated, using the standard macros used to define/declare SVG animated properties. This required several changes to the macros.
 60 Here's a summary:
 61
 62 #1) In all headers, wrap DECLARE_ANIMATED_* calls, in BEGIN_DECLARE_ANIMATED_PROPERTIES(ClassName) / END_DECLARE_ANIMATED_PROPERTIES blocks.
 63
 64 Sample change for SVGRectElement:
 65 - DECLARE_ANIMATED_LENGTH(X, x)
 66 - DECLARE_ANIMATED_LENGTH(Y, y)
 67 - ...
 68
 69 + BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGRectElement)
 70 + DECLARE_ANIMATED_LENGTH(X, x)
 71 + DECLARE_ANIMATED_LENGTH(Y, y)
 72 + ...
 73 + END_DECLARE_ANIMATED_PROPERTIES
 74
 75 #2) In all cpp files, add a new section wrapped in BEGIN_REGISTER_ANIMATED_PROPERTIES(ClassName / END_REGISTER_ANIMATED_PROPERTIES blocks:
 76
 77 Sample change for SVGRectElement:
 78 +BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGRectElement)
 79 + REGISTER_LOCAL_ANIMATED_PROPERTY(x)
 80 + REGISTER_LOCAL_ANIMATED_PROPERTY(y)
 81 + ...
 82 + REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 83 + REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 84 +END_REGISTER_ANIMATED_PROPERTIES
 85
 86 This is the main piece of the logic that replaces the manual synchronizeProperty/fillAttributeToPropertyMap implementation. It expands to following:
 87
 88 SVGAttributeToPropertyMap& SVGRectElement::attributeToPropertyMap()
 89 {
 90 DEFINE_STATIC_LOCAL(SVGAttributeToPropertyMap, s_attributeToPropertyMap, ());
 91 }
 92
 93 static void registerAnimatedPropertiesForSVGRectElement()
 94 {
 95 SVGAttributeToPropertyMap& map = SVGRectElement::attributeToPropertyMap();
 96 if (!map.isEmpty())
 97 return;
 98 map.addProperty(SVGRectElement::xPropertyInfo());
 99 map.addProperty(SVGRectElement::yPropertyInfo());
 100 ...
 101 map.addProperties(SVGStyledTransformableElement::attributeToPropertyMap());
 102 map.addProperties(SVGTests::attributeToPropertyMap());
 103 }
 104
 105 A single-instance of SVGAttributeToPropertyMap is created for each SVG*Element. The constructor of SVGRectElement is supposed to call
 106 registerAnimatedPropertiesForSVGRectElement(), which collects all properties of SVGRectElement and all its parent classes and stores them
 107 in a Vector<const SVGPropertyInfo*>. This Vector is stored in a HashMap<QualifiedName, Vector<const SVGPropertyInfo*> > where the key
 108 is the attribute name (eg. SVGNames::xAttr -> SVGRectElement::xPropertyInfo). This is only done _once_ per SVGRectElement.
 109
 110 SVGElement contains a "virtual SVGAttributeToPropertyMap& localAttributeToPropertyMap()" method, and SVGRectElement overrides it
 111 and returns SVGRectElement::attributeToPropertyMap() (which is static!) -- this is hidden again in the macros, no need to write any code.
 112
 113 SVGAttributeToPropertyMap provides following API:
 114 - bool synchronizeProperty(SVGElement* contextElement, const QualifiedName& attributeName)
 115 - void synchronizeProperties(SVGElement* contextElement)
 116
 117 A generic way to synchronize a SVGAnimatedProperty with its XML DOM attribute. Any SVG DOM change to eg. <rect>s x property will now trigger
 118 contextElement->localAttributeToPropertyMap().synchronizeProperty(this, SVGNames::xAttr)
 119 The SVGAttributeToPropertyMap will ask its HashMap for the Vector containing the properties for SVGNames::xAttr (in that case, just one xAnimated()).
 120
 121 - void animatedPropertyTypeForAttribute(const QualifiedName& attributeName, Vector<AnimatedPropertyType>& propertyTypes)
 122
 123 This method replaces the fillAttributeToPropertyMap implementations everywhere.
 124
 125 - void animatedPropertiesForAttribute(SVGElement* contextElement, const QualifiedName& attributeName, Vector<RefPtr<SVGAnimatedProperty> >& properties);
 126
 127 This method is not used yet, but allows us to collect all SVGAnimatedProperties for a QualifiedName -- the initial goal for this patch.
 128
 129 #3) In all cpp files, add a call to "registerAnimatedPropertiesForClassName()" in the constructor. Forgetting this will result in a compile error.
 130
 131 Doesn't affect any tests.
 132
 133 * CMakeLists.txt:
 134 * GNUmakefile.list.am:
 135 * WebCore.gypi:
 136 * WebCore.pro:
 137 * WebCore.vcproj/WebCore.vcproj:
 138 * WebCore.xcodeproj/project.pbxproj:
 139 * bindings/scripts/CodeGeneratorJS.pm:
 140 (NativeToJSValue):
 141 * bindings/scripts/CodeGeneratorObjC.pm:
 142 (GenerateImplementation):
 143 * bindings/scripts/CodeGeneratorV8.pm:
 144 (GenerateNormalAttrGetter):
 145 * svg/SVGAElement.cpp:
 146 (WebCore::SVGAElement::SVGAElement):
 147 * svg/SVGAElement.h:
 148 (WebCore::SVGAElement::synchronizeRequiredFeatures):
 149 (WebCore::SVGAElement::synchronizeRequiredExtensions):
 150 (WebCore::SVGAElement::synchronizeSystemLanguage):
 151 * svg/SVGAltGlyphElement.cpp:
 152 (WebCore::SVGAltGlyphElement::SVGAltGlyphElement):
 153 * svg/SVGAltGlyphElement.h:
 154 * svg/SVGAnimateElement.cpp:
 155 (WebCore::SVGAnimateElement::SVGAnimateElement):
 156 (WebCore::SVGAnimateElement::hasValidAttributeType):
 157 (WebCore::SVGAnimateElement::determineAnimatedPropertyType):
 158 (WebCore::SVGAnimateElement::determinePropertyValueTypes):
 159 (WebCore::SVGAnimateElement::calculateAnimatedValue):
 160 (WebCore::SVGAnimateElement::calculateFromAndToValues):
 161 (WebCore::SVGAnimateElement::calculateFromAndByValues):
 162 (WebCore::SVGAnimateElement::resetToBaseValue):
 163 (WebCore::SVGAnimateElement::applyResultsToTarget):
 164 (WebCore::SVGAnimateElement::calculateDistance):
 165 (WebCore::SVGAnimateElement::ensureAnimator):
 166 * svg/SVGAnimateElement.h:
 167 * svg/SVGAnimateTransformElement.cpp:
 168 (WebCore::SVGAnimateTransformElement::hasValidAttributeType):
 169 (WebCore::SVGAnimateTransformElement::determineAnimatedPropertyType):
 170 (WebCore::SVGAnimateTransformElement::resetToBaseValue):
 171 (WebCore::SVGAnimateTransformElement::calculateAnimatedValue):
 172 (WebCore::SVGAnimateTransformElement::applyResultsToTarget):
 173 * svg/SVGAnimateTransformElement.h:
 174 * svg/SVGAnimatedAngle.h:
 175 * svg/SVGAnimatedBoolean.h:
 176 * svg/SVGAnimatedEnumeration.h:
 177 * svg/SVGAnimatedInteger.h:
 178 * svg/SVGAnimatedLength.h:
 179 * svg/SVGAnimatedLengthList.h:
 180 * svg/SVGAnimatedNumber.h:
 181 * svg/SVGAnimatedNumberList.h:
 182 * svg/SVGAnimatedPreserveAspectRatio.h:
 183 * svg/SVGAnimatedRect.h:
 184 * svg/SVGAnimatedString.h:
 185 * svg/SVGAnimatedTransformList.h:
 186 * svg/SVGAnimatedType.cpp:
 187 (WebCore::SVGAnimatedType::SVGAnimatedType):
 188 * svg/SVGAnimatedType.h:
 189 (WebCore::SVGAnimatedType::type):
 190 * svg/SVGAnimatedTypeAnimator.h:
 191 (WebCore::SVGAnimatedTypeAnimator::SVGAnimatedTypeAnimator):
 192 * svg/SVGAnimationElement.cpp:
 193 (WebCore::SVGAnimationElement::SVGAnimationElement):
 194 (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
 195 * svg/SVGAnimationElement.h:
 196 (WebCore::SVGAnimationElement::synchronizeRequiredFeatures):
 197 (WebCore::SVGAnimationElement::synchronizeRequiredExtensions):
 198 (WebCore::SVGAnimationElement::synchronizeSystemLanguage):
 199 * svg/SVGAnimatorFactory.h:
 200 (WebCore::SVGAnimatorFactory::create):
 201 * svg/SVGCircleElement.cpp:
 202 (WebCore::SVGCircleElement::SVGCircleElement):
 203 * svg/SVGCircleElement.h:
 204 (WebCore::SVGCircleElement::synchronizeRequiredFeatures):
 205 (WebCore::SVGCircleElement::synchronizeRequiredExtensions):
 206 (WebCore::SVGCircleElement::synchronizeSystemLanguage):
 207 * svg/SVGClipPathElement.cpp:
 208 (WebCore::SVGClipPathElement::SVGClipPathElement):
 209 * svg/SVGClipPathElement.h:
 210 (WebCore::SVGClipPathElement::synchronizeRequiredFeatures):
 211 (WebCore::SVGClipPathElement::synchronizeRequiredExtensions):
 212 (WebCore::SVGClipPathElement::synchronizeSystemLanguage):
 213 * svg/SVGComponentTransferFunctionElement.cpp:
 214 (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
 215 * svg/SVGComponentTransferFunctionElement.h:
 216 * svg/SVGCursorElement.cpp:
 217 (WebCore::SVGCursorElement::SVGCursorElement):
 218 * svg/SVGCursorElement.h:
 219 (WebCore::SVGCursorElement::synchronizeRequiredFeatures):
 220 (WebCore::SVGCursorElement::synchronizeRequiredExtensions):
 221 (WebCore::SVGCursorElement::synchronizeSystemLanguage):
 222 * svg/SVGDefsElement.cpp:
 223 (WebCore::SVGDefsElement::SVGDefsElement):
 224 * svg/SVGDefsElement.h:
 225 (WebCore::SVGDefsElement::synchronizeRequiredFeatures):
 226 (WebCore::SVGDefsElement::synchronizeRequiredExtensions):
 227 (WebCore::SVGDefsElement::synchronizeSystemLanguage):
 228 * svg/SVGElement.cpp:
 229 (WebCore::SVGElement::animatedPropertyTypeForAttribute):
 230 (WebCore::SVGElement::updateAnimatedSVGAttribute):
 231 (WebCore::SVGElement::localAttributeToPropertyMap):
 232 (WebCore::SVGElement::synchronizeRequiredFeatures):
 233 (WebCore::SVGElement::synchronizeRequiredExtensions):
 234 (WebCore::SVGElement::synchronizeSystemLanguage):
 235 * svg/SVGElement.h:
 236 (WebCore::SVGElement::svgAttributeChanged):
 237 (WebCore::SVGElement::synchronizeRequiredFeatures):
 238 (WebCore::SVGElement::synchronizeRequiredExtensions):
 239 (WebCore::SVGElement::synchronizeSystemLanguage):
 240 * svg/SVGEllipseElement.cpp:
 241 (WebCore::SVGEllipseElement::SVGEllipseElement):
 242 * svg/SVGEllipseElement.h:
 243 (WebCore::SVGEllipseElement::synchronizeRequiredFeatures):
 244 (WebCore::SVGEllipseElement::synchronizeRequiredExtensions):
 245 (WebCore::SVGEllipseElement::synchronizeSystemLanguage):
 246 * svg/SVGFEBlendElement.cpp:
 247 (WebCore::SVGFEBlendElement::SVGFEBlendElement):
 248 * svg/SVGFEBlendElement.h:
 249 * svg/SVGFEColorMatrixElement.cpp:
 250 (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
 251 * svg/SVGFEColorMatrixElement.h:
 252 * svg/SVGFEComponentTransferElement.cpp:
 253 (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement):
 254 * svg/SVGFEComponentTransferElement.h:
 255 * svg/SVGFECompositeElement.cpp:
 256 (WebCore::SVGFECompositeElement::SVGFECompositeElement):
 257 * svg/SVGFECompositeElement.h:
 258 * svg/SVGFEConvolveMatrixElement.cpp:
 259 (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
 260 * svg/SVGFEConvolveMatrixElement.h:
 261 * svg/SVGFEDiffuseLightingElement.cpp:
 262 (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
 263 * svg/SVGFEDiffuseLightingElement.h:
 264 * svg/SVGFEDisplacementMapElement.cpp:
 265 (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
 266 * svg/SVGFEDisplacementMapElement.h:
 267 * svg/SVGFEDropShadowElement.cpp:
 268 (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
 269 * svg/SVGFEDropShadowElement.h:
 270 * svg/SVGFEFloodElement.cpp:
 271 * svg/SVGFEFloodElement.h:
 272 * svg/SVGFEGaussianBlurElement.cpp:
 273 (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
 274 * svg/SVGFEGaussianBlurElement.h:
 275 * svg/SVGFEImageElement.cpp:
 276 (WebCore::SVGFEImageElement::SVGFEImageElement):
 277 * svg/SVGFEImageElement.h:
 278 * svg/SVGFELightElement.cpp:
 279 (WebCore::SVGFELightElement::SVGFELightElement):
 280 * svg/SVGFELightElement.h:
 281 * svg/SVGFEMergeElement.cpp:
 282 * svg/SVGFEMergeElement.h:
 283 * svg/SVGFEMergeNodeElement.cpp:
 284 (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement):
 285 * svg/SVGFEMergeNodeElement.h:
 286 * svg/SVGFEMorphologyElement.cpp:
 287 (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
 288 * svg/SVGFEMorphologyElement.h:
 289 * svg/SVGFEOffsetElement.cpp:
 290 (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
 291 * svg/SVGFEOffsetElement.h:
 292 * svg/SVGFESpecularLightingElement.cpp:
 293 (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
 294 * svg/SVGFESpecularLightingElement.h:
 295 * svg/SVGFETileElement.cpp:
 296 (WebCore::SVGFETileElement::SVGFETileElement):
 297 * svg/SVGFETileElement.h:
 298 * svg/SVGFETurbulenceElement.cpp:
 299 (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
 300 * svg/SVGFETurbulenceElement.h:
 301 * svg/SVGFilterElement.cpp:
 302 (WebCore::SVGFilterElement::SVGFilterElement):
 303 * svg/SVGFilterElement.h:
 304 * svg/SVGFilterPrimitiveStandardAttributes.cpp:
 305 (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
 306 * svg/SVGFilterPrimitiveStandardAttributes.h:
 307 * svg/SVGFitToViewBox.cpp:
 308 * svg/SVGFitToViewBox.h:
 309 * svg/SVGFontElement.cpp:
 310 (WebCore::SVGFontElement::SVGFontElement):
 311 * svg/SVGFontElement.h:
 312 (WebCore::SVGFontElement::rendererIsNeeded):
 313 * svg/SVGForeignObjectElement.cpp:
 314 (WebCore::SVGForeignObjectElement::SVGForeignObjectElement):
 315 * svg/SVGForeignObjectElement.h:
 316 (WebCore::SVGForeignObjectElement::synchronizeRequiredFeatures):
 317 (WebCore::SVGForeignObjectElement::synchronizeRequiredExtensions):
 318 (WebCore::SVGForeignObjectElement::synchronizeSystemLanguage):
 319 * svg/SVGGElement.cpp:
 320 (WebCore::SVGGElement::SVGGElement):
 321 * svg/SVGGElement.h:
 322 (WebCore::SVGGElement::synchronizeRequiredFeatures):
 323 (WebCore::SVGGElement::synchronizeRequiredExtensions):
 324 (WebCore::SVGGElement::synchronizeSystemLanguage):
 325 * svg/SVGGlyphElement.cpp:
 326 * svg/SVGGlyphElement.h:
 327 * svg/SVGGradientElement.cpp:
 328 (WebCore::SVGGradientElement::SVGGradientElement):
 329 (WebCore::SVGGradientElement::svgAttributeChanged):
 330 * svg/SVGGradientElement.h:
 331 * svg/SVGImageElement.cpp:
 332 (WebCore::SVGImageElement::SVGImageElement):
 333 * svg/SVGImageElement.h:
 334 (WebCore::SVGImageElement::synchronizeRequiredFeatures):
 335 (WebCore::SVGImageElement::synchronizeRequiredExtensions):
 336 (WebCore::SVGImageElement::synchronizeSystemLanguage):
 337 * svg/SVGLineElement.cpp:
 338 (WebCore::SVGLineElement::SVGLineElement):
 339 * svg/SVGLineElement.h:
 340 (WebCore::SVGLineElement::synchronizeRequiredFeatures):
 341 (WebCore::SVGLineElement::synchronizeRequiredExtensions):
 342 (WebCore::SVGLineElement::synchronizeSystemLanguage):
 343 * svg/SVGLinearGradientElement.cpp:
 344 (WebCore::SVGLinearGradientElement::SVGLinearGradientElement):
 345 * svg/SVGLinearGradientElement.h:
 346 * svg/SVGMPathElement.cpp:
 347 (WebCore::SVGMPathElement::SVGMPathElement):
 348 * svg/SVGMPathElement.h:
 349 * svg/SVGMarkerElement.cpp:
 350 (WebCore::SVGMarkerElement::orientTypePropertyInfo):
 351 (WebCore::SVGMarkerElement::SVGMarkerElement):
 352 (WebCore::SVGMarkerElement::setOrientToAuto):
 353 (WebCore::SVGMarkerElement::setOrientToAngle):
 354 (WebCore::SVGMarkerElement::synchronizeOrientType):
 355 (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper):
 356 (WebCore::SVGMarkerElement::orientTypeAnimated):
 357 * svg/SVGMarkerElement.h:
 358 * svg/SVGMaskElement.cpp:
 359 (WebCore::SVGMaskElement::SVGMaskElement):
 360 * svg/SVGMaskElement.h:
 361 (WebCore::SVGMaskElement::synchronizeRequiredFeatures):
 362 (WebCore::SVGMaskElement::synchronizeRequiredExtensions):
 363 (WebCore::SVGMaskElement::synchronizeSystemLanguage):
 364 * svg/SVGMissingGlyphElement.cpp:
 365 * svg/SVGMissingGlyphElement.h:
 366 * svg/SVGPathElement.cpp:
 367 (WebCore::SVGPathElement::dPropertyInfo):
 368 (WebCore::SVGPathElement::SVGPathElement):
 369 (WebCore::SVGPathElement::svgAttributeChanged):
 370 (WebCore::SVGPathElement::lookupOrCreateDWrapper):
 371 (WebCore::SVGPathElement::synchronizeD):
 372 (WebCore::SVGPathElement::pathSegList):
 373 (WebCore::SVGPathElement::animatedPathSegList):
 374 * svg/SVGPathElement.h:
 375 (WebCore::SVGPathElement::pathByteStream):
 376 (WebCore::SVGPathElement::synchronizeRequiredFeatures):
 377 (WebCore::SVGPathElement::synchronizeRequiredExtensions):
 378 (WebCore::SVGPathElement::synchronizeSystemLanguage):
 379 * svg/SVGPathSegWithContext.h:
 380 (WebCore::SVGPathSegWithContext::animatedProperty):
 381 * svg/SVGPatternElement.cpp:
 382 (WebCore::SVGPatternElement::SVGPatternElement):
 383 * svg/SVGPatternElement.h:
 384 (WebCore::SVGPatternElement::synchronizeRequiredFeatures):
 385 (WebCore::SVGPatternElement::synchronizeRequiredExtensions):
 386 (WebCore::SVGPatternElement::synchronizeSystemLanguage):
 387 * svg/SVGPolyElement.cpp:
 388 (WebCore::SVGPolyElement::pointsPropertyInfo):
 389 (WebCore::SVGPolyElement::SVGPolyElement):
 390 (WebCore::SVGPolyElement::parseMappedAttribute):
 391 (WebCore::SVGPolyElement::synchronizePoints):
 392 (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
 393 (WebCore::SVGPolyElement::points):
 394 (WebCore::SVGPolyElement::animatedPoints):
 395 * svg/SVGPolyElement.h:
 396 (WebCore::SVGPolyElement::synchronizeRequiredFeatures):
 397 (WebCore::SVGPolyElement::synchronizeRequiredExtensions):
 398 (WebCore::SVGPolyElement::synchronizeSystemLanguage):
 399 * svg/SVGRadialGradientElement.cpp:
 400 (WebCore::SVGRadialGradientElement::SVGRadialGradientElement):
 401 * svg/SVGRadialGradientElement.h:
 402 * svg/SVGRectElement.cpp:
 403 (WebCore::SVGRectElement::SVGRectElement):
 404 * svg/SVGRectElement.h:
 405 (WebCore::SVGRectElement::synchronizeRequiredFeatures):
 406 (WebCore::SVGRectElement::synchronizeRequiredExtensions):
 407 (WebCore::SVGRectElement::synchronizeSystemLanguage):
 408 * svg/SVGSVGElement.cpp:
 409 (WebCore::SVGSVGElement::SVGSVGElement):
 410 * svg/SVGSVGElement.h:
 411 (WebCore::SVGSVGElement::synchronizeRequiredFeatures):
 412 (WebCore::SVGSVGElement::synchronizeRequiredExtensions):
 413 (WebCore::SVGSVGElement::synchronizeSystemLanguage):
 414 * svg/SVGScriptElement.cpp:
 415 (WebCore::SVGScriptElement::SVGScriptElement):
 416 * svg/SVGScriptElement.h:
 417 * svg/SVGStopElement.cpp:
 418 (WebCore::SVGStopElement::SVGStopElement):
 419 * svg/SVGStopElement.h:
 420 * svg/SVGStyledElement.cpp:
 421 (WebCore::SVGStyledElement::SVGStyledElement):
 422 (WebCore::cssPropertyToTypeMap):
 423 (WebCore::SVGStyledElement::animatedPropertyTypeForAttribute):
 424 * svg/SVGStyledElement.h:
 425 * svg/SVGStyledTransformableElement.cpp:
 426 (WebCore::SVGStyledTransformableElement::SVGStyledTransformableElement):
 427 * svg/SVGStyledTransformableElement.h:
 428 * svg/SVGSwitchElement.cpp:
 429 (WebCore::SVGSwitchElement::SVGSwitchElement):
 430 * svg/SVGSwitchElement.h:
 431 (WebCore::SVGSwitchElement::synchronizeRequiredFeatures):
 432 (WebCore::SVGSwitchElement::synchronizeRequiredExtensions):
 433 (WebCore::SVGSwitchElement::synchronizeSystemLanguage):
 434 * svg/SVGSymbolElement.cpp:
 435 (WebCore::SVGSymbolElement::SVGSymbolElement):
 436 * svg/SVGSymbolElement.h:
 437 * svg/SVGTRefElement.cpp:
 438 (WebCore::SVGTRefElement::SVGTRefElement):
 439 * svg/SVGTRefElement.h:
 440 * svg/SVGTSpanElement.cpp:
 441 * svg/SVGTSpanElement.h:
 442 * svg/SVGTests.cpp:
 443 (WebCore::SVGTests::requiredFeaturesPropertyInfo):
 444 (WebCore::SVGTests::requiredExtensionsPropertyInfo):
 445 (WebCore::SVGTests::systemLanguagePropertyInfo):
 446 (WebCore::SVGTests::attributeToPropertyMap):
 447 (WebCore::SVGTests::synchronizeRequiredFeatures):
 448 (WebCore::SVGTests::synchronizeRequiredExtensions):
 449 (WebCore::SVGTests::synchronizeSystemLanguage):
 450 * svg/SVGTests.h:
 451 * svg/SVGTextContentElement.cpp:
 452 (WebCore::SVGTextContentElement::textLengthPropertyInfo):
 453 (WebCore::SVGTextContentElement::SVGTextContentElement):
 454 (WebCore::SVGTextContentElement::synchronizeTextLength):
 455 (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
 456 (WebCore::SVGTextContentElement::textLengthAnimated):
 457 * svg/SVGTextContentElement.h:
 458 (WebCore::SVGTextContentElement::synchronizeRequiredFeatures):
 459 (WebCore::SVGTextContentElement::synchronizeRequiredExtensions):
 460 (WebCore::SVGTextContentElement::synchronizeSystemLanguage):
 461 * svg/SVGTextElement.cpp:
 462 (WebCore::SVGTextElement::SVGTextElement):
 463 * svg/SVGTextElement.h:
 464 * svg/SVGTextPathElement.cpp:
 465 (WebCore::SVGTextPathElement::SVGTextPathElement):
 466 * svg/SVGTextPathElement.h:
 467 * svg/SVGTextPositioningElement.cpp:
 468 (WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
 469 * svg/SVGTextPositioningElement.h:
 470 * svg/SVGTitleElement.cpp:
 471 * svg/SVGTitleElement.h:
 472 (WebCore::SVGTitleElement::rendererIsNeeded):
 473 * svg/SVGUseElement.cpp:
 474 (WebCore::SVGUseElement::SVGUseElement):
 475 * svg/SVGUseElement.h:
 476 (WebCore::SVGUseElement::synchronizeRequiredFeatures):
 477 (WebCore::SVGUseElement::synchronizeRequiredExtensions):
 478 (WebCore::SVGUseElement::synchronizeSystemLanguage):
 479 * svg/SVGViewElement.cpp:
 480 (WebCore::SVGViewElement::SVGViewElement):
 481 * svg/SVGViewElement.h:
 482 * svg/SVGViewSpec.cpp:
 483 (WebCore::SVGViewSpec::SVGViewSpec):
 484 * svg/SVGViewSpec.h:
 485 * svg/properties/SVGAnimatedProperty.h:
 486 (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper):
 487 (WebCore::SVGAnimatedProperty::lookupWrapper):
 488 * svg/properties/SVGAnimatedPropertyMacros.h:
 489 * svg/properties/SVGAnimatedPropertySynchronizer.h:
 490 * svg/properties/SVGAttributeToPropertyMap.cpp: Added.
 491 (WebCore::SVGAttributeToPropertyMap::addProperties):
 492 (WebCore::SVGAttributeToPropertyMap::addProperty):
 493 (WebCore::SVGAttributeToPropertyMap::animatedPropertiesForAttribute):
 494 (WebCore::SVGAttributeToPropertyMap::animatedPropertyTypeForAttribute):
 495 (WebCore::SVGAttributeToPropertyMap::synchronizeProperties):
 496 (WebCore::SVGAttributeToPropertyMap::synchronizeProperty):
 497 (WebCore::SVGAttributeToPropertyMap::animatedProperty):
 498 * svg/properties/SVGAttributeToPropertyMap.h: Added.
 499 (WebCore::SVGAttributeToPropertyMap::SVGAttributeToPropertyMap):
 500 (WebCore::SVGAttributeToPropertyMap::~SVGAttributeToPropertyMap):
 501 (WebCore::SVGAttributeToPropertyMap::isEmpty):
 502 * svg/properties/SVGPropertyInfo.h: Added.
 503 (WebCore::SVGPropertyInfo::SVGPropertyInfo):
 504
15052011-07-08 Adam Barth <abarth@webkit.org>
2506
3507 Unreviewed, rolling out r90662.
90671

Source/WebCore/CMakeLists.txt

@@IF (ENABLE_SVG)
18091809 svg/graphics/filters/SVGFEImage.cpp
18101810 svg/graphics/filters/SVGFilter.cpp
18111811 svg/graphics/filters/SVGFilterBuilder.cpp
 1812 svg/properties/SVGAttributeToPropertyMap.cpp
18121813 svg/properties/SVGPathSegListPropertyTearOff.cpp
18131814 )
18141815
90666

Source/WebCore/GNUmakefile.list.am

@@webcore_sources += \
33953395 Source/WebCore/svg/graphics/SVGImage.h \
33963396 Source/WebCore/svg/LinearGradientAttributes.h \
33973397 Source/WebCore/svg/PatternAttributes.h \
 3398 Source/WebCore/svg/properties/SVGAttributeToPropertyMap.cpp \
 3399 Source/WebCore/svg/properties/SVGAttributeToPropertyMap.h \
33983400 Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h \
33993401 Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h \
34003402 Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h \

@@webcore_sources += \
34103412 Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp \
34113413 Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.h \
34123414 Source/WebCore/svg/properties/SVGProperty.h \
 3415 Source/WebCore/svg/properties/SVGPropertyInfo.h \
34133416 Source/WebCore/svg/properties/SVGPropertyTearOff.h \
34143417 Source/WebCore/svg/properties/SVGPropertyTraits.h \
34153418 Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h \
90666

Source/WebCore/WebCore.gypi

10771077 'svg/SVGTransformList.h',
10781078 'svg/animation/SMILTime.h',
10791079 'svg/animation/SVGSMILElement.h',
 1080 'svg/properties/SVGAttributeToPropertyMap.h',
10801081 'svg/properties/SVGAnimatedEnumerationPropertyTearOff.h',
10811082 'svg/properties/SVGAnimatedListPropertyTearOff.h',
10821083 'svg/properties/SVGAnimatedProperty.h',

10901091 'svg/properties/SVGListPropertyTearOff.h',
10911092 'svg/properties/SVGPathSegListPropertyTearOff.h',
10921093 'svg/properties/SVGProperty.h',
 1094 'svg/properties/SVGPropertyInfo.h',
10931095 'svg/properties/SVGPropertyTearOff.h',
10941096 'svg/properties/SVGPropertyTraits.h',
10951097 'svg/properties/SVGStaticListPropertyTearOff.h',

60026004 'svg/graphics/filters/SVGFilter.h',
60036005 'svg/graphics/filters/SVGFilterBuilder.cpp',
60046006 'svg/graphics/filters/SVGFilterBuilder.h',
 6007 'svg/properties/SVGAttributeToPropertyMap.cpp',
60056008 'svg/properties/SVGAnimatedPathSegListPropertyTearOff.h',
60066009 'svg/properties/SVGPathSegListPropertyTearOff.cpp',
60076010 'webaudio/AudioBasicProcessorNode.cpp',
90666

Source/WebCore/WebCore.pro

@@HEADERS += \
23002300 svg/graphics/filters/SVGFilterBuilder.h \
23012301 svg/graphics/filters/SVGFilter.h \
23022302 svg/graphics/SVGImage.h \
 2303 svg/properties/SVGAttributeToPropertyMap.h \
23032304 svg/properties/SVGAnimatedEnumerationPropertyTearOff.h \
23042305 svg/properties/SVGAnimatedListPropertyTearOff.h \
23052306 svg/properties/SVGAnimatedPathSegListPropertyTearOff.h \

@@HEADERS += \
23142315 svg/properties/SVGListPropertyTearOff.h \
23152316 svg/properties/SVGPathSegListPropertyTearOff.h \
23162317 svg/properties/SVGProperty.h \
 2318 svg/properties/SVGPropertyInfo.h \
23172319 svg/properties/SVGPropertyTearOff.h \
23182320 svg/properties/SVGPropertyTraits.h \
23192321 svg/properties/SVGStaticListPropertyTearOff.h \

@@contains(DEFINES, ENABLE_SVG=1) {
32633265 svg/graphics/filters/SVGFilter.cpp \
32643266 svg/graphics/filters/SVGFilterBuilder.cpp \
32653267 svg/graphics/SVGImage.cpp \
 3268 svg/properties/SVGAttributeToPropertyMap.cpp \
32663269 svg/properties/SVGPathSegListPropertyTearOff.cpp
32673270
32683271 linux-g++*:CONFIG(debug, debug|release):isEqual(QT_ARCH,i386) {
90666

Source/WebCore/WebCore.vcproj/WebCore.vcproj

6647366473 Name="properties"
6647466474 >
6647566475 <File
 66476 RelativePath="..\svg\properties\SVGAttributeToPropertyMap.cpp"
 66477 >
 66478 </File>
 66479 <File
 66480 RelativePath="..\svg\properties\SVGAttributeToPropertyMap.h"
 66481 >
 66482 </File>
 66483 <File
6647666484 RelativePath="..\svg\properties\SVGAnimatedEnumerationPropertyTearOff.h"
6647766485 >
6647866486 </File>

6653366541 >
6653466542 </File>
6653566543 <File
 66544 RelativePath="..\svg\properties\SVGPropertyInfo.h"
 66545 >
 66546 </File>
 66547 <File
6653666548 RelativePath="..\svg\properties\SVGPropertyTearOff.h"
6653766549 >
6653866550 </File>
90666

Source/WebCore/WebCore.xcodeproj/project.pbxproj

8888 081668DA125603D5006F25DE /* SVGTextLayoutEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 081668D8125603D5006F25DE /* SVGTextLayoutEngine.h */; };
8989 081AA8DA1111237E002AB06E /* SVGElementRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 081AA8D91111237E002AB06E /* SVGElementRareData.h */; };
9090 081CDFBF126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 081CDFBE126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h */; settings = {ATTRIBUTES = (Private, ); }; };
 91 081DD49C13BA1A6000DC7627 /* SVGPropertyInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 081DD49B13BA1A6000DC7627 /* SVGPropertyInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
9192 081EBF3A0FD34F4100DA7559 /* SVGFilterBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 081EBF380FD34F4100DA7559 /* SVGFilterBuilder.cpp */; };
9293 081EBF3B0FD34F4100DA7559 /* SVGFilterBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 081EBF390FD34F4100DA7559 /* SVGFilterBuilder.h */; };
9394 0823D159127AD6AC000EBC95 /* SVGAnimatedInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */; settings = {ATTRIBUTES = (Private, ); }; };

170171 08F0BFC61255C53C00075185 /* SVGTextMetrics.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F0BFC11255C53C00075185 /* SVGTextMetrics.h */; };
171172 08F2F0091213E61700DCEC48 /* RenderImageResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08F2F0071213E61700DCEC48 /* RenderImageResource.cpp */; };
172173 08F2F00A1213E61700DCEC48 /* RenderImageResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F2F0081213E61700DCEC48 /* RenderImageResource.h */; settings = {ATTRIBUTES = (Private, ); }; };
 174 08FB17C113BC7E9100040086 /* SVGAttributeToPropertyMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08FB17C013BC7E9100040086 /* SVGAttributeToPropertyMap.cpp */; };
 175 08FB3F8413BC754C0099FC18 /* SVGAttributeToPropertyMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 08FB3F8313BC754C0099FC18 /* SVGAttributeToPropertyMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
173176 08FE0BC5127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h in Headers */ = {isa = PBXBuildFile; fileRef = 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */; settings = {ATTRIBUTES = (Private, ); }; };
174177 08FF102012950F5A00F00276 /* SVGPathSegListPropertyTearOff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08FF101F12950F5900F00276 /* SVGPathSegListPropertyTearOff.cpp */; };
175178 0A4844990CA44CB200B7BD48 /* SoftLinking.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A4844980CA44CB200B7BD48 /* SoftLinking.h */; settings = {ATTRIBUTES = (Private, ); }; };

64576460 081668D8125603D5006F25DE /* SVGTextLayoutEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutEngine.h; sourceTree = "<group>"; };
64586461 081AA8D91111237E002AB06E /* SVGElementRareData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGElementRareData.h; sourceTree = "<group>"; };
64596462 081CDFBE126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertySynchronizer.h; sourceTree = "<group>"; };
 6463 081DD49B13BA1A6000DC7627 /* SVGPropertyInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyInfo.h; sourceTree = "<group>"; };
64606464 081EBF380FD34F4100DA7559 /* SVGFilterBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFilterBuilder.cpp; sourceTree = "<group>"; };
64616465 081EBF390FD34F4100DA7559 /* SVGFilterBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFilterBuilder.h; sourceTree = "<group>"; };
64626466 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedInteger.h; sourceTree = "<group>"; };

65516555 08F0BFC11255C53C00075185 /* SVGTextMetrics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextMetrics.h; sourceTree = "<group>"; };
65526556 08F2F0071213E61700DCEC48 /* RenderImageResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderImageResource.cpp; sourceTree = "<group>"; };
65536557 08F2F0081213E61700DCEC48 /* RenderImageResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderImageResource.h; sourceTree = "<group>"; };
 6558 08FB17C013BC7E9100040086 /* SVGAttributeToPropertyMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAttributeToPropertyMap.cpp; sourceTree = "<group>"; };
 6559 08FB3F8313BC754C0099FC18 /* SVGAttributeToPropertyMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAttributeToPropertyMap.h; sourceTree = "<group>"; };
65546560 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPreserveAspectRatio.h; sourceTree = "<group>"; };
65556561 08FF101F12950F5900F00276 /* SVGPathSegListPropertyTearOff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegListPropertyTearOff.cpp; sourceTree = "<group>"; };
65566562 0A4844980CA44CB200B7BD48 /* SoftLinking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoftLinking.h; sourceTree = "<group>"; };

1275412760 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */,
1275512761 08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */,
1275612762 085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */,
 12763 08FB17C013BC7E9100040086 /* SVGAttributeToPropertyMap.cpp */,
 12764 08FB3F8313BC754C0099FC18 /* SVGAttributeToPropertyMap.h */,
1275712765 0810764312828556007C63BA /* SVGListProperty.h */,
1275812766 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */,
1275912767 08FF101F12950F5900F00276 /* SVGPathSegListPropertyTearOff.cpp */,
1276012768 084A0828128D7867002DB1F1 /* SVGPathSegListPropertyTearOff.h */,
1276112769 088A0E01126EF1DB00978F7A /* SVGProperty.h */,
 12770 081DD49B13BA1A6000DC7627 /* SVGPropertyInfo.h */,
1276212771 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */,
1276312772 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */,
1276412773 0880F70D1282B46D00948505 /* SVGStaticListPropertyTearOff.h */,

2310123110 0863951613B5FE5700BB344D /* SVGAnimatedPath.h in Headers */,
2310223111 431A2F9C13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h in Headers */,
2310323112 A5ABB78713B904BC00F197E3 /* LineBreakIteratorPoolICU.h in Headers */,
 23113 081DD49C13BA1A6000DC7627 /* SVGPropertyInfo.h in Headers */,
 23114 08FB3F8413BC754C0099FC18 /* SVGAttributeToPropertyMap.h in Headers */,
2310423115 82889B4D13C62392009A6156 /* InspectorStyleTextEditor.h in Headers */,
2310523116 );
2310623117 runOnlyForDeploymentPostprocessing = 0;

2586925880 431A2FD713B7707A007791E4 /* SVGAnimatedLengthList.cpp in Sources */,
2587025881 431A302113B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp in Sources */,
2587125882 431A308813B8F978007791E4 /* SVGAnimatedBoolean.cpp in Sources */,
 25883 08FB17C113BC7E9100040086 /* SVGAttributeToPropertyMap.cpp in Sources */,
2587225884 43F6FD9613BCD0B100224052 /* SVGAnimatedInteger.cpp in Sources */,
2587325885 82889B4C13C62392009A6156 /* InspectorStyleTextEditor.cpp in Sources */,
2587425886 );
90666

Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

@@sub NativeToJSValue
27372737 $value = "${tearOffType}::create(imp, $value, $updateMethod)";
27382738 }
27392739 } elsif ($tearOffType =~ /SVGStaticListPropertyTearOff/) {
2740  my $extraImp = "GetOwnerElementForType<$implClassName, IsDerivedFromSVGElement<$implClassName>::value>::ownerElement(imp), ";
2741  $value = "${tearOffType}::create($extraImp$value)";
 2740 $value = "${tearOffType}::create(imp, $value)";
27422741 } elsif (not $tearOffType =~ /SVG(Point|PathSeg)List/) {
27432742 $value = "${tearOffType}::create($value)";
27442743 }
90666

Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm

@@sub GenerateImplementation
13161316 $getterContentHead = "kit(WTF::getPtr($getterContentHead";
13171317 $getterContentTail .= "))";
13181318 } elsif ($idlTypeWithNamespace =~ /SVGStaticListPropertyTearOff/) {
1319  my $extraImp = "WebCore::GetOwnerElementForType<$implClassNameWithNamespace, WebCore::IsDerivedFromSVGElement<$implClassNameWithNamespace>::value>::ownerElement(IMPL), ";
1320  $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($extraImp$getterContentHead";
 1319 $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create(IMPL, $getterContentHead";
13211320 $getterContentTail .= ")))";
13221321 } else {
13231322 $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($getterContentHead";
90666

Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

@@END
902902 push(@implContentDecls, " return toV8(WTF::getPtr(${tearOffType}::create(imp, $result, $updateMethod)));\n");
903903 }
904904 } elsif ($tearOffType =~ /SVGStaticListPropertyTearOff/) {
905  my $extraImp = "GetOwnerElementForType<$implClassName, IsDerivedFromSVGElement<$implClassName>::value>::ownerElement(imp), ";
906  push(@implContentDecls, " return toV8(WTF::getPtr(${tearOffType}::create($extraImp$result)));\n");
 905 push(@implContentDecls, " return toV8(WTF::getPtr(${tearOffType}::create(imp, $result)));\n");
907906 } elsif ($tearOffType =~ /SVG(Point|PathSeg)List/) {
908907 push(@implContentDecls, " return toV8(WTF::getPtr($result));\n");
909908 } else {
90666

Source/WebCore/svg/SVGAElement.cpp

@@DEFINE_ANIMATED_STRING(SVGAElement, SVGN
5353DEFINE_ANIMATED_STRING(SVGAElement, XLinkNames::hrefAttr, Href, href)
5454DEFINE_ANIMATED_BOOLEAN(SVGAElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
5555
 56BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAElement)
 57 REGISTER_LOCAL_ANIMATED_PROPERTY(svgTarget)
 58 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
 59 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 60 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 61 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 62END_REGISTER_ANIMATED_PROPERTIES
 63
5664inline SVGAElement::SVGAElement(const QualifiedName& tagName, Document* document)
5765 : SVGStyledTransformableElement(tagName, document)
5866{
5967 ASSERT(hasTagName(SVGNames::aTag));
 68 registerAnimatedPropertiesForSVGAElement();
6069}
6170
6271PassRefPtr<SVGAElement> SVGAElement::create(const QualifiedName& tagName, Document* document)

@@void SVGAElement::svgAttributeChanged(co
132141 }
133142}
134143
135 AttributeToPropertyTypeMap& SVGAElement::attributeToPropertyTypeMap()
136 {
137  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
138  return s_attributeToPropertyTypeMap;
139 }
140 
141 void SVGAElement::fillAttributeToPropertyTypeMap()
142 {
143  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
144 
145  SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
146  attributeToPropertyTypeMap.set(SVGNames::targetAttr, AnimatedString);
147  attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
148 }
149 
150 void SVGAElement::synchronizeProperty(const QualifiedName& attrName)
151 {
152  if (attrName == anyQName()) {
153  synchronizeSVGTarget();
154  synchronizeHref();
155  synchronizeExternalResourcesRequired();
156  SVGTests::synchronizeProperties(this, attrName);
157  SVGStyledTransformableElement::synchronizeProperty(attrName);
158  return;
159  }
160 
161  if (!isSupportedAttribute(attrName)) {
162  SVGStyledTransformableElement::synchronizeProperty(attrName);
163  return;
164  }
165 
166  if (attrName == SVGNames::targetAttr) {
167  synchronizeSVGTarget();
168  return;
169  }
170 
171  if (SVGURIReference::isKnownAttribute(attrName)) {
172  synchronizeHref();
173  return;
174  }
175 
176  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
177  synchronizeExternalResourcesRequired();
178  return;
179  }
180 
181  if (SVGTests::isKnownAttribute(attrName)) {
182  SVGTests::synchronizeProperties(this, attrName);
183  return;
184  }
185 
186  ASSERT_NOT_REACHED();
187 }
188 
189144RenderObject* SVGAElement::createRenderer(RenderArena* arena, RenderStyle*)
190145{
191146 if (static_cast<SVGElement*>(parentNode())->isTextContent())
90666

Source/WebCore/svg/SVGAElement.h

@@private:
5151 bool isSupportedAttribute(const QualifiedName&);
5252 virtual void parseMappedAttribute(Attribute*);
5353 virtual void svgAttributeChanged(const QualifiedName&);
54  virtual void synchronizeProperty(const QualifiedName&);
55 
56  virtual void fillAttributeToPropertyTypeMap();
57  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5854
5955 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
6056

@@private:
6763
6864 virtual bool childShouldCreateRenderer(Node*) const;
6965
70  // Animated property declarations
71 
72  // This declaration used to define a non-virtual "String& target() const" method, that clashes with "virtual String Element::target() const".
73  // That's why it has been renamed to "svgTarget", the CodeGenerators take care of calling svgTargetAnimated() instead of targetAnimated(), see CodeGenerator.pm.
74  DECLARE_ANIMATED_STRING(SVGTarget, svgTarget)
75 
76  // SVGURIReference
77  DECLARE_ANIMATED_STRING(Href, href)
78 
79  // SVGExternalResourcesRequired
80  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 66 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAElement)
 67 // This declaration used to define a non-virtual "String& target() const" method, that clashes with "virtual String Element::target() const".
 68 // That's why it has been renamed to "svgTarget", the CodeGenerators take care of calling svgTargetAnimated() instead of targetAnimated(), see CodeGenerator.pm.
 69 DECLARE_ANIMATED_STRING(SVGTarget, svgTarget)
 70 DECLARE_ANIMATED_STRING(Href, href)
 71 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 72 END_DECLARE_ANIMATED_PROPERTIES
 73
 74 // SVGTests
 75 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 76 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 77 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
8178};
8279
8380} // namespace WebCore
90666

Source/WebCore/svg/SVGAltGlyphElement.cpp

3333
3434namespace WebCore {
3535
36 // Animated property declarations
 36// Animated property definitions
3737DEFINE_ANIMATED_STRING(SVGAltGlyphElement, XLinkNames::hrefAttr, Href, href)
3838
 39BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAltGlyphElement)
 40 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
 41 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTextPositioningElement)
 42END_REGISTER_ANIMATED_PROPERTIES
 43
3944inline SVGAltGlyphElement::SVGAltGlyphElement(const QualifiedName& tagName, Document* document)
4045 : SVGTextPositioningElement(tagName, document)
4146{
4247 ASSERT(hasTagName(SVGNames::altGlyphTag));
 48 registerAnimatedPropertiesForSVGAltGlyphElement();
4349}
4450
4551PassRefPtr<SVGAltGlyphElement> SVGAltGlyphElement::create(const QualifiedName& tagName, Document* document)

@@PassRefPtr<SVGAltGlyphElement> SVGAltGly
4753 return adoptRef(new SVGAltGlyphElement(tagName, document));
4854}
4955
50 void SVGAltGlyphElement::synchronizeProperty(const QualifiedName& attrName)
51 {
52  SVGTextPositioningElement::synchronizeProperty(attrName);
53 
54  if (attrName == anyQName() || SVGURIReference::isKnownAttribute(attrName))
55  synchronizeHref();
56 }
57 
58 AttributeToPropertyTypeMap& SVGAltGlyphElement::attributeToPropertyTypeMap()
59 {
60  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
61  return s_attributeToPropertyTypeMap;
62 }
63 
64 void SVGAltGlyphElement::fillAttributeToPropertyTypeMap()
65 {
66  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
67 
68  SVGTextPositioningElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
69  attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
70 }
71 
7256void SVGAltGlyphElement::setGlyphRef(const AtomicString&, ExceptionCode& ec)
7357{
7458 ec = NO_MODIFICATION_ALLOWED_ERR;
90666

Source/WebCore/svg/SVGAltGlyphElement.h

@@public:
4545private:
4646 SVGAltGlyphElement(const QualifiedName&, Document*);
4747
48  virtual void synchronizeProperty(const QualifiedName&);
49 
50  virtual void fillAttributeToPropertyTypeMap();
51  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
52 
5348 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
5449 virtual bool childShouldCreateRenderer(Node*) const;
5550
56  // Animated property declarations
57 
58  // SVGURIReference
59  DECLARE_ANIMATED_STRING(Href, href)
 51 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAltGlyphElement)
 52 DECLARE_ANIMATED_STRING(Href, href)
 53 END_DECLARE_ANIMATED_PROPERTIES
6054};
6155
6256} // namespace WebCore
90666

Source/WebCore/svg/SVGAnimateElement.cpp

@@namespace WebCore {
4040
4141SVGAnimateElement::SVGAnimateElement(const QualifiedName& tagName, Document* document)
4242 : SVGAnimationElement(tagName, document)
43  , m_animatedAttributeType(AnimatedString)
 43 , m_animatedPropertyType(AnimatedString)
4444 , m_fromPropertyValueType(RegularPropertyValue)
4545 , m_toPropertyValueType(RegularPropertyValue)
4646{

@@bool SVGAnimateElement::hasValidAttribut
109109 if (!targetElement)
110110 return false;
111111
112  return determineAnimatedAttributeType(targetElement) != AnimatedUnknown;
 112 return determineAnimatedPropertyType(targetElement) != AnimatedUnknown;
113113}
114114
115 AnimatedAttributeType SVGAnimateElement::determineAnimatedAttributeType(SVGElement* targetElement) const
 115AnimatedPropertyType SVGAnimateElement::determineAnimatedPropertyType(SVGElement* targetElement) const
116116{
117117 ASSERT(targetElement);
118118
119  AnimatedAttributeType type = targetElement->animatedPropertyTypeForAttribute(attributeName());
 119 Vector<AnimatedPropertyType> propertyTypes;
 120 targetElement->animatedPropertyTypeForAttribute(attributeName(), propertyTypes);
 121 if (propertyTypes.isEmpty())
 122 return AnimatedUnknown;
 123
 124 AnimatedPropertyType type = propertyTypes[0];
120125 if (hasTagName(SVGNames::animateColorTag) && type != AnimatedColor)
121126 return AnimatedUnknown;
122127

@@void SVGAnimateElement::determinePropert
142147 if (inheritsFromProperty(targetElement, attributeName(), to))
143148 m_toPropertyValueType = InheritValue;
144149
145  if (m_animatedAttributeType != AnimatedColor)
 150 if (m_animatedPropertyType != AnimatedColor)
146151 return;
147152
148153 if (attributeValueIsCurrentColor(from))

@@void SVGAnimateElement::calculateAnimate
155160{
156161 ASSERT(resultElement);
157162 ASSERT(percentage >= 0 && percentage <= 1);
158  ASSERT(m_animatedAttributeType != AnimatedEnumeration);
159  ASSERT(m_animatedAttributeType != AnimatedTransformList);
160  ASSERT(m_animatedAttributeType != AnimatedUnknown);
 163 ASSERT(m_animatedPropertyType != AnimatedEnumeration);
 164 ASSERT(m_animatedPropertyType != AnimatedTransformList);
 165 ASSERT(m_animatedPropertyType != AnimatedUnknown);
161166 ASSERT(m_animator);
162167 ASSERT(m_fromType);
163168 ASSERT(m_toType);
164169
165170 SVGAnimateElement* resultAnimationElement = static_cast<SVGAnimateElement*>(resultElement);
166171 ASSERT(resultAnimationElement->m_animatedType);
167  ASSERT(resultAnimationElement->m_animatedAttributeType == m_animatedAttributeType);
 172 ASSERT(resultAnimationElement->m_animatedPropertyType == m_animatedPropertyType);
168173 ASSERT(resultAnimationElement->hasTagName(SVGNames::animateTag)
169174 || resultAnimationElement->hasTagName(SVGNames::animateColorTag)
170175 || resultAnimationElement->hasTagName(SVGNames::setTag));

@@bool SVGAnimateElement::calculateFromAnd
187192 if (!targetElement)
188193 return false;
189194
190  m_animatedAttributeType = determineAnimatedAttributeType(targetElement);
 195 m_animatedPropertyType = determineAnimatedPropertyType(targetElement);
191196
192197 ensureAnimator()->calculateFromAndToValues(m_fromType, m_toType, fromString, toString);
193198 return true;

@@bool SVGAnimateElement::calculateFromAnd
200205 return false;
201206
202207 ASSERT(!hasTagName(SVGNames::setTag));
203  m_animatedAttributeType = determineAnimatedAttributeType(targetElement);
 208 m_animatedPropertyType = determineAnimatedPropertyType(targetElement);
204209
205210 ensureAnimator()->calculateFromAndByValues(m_fromType, m_toType, fromString, byString);
206211 return true;

@@void SVGAnimateElement::resetToBaseValue
210215{
211216 SVGElement* targetElement = this->targetElement();
212217 ASSERT(targetElement);
213  m_animatedAttributeType = determineAnimatedAttributeType(targetElement);
 218 m_animatedPropertyType = determineAnimatedPropertyType(targetElement);
214219
215220 if (!m_animatedType)
216221 m_animatedType = ensureAnimator()->constructFromString(baseString);

@@void SVGAnimateElement::resetToBaseValue
220225
221226void SVGAnimateElement::applyResultsToTarget()
222227{
223  ASSERT(m_animatedAttributeType != AnimatedEnumeration);
224  ASSERT(m_animatedAttributeType != AnimatedTransformList);
225  ASSERT(m_animatedAttributeType != AnimatedUnknown);
 228 ASSERT(m_animatedPropertyType != AnimatedEnumeration);
 229 ASSERT(m_animatedPropertyType != AnimatedTransformList);
 230 ASSERT(m_animatedPropertyType != AnimatedUnknown);
226231 ASSERT(m_animatedType);
227232
228233 setTargetAttributeAnimatedValue(m_animatedType->valueAsString());

@@float SVGAnimateElement::calculateDistan
234239 SVGElement* targetElement = this->targetElement();
235240 if (!targetElement)
236241 return -1;
237  m_animatedAttributeType = determineAnimatedAttributeType(targetElement);
 242 m_animatedPropertyType = determineAnimatedPropertyType(targetElement);
238243
239244 return ensureAnimator()->calculateDistance(fromString, toString);
240245}

@@float SVGAnimateElement::calculateDistan
242247SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator()
243248{
244249 if (!m_animator)
245  m_animator = SVGAnimatorFactory::create(this, targetElement(), m_animatedAttributeType);
 250 m_animator = SVGAnimatorFactory::create(this, targetElement(), m_animatedPropertyType);
246251 return m_animator.get();
247252}
248253
90666

Source/WebCore/svg/SVGAnimateElement.h

@@public:
4949 static void adjustForCurrentColor(SVGElement* targetElement, Color&);
5050 void adjustForInheritance(SVGElement* targetElement, const QualifiedName&, String& value);
5151
52  AnimatedAttributeType determineAnimatedAttributeType(SVGElement*) const;
 52 AnimatedPropertyType determineAnimatedPropertyType(SVGElement*) const;
5353 void determinePropertyValueTypes(const String&, const String&);
5454
5555 AnimatedPropertyValueType fromPropertyValueType() { return m_fromPropertyValueType; }

@@private:
6969 SVGAnimatedTypeAnimator* ensureAnimator();
7070
7171 virtual bool hasValidAttributeType() const;
72  AnimatedAttributeType m_animatedAttributeType;
 72 AnimatedPropertyType m_animatedPropertyType;
7373
7474 AnimatedPropertyValueType m_fromPropertyValueType;
7575 AnimatedPropertyValueType m_toPropertyValueType;
90666

Source/WebCore/svg/SVGAnimateTransformElement.cpp

@@bool SVGAnimateTransformElement::hasVali
6666 if (!targetElement)
6767 return false;
6868
69  return determineAnimatedAttributeType(targetElement) == AnimatedTransformList;
 69 return determineAnimatedPropertyType(targetElement) == AnimatedTransformList;
7070}
7171
72 AnimatedAttributeType SVGAnimateTransformElement::determineAnimatedAttributeType(SVGElement* targetElement) const
 72AnimatedPropertyType SVGAnimateTransformElement::determineAnimatedPropertyType(SVGElement* targetElement) const
7373{
7474 ASSERT(targetElement);
7575
7676 // Just transform lists can be animated with <animateTransform>
7777 // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties
78  if (targetElement->animatedPropertyTypeForAttribute(attributeName()) != AnimatedTransformList)
 78 Vector<AnimatedPropertyType> propertyTypes;
 79 targetElement->animatedPropertyTypeForAttribute(attributeName(), propertyTypes);
 80 if (propertyTypes.isEmpty() || propertyTypes[0] != AnimatedTransformList)
7981 return AnimatedUnknown;
8082
 83 ASSERT(propertyTypes.size() == 1);
8184 return AnimatedTransformList;
8285}
8386

@@static SVGTransformList* transformListFo
131134void SVGAnimateTransformElement::resetToBaseValue(const String& baseValue)
132135{
133136 SVGElement* targetElement = this->targetElement();
134  if (!targetElement || determineAnimatedAttributeType(targetElement) == AnimatedUnknown)
 137 if (!targetElement || determineAnimatedPropertyType(targetElement) == AnimatedUnknown)
135138 return;
136139
137140 // FIXME: This might not be correct for accumulated sum. Needs checking.

@@void SVGAnimateTransformElement::resetTo
154157void SVGAnimateTransformElement::calculateAnimatedValue(float percentage, unsigned repeat, SVGSMILElement*)
155158{
156159 SVGElement* targetElement = this->targetElement();
157  if (!targetElement || determineAnimatedAttributeType(targetElement) == AnimatedUnknown)
 160 if (!targetElement || determineAnimatedPropertyType(targetElement) == AnimatedUnknown)
158161 return;
159162 SVGTransformList* transformList = transformListFor(targetElement);
160163 ASSERT(transformList);

@@SVGTransform SVGAnimateTransformElement:
203206void SVGAnimateTransformElement::applyResultsToTarget()
204207{
205208 SVGElement* targetElement = this->targetElement();
206  if (!targetElement || determineAnimatedAttributeType(targetElement) == AnimatedUnknown)
 209 if (!targetElement || determineAnimatedPropertyType(targetElement) == AnimatedUnknown)
207210 return;
208211
209212 // We accumulate to the target element transform list so there is not much to do here.
90666

Source/WebCore/svg/SVGAnimateTransformElement.h

@@private:
4040 SVGAnimateTransformElement(const QualifiedName&, Document*);
4141
4242 virtual bool hasValidAttributeType() const;
43  AnimatedAttributeType determineAnimatedAttributeType(SVGElement*) const;
 43 AnimatedPropertyType determineAnimatedPropertyType(SVGElement*) const;
4444
4545 bool isSupportedAttribute(const QualifiedName&);
4646 virtual void parseMappedAttribute(Attribute*);
90666

Source/WebCore/svg/SVGAnimatedAngle.h

@@typedef SVGAnimatedPropertyTearOff<SVGAn
3434DECLARE_ANIMATED_PROPERTY(SVGAnimatedAngle, SVGAngle, UpperProperty, LowerProperty)
3535
3636#define DEFINE_ANIMATED_ANGLE_MULTIPLE_WRAPPERS(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty) \
37 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, SVGAnimatedAngle, SVGAngle, UpperProperty, LowerProperty)
 37DEFINE_ANIMATED_PROPERTY(AnimatedAngle, OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty)
3838
3939#if ENABLE(SVG_ANIMATION)
4040class SVGAnimationElement;
90666

Source/WebCore/svg/SVGAnimatedBoolean.h

@@typedef SVGAnimatedStaticPropertyTearOff
3333DECLARE_ANIMATED_PROPERTY(SVGAnimatedBoolean, bool, UpperProperty, LowerProperty)
3434
3535#define DEFINE_ANIMATED_BOOLEAN(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
36 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedBoolean, bool, UpperProperty, LowerProperty)
 36DEFINE_ANIMATED_PROPERTY(AnimatedBoolean, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
3737
38 
3938#if ENABLE(SVG_ANIMATION)
4039class SVGAnimationElement;
4140
90666

Source/WebCore/svg/SVGAnimatedEnumeration.h

@@typedef SVGAnimatedStaticPropertyTearOff
3333DECLARE_ANIMATED_PROPERTY(SVGAnimatedEnumerationPropertyTearOff<EnumType>, EnumType, UpperProperty, LowerProperty)
3434
3535#define DEFINE_ANIMATED_ENUMERATION(OwnerType, DOMAttribute, UpperProperty, LowerProperty, EnumType) \
36 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedEnumerationPropertyTearOff<EnumType>, EnumType, UpperProperty, LowerProperty)
37 
38 #define DEFINE_ANIMATED_ENUMERATION_MULTIPLE_WRAPPERS(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty, EnumType) \
39 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, SVGAnimatedEnumerationPropertyTearOff<EnumType>, EnumType, UpperProperty, LowerProperty)
 36DEFINE_ANIMATED_PROPERTY(AnimatedEnumeration, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
4037
4138} // namespace WebCore
4239
90666

Source/WebCore/svg/SVGAnimatedInteger.h

@@typedef SVGAnimatedStaticPropertyTearOff
3434DECLARE_ANIMATED_PROPERTY(SVGAnimatedInteger, long, UpperProperty, LowerProperty)
3535
3636#define DEFINE_ANIMATED_INTEGER(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
37 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedInteger, long, UpperProperty, LowerProperty)
 37DEFINE_ANIMATED_PROPERTY(AnimatedInteger, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
3838
 39// FIXME: This currently animates as number-optional-number, instead of integer-optional-integer, which is missing.
3940#define DEFINE_ANIMATED_INTEGER_MULTIPLE_WRAPPERS(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty) \
40 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, SVGAnimatedInteger, long, UpperProperty, LowerProperty)
 41DEFINE_ANIMATED_PROPERTY(AnimatedNumberOptionalNumber, OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty)
4142
4243#if ENABLE(SVG_ANIMATION)
4344class SVGAnimationElement;
90666

Source/WebCore/svg/SVGAnimatedLength.h

@@typedef SVGAnimatedPropertyTearOff<SVGLe
3434DECLARE_ANIMATED_PROPERTY(SVGAnimatedLength, SVGLength, UpperProperty, LowerProperty)
3535
3636#define DEFINE_ANIMATED_LENGTH(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
37 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedLength, SVGLength, UpperProperty, LowerProperty)
 37DEFINE_ANIMATED_PROPERTY(AnimatedLength, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
3838
3939#if ENABLE(SVG_ANIMATION)
4040class SVGAnimationElement;
90666

Source/WebCore/svg/SVGAnimatedLengthList.h

@@typedef SVGAnimatedListPropertyTearOff<S
3434DECLARE_ANIMATED_LIST_PROPERTY(SVGAnimatedLengthList, SVGLengthList, UpperProperty, LowerProperty)
3535
3636#define DEFINE_ANIMATED_LENGTH_LIST(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
37 DEFINE_ANIMATED_LIST_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedLengthList, SVGLengthList, UpperProperty, LowerProperty)
38 
 37DEFINE_ANIMATED_PROPERTY(AnimatedLengthList, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
 38
3939#if ENABLE(SVG_ANIMATION)
4040class SVGAnimationElement;
4141
90666

Source/WebCore/svg/SVGAnimatedNumber.h

@@typedef SVGAnimatedStaticPropertyTearOff
3434DECLARE_ANIMATED_PROPERTY(SVGAnimatedNumber, float, UpperProperty, LowerProperty)
3535
3636#define DEFINE_ANIMATED_NUMBER(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
37 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedNumber, float, UpperProperty, LowerProperty)
 37DEFINE_ANIMATED_PROPERTY(AnimatedNumber, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
3838
3939#define DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty) \
40 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, SVGAnimatedNumber, float, UpperProperty, LowerProperty)
 40DEFINE_ANIMATED_PROPERTY(AnimatedNumberOptionalNumber, OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty)
4141
4242#if ENABLE(SVG_ANIMATION)
4343class SVGAnimationElement;
90666

Source/WebCore/svg/SVGAnimatedNumberList.h

@@typedef SVGAnimatedListPropertyTearOff<S
3434DECLARE_ANIMATED_LIST_PROPERTY(SVGAnimatedNumberList, SVGNumberList, UpperProperty, LowerProperty)
3535
3636#define DEFINE_ANIMATED_NUMBER_LIST(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
37 DEFINE_ANIMATED_LIST_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedNumberList, SVGNumberList, UpperProperty, LowerProperty)
38 
 37DEFINE_ANIMATED_PROPERTY(AnimatedNumberList, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
 38
3939#if ENABLE(SVG_ANIMATION)
4040class SVGAnimationElement;
4141
90666

Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.h

@@typedef SVGAnimatedPropertyTearOff<SVGPr
3434DECLARE_ANIMATED_PROPERTY(SVGAnimatedPreserveAspectRatio, SVGPreserveAspectRatio, UpperProperty, LowerProperty)
3535
3636#define DEFINE_ANIMATED_PRESERVEASPECTRATIO(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
37 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedPreserveAspectRatio, SVGPreserveAspectRatio, UpperProperty, LowerProperty)
 37DEFINE_ANIMATED_PROPERTY(AnimatedPreserveAspectRatio, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
3838
39 
4039#if ENABLE(SVG_ANIMATION)
4140class SVGAnimationElement;
4241
90666

Source/WebCore/svg/SVGAnimatedRect.h

@@typedef SVGAnimatedPropertyTearOff<Float
3535DECLARE_ANIMATED_PROPERTY(SVGAnimatedRect, FloatRect, UpperProperty, LowerProperty)
3636
3737#define DEFINE_ANIMATED_RECT(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
38 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedRect, FloatRect, UpperProperty, LowerProperty)
 38DEFINE_ANIMATED_PROPERTY(AnimatedRect, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
3939
4040#if ENABLE(SVG_ANIMATION)
4141class SVGAnimationElement;
90666

Source/WebCore/svg/SVGAnimatedString.h

@@typedef SVGAnimatedStaticPropertyTearOff
3434DECLARE_ANIMATED_PROPERTY(SVGAnimatedString, String, UpperProperty, LowerProperty)
3535
3636#define DEFINE_ANIMATED_STRING(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
37 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedString, String, UpperProperty, LowerProperty)
 37DEFINE_ANIMATED_PROPERTY(AnimatedString, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
3838
3939#if ENABLE(SVG_ANIMATION)
4040class SVGAnimationElement;
90666

Source/WebCore/svg/SVGAnimatedTransformList.h

@@typedef SVGAnimatedTransformListProperty
3232DECLARE_ANIMATED_LIST_PROPERTY(SVGAnimatedTransformList, SVGTransformList, UpperProperty, LowerProperty)
3333
3434#define DEFINE_ANIMATED_TRANSFORM_LIST(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
35 DEFINE_ANIMATED_LIST_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedTransformList, SVGTransformList, UpperProperty, LowerProperty)
 35DEFINE_ANIMATED_PROPERTY(AnimatedTransformList, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
3636
3737} // namespace WebCore
3838
90666

Source/WebCore/svg/SVGAnimatedType.cpp

@@using namespace std;
3737
3838namespace WebCore {
3939
40 SVGAnimatedType::SVGAnimatedType(AnimatedAttributeType type)
 40SVGAnimatedType::SVGAnimatedType(AnimatedPropertyType type)
4141 : m_type(type)
4242{
4343}
90666

Source/WebCore/svg/SVGAnimatedType.h

@@public:
5555 static PassOwnPtr<SVGAnimatedType> createRect(FloatRect*);
5656 static PassOwnPtr<SVGAnimatedType> createString(String*);
5757
58  AnimatedAttributeType type() const { return m_type; }
 58 AnimatedPropertyType type() const { return m_type; }
5959
6060 SVGAngle& angle();
6161 bool& boolean();

@@public:
7979 void setPreserveAspectRatioBaseValue(const SVGPreserveAspectRatio&);
8080
8181private:
82  SVGAnimatedType(AnimatedAttributeType);
 82 SVGAnimatedType(AnimatedPropertyType);
8383
84  AnimatedAttributeType m_type;
 84 AnimatedPropertyType m_type;
8585
8686 union DataUnion {
8787 DataUnion()
90666

Source/WebCore/svg/SVGAnimatedTypeAnimator.h

@@public:
4343 void setContextElement(SVGElement* contextElement) { m_contextElement = contextElement; }
4444
4545protected:
46  SVGAnimatedTypeAnimator(AnimatedAttributeType type, SVGAnimationElement* animationElement, SVGElement* contextElement)
 46 SVGAnimatedTypeAnimator(AnimatedPropertyType type, SVGAnimationElement* animationElement, SVGElement* contextElement)
4747 : m_type(type)
4848 , m_animationElement(animationElement)
4949 , m_contextElement(contextElement)
5050 {
5151 }
5252
53  AnimatedAttributeType m_type;
 53 AnimatedPropertyType m_type;
5454 SVGAnimationElement* m_animationElement;
5555 SVGElement* m_contextElement;
5656};
90666

Source/WebCore/svg/SVGAnimationElement.cpp

@@namespace WebCore {
5555// Animated property definitions
5656DEFINE_ANIMATED_BOOLEAN(SVGAnimationElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
5757
 58BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAnimationElement)
 59 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 60 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 61END_REGISTER_ANIMATED_PROPERTIES
 62
5863SVGAnimationElement::SVGAnimationElement(const QualifiedName& tagName, Document* document)
5964 : SVGSMILElement(tagName, document)
6065 , m_animationValid(false)
6166{
 67 registerAnimatedPropertiesForSVGAnimationElement();
6268}
6369
6470static void parseKeyTimes(const String& parse, Vector<float>& result, bool verifyOrder)

@@void SVGAnimationElement::attributeChang
203209 SVGSMILElement::attributeChanged(attr, preserveDecls);
204210}
205211
206 void SVGAnimationElement::synchronizeProperty(const QualifiedName& attrName)
207 {
208  SVGSMILElement::synchronizeProperty(attrName);
209 
210  if (attrName == anyQName()) {
211  synchronizeExternalResourcesRequired();
212  SVGTests::synchronizeProperties(this, attrName);
213  return;
214  }
215 
216  if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
217  synchronizeExternalResourcesRequired();
218  else if (SVGTests::isKnownAttribute(attrName))
219  SVGTests::synchronizeProperties(this, attrName);
220 }
221 
222212float SVGAnimationElement::getStartTime() const
223213{
224214 return narrowPrecisionToFloat(intervalBegin().value());

@@void SVGAnimationElement::currentValuesF
486476 CalcMode calcMode = this->calcMode();
487477 if (hasTagName(SVGNames::animateTag) || hasTagName(SVGNames::animateColorTag)) {
488478 const SVGAnimateElement* animateElement = static_cast<const SVGAnimateElement*>(this);
489  AnimatedAttributeType attributeType = animateElement->determineAnimatedAttributeType(targetElement());
 479 AnimatedPropertyType attributeType = animateElement->determineAnimatedPropertyType(targetElement());
490480 // Fall back to discrete animations for Strings.
491481 if (attributeType == AnimatedBoolean
492482 || attributeType == AnimatedEnumeration
90666

Source/WebCore/svg/SVGAnimationElement.h

@@protected:
108108
109109private:
110110 virtual void attributeChanged(Attribute*, bool preserveDecls);
111  virtual void synchronizeProperty(const QualifiedName&);
112111
113112 virtual bool calculateFromAndToValues(const String& fromString, const String& toString) = 0;
114113 virtual bool calculateFromAndByValues(const String& fromString, const String& byString) = 0;

@@private:
123122 float calculatePercentForSpline(float percent, unsigned splineIndex) const;
124123 unsigned calculateKeyTimesIndex(float percent) const;
125124
126  // Animated property declarations
127 
128  // SVGExternalResourcesRequired
129  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 125 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAnimationElement)
 126 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 127 END_DECLARE_ANIMATED_PROPERTIES
 128
 129 // SVGTests
 130 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 131 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 132 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
130133
131134 bool m_animationValid;
132135
90666

Source/WebCore/svg/SVGAnimatorFactory.h

@@class SVGAnimationElement;
4242
4343class SVGAnimatorFactory {
4444public:
45  static PassOwnPtr<SVGAnimatedTypeAnimator> create(SVGAnimationElement* animationElement, SVGElement* contextElement, AnimatedAttributeType attributeType)
 45 static PassOwnPtr<SVGAnimatedTypeAnimator> create(SVGAnimationElement* animationElement, SVGElement* contextElement, AnimatedPropertyType attributeType)
4646 {
4747 ASSERT(animationElement);
4848 ASSERT(contextElement);
90666

Source/WebCore/svg/SVGCircleElement.cpp

@@DEFINE_ANIMATED_LENGTH(SVGCircleElement,
3939DEFINE_ANIMATED_LENGTH(SVGCircleElement, SVGNames::rAttr, R, r)
4040DEFINE_ANIMATED_BOOLEAN(SVGCircleElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
4141
 42BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGCircleElement)
 43 REGISTER_LOCAL_ANIMATED_PROPERTY(cx)
 44 REGISTER_LOCAL_ANIMATED_PROPERTY(cy)
 45 REGISTER_LOCAL_ANIMATED_PROPERTY(r)
 46 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 47 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 48 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 49END_REGISTER_ANIMATED_PROPERTIES
 50
4251inline SVGCircleElement::SVGCircleElement(const QualifiedName& tagName, Document* document)
4352 : SVGStyledTransformableElement(tagName, document)
4453 , m_cx(LengthModeWidth)

@@inline SVGCircleElement::SVGCircleElemen
4655 , m_r(LengthModeOther)
4756{
4857 ASSERT(hasTagName(SVGNames::circleTag));
 58 registerAnimatedPropertiesForSVGCircleElement();
4959}
5060
5161PassRefPtr<SVGCircleElement> SVGCircleElement::create(const QualifiedName& tagName, Document* document)

@@void SVGCircleElement::svgAttributeChang
138148 ASSERT_NOT_REACHED();
139149}
140150
141 void SVGCircleElement::synchronizeProperty(const QualifiedName& attrName)
142 {
143  if (attrName == anyQName()) {
144  synchronizeCx();
145  synchronizeCy();
146  synchronizeR();
147  synchronizeExternalResourcesRequired();
148  SVGTests::synchronizeProperties(this, attrName);
149  SVGStyledTransformableElement::synchronizeProperty(attrName);
150  return;
151  }
152 
153  if (!isSupportedAttribute(attrName)) {
154  SVGStyledTransformableElement::synchronizeProperty(attrName);
155  return;
156  }
157 
158  if (attrName == SVGNames::cxAttr) {
159  synchronizeCx();
160  return;
161  }
162 
163  if (attrName == SVGNames::cyAttr) {
164  synchronizeCy();
165  return;
166  }
167 
168  if (attrName == SVGNames::rAttr) {
169  synchronizeR();
170  return;
171  }
172 
173  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
174  synchronizeExternalResourcesRequired();
175  return;
176  }
177 
178  if (SVGTests::isKnownAttribute(attrName)) {
179  SVGTests::synchronizeProperties(this, attrName);
180  return;
181  }
182 
183  ASSERT_NOT_REACHED();
184 }
185 
186 AttributeToPropertyTypeMap& SVGCircleElement::attributeToPropertyTypeMap()
187 {
188  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
189  return s_attributeToPropertyTypeMap;
190 }
191 
192 void SVGCircleElement::fillAttributeToPropertyTypeMap()
193 {
194  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
195 
196  SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
197  attributeToPropertyTypeMap.set(SVGNames::cxAttr, AnimatedLength);
198  attributeToPropertyTypeMap.set(SVGNames::cyAttr, AnimatedLength);
199  attributeToPropertyTypeMap.set(SVGNames::rAttr, AnimatedLength);
200 }
201 
202151void SVGCircleElement::toPathData(Path& path) const
203152{
204153 ASSERT(path.isEmpty());
90666

Source/WebCore/svg/SVGCircleElement.h

@@private:
4747 bool isSupportedAttribute(const QualifiedName&);
4848 virtual void parseMappedAttribute(Attribute*);
4949 virtual void svgAttributeChanged(const QualifiedName&);
50  virtual void synchronizeProperty(const QualifiedName&);
51 
52  virtual void fillAttributeToPropertyTypeMap();
53  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5450
5551 virtual void toPathData(Path&) const;
5652
5753 virtual bool selfHasRelativeLengths() const;
5854
59  // Animated property declarations
60  DECLARE_ANIMATED_LENGTH(Cx, cx)
61  DECLARE_ANIMATED_LENGTH(Cy, cy)
62  DECLARE_ANIMATED_LENGTH(R, r)
63 
64  // SVGExternalResourcesRequired
65  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 55 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGCircleElement)
 56 DECLARE_ANIMATED_LENGTH(Cx, cx)
 57 DECLARE_ANIMATED_LENGTH(Cy, cy)
 58 DECLARE_ANIMATED_LENGTH(R, r)
 59 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 60 END_DECLARE_ANIMATED_PROPERTIES
 61
 62 // SVGTests
 63 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 64 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 65 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
6666};
6767
6868} // namespace WebCore
90666

Source/WebCore/svg/SVGClipPathElement.cpp

@@namespace WebCore {
3838DEFINE_ANIMATED_ENUMERATION(SVGClipPathElement, SVGNames::clipPathUnitsAttr, ClipPathUnits, clipPathUnits, SVGUnitTypes::SVGUnitType)
3939DEFINE_ANIMATED_BOOLEAN(SVGClipPathElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
4040
 41BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGClipPathElement)
 42 REGISTER_LOCAL_ANIMATED_PROPERTY(clipPathUnits)
 43 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 44 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 45 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 46END_REGISTER_ANIMATED_PROPERTIES
 47
4148inline SVGClipPathElement::SVGClipPathElement(const QualifiedName& tagName, Document* document)
4249 : SVGStyledTransformableElement(tagName, document)
4350 , m_clipPathUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
4451{
4552 ASSERT(hasTagName(SVGNames::clipPathTag));
 53 registerAnimatedPropertiesForSVGClipPathElement();
4654}
4755
4856PassRefPtr<SVGClipPathElement> SVGClipPathElement::create(const QualifiedName& tagName, Document* document)

@@void SVGClipPathElement::svgAttributeCha
99107 object->setNeedsLayout(true);
100108}
101109
102 void SVGClipPathElement::synchronizeProperty(const QualifiedName& attrName)
103 {
104  if (attrName == anyQName()) {
105  synchronizeClipPathUnits();
106  synchronizeExternalResourcesRequired();
107  SVGTests::synchronizeProperties(this, attrName);
108  SVGStyledTransformableElement::synchronizeProperty(attrName);
109  return;
110  }
111 
112  if (!isSupportedAttribute(attrName)) {
113  SVGStyledTransformableElement::synchronizeProperty(attrName);
114  return;
115  }
116 
117  if (attrName == SVGNames::clipPathUnitsAttr) {
118  synchronizeClipPathUnits();
119  return;
120  }
121 
122  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
123  synchronizeExternalResourcesRequired();
124  return;
125  }
126 
127  if (SVGTests::isKnownAttribute(attrName)) {
128  SVGTests::synchronizeProperties(this, attrName);
129  return;
130  }
131 
132  ASSERT_NOT_REACHED();
133 }
134 
135 AttributeToPropertyTypeMap& SVGClipPathElement::attributeToPropertyTypeMap()
136 {
137  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
138  return s_attributeToPropertyTypeMap;
139 }
140 
141 void SVGClipPathElement::fillAttributeToPropertyTypeMap()
142 {
143  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
144 
145  SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
146  attributeToPropertyTypeMap.set(SVGNames::clipPathUnitsAttr, AnimatedEnumeration);
147 }
148 
149110void SVGClipPathElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
150111{
151112 SVGStyledTransformableElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
90666

Source/WebCore/svg/SVGClipPathElement.h

@@private:
5050 bool isSupportedAttribute(const QualifiedName&);
5151 virtual void parseMappedAttribute(Attribute*);
5252 virtual void svgAttributeChanged(const QualifiedName&);
53  virtual void synchronizeProperty(const QualifiedName&);
54  virtual void fillAttributeToPropertyTypeMap();
55  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5653 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
5754
5855 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
5956
60  // Animated property declarations
61  DECLARE_ANIMATED_ENUMERATION(ClipPathUnits, clipPathUnits, SVGUnitTypes::SVGUnitType)
 57 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGClipPathElement)
 58 DECLARE_ANIMATED_ENUMERATION(ClipPathUnits, clipPathUnits, SVGUnitTypes::SVGUnitType)
 59 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 60 END_DECLARE_ANIMATED_PROPERTIES
6261
63  // SVGExternalResourcesRequired
64  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 62 // SVGTests
 63 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 64 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 65 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
6566};
6667
6768}
90666

Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp

@@DEFINE_ANIMATED_NUMBER(SVGComponentTrans
3939DEFINE_ANIMATED_NUMBER(SVGComponentTransferFunctionElement, SVGNames::exponentAttr, Exponent, exponent)
4040DEFINE_ANIMATED_NUMBER(SVGComponentTransferFunctionElement, SVGNames::offsetAttr, Offset, offset)
4141
 42BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGComponentTransferFunctionElement)
 43 REGISTER_LOCAL_ANIMATED_PROPERTY(type)
 44 REGISTER_LOCAL_ANIMATED_PROPERTY(tableValues)
 45 REGISTER_LOCAL_ANIMATED_PROPERTY(slope)
 46 REGISTER_LOCAL_ANIMATED_PROPERTY(intercept)
 47 REGISTER_LOCAL_ANIMATED_PROPERTY(amplitude)
 48 REGISTER_LOCAL_ANIMATED_PROPERTY(exponent)
 49 REGISTER_LOCAL_ANIMATED_PROPERTY(offset)
 50END_REGISTER_ANIMATED_PROPERTIES
 51
4252SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(const QualifiedName& tagName, Document* document)
4353 : SVGElement(tagName, document)
4454 , m_type(FECOMPONENTTRANSFER_TYPE_IDENTITY)

@@SVGComponentTransferFunctionElement::SVG
4656 , m_amplitude(1)
4757 , m_exponent(1)
4858{
 59 registerAnimatedPropertiesForSVGComponentTransferFunctionElement();
4960}
5061
5162bool SVGComponentTransferFunctionElement::isSupportedAttribute(const QualifiedName& attrName)

@@void SVGComponentTransferFunctionElement
114125 ASSERT_NOT_REACHED();
115126}
116127
117 void SVGComponentTransferFunctionElement::synchronizeProperty(const QualifiedName& attrName)
118 {
119  if (attrName == anyQName()) {
120  synchronizeType();
121  synchronizeTableValues();
122  synchronizeSlope();
123  synchronizeIntercept();
124  synchronizeAmplitude();
125  synchronizeExponent();
126  synchronizeOffset();
127  SVGElement::synchronizeProperty(attrName);
128  return;
129  }
130 
131  if (!isSupportedAttribute(attrName)) {
132  SVGElement::synchronizeProperty(attrName);
133  return;
134  }
135 
136  if (attrName == SVGNames::typeAttr) {
137  synchronizeType();
138  return;
139  }
140 
141  if (attrName == SVGNames::tableValuesAttr) {
142  synchronizeTableValues();
143  return;
144  }
145 
146  if (attrName == SVGNames::slopeAttr) {
147  synchronizeSlope();
148  return;
149  }
150 
151  if (attrName == SVGNames::interceptAttr) {
152  synchronizeIntercept();
153  return;
154  }
155 
156  if (attrName == SVGNames::amplitudeAttr) {
157  synchronizeAmplitude();
158  return;
159  }
160 
161  if (attrName == SVGNames::exponentAttr) {
162  synchronizeExponent();
163  return;
164  }
165 
166  if (attrName == SVGNames::offsetAttr) {
167  synchronizeOffset();
168  return;
169  }
170 
171  ASSERT_NOT_REACHED();
172 }
173 
174 AttributeToPropertyTypeMap& SVGComponentTransferFunctionElement::attributeToPropertyTypeMap()
175 {
176  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
177  return s_attributeToPropertyTypeMap;
178 }
179 
180 void SVGComponentTransferFunctionElement::fillAttributeToPropertyTypeMap()
181 {
182  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
183  attributeToPropertyTypeMap.set(SVGNames::typeAttr, AnimatedEnumeration);
184  attributeToPropertyTypeMap.set(SVGNames::tableValuesAttr, AnimatedNumberList);
185  attributeToPropertyTypeMap.set(SVGNames::slopeAttr, AnimatedNumber);
186  attributeToPropertyTypeMap.set(SVGNames::interceptAttr, AnimatedNumber);
187  attributeToPropertyTypeMap.set(SVGNames::amplitudeAttr, AnimatedNumber);
188  attributeToPropertyTypeMap.set(SVGNames::exponentAttr, AnimatedNumber);
189  attributeToPropertyTypeMap.set(SVGNames::offsetAttr, AnimatedNumber);
190 }
191 
192128ComponentTransferFunction SVGComponentTransferFunctionElement::transferFunction() const
193129{
194130 ComponentTransferFunction func;
90666

Source/WebCore/svg/SVGComponentTransferFunctionElement.h

@@protected:
8080 // FIXME: svgAttributeChanged missing.
8181 bool isSupportedAttribute(const QualifiedName&);
8282 virtual void parseMappedAttribute(Attribute*);
83  virtual void synchronizeProperty(const QualifiedName&);
84  virtual void fillAttributeToPropertyTypeMap();
85  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
8683
8784private:
88  // Animated property declarations
89  DECLARE_ANIMATED_ENUMERATION(Type, type, ComponentTransferType)
90  DECLARE_ANIMATED_NUMBER_LIST(TableValues, tableValues)
91  DECLARE_ANIMATED_NUMBER(Slope, slope)
92  DECLARE_ANIMATED_NUMBER(Intercept, intercept)
93  DECLARE_ANIMATED_NUMBER(Amplitude, amplitude)
94  DECLARE_ANIMATED_NUMBER(Exponent, exponent)
95  DECLARE_ANIMATED_NUMBER(Offset, offset)
 85 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGComponentTransferFunctionElement)
 86 DECLARE_ANIMATED_ENUMERATION(Type, type, ComponentTransferType)
 87 DECLARE_ANIMATED_NUMBER_LIST(TableValues, tableValues)
 88 DECLARE_ANIMATED_NUMBER(Slope, slope)
 89 DECLARE_ANIMATED_NUMBER(Intercept, intercept)
 90 DECLARE_ANIMATED_NUMBER(Amplitude, amplitude)
 91 DECLARE_ANIMATED_NUMBER(Exponent, exponent)
 92 DECLARE_ANIMATED_NUMBER(Offset, offset)
 93 END_DECLARE_ANIMATED_PROPERTIES
9694};
9795
9896} // namespace WebCore
90666

Source/WebCore/svg/SVGCursorElement.cpp

@@DEFINE_ANIMATED_LENGTH(SVGCursorElement,
3636DEFINE_ANIMATED_STRING(SVGCursorElement, XLinkNames::hrefAttr, Href, href)
3737DEFINE_ANIMATED_BOOLEAN(SVGCursorElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
3838
 39BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGCursorElement)
 40 REGISTER_LOCAL_ANIMATED_PROPERTY(x)
 41 REGISTER_LOCAL_ANIMATED_PROPERTY(y)
 42 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
 43 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 44 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 45END_REGISTER_ANIMATED_PROPERTIES
 46
3947inline SVGCursorElement::SVGCursorElement(const QualifiedName& tagName, Document* document)
4048 : SVGElement(tagName, document)
4149 , m_x(LengthModeWidth)
4250 , m_y(LengthModeHeight)
4351{
4452 ASSERT(hasTagName(SVGNames::cursorTag));
 53 registerAnimatedPropertiesForSVGCursorElement();
4554}
4655
4756PassRefPtr<SVGCursorElement> SVGCursorElement::create(const QualifiedName& tagName, Document* document)

@@void SVGCursorElement::parseMappedAttrib
96105 ASSERT_NOT_REACHED();
97106}
98107
99 AttributeToPropertyTypeMap& SVGCursorElement::attributeToPropertyTypeMap()
100 {
101  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
102  return s_attributeToPropertyTypeMap;
103 }
104 
105 void SVGCursorElement::fillAttributeToPropertyTypeMap()
106 {
107  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
108  attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedNumber);
109  attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedNumber);
110  attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
111 }
112 
113108void SVGCursorElement::addClient(SVGElement* element)
114109{
115110 m_clients.add(element);

@@void SVGCursorElement::svgAttributeChang
147142 (*it)->setNeedsStyleRecalc();
148143}
149144
150 void SVGCursorElement::synchronizeProperty(const QualifiedName& attrName)
151 {
152  if (attrName == anyQName()) {
153  synchronizeX();
154  synchronizeY();
155  synchronizeExternalResourcesRequired();
156  synchronizeHref();
157  SVGTests::synchronizeProperties(this, attrName);
158  SVGElement::synchronizeProperty(attrName);
159  return;
160  }
161 
162  if (!isSupportedAttribute(attrName)) {
163  SVGElement::synchronizeProperty(attrName);
164  return;
165  }
166 
167  if (attrName == SVGNames::xAttr) {
168  synchronizeX();
169  return;
170  }
171 
172  if (attrName == SVGNames::yAttr) {
173  synchronizeY();
174  return;
175  }
176 
177  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
178  synchronizeExternalResourcesRequired();
179  return;
180  }
181 
182  if (SVGURIReference::isKnownAttribute(attrName)) {
183  synchronizeHref();
184  return;
185  }
186 
187  if (SVGTests::isKnownAttribute(attrName)) {
188  SVGTests::synchronizeProperties(this, attrName);
189  return;
190  }
191 
192  ASSERT_NOT_REACHED();
193 }
194 
195145void SVGCursorElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
196146{
197147 SVGElement::addSubresourceAttributeURLs(urls);
90666

Source/WebCore/svg/SVGCursorElement.h

@@private:
5353 bool isSupportedAttribute(const QualifiedName&);
5454 virtual void parseMappedAttribute(Attribute*);
5555 virtual void svgAttributeChanged(const QualifiedName&);
56  virtual void synchronizeProperty(const QualifiedName&);
57  virtual void fillAttributeToPropertyTypeMap();
58  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5956
6057 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
6158
62  // Animated property declarations
63  DECLARE_ANIMATED_LENGTH(X, x)
64  DECLARE_ANIMATED_LENGTH(Y, y)
65 
66  // SVGURIReference
67  DECLARE_ANIMATED_STRING(Href, href)
68 
69  // SVGExternalResourcesRequired
70  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 59 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGCursorElement)
 60 DECLARE_ANIMATED_LENGTH(X, x)
 61 DECLARE_ANIMATED_LENGTH(Y, y)
 62 DECLARE_ANIMATED_STRING(Href, href)
 63 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 64 END_DECLARE_ANIMATED_PROPERTIES
 65
 66 // SVGTests
 67 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 68 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 69 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
7170
7271 HashSet<SVGElement*> m_clients;
7372};
90666

Source/WebCore/svg/SVGDefsElement.cpp

@@namespace WebCore {
3131// Animated property definitions
3232DEFINE_ANIMATED_BOOLEAN(SVGDefsElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
3333
 34BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGDefsElement)
 35 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 36 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 37 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 38END_REGISTER_ANIMATED_PROPERTIES
 39
3440inline SVGDefsElement::SVGDefsElement(const QualifiedName& tagName, Document* document)
3541 : SVGStyledTransformableElement(tagName, document)
3642{
3743 ASSERT(hasTagName(SVGNames::defsTag));
 44 registerAnimatedPropertiesForSVGDefsElement();
3845}
3946
4047PassRefPtr<SVGDefsElement> SVGDefsElement::create(const QualifiedName& tagName, Document* document)

@@RenderObject* SVGDefsElement::createRend
5259 return new (arena) RenderSVGHiddenContainer(this);
5360}
5461
55 void SVGDefsElement::synchronizeProperty(const QualifiedName& attrName)
56 {
57  SVGStyledTransformableElement::synchronizeProperty(attrName);
58 
59  if (attrName == anyQName()) {
60  synchronizeExternalResourcesRequired();
61  SVGTests::synchronizeProperties(this, attrName);
62  return;
63  }
64 
65  if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
66  synchronizeExternalResourcesRequired();
67  else if (SVGTests::isKnownAttribute(attrName))
68  SVGTests::synchronizeProperties(this, attrName);
69 }
70 
7162}
7263
7364#endif // ENABLE(SVG)
90666

Source/WebCore/svg/SVGDefsElement.h

@@private:
4343 virtual bool isValid() const;
4444
4545 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
46  virtual void synchronizeProperty(const QualifiedName&);
4746
48  // Animated property declarations
 47 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGDefsElement)
 48 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 49 END_DECLARE_ANIMATED_PROPERTIES
4950
50  // SVGExternalResourcesRequired
51  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 51 // SVGTests
 52 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 53 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 54 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
5255};
5356
5457} // namespace WebCore
90666

Source/WebCore/svg/SVGElement.cpp

@@void SVGElement::parseMappedAttribute(At
285285 StyledElement::parseMappedAttribute(attr);
286286}
287287
288 AttributeToPropertyTypeMap& SVGElement::attributeToPropertyTypeMap()
 288void SVGElement::animatedPropertyTypeForAttribute(const QualifiedName& attributeName, Vector<AnimatedPropertyType>& propertyTypes)
289289{
290  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
291  return s_attributeToPropertyTypeMap;
292 }
293 
294 AnimatedAttributeType SVGElement::animatedPropertyTypeForAttribute(const QualifiedName& attrName)
295 {
296  AttributeToPropertyTypeMap& animatedAttributeMap = attributeToPropertyTypeMap();
297  if (animatedAttributeMap.isEmpty())
298  fillAttributeToPropertyTypeMap();
299  if (animatedAttributeMap.contains(attrName))
300  return animatedAttributeMap.get(attrName);
301  if (isStyled())
302  return static_cast<SVGStyledElement*>(this)->animatedPropertyTypeForCSSProperty(attrName);
303 
304  return AnimatedUnknown;
 290 localAttributeToPropertyMap().animatedPropertyTypeForAttribute(attributeName, propertyTypes);
305291}
306292
307293bool SVGElement::haveLoadedRequiredResources()

@@void SVGElement::updateAnimatedSVGAttrib
392378
393379 setIsSynchronizingSVGAttributes();
394380
395  const_cast<SVGElement*>(this)->synchronizeProperty(name);
396  if (name == anyQName())
 381 SVGElement* nonConstThis = const_cast<SVGElement*>(this);
 382 if (name == anyQName()) {
 383 nonConstThis->localAttributeToPropertyMap().synchronizeProperties(nonConstThis);
397384 setAreSVGAttributesValid();
 385 } else
 386 nonConstThis->localAttributeToPropertyMap().synchronizeProperty(nonConstThis, name);
398387
399388 clearIsSynchronizingSVGAttributes();
400389}
401390
 391SVGAttributeToPropertyMap& SVGElement::localAttributeToPropertyMap()
 392{
 393 ASSERT_NOT_REACHED();
 394
 395 DEFINE_STATIC_LOCAL(SVGAttributeToPropertyMap, dummyMap, ());
 396 return dummyMap;
 397}
 398
 399void SVGElement::synchronizeRequiredFeatures(void* contextElement)
 400{
 401 ASSERT(contextElement);
 402 static_cast<SVGElement*>(contextElement)->synchronizeRequiredFeatures();
 403}
 404
 405void SVGElement::synchronizeRequiredExtensions(void* contextElement)
 406{
 407 ASSERT(contextElement);
 408 static_cast<SVGElement*>(contextElement)->synchronizeRequiredExtensions();
 409}
 410
 411void SVGElement::synchronizeSystemLanguage(void* contextElement)
 412{
 413 ASSERT(contextElement);
 414 static_cast<SVGElement*>(contextElement)->synchronizeSystemLanguage();
 415}
 416
402417}
403418
404419#endif // ENABLE(SVG)
90666

Source/WebCore/svg/SVGElement.h

2424
2525#if ENABLE(SVG)
2626#include "SVGLocatable.h"
 27#include "SVGPropertyInfo.h"
2728#include "StyledElement.h"
2829#include <wtf/HashMap.h>
2930
3031namespace WebCore {
3132
32 enum AnimatedAttributeType {
33  AnimatedAngle,
34  AnimatedBoolean,
35  AnimatedColor,
36  AnimatedEnumeration,
37  AnimatedInteger,
38  AnimatedLength,
39  AnimatedLengthList,
40  AnimatedNumber,
41  AnimatedNumberList,
42  AnimatedNumberOptionalNumber,
43  AnimatedPath,
44  AnimatedPoints,
45  AnimatedPreserveAspectRatio,
46  AnimatedRect,
47  AnimatedString,
48  AnimatedTransformList,
49  AnimatedUnknown
50 };
51 
5233enum SVGParsingError {
5334 NoError,
5435 ParsingAttributeFailedError,
5536 NegativeValueForbiddenError
5637};
5738
58 typedef HashMap<QualifiedName, AnimatedAttributeType> AttributeToPropertyTypeMap;
59 
 39class AffineTransform;
6040class CSSCursorImageValue;
6141class Document;
 42class SVGAttributeToPropertyMap;
6243class SVGCursorElement;
6344class SVGDocumentExtensions;
6445class SVGElementInstance;
6546class SVGElementRareData;
6647class SVGSVGElement;
67 class AffineTransform;
6848
6949class SVGElement : public StyledElement {
7050public:

@@public:
9171 virtual bool isValid() const { return true; }
9272
9373 virtual void svgAttributeChanged(const QualifiedName&) { }
94  virtual void synchronizeProperty(const QualifiedName&) { }
95 
96  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
97  AnimatedAttributeType animatedPropertyTypeForAttribute(const QualifiedName&);
9874
99  virtual void fillAttributeToPropertyTypeMap() { }
 75 virtual void animatedPropertyTypeForAttribute(const QualifiedName&, Vector<AnimatedPropertyType>&);
10076
10177 void sendSVGLoadEventIfPossible(bool sendParentLoadEvents = false);
10278

@@public:
11591
11692 virtual void updateAnimatedSVGAttribute(const QualifiedName&) const;
11793
 94 static void synchronizeRequiredFeatures(void* contextElement);
 95 static void synchronizeRequiredExtensions(void* contextElement);
 96 static void synchronizeSystemLanguage(void* contextElement);
 97
 98 virtual void synchronizeRequiredFeatures() { }
 99 virtual void synchronizeRequiredExtensions() { }
 100 virtual void synchronizeSystemLanguage() { }
 101
 102 virtual SVGAttributeToPropertyMap& localAttributeToPropertyMap();
 103
118104protected:
119105 SVGElement(const QualifiedName&, Document*);
120106
90666

Source/WebCore/svg/SVGEllipseElement.cpp

@@DEFINE_ANIMATED_LENGTH(SVGEllipseElement
4040DEFINE_ANIMATED_LENGTH(SVGEllipseElement, SVGNames::ryAttr, Ry, ry)
4141DEFINE_ANIMATED_BOOLEAN(SVGEllipseElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
4242
 43BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGEllipseElement)
 44 REGISTER_LOCAL_ANIMATED_PROPERTY(cx)
 45 REGISTER_LOCAL_ANIMATED_PROPERTY(cy)
 46 REGISTER_LOCAL_ANIMATED_PROPERTY(rx)
 47 REGISTER_LOCAL_ANIMATED_PROPERTY(ry)
 48 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 49 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 50 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 51END_REGISTER_ANIMATED_PROPERTIES
 52
4353inline SVGEllipseElement::SVGEllipseElement(const QualifiedName& tagName, Document* document)
4454 : SVGStyledTransformableElement(tagName, document)
4555 , m_cx(LengthModeWidth)

@@inline SVGEllipseElement::SVGEllipseElem
4858 , m_ry(LengthModeHeight)
4959{
5060 ASSERT(hasTagName(SVGNames::ellipseTag));
 61 registerAnimatedPropertiesForSVGEllipseElement();
5162}
5263
5364PassRefPtr<SVGEllipseElement> SVGEllipseElement::create(const QualifiedName& tagName, Document* document)

@@void SVGEllipseElement::svgAttributeChan
149160 ASSERT_NOT_REACHED();
150161}
151162
152 void SVGEllipseElement::synchronizeProperty(const QualifiedName& attrName)
153 {
154  if (attrName == anyQName()) {
155  synchronizeCx();
156  synchronizeCy();
157  synchronizeRx();
158  synchronizeRy();
159  synchronizeExternalResourcesRequired();
160  SVGTests::synchronizeProperties(this, attrName);
161  SVGStyledTransformableElement::synchronizeProperty(attrName);
162  return;
163  }
164 
165  if (!isSupportedAttribute(attrName)) {
166  SVGStyledTransformableElement::synchronizeProperty(attrName);
167  return;
168  }
169 
170  if (attrName == SVGNames::cxAttr) {
171  synchronizeCx();
172  return;
173  }
174 
175  if (attrName == SVGNames::cyAttr) {
176  synchronizeCy();
177  return;
178  }
179 
180  if (attrName == SVGNames::rxAttr) {
181  synchronizeRx();
182  return;
183  }
184 
185  if (attrName == SVGNames::ryAttr) {
186  synchronizeRy();
187  return;
188  }
189 
190  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
191  synchronizeExternalResourcesRequired();
192  return;
193  }
194 
195  if (SVGTests::isKnownAttribute(attrName)) {
196  SVGTests::synchronizeProperties(this, attrName);
197  return;
198  }
199 
200  ASSERT_NOT_REACHED();
201 }
202 
203 AttributeToPropertyTypeMap& SVGEllipseElement::attributeToPropertyTypeMap()
204 {
205  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
206  return s_attributeToPropertyTypeMap;
207 }
208 
209 void SVGEllipseElement::fillAttributeToPropertyTypeMap()
210 {
211  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
212 
213  SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
214  attributeToPropertyTypeMap.set(SVGNames::cxAttr, AnimatedLength);
215  attributeToPropertyTypeMap.set(SVGNames::cyAttr, AnimatedLength);
216  attributeToPropertyTypeMap.set(SVGNames::rxAttr, AnimatedLength);
217  attributeToPropertyTypeMap.set(SVGNames::ryAttr, AnimatedLength);
218 }
219 
220163void SVGEllipseElement::toPathData(Path& path) const
221164{
222165 ASSERT(path.isEmpty());
90666

Source/WebCore/svg/SVGEllipseElement.h

@@private:
4747 bool isSupportedAttribute(const QualifiedName&);
4848 virtual void parseMappedAttribute(Attribute*);
4949 virtual void svgAttributeChanged(const QualifiedName&);
50  virtual void synchronizeProperty(const QualifiedName&);
51  virtual void fillAttributeToPropertyTypeMap();
52  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5350
5451 virtual void toPathData(Path&) const;
5552
5653 virtual bool selfHasRelativeLengths() const;
5754
58  // Animated property declarations
59  DECLARE_ANIMATED_LENGTH(Cx, cx)
60  DECLARE_ANIMATED_LENGTH(Cy, cy)
61  DECLARE_ANIMATED_LENGTH(Rx, rx)
62  DECLARE_ANIMATED_LENGTH(Ry, ry)
63 
64  // SVGExternalResourcesRequired
65  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 55 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGEllipseElement)
 56 DECLARE_ANIMATED_LENGTH(Cx, cx)
 57 DECLARE_ANIMATED_LENGTH(Cy, cy)
 58 DECLARE_ANIMATED_LENGTH(Rx, rx)
 59 DECLARE_ANIMATED_LENGTH(Ry, ry)
 60 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 61 END_DECLARE_ANIMATED_PROPERTIES
 62
 63 // SVGTests
 64 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 65 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 66 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
6667};
6768
6869} // namespace WebCore
90666

Source/WebCore/svg/SVGFEBlendElement.cpp

@@DEFINE_ANIMATED_STRING(SVGFEBlendElement
3636DEFINE_ANIMATED_STRING(SVGFEBlendElement, SVGNames::in2Attr, In2, in2)
3737DEFINE_ANIMATED_ENUMERATION(SVGFEBlendElement, SVGNames::modeAttr, Mode, mode, BlendModeType)
3838
 39BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEBlendElement)
 40 REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
 41 REGISTER_LOCAL_ANIMATED_PROPERTY(in2)
 42 REGISTER_LOCAL_ANIMATED_PROPERTY(mode)
 43 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 44END_REGISTER_ANIMATED_PROPERTIES
 45
3946inline SVGFEBlendElement::SVGFEBlendElement(const QualifiedName& tagName, Document* document)
4047 : SVGFilterPrimitiveStandardAttributes(tagName, document)
4148 , m_mode(FEBLEND_MODE_NORMAL)
4249{
4350 ASSERT(hasTagName(SVGNames::feBlendTag));
 51 registerAnimatedPropertiesForSVGFEBlendElement();
4452}
4553
4654PassRefPtr<SVGFEBlendElement> SVGFEBlendElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFEBlendElement::svgAttributeChan
119127 ASSERT_NOT_REACHED();
120128}
121129
122 void SVGFEBlendElement::synchronizeProperty(const QualifiedName& attrName)
123 {
124  if (attrName == anyQName()) {
125  synchronizeMode();
126  synchronizeIn1();
127  synchronizeIn2();
128  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
129  return;
130  }
131 
132  if (!isSupportedAttribute(attrName)) {
133  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
134  return;
135  }
136 
137  if (attrName == SVGNames::modeAttr) {
138  synchronizeMode();
139  return;
140  }
141 
142  if (attrName == SVGNames::inAttr) {
143  synchronizeIn1();
144  return;
145  }
146 
147  if (attrName == SVGNames::in2Attr) {
148  synchronizeIn2();
149  return;
150  }
151 
152  ASSERT_NOT_REACHED();
153 }
154 
155 AttributeToPropertyTypeMap& SVGFEBlendElement::attributeToPropertyTypeMap()
156 {
157  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
158  return s_attributeToPropertyTypeMap;
159 }
160 
161 void SVGFEBlendElement::fillAttributeToPropertyTypeMap()
162 {
163  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
164 
165  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
166  attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
167  attributeToPropertyTypeMap.set(SVGNames::in2Attr, AnimatedString);
168  attributeToPropertyTypeMap.set(SVGNames::modeAttr, AnimatedEnumeration);
169 }
170 
171130PassRefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
172131{
173132 FilterEffect* input1 = filterBuilder->getEffectById(in1());
90666

Source/WebCore/svg/SVGFEBlendElement.h

@@private:
8080 virtual void parseMappedAttribute(Attribute*);
8181 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName);
8282 virtual void svgAttributeChanged(const QualifiedName&);
83  virtual void synchronizeProperty(const QualifiedName&);
84  virtual void fillAttributeToPropertyTypeMap();
85  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
8683 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
8784
88  // Animated property declarations
89  DECLARE_ANIMATED_STRING(In1, in1)
90  DECLARE_ANIMATED_STRING(In2, in2)
91  DECLARE_ANIMATED_ENUMERATION(Mode, mode, BlendModeType)
 85 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEBlendElement)
 86 DECLARE_ANIMATED_STRING(In1, in1)
 87 DECLARE_ANIMATED_STRING(In2, in2)
 88 DECLARE_ANIMATED_ENUMERATION(Mode, mode, BlendModeType)
 89 END_DECLARE_ANIMATED_PROPERTIES
9290};
9391
9492} // namespace WebCore
90666

Source/WebCore/svg/SVGFEColorMatrixElement.cpp

@@DEFINE_ANIMATED_STRING(SVGFEColorMatrixE
3636DEFINE_ANIMATED_ENUMERATION(SVGFEColorMatrixElement, SVGNames::typeAttr, Type, type, ColorMatrixType)
3737DEFINE_ANIMATED_NUMBER_LIST(SVGFEColorMatrixElement, SVGNames::valuesAttr, Values, values)
3838
 39BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEColorMatrixElement)
 40 REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
 41 REGISTER_LOCAL_ANIMATED_PROPERTY(type)
 42 REGISTER_LOCAL_ANIMATED_PROPERTY(values)
 43 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 44END_REGISTER_ANIMATED_PROPERTIES
 45
3946inline SVGFEColorMatrixElement::SVGFEColorMatrixElement(const QualifiedName& tagName, Document* document)
4047 : SVGFilterPrimitiveStandardAttributes(tagName, document)
4148 , m_type(FECOLORMATRIX_TYPE_UNKNOWN)
4249{
4350 ASSERT(hasTagName(SVGNames::feColorMatrixTag));
 51 registerAnimatedPropertiesForSVGFEColorMatrixElement();
4452}
4553
4654PassRefPtr<SVGFEColorMatrixElement> SVGFEColorMatrixElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFEColorMatrixElement::svgAttribu
124132 ASSERT_NOT_REACHED();
125133}
126134
127 void SVGFEColorMatrixElement::synchronizeProperty(const QualifiedName& attrName)
128 {
129  if (attrName == anyQName()) {
130  synchronizeType();
131  synchronizeIn1();
132  synchronizeValues();
133  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
134  return;
135  }
136 
137  if (!isSupportedAttribute(attrName)) {
138  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
139  return;
140  }
141 
142  if (attrName == SVGNames::typeAttr) {
143  synchronizeType();
144  return;
145  }
146 
147  if (attrName == SVGNames::inAttr) {
148  synchronizeIn1();
149  return;
150  }
151 
152  if (attrName == SVGNames::valuesAttr) {
153  synchronizeValues();
154  return;
155  }
156 
157  ASSERT_NOT_REACHED();
158 }
159 
160 AttributeToPropertyTypeMap& SVGFEColorMatrixElement::attributeToPropertyTypeMap()
161 {
162  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
163  return s_attributeToPropertyTypeMap;
164 }
165 
166 void SVGFEColorMatrixElement::fillAttributeToPropertyTypeMap()
167 {
168  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
169 
170  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
171  attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
172  attributeToPropertyTypeMap.set(SVGNames::typeAttr, AnimatedEnumeration);
173  attributeToPropertyTypeMap.set(SVGNames::valuesAttr, AnimatedNumberList);
174 }
175 
176135PassRefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
177136{
178137 FilterEffect* input1 = filterBuilder->getEffectById(in1());
90666

Source/WebCore/svg/SVGFEColorMatrixElement.h

@@private:
7777 virtual void parseMappedAttribute(Attribute*);
7878 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
7979 virtual void svgAttributeChanged(const QualifiedName&);
80  virtual void synchronizeProperty(const QualifiedName&);
81  virtual void fillAttributeToPropertyTypeMap();
82  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
8380 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
8481
85  // Animated property declarations
86  DECLARE_ANIMATED_STRING(In1, in1)
87  DECLARE_ANIMATED_ENUMERATION(Type, type, ColorMatrixType)
88  DECLARE_ANIMATED_NUMBER_LIST(Values, values)
 82 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEColorMatrixElement)
 83 DECLARE_ANIMATED_STRING(In1, in1)
 84 DECLARE_ANIMATED_ENUMERATION(Type, type, ColorMatrixType)
 85 DECLARE_ANIMATED_NUMBER_LIST(Values, values)
 86 END_DECLARE_ANIMATED_PROPERTIES
8987};
9088
9189} // namespace WebCore
90666

Source/WebCore/svg/SVGFEComponentTransferElement.cpp

3434
3535namespace WebCore {
3636
37 // Animated property declarations
 37// Animated property definitions
3838DEFINE_ANIMATED_STRING(SVGFEComponentTransferElement, SVGNames::inAttr, In1, in1)
3939
 40BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEComponentTransferElement)
 41 REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
 42 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 43END_REGISTER_ANIMATED_PROPERTIES
 44
4045inline SVGFEComponentTransferElement::SVGFEComponentTransferElement(const QualifiedName& tagName, Document* document)
4146 : SVGFilterPrimitiveStandardAttributes(tagName, document)
4247{
4348 ASSERT(hasTagName(SVGNames::feComponentTransferTag));
 49 registerAnimatedPropertiesForSVGFEComponentTransferElement();
4450}
4551
4652PassRefPtr<SVGFEComponentTransferElement> SVGFEComponentTransferElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFEComponentTransferElement::pars
7278 ASSERT_NOT_REACHED();
7379}
7480
75 void SVGFEComponentTransferElement::synchronizeProperty(const QualifiedName& attrName)
76 {
77  if (attrName == anyQName()) {
78  synchronizeIn1();
79  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
80  return;
81  }
82 
83  if (!isSupportedAttribute(attrName)) {
84  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
85  return;
86  }
87 
88  if (attrName == SVGNames::inAttr) {
89  synchronizeIn1();
90  return;
91  }
92 
93  ASSERT_NOT_REACHED();
94 }
95 
96 AttributeToPropertyTypeMap& SVGFEComponentTransferElement::attributeToPropertyTypeMap()
97 {
98  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
99  return s_attributeToPropertyTypeMap;
100 }
101 
102 void SVGFEComponentTransferElement::fillAttributeToPropertyTypeMap()
103 {
104  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
105 
106  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
107  attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
108 }
109 
11081PassRefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
11182{
11283 FilterEffect* input1 = filterBuilder->getEffectById(in1());
90666

Source/WebCore/svg/SVGFEComponentTransferElement.h

@@private:
3737 // FIXME: svgAttributeChanged missing.
3838 bool isSupportedAttribute(const QualifiedName&);
3939 virtual void parseMappedAttribute(Attribute*);
40  virtual void synchronizeProperty(const QualifiedName&);
41  virtual void fillAttributeToPropertyTypeMap();
42  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
4340 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
4441
45  // Animated property declarations
46  DECLARE_ANIMATED_STRING(In1, in1)
 42 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEComponentTransferElement)
 43 DECLARE_ANIMATED_STRING(In1, in1)
 44 END_DECLARE_ANIMATED_PROPERTIES
4745};
4846
4947} // namespace WebCore
90666

Source/WebCore/svg/SVGFECompositeElement.cpp

@@DEFINE_ANIMATED_NUMBER(SVGFECompositeEle
4040DEFINE_ANIMATED_NUMBER(SVGFECompositeElement, SVGNames::k3Attr, K3, k3)
4141DEFINE_ANIMATED_NUMBER(SVGFECompositeElement, SVGNames::k4Attr, K4, k4)
4242
 43BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFECompositeElement)
 44 REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
 45 REGISTER_LOCAL_ANIMATED_PROPERTY(in2)
 46 REGISTER_LOCAL_ANIMATED_PROPERTY(_operator)
 47 REGISTER_LOCAL_ANIMATED_PROPERTY(k1)
 48 REGISTER_LOCAL_ANIMATED_PROPERTY(k2)
 49 REGISTER_LOCAL_ANIMATED_PROPERTY(k3)
 50 REGISTER_LOCAL_ANIMATED_PROPERTY(k4)
 51 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 52END_REGISTER_ANIMATED_PROPERTIES
 53
4354inline SVGFECompositeElement::SVGFECompositeElement(const QualifiedName& tagName, Document* document)
4455 : SVGFilterPrimitiveStandardAttributes(tagName, document)
4556 , m__operator(FECOMPOSITE_OPERATOR_OVER)
4657{
4758 ASSERT(hasTagName(SVGNames::feCompositeTag));
 59 registerAnimatedPropertiesForSVGFECompositeElement();
4860}
4961
5062PassRefPtr<SVGFECompositeElement> SVGFECompositeElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFECompositeElement::svgAttribute
160172 ASSERT_NOT_REACHED();
161173}
162174
163 void SVGFECompositeElement::synchronizeProperty(const QualifiedName& attrName)
164 {
165  if (attrName == anyQName()) {
166  synchronize_operator();
167  synchronizeIn1();
168  synchronizeIn2();
169  synchronizeK1();
170  synchronizeK2();
171  synchronizeK3();
172  synchronizeK4();
173  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
174  return;
175  }
176 
177  if (!isSupportedAttribute(attrName)) {
178  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
179  return;
180  }
181 
182  if (attrName == SVGNames::operatorAttr) {
183  synchronize_operator();
184  return;
185  }
186 
187  if (attrName == SVGNames::inAttr) {
188  synchronizeIn1();
189  return;
190  }
191 
192  if (attrName == SVGNames::in2Attr) {
193  synchronizeIn2();
194  return;
195  }
196 
197  if (attrName == SVGNames::k1Attr) {
198  synchronizeK1();
199  return;
200  }
201 
202  if (attrName == SVGNames::k2Attr) {
203  synchronizeK2();
204  return;
205  }
206 
207  if (attrName == SVGNames::k3Attr) {
208  synchronizeK3();
209  return;
210  }
211 
212  if (attrName == SVGNames::k4Attr) {
213  synchronizeK4();
214  return;
215  }
216 
217  ASSERT_NOT_REACHED();
218 }
219 
220 AttributeToPropertyTypeMap& SVGFECompositeElement::attributeToPropertyTypeMap()
221 {
222  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
223  return s_attributeToPropertyTypeMap;
224 }
225 
226 void SVGFECompositeElement::fillAttributeToPropertyTypeMap()
227 {
228  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
229 
230  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
231  attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
232  attributeToPropertyTypeMap.set(SVGNames::in2Attr, AnimatedString);
233  attributeToPropertyTypeMap.set(SVGNames::operatorAttr, AnimatedEnumeration);
234  attributeToPropertyTypeMap.set(SVGNames::k1Attr, AnimatedNumber);
235  attributeToPropertyTypeMap.set(SVGNames::k2Attr, AnimatedNumber);
236  attributeToPropertyTypeMap.set(SVGNames::k3Attr, AnimatedNumber);
237  attributeToPropertyTypeMap.set(SVGNames::k4Attr, AnimatedNumber);
238 }
239 
240175PassRefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
241176{
242177 FilterEffect* input1 = filterBuilder->getEffectById(in1());
90666

Source/WebCore/svg/SVGFECompositeElement.h

@@private:
8585 virtual void parseMappedAttribute(Attribute*);
8686 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
8787 virtual void svgAttributeChanged(const QualifiedName&);
88  virtual void synchronizeProperty(const QualifiedName&);
89  virtual void fillAttributeToPropertyTypeMap();
90  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
9188 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
9289
93  // Animated property declarations
94  DECLARE_ANIMATED_STRING(In1, in1)
95  DECLARE_ANIMATED_STRING(In2, in2)
96  DECLARE_ANIMATED_ENUMERATION(_operator, _operator, CompositeOperationType)
97  DECLARE_ANIMATED_NUMBER(K1, k1)
98  DECLARE_ANIMATED_NUMBER(K2, k2)
99  DECLARE_ANIMATED_NUMBER(K3, k3)
100  DECLARE_ANIMATED_NUMBER(K4, k4)
 90 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFECompositeElement)
 91 DECLARE_ANIMATED_STRING(In1, in1)
 92 DECLARE_ANIMATED_STRING(In2, in2)
 93 DECLARE_ANIMATED_ENUMERATION(_operator, _operator, CompositeOperationType)
 94 DECLARE_ANIMATED_NUMBER(K1, k1)
 95 DECLARE_ANIMATED_NUMBER(K2, k2)
 96 DECLARE_ANIMATED_NUMBER(K3, k3)
 97 DECLARE_ANIMATED_NUMBER(K4, k4)
 98 END_DECLARE_ANIMATED_PROPERTIES
10199};
102100
103101} // namespace WebCore
90666

Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp

@@DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS
4848DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), KernelUnitLengthY, kernelUnitLengthY)
4949DEFINE_ANIMATED_BOOLEAN(SVGFEConvolveMatrixElement, SVGNames::preserveAlphaAttr, PreserveAlpha, preserveAlpha)
5050
 51BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEConvolveMatrixElement)
 52 REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
 53 REGISTER_LOCAL_ANIMATED_PROPERTY(orderX)
 54 REGISTER_LOCAL_ANIMATED_PROPERTY(orderY)
 55 REGISTER_LOCAL_ANIMATED_PROPERTY(kernelMatrix)
 56 REGISTER_LOCAL_ANIMATED_PROPERTY(divisor)
 57 REGISTER_LOCAL_ANIMATED_PROPERTY(bias)
 58 REGISTER_LOCAL_ANIMATED_PROPERTY(targetX)
 59 REGISTER_LOCAL_ANIMATED_PROPERTY(targetY)
 60 REGISTER_LOCAL_ANIMATED_PROPERTY(edgeMode)
 61 REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthX)
 62 REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthY)
 63 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAlpha)
 64 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 65END_REGISTER_ANIMATED_PROPERTIES
 66
5167inline SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(const QualifiedName& tagName, Document* document)
5268 : SVGFilterPrimitiveStandardAttributes(tagName, document)
5369 , m_edgeMode(EDGEMODE_DUPLICATE)
5470{
5571 ASSERT(hasTagName(SVGNames::feConvolveMatrixTag));
 72 registerAnimatedPropertiesForSVGFEConvolveMatrixElement();
5673}
5774
5875PassRefPtr<SVGFEConvolveMatrixElement> SVGFEConvolveMatrixElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFEConvolveMatrixElement::svgAttr
245262 ASSERT_NOT_REACHED();
246263}
247264
248 void SVGFEConvolveMatrixElement::synchronizeProperty(const QualifiedName& attrName)
249 {
250  if (attrName == anyQName()) {
251  synchronizeEdgeMode();
252  synchronizeDivisor();
253  synchronizeBias();
254  synchronizeTargetX();
255  synchronizeTargetY();
256  synchronizeKernelUnitLengthX();
257  synchronizeKernelUnitLengthY();
258  synchronizePreserveAlpha();
259  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
260  return;
261  }
262 
263  if (!isSupportedAttribute(attrName)) {
264  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
265  return;
266  }
267 
268  if (attrName == SVGNames::edgeModeAttr) {
269  synchronizeEdgeMode();
270  return;
271  }
272 
273  if (attrName == SVGNames::divisorAttr) {
274  synchronizeDivisor();
275  return;
276  }
277 
278  if (attrName == SVGNames::biasAttr) {
279  synchronizeBias();
280  return;
281  }
282 
283  if (attrName == SVGNames::targetXAttr) {
284  synchronizeTargetX();
285  return;
286  }
287 
288  if (attrName == SVGNames::targetYAttr) {
289  synchronizeTargetY();
290  return;
291  }
292 
293  if (attrName == SVGNames::kernelUnitLengthAttr) {
294  synchronizeKernelUnitLengthX();
295  synchronizeKernelUnitLengthY();
296  return;
297  }
298 
299  if (attrName == SVGNames::preserveAlphaAttr) {
300  synchronizePreserveAlpha();
301  return;
302  }
303 
304  ASSERT_NOT_REACHED();
305 }
306 
307 AttributeToPropertyTypeMap& SVGFEConvolveMatrixElement::attributeToPropertyTypeMap()
308 {
309  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
310  return s_attributeToPropertyTypeMap;
311 }
312 
313 void SVGFEConvolveMatrixElement::fillAttributeToPropertyTypeMap()
314 {
315  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
316 
317  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
318  attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
319  attributeToPropertyTypeMap.set(SVGNames::orderAttr, AnimatedNumberOptionalNumber);
320  attributeToPropertyTypeMap.set(SVGNames::kernelMatrixAttr, AnimatedNumberList);
321  attributeToPropertyTypeMap.set(SVGNames::divisorAttr, AnimatedNumber);
322  attributeToPropertyTypeMap.set(SVGNames::biasAttr, AnimatedNumber);
323  attributeToPropertyTypeMap.set(SVGNames::targetXAttr, AnimatedInteger);
324  attributeToPropertyTypeMap.set(SVGNames::targetYAttr, AnimatedInteger);
325  attributeToPropertyTypeMap.set(SVGNames::operatorAttr, AnimatedEnumeration);
326  attributeToPropertyTypeMap.set(SVGNames::kernelUnitLengthAttr, AnimatedNumberOptionalNumber);
327  attributeToPropertyTypeMap.set(SVGNames::preserveAlphaAttr, AnimatedBoolean);
328 }
329 
330265PassRefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
331266{
332267 FilterEffect* input1 = filterBuilder->getEffectById(in1());
90666

Source/WebCore/svg/SVGFEConvolveMatrixElement.h

@@private:
7878 virtual void parseMappedAttribute(Attribute*);
7979 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
8080 virtual void svgAttributeChanged(const QualifiedName&);
81  virtual void synchronizeProperty(const QualifiedName&);
82  virtual void fillAttributeToPropertyTypeMap();
83  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
8481 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
8582
8683 static const AtomicString& orderXIdentifier();

@@private:
8885 static const AtomicString& kernelUnitLengthXIdentifier();
8986 static const AtomicString& kernelUnitLengthYIdentifier();
9087
91  // Animated property declarations
92  DECLARE_ANIMATED_STRING(In1, in1)
93  DECLARE_ANIMATED_INTEGER(OrderX, orderX)
94  DECLARE_ANIMATED_INTEGER(OrderY, orderY)
95  DECLARE_ANIMATED_NUMBER_LIST(KernelMatrix, kernelMatrix)
96  DECLARE_ANIMATED_NUMBER(Divisor, divisor)
97  DECLARE_ANIMATED_NUMBER(Bias, bias)
98  DECLARE_ANIMATED_INTEGER(TargetX, targetX)
99  DECLARE_ANIMATED_INTEGER(TargetY, targetY)
100  DECLARE_ANIMATED_ENUMERATION(EdgeMode, edgeMode, EdgeModeType)
101  DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
102  DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
103  DECLARE_ANIMATED_BOOLEAN(PreserveAlpha, preserveAlpha)
 88 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEConvolveMatrixElement)
 89 DECLARE_ANIMATED_STRING(In1, in1)
 90 DECLARE_ANIMATED_INTEGER(OrderX, orderX)
 91 DECLARE_ANIMATED_INTEGER(OrderY, orderY)
 92 DECLARE_ANIMATED_NUMBER_LIST(KernelMatrix, kernelMatrix)
 93 DECLARE_ANIMATED_NUMBER(Divisor, divisor)
 94 DECLARE_ANIMATED_NUMBER(Bias, bias)
 95 DECLARE_ANIMATED_INTEGER(TargetX, targetX)
 96 DECLARE_ANIMATED_INTEGER(TargetY, targetY)
 97 DECLARE_ANIMATED_ENUMERATION(EdgeMode, edgeMode, EdgeModeType)
 98 DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
 99 DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
 100 DECLARE_ANIMATED_BOOLEAN(PreserveAlpha, preserveAlpha)
 101 END_DECLARE_ANIMATED_PROPERTIES
104102};
105103
106104} // namespace WebCore
90666

Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp

@@DEFINE_ANIMATED_NUMBER(SVGFEDiffuseLight
4242DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), KernelUnitLengthX, kernelUnitLengthX)
4343DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), KernelUnitLengthY, kernelUnitLengthY)
4444
 45BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEDiffuseLightingElement)
 46 REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
 47 REGISTER_LOCAL_ANIMATED_PROPERTY(diffuseConstant)
 48 REGISTER_LOCAL_ANIMATED_PROPERTY(surfaceScale)
 49 REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthX)
 50 REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthY)
 51 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 52END_REGISTER_ANIMATED_PROPERTIES
 53
4554inline SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const QualifiedName& tagName, Document* document)
4655 : SVGFilterPrimitiveStandardAttributes(tagName, document)
4756 , m_diffuseConstant(1)
4857 , m_surfaceScale(1)
4958{
5059 ASSERT(hasTagName(SVGNames::feDiffuseLightingTag));
 60 registerAnimatedPropertiesForSVGFEDiffuseLightingElement();
5161}
5262
5363PassRefPtr<SVGFEDiffuseLightingElement> SVGFEDiffuseLightingElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFEDiffuseLightingElement::lightE
194204 primitiveAttributeChanged(attrName);
195205}
196206
197 void SVGFEDiffuseLightingElement::synchronizeProperty(const QualifiedName& attrName)
198 {
199  if (attrName == anyQName()) {
200  synchronizeIn1();
201  synchronizeSurfaceScale();
202  synchronizeDiffuseConstant();
203  synchronizeKernelUnitLengthX();
204  synchronizeKernelUnitLengthY();
205  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
206  return;
207  }
208 
209  if (!isSupportedAttribute(attrName)) {
210  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
211  return;
212  }
213 
214  if (attrName == SVGNames::lighting_colorAttr)
215  return;
216 
217  if (attrName == SVGNames::inAttr) {
218  synchronizeIn1();
219  return;
220  }
221 
222  if (attrName == SVGNames::surfaceScaleAttr) {
223  synchronizeSurfaceScale();
224  return;
225  }
226 
227  if (attrName == SVGNames::diffuseConstantAttr) {
228  synchronizeDiffuseConstant();
229  return;
230  }
231 
232  if (attrName == SVGNames::kernelUnitLengthAttr) {
233  synchronizeKernelUnitLengthX();
234  synchronizeKernelUnitLengthY();
235  return;
236  }
237 
238  ASSERT_NOT_REACHED();
239 }
240 
241 AttributeToPropertyTypeMap& SVGFEDiffuseLightingElement::attributeToPropertyTypeMap()
242 {
243  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
244  return s_attributeToPropertyTypeMap;
245 }
246 
247 void SVGFEDiffuseLightingElement::fillAttributeToPropertyTypeMap()
248 {
249  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
250 
251  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
252  attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
253  attributeToPropertyTypeMap.set(SVGNames::diffuseConstantAttr, AnimatedNumber);
254  attributeToPropertyTypeMap.set(SVGNames::surfaceScaleAttr, AnimatedNumber);
255  attributeToPropertyTypeMap.set(SVGNames::kernelUnitLengthAttr, AnimatedNumberOptionalNumber);
256 }
257 
258207PassRefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
259208{
260209 FilterEffect* input1 = filterBuilder->getEffectById(in1());
90666

Source/WebCore/svg/SVGFEDiffuseLightingElement.h

@@private:
4343 virtual void parseMappedAttribute(Attribute*);
4444 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
4545 virtual void svgAttributeChanged(const QualifiedName&);
46  virtual void synchronizeProperty(const QualifiedName&);
47  virtual void fillAttributeToPropertyTypeMap();
48  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
4946 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
5047
5148 static const AtomicString& kernelUnitLengthXIdentifier();
5249 static const AtomicString& kernelUnitLengthYIdentifier();
5350
54  // Animated property declarations
55  DECLARE_ANIMATED_STRING(In1, in1)
56  DECLARE_ANIMATED_NUMBER(DiffuseConstant, diffuseConstant)
57  DECLARE_ANIMATED_NUMBER(SurfaceScale, surfaceScale)
58  DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
59  DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
 51 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEDiffuseLightingElement)
 52 DECLARE_ANIMATED_STRING(In1, in1)
 53 DECLARE_ANIMATED_NUMBER(DiffuseConstant, diffuseConstant)
 54 DECLARE_ANIMATED_NUMBER(SurfaceScale, surfaceScale)
 55 DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
 56 DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
 57 END_DECLARE_ANIMATED_PROPERTIES
6058};
6159
6260} // namespace WebCore
90666

Source/WebCore/svg/SVGFEDisplacementMapElement.cpp

@@DEFINE_ANIMATED_ENUMERATION(SVGFEDisplac
3737DEFINE_ANIMATED_ENUMERATION(SVGFEDisplacementMapElement, SVGNames::yChannelSelectorAttr, YChannelSelector, yChannelSelector, ChannelSelectorType)
3838DEFINE_ANIMATED_NUMBER(SVGFEDisplacementMapElement, SVGNames::scaleAttr, Scale, scale)
3939
 40BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEDisplacementMapElement)
 41 REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
 42 REGISTER_LOCAL_ANIMATED_PROPERTY(in2)
 43 REGISTER_LOCAL_ANIMATED_PROPERTY(xChannelSelector)
 44 REGISTER_LOCAL_ANIMATED_PROPERTY(yChannelSelector)
 45 REGISTER_LOCAL_ANIMATED_PROPERTY(scale)
 46 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 47END_REGISTER_ANIMATED_PROPERTIES
 48
4049inline SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const QualifiedName& tagName, Document* document)
4150 : SVGFilterPrimitiveStandardAttributes(tagName, document)
4251 , m_xChannelSelector(CHANNEL_A)
4352 , m_yChannelSelector(CHANNEL_A)
4453{
4554 ASSERT(hasTagName(SVGNames::feDisplacementMapTag));
 55 registerAnimatedPropertiesForSVGFEDisplacementMapElement();
4656}
4757
4858PassRefPtr<SVGFEDisplacementMapElement> SVGFEDisplacementMapElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFEDisplacementMapElement::svgAtt
139149 ASSERT_NOT_REACHED();
140150}
141151
142 void SVGFEDisplacementMapElement::synchronizeProperty(const QualifiedName& attrName)
143 {
144  if (attrName == anyQName()) {
145  synchronizeXChannelSelector();
146  synchronizeYChannelSelector();
147  synchronizeIn1();
148  synchronizeIn2();
149  synchronizeScale();
150  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
151  return;
152  }
153 
154  if (!isSupportedAttribute(attrName)) {
155  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
156  return;
157  }
158 
159  if (attrName == SVGNames::xChannelSelectorAttr) {
160  synchronizeXChannelSelector();
161  return;
162  }
163 
164  if (attrName == SVGNames::yChannelSelectorAttr) {
165  synchronizeYChannelSelector();
166  return;
167  }
168 
169  if (attrName == SVGNames::inAttr) {
170  synchronizeIn1();
171  return;
172  }
173 
174  if (attrName == SVGNames::in2Attr) {
175  synchronizeIn2();
176  return;
177  }
178 
179  if (attrName == SVGNames::scaleAttr) {
180  synchronizeScale();
181  return;
182  }
183 
184  ASSERT_NOT_REACHED();
185 }
186 
187 AttributeToPropertyTypeMap& SVGFEDisplacementMapElement::attributeToPropertyTypeMap()
188 {
189  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
190  return s_attributeToPropertyTypeMap;
191 }
192 
193 void SVGFEDisplacementMapElement::fillAttributeToPropertyTypeMap()
194 {
195  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
196 
197  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
198  attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
199  attributeToPropertyTypeMap.set(SVGNames::in2Attr, AnimatedString);
200  attributeToPropertyTypeMap.set(SVGNames::xChannelSelectorAttr, AnimatedEnumeration);
201  attributeToPropertyTypeMap.set(SVGNames::yChannelSelectorAttr, AnimatedEnumeration);
202  attributeToPropertyTypeMap.set(SVGNames::scaleAttr, AnimatedNumber);
203 }
204 
205152PassRefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
206153{
207154 FilterEffect* input1 = filterBuilder->getEffectById(in1());
90666

Source/WebCore/svg/SVGFEDisplacementMapElement.h

@@private:
7878 virtual void parseMappedAttribute(Attribute*);
7979 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName);
8080 virtual void svgAttributeChanged(const QualifiedName&);
81  virtual void synchronizeProperty(const QualifiedName&);
82  virtual void fillAttributeToPropertyTypeMap();
83  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
8481 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
8582
86  // Animated property declarations
87  DECLARE_ANIMATED_STRING(In1, in1)
88  DECLARE_ANIMATED_STRING(In2, in2)
89  DECLARE_ANIMATED_ENUMERATION(XChannelSelector, xChannelSelector, ChannelSelectorType)
90  DECLARE_ANIMATED_ENUMERATION(YChannelSelector, yChannelSelector, ChannelSelectorType)
91  DECLARE_ANIMATED_NUMBER(Scale, scale)
 83 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEDisplacementMapElement)
 84 DECLARE_ANIMATED_STRING(In1, in1)
 85 DECLARE_ANIMATED_STRING(In2, in2)
 86 DECLARE_ANIMATED_ENUMERATION(XChannelSelector, xChannelSelector, ChannelSelectorType)
 87 DECLARE_ANIMATED_ENUMERATION(YChannelSelector, yChannelSelector, ChannelSelectorType)
 88 DECLARE_ANIMATED_NUMBER(Scale, scale)
 89 END_DECLARE_ANIMATED_PROPERTIES
9290};
9391
9492} // namespace WebCore
90666

Source/WebCore/svg/SVGFEDropShadowElement.cpp

@@DEFINE_ANIMATED_NUMBER(SVGFEDropShadowEl
3939DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEDropShadowElement, SVGNames::stdDeviationAttr, stdDeviationXIdentifier(), StdDeviationX, stdDeviationX)
4040DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEDropShadowElement, SVGNames::stdDeviationAttr, stdDeviationYIdentifier(), StdDeviationY, stdDeviationY)
4141
 42BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEDropShadowElement)
 43 REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
 44 REGISTER_LOCAL_ANIMATED_PROPERTY(dx)
 45 REGISTER_LOCAL_ANIMATED_PROPERTY(dy)
 46 REGISTER_LOCAL_ANIMATED_PROPERTY(stdDeviationX)
 47 REGISTER_LOCAL_ANIMATED_PROPERTY(stdDeviationY)
 48 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 49END_REGISTER_ANIMATED_PROPERTIES
 50
4251inline SVGFEDropShadowElement::SVGFEDropShadowElement(const QualifiedName& tagName, Document* document)
4352 : SVGFilterPrimitiveStandardAttributes(tagName, document)
4453 , m_dx(2)

@@inline SVGFEDropShadowElement::SVGFEDrop
4756 , m_stdDeviationY(2)
4857{
4958 ASSERT(hasTagName(SVGNames::feDropShadowTag));
 59 registerAnimatedPropertiesForSVGFEDropShadowElement();
5060}
5161
5262PassRefPtr<SVGFEDropShadowElement> SVGFEDropShadowElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFEDropShadowElement::svgAttribut
140150 ASSERT_NOT_REACHED();
141151}
142152
143 void SVGFEDropShadowElement::synchronizeProperty(const QualifiedName& attrName)
144 {
145  if (attrName == anyQName()) {
146  synchronizeStdDeviationX();
147  synchronizeStdDeviationY();
148  synchronizeDx();
149  synchronizeDy();
150  synchronizeIn1();
151  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
152  return;
153  }
154 
155  if (!isSupportedAttribute(attrName)) {
156  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
157  return;
158  }
159 
160  if (attrName == SVGNames::stdDeviationAttr) {
161  synchronizeStdDeviationX();
162  synchronizeStdDeviationY();
163  return;
164  }
165 
166  if (attrName == SVGNames::inAttr) {
167  synchronizeIn1();
168  return;
169  }
170 
171  if (attrName == SVGNames::dxAttr) {
172  synchronizeDx();
173  return;
174  }
175 
176  if (attrName == SVGNames::dyAttr) {
177  synchronizeDy();
178  return;
179  }
180 
181  ASSERT_NOT_REACHED();
182 }
183 
184153PassRefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
185154{
186155 RenderObject* renderer = this->renderer();
90666

Source/WebCore/svg/SVGFEDropShadowElement.h

@@private:
3939 bool isSupportedAttribute(const QualifiedName&);
4040 virtual void parseMappedAttribute(Attribute*);
4141 virtual void svgAttributeChanged(const QualifiedName&);
42  virtual void synchronizeProperty(const QualifiedName&);
4342 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
4443
4544 static const AtomicString& stdDeviationXIdentifier();
4645 static const AtomicString& stdDeviationYIdentifier();
4746
48  // Animated property declarations
49  DECLARE_ANIMATED_STRING(In1, in1)
50  DECLARE_ANIMATED_NUMBER(Dx, dx)
51  DECLARE_ANIMATED_NUMBER(Dy, dy)
52  DECLARE_ANIMATED_NUMBER(StdDeviationX, stdDeviationX)
53  DECLARE_ANIMATED_NUMBER(StdDeviationY, stdDeviationY)
 47 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEDropShadowElement)
 48 DECLARE_ANIMATED_STRING(In1, in1)
 49 DECLARE_ANIMATED_NUMBER(Dx, dx)
 50 DECLARE_ANIMATED_NUMBER(Dy, dy)
 51 DECLARE_ANIMATED_NUMBER(StdDeviationX, stdDeviationX)
 52 DECLARE_ANIMATED_NUMBER(StdDeviationY, stdDeviationY)
 53 END_DECLARE_ANIMATED_PROPERTIES
5454};
5555
5656} // namespace WebCore
90666

Source/WebCore/svg/SVGFEFloodElement.cpp

@@PassRefPtr<FilterEffect> SVGFEFloodEleme
7474 return FEFlood::create(filter, color, opacity);
7575}
7676
77 AttributeToPropertyTypeMap& SVGFEFloodElement::attributeToPropertyTypeMap()
78 {
79  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
80  return s_attributeToPropertyTypeMap;
81 }
82 
83 void SVGFEFloodElement::fillAttributeToPropertyTypeMap()
84 {
85  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap());
86 }
87 
8877}
8978
9079#endif // ENABLE(SVG) && ENABLE(FILTERS)
91 
92 // vim:ts=4:noet
90666

Source/WebCore/svg/SVGFEFloodElement.h

@@public:
3434private:
3535 SVGFEFloodElement(const QualifiedName&, Document*);
3636
37  virtual void fillAttributeToPropertyTypeMap();
38  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
3937 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName);
4038 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
4139};
90666

Source/WebCore/svg/SVGFEGaussianBlurElement.cpp

@@DEFINE_ANIMATED_STRING(SVGFEGaussianBlur
3737DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, stdDeviationXIdentifier(), StdDeviationX, stdDeviationX)
3838DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, stdDeviationYIdentifier(), StdDeviationY, stdDeviationY)
3939
 40BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEGaussianBlurElement)
 41 REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
 42 REGISTER_LOCAL_ANIMATED_PROPERTY(stdDeviationX)
 43 REGISTER_LOCAL_ANIMATED_PROPERTY(stdDeviationY)
 44 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 45END_REGISTER_ANIMATED_PROPERTIES
 46
4047inline SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(const QualifiedName& tagName, Document* document)
4148 : SVGFilterPrimitiveStandardAttributes(tagName, document)
4249{
4350 ASSERT(hasTagName(SVGNames::feGaussianBlurTag));
 51 registerAnimatedPropertiesForSVGFEGaussianBlurElement();
4452}
4553
4654PassRefPtr<SVGFEGaussianBlurElement> SVGFEGaussianBlurElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFEGaussianBlurElement::svgAttrib
119127 ASSERT_NOT_REACHED();
120128}
121129
122 void SVGFEGaussianBlurElement::synchronizeProperty(const QualifiedName& attrName)
123 {
124  if (attrName == anyQName()) {
125  synchronizeStdDeviationX();
126  synchronizeStdDeviationY();
127  synchronizeIn1();
128  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
129  return;
130  }
131 
132  if (!isSupportedAttribute(attrName)) {
133  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
134  return;
135  }
136 
137  if (attrName == SVGNames::stdDeviationAttr) {
138  synchronizeStdDeviationX();
139  synchronizeStdDeviationY();
140  return;
141  }
142 
143  if (attrName == SVGNames::inAttr) {
144  synchronizeIn1();
145  return;
146  }
147 
148  ASSERT_NOT_REACHED();
149 }
150 
151 AttributeToPropertyTypeMap& SVGFEGaussianBlurElement::attributeToPropertyTypeMap()
152 {
153  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
154  return s_attributeToPropertyTypeMap;
155 }
156 
157 void SVGFEGaussianBlurElement::fillAttributeToPropertyTypeMap()
158 {
159  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
160 
161  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
162  attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
163  attributeToPropertyTypeMap.set(SVGNames::stdDeviationAttr, AnimatedNumberOptionalNumber);
164 }
165 
166130PassRefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
167131{
168132 FilterEffect* input1 = filterBuilder->getEffectById(in1());
90666

Source/WebCore/svg/SVGFEGaussianBlurElement.h

@@private:
4040 bool isSupportedAttribute(const QualifiedName&);
4141 virtual void parseMappedAttribute(Attribute*);
4242 virtual void svgAttributeChanged(const QualifiedName&);
43  virtual void synchronizeProperty(const QualifiedName&);
44  virtual void fillAttributeToPropertyTypeMap();
45  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
4643 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
4744
4845 static const AtomicString& stdDeviationXIdentifier();
4946 static const AtomicString& stdDeviationYIdentifier();
5047
51  // Animated property declarations
52  DECLARE_ANIMATED_STRING(In1, in1)
53  DECLARE_ANIMATED_NUMBER(StdDeviationX, stdDeviationX)
54  DECLARE_ANIMATED_NUMBER(StdDeviationY, stdDeviationY)
 48 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEGaussianBlurElement)
 49 DECLARE_ANIMATED_STRING(In1, in1)
 50 DECLARE_ANIMATED_NUMBER(StdDeviationX, stdDeviationX)
 51 DECLARE_ANIMATED_NUMBER(StdDeviationY, stdDeviationY)
 52 END_DECLARE_ANIMATED_PROPERTIES
5553};
5654
5755} // namespace WebCore
90666

Source/WebCore/svg/SVGFEImageElement.cpp

@@DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGF
4444DEFINE_ANIMATED_STRING(SVGFEImageElement, XLinkNames::hrefAttr, Href, href)
4545DEFINE_ANIMATED_BOOLEAN(SVGFEImageElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
4646
 47BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEImageElement)
 48 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
 49 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
 50 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 51 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 52END_REGISTER_ANIMATED_PROPERTIES
 53
4754inline SVGFEImageElement::SVGFEImageElement(const QualifiedName& tagName, Document* document)
4855 : SVGFilterPrimitiveStandardAttributes(tagName, document)
4956{
5057 ASSERT(hasTagName(SVGNames::feImageTag));
 58 registerAnimatedPropertiesForSVGFEImageElement();
5159}
5260
5361PassRefPtr<SVGFEImageElement> SVGFEImageElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFEImageElement::svgAttributeChan
138146 ASSERT_NOT_REACHED();
139147}
140148
141 void SVGFEImageElement::synchronizeProperty(const QualifiedName& attrName)
142 {
143  if (attrName == anyQName()) {
144  synchronizePreserveAspectRatio();
145  synchronizeHref();
146  synchronizeExternalResourcesRequired();
147  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
148  return;
149  }
150 
151  if (!isSupportedAttribute(attrName)) {
152  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
153  return;
154  }
155 
156  if (attrName == SVGNames::preserveAspectRatioAttr) {
157  synchronizePreserveAspectRatio();
158  return;
159  }
160 
161  if (SVGURIReference::isKnownAttribute(attrName)) {
162  synchronizeHref();
163  return;
164  }
165 
166  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
167  synchronizeExternalResourcesRequired();
168  return;
169  }
170 
171  ASSERT_NOT_REACHED();
172 }
173 
174 AttributeToPropertyTypeMap& SVGFEImageElement::attributeToPropertyTypeMap()
175 {
176  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
177  return s_attributeToPropertyTypeMap;
178 }
179 
180 void SVGFEImageElement::fillAttributeToPropertyTypeMap()
181 {
182  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
183 
184  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
185  attributeToPropertyTypeMap.set(SVGNames::preserveAspectRatioAttr, AnimatedPreserveAspectRatio);
186  attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
187 }
188 
189149void SVGFEImageElement::notifyFinished(CachedResource*)
190150{
191151 if (!inDocument())
90666

Source/WebCore/svg/SVGFEImageElement.h

@@private:
5151 bool isSupportedAttribute(const QualifiedName&);
5252 virtual void parseMappedAttribute(Attribute*);
5353 virtual void svgAttributeChanged(const QualifiedName&);
54  virtual void synchronizeProperty(const QualifiedName&);
55  virtual void fillAttributeToPropertyTypeMap();
56  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5754 virtual void notifyFinished(CachedResource*);
5855
5956 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;

@@private:
6158
6259 void requestImageResource();
6360
64  // Animated property declarations
65  DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
66 
67  // SVGURIReference
68  DECLARE_ANIMATED_STRING(Href, href)
69 
70  // SVGExternalResourcesRequired
71  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 61 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEImageElement)
 62 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
 63 DECLARE_ANIMATED_STRING(Href, href)
 64 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 65 END_DECLARE_ANIMATED_PROPERTIES
7266
7367 CachedResourceHandle<CachedImage> m_cachedImage;
7468 OwnPtr<ImageBuffer> m_targetImage;
90666

Source/WebCore/svg/SVGFELightElement.cpp

@@DEFINE_ANIMATED_NUMBER(SVGFELightElement
4848DEFINE_ANIMATED_NUMBER(SVGFELightElement, SVGNames::specularExponentAttr, SpecularExponent, specularExponent)
4949DEFINE_ANIMATED_NUMBER(SVGFELightElement, SVGNames::limitingConeAngleAttr, LimitingConeAngle, limitingConeAngle)
5050
 51BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFELightElement)
 52 REGISTER_LOCAL_ANIMATED_PROPERTY(azimuth)
 53 REGISTER_LOCAL_ANIMATED_PROPERTY(elevation)
 54 REGISTER_LOCAL_ANIMATED_PROPERTY(x)
 55 REGISTER_LOCAL_ANIMATED_PROPERTY(y)
 56 REGISTER_LOCAL_ANIMATED_PROPERTY(z)
 57 REGISTER_LOCAL_ANIMATED_PROPERTY(pointsAtX)
 58 REGISTER_LOCAL_ANIMATED_PROPERTY(pointsAtY)
 59 REGISTER_LOCAL_ANIMATED_PROPERTY(pointsAtZ)
 60 REGISTER_LOCAL_ANIMATED_PROPERTY(specularExponent)
 61 REGISTER_LOCAL_ANIMATED_PROPERTY(limitingConeAngle)
 62END_REGISTER_ANIMATED_PROPERTIES
 63
5164SVGFELightElement::SVGFELightElement(const QualifiedName& tagName, Document* document)
5265 : SVGElement(tagName, document)
5366 , m_specularExponent(1)
5467{
 68 registerAnimatedPropertiesForSVGFELightElement();
5569}
5670
5771SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement* svgElement)

@@void SVGFELightElement::svgAttributeChan
194208 ASSERT_NOT_REACHED();
195209}
196210
197 void SVGFELightElement::synchronizeProperty(const QualifiedName& attrName)
198 {
199  if (attrName == anyQName()) {
200  synchronizeAzimuth();
201  synchronizeElevation();
202  synchronizeX();
203  synchronizeY();
204  synchronizeZ();
205  synchronizePointsAtX();
206  synchronizePointsAtY();
207  synchronizePointsAtZ();
208  synchronizeSpecularExponent();
209  synchronizeLimitingConeAngle();
210  SVGElement::synchronizeProperty(attrName);
211  return;
212  }
213 
214  if (!isSupportedAttribute(attrName)) {
215  SVGElement::synchronizeProperty(attrName);
216  return;
217  }
218 
219  if (attrName == SVGNames::azimuthAttr) {
220  synchronizeAzimuth();
221  return;
222  }
223 
224  if (attrName == SVGNames::elevationAttr) {
225  synchronizeElevation();
226  return;
227  }
228 
229  if (attrName == SVGNames::xAttr) {
230  synchronizeX();
231  return;
232  }
233 
234  if (attrName == SVGNames::yAttr) {
235  synchronizeY();
236  return;
237  }
238 
239  if (attrName == SVGNames::zAttr) {
240  synchronizeZ();
241  return;
242  }
243 
244  if (attrName == SVGNames::pointsAtXAttr) {
245  synchronizePointsAtX();
246  return;
247  }
248 
249  if (attrName == SVGNames::pointsAtYAttr) {
250  synchronizePointsAtY();
251  return;
252  }
253 
254  if (attrName == SVGNames::pointsAtZAttr) {
255  synchronizePointsAtZ();
256  return;
257  }
258 
259  if (attrName == SVGNames::specularExponentAttr) {
260  synchronizeSpecularExponent();
261  return;
262  }
263 
264  if (attrName == SVGNames::limitingConeAngleAttr) {
265  synchronizeLimitingConeAngle();
266  return;
267  }
268 
269  ASSERT_NOT_REACHED();
270 }
271 
272 AttributeToPropertyTypeMap& SVGFELightElement::attributeToPropertyTypeMap()
273 {
274  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
275  return s_attributeToPropertyTypeMap;
276 }
277 
278 void SVGFELightElement::fillAttributeToPropertyTypeMap()
279 {
280  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
281  attributeToPropertyTypeMap.set(SVGNames::azimuthAttr, AnimatedNumber);
282  attributeToPropertyTypeMap.set(SVGNames::elevationAttr, AnimatedNumber);
283  attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedNumber);
284  attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedNumber);
285  attributeToPropertyTypeMap.set(SVGNames::zAttr, AnimatedNumber);
286  attributeToPropertyTypeMap.set(SVGNames::pointsAtXAttr, AnimatedNumber);
287  attributeToPropertyTypeMap.set(SVGNames::pointsAtYAttr, AnimatedNumber);
288  attributeToPropertyTypeMap.set(SVGNames::pointsAtZAttr, AnimatedNumber);
289  attributeToPropertyTypeMap.set(SVGNames::specularExponentAttr, AnimatedNumber);
290  attributeToPropertyTypeMap.set(SVGNames::limitingConeAngleAttr, AnimatedNumber);
291 }
292 
293211void SVGFELightElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
294212{
295213 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
90666

Source/WebCore/svg/SVGFELightElement.h

@@private:
4242 bool isSupportedAttribute(const QualifiedName&);
4343 virtual void parseMappedAttribute(Attribute*);
4444 virtual void svgAttributeChanged(const QualifiedName&);
45  virtual void synchronizeProperty(const QualifiedName&);
46  virtual void fillAttributeToPropertyTypeMap();
47  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
4845 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
4946
50  // Animated property declarations
51  DECLARE_ANIMATED_NUMBER(Azimuth, azimuth)
52  DECLARE_ANIMATED_NUMBER(Elevation, elevation)
53  DECLARE_ANIMATED_NUMBER(X, x)
54  DECLARE_ANIMATED_NUMBER(Y, y)
55  DECLARE_ANIMATED_NUMBER(Z, z)
56  DECLARE_ANIMATED_NUMBER(PointsAtX, pointsAtX)
57  DECLARE_ANIMATED_NUMBER(PointsAtY, pointsAtY)
58  DECLARE_ANIMATED_NUMBER(PointsAtZ, pointsAtZ)
59  DECLARE_ANIMATED_NUMBER(SpecularExponent, specularExponent)
60  DECLARE_ANIMATED_NUMBER(LimitingConeAngle, limitingConeAngle)
 47 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFELightElement)
 48 DECLARE_ANIMATED_NUMBER(Azimuth, azimuth)
 49 DECLARE_ANIMATED_NUMBER(Elevation, elevation)
 50 DECLARE_ANIMATED_NUMBER(X, x)
 51 DECLARE_ANIMATED_NUMBER(Y, y)
 52 DECLARE_ANIMATED_NUMBER(Z, z)
 53 DECLARE_ANIMATED_NUMBER(PointsAtX, pointsAtX)
 54 DECLARE_ANIMATED_NUMBER(PointsAtY, pointsAtY)
 55 DECLARE_ANIMATED_NUMBER(PointsAtZ, pointsAtZ)
 56 DECLARE_ANIMATED_NUMBER(SpecularExponent, specularExponent)
 57 DECLARE_ANIMATED_NUMBER(LimitingConeAngle, limitingConeAngle)
 58 END_DECLARE_ANIMATED_PROPERTIES
6159};
6260
6361} // namespace WebCore
90666

Source/WebCore/svg/SVGFEMergeElement.cpp

@@PassRefPtr<FilterEffect> SVGFEMergeEleme
6060 return effect.release();
6161}
6262
63 AttributeToPropertyTypeMap& SVGFEMergeElement::attributeToPropertyTypeMap()
64 {
65  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
66  return s_attributeToPropertyTypeMap;
67 }
68 
69 void SVGFEMergeElement::fillAttributeToPropertyTypeMap()
70 {
71  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap());
72 }
73 
7463}
7564
7665#endif // ENABLE(SVG)
77 
78 // vim:ts=4:noet
90666

Source/WebCore/svg/SVGFEMergeElement.h

@@public:
3434private:
3535 SVGFEMergeElement(const QualifiedName&, Document*);
3636
37  virtual void fillAttributeToPropertyTypeMap();
38  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
3937 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
4038};
4139
90666

Source/WebCore/svg/SVGFEMergeNodeElement.cpp

@@namespace WebCore {
3535// Animated property definitions
3636DEFINE_ANIMATED_STRING(SVGFEMergeNodeElement, SVGNames::inAttr, In1, in1)
3737
 38BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEMergeNodeElement)
 39 REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
 40END_REGISTER_ANIMATED_PROPERTIES
 41
3842inline SVGFEMergeNodeElement::SVGFEMergeNodeElement(const QualifiedName& tagName, Document* document)
3943 : SVGElement(tagName, document)
4044{
4145 ASSERT(hasTagName(SVGNames::feMergeNodeTag));
 46 registerAnimatedPropertiesForSVGFEMergeNodeElement();
4247}
4348
4449PassRefPtr<SVGFEMergeNodeElement> SVGFEMergeNodeElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFEMergeNodeElement::svgAttribute
9499 ASSERT_NOT_REACHED();
95100}
96101
97 AttributeToPropertyTypeMap& SVGFEMergeNodeElement::attributeToPropertyTypeMap()
98 {
99  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
100  return s_attributeToPropertyTypeMap;
101 }
102 
103 void SVGFEMergeNodeElement::fillAttributeToPropertyTypeMap()
104 {
105  attributeToPropertyTypeMap().set(SVGNames::inAttr, AnimatedString);
106 }
107 
108 void SVGFEMergeNodeElement::synchronizeProperty(const QualifiedName& attrName)
109 {
110  if (attrName == anyQName()) {
111  synchronizeIn1();
112  SVGElement::synchronizeProperty(attrName);
113  return;
114  }
115 
116  if (!isSupportedAttribute(attrName)) {
117  SVGElement::synchronizeProperty(attrName);
118  return;
119  }
120 
121  if (attrName == SVGNames::inAttr) {
122  synchronizeIn1();
123  return;
124  }
125 
126  ASSERT_NOT_REACHED();
127 }
128 
129102}
130103
131104#endif // ENABLE(SVG)
90666

Source/WebCore/svg/SVGFEMergeNodeElement.h

@@private:
3737 bool isSupportedAttribute(const QualifiedName&);
3838 virtual void parseMappedAttribute(Attribute*);
3939 virtual void svgAttributeChanged(const QualifiedName&);
40  virtual void synchronizeProperty(const QualifiedName&);
41  virtual void fillAttributeToPropertyTypeMap();
42  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
4340
44  // Animated property declarations
45  DECLARE_ANIMATED_STRING(In1, in1)
 41 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEMergeNodeElement)
 42 DECLARE_ANIMATED_STRING(In1, in1)
 43 END_DECLARE_ANIMATED_PROPERTIES
4644};
4745
4846} // namespace WebCore
90666

Source/WebCore/svg/SVGFEMorphologyElement.cpp

@@DEFINE_ANIMATED_ENUMERATION(SVGFEMorphol
3737DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, radiusXIdentifier(), RadiusX, radiusX)
3838DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, radiusYIdentifier(), RadiusY, radiusY)
3939
 40BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEMorphologyElement)
 41 REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
 42 REGISTER_LOCAL_ANIMATED_PROPERTY(_operator)
 43 REGISTER_LOCAL_ANIMATED_PROPERTY(radiusX)
 44 REGISTER_LOCAL_ANIMATED_PROPERTY(radiusY)
 45 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 46END_REGISTER_ANIMATED_PROPERTIES
 47
4048inline SVGFEMorphologyElement::SVGFEMorphologyElement(const QualifiedName& tagName, Document* document)
4149 : SVGFilterPrimitiveStandardAttributes(tagName, document)
4250 , m__operator(FEMORPHOLOGY_OPERATOR_ERODE)
4351{
4452 ASSERT(hasTagName(SVGNames::feMorphologyTag));
 53 registerAnimatedPropertiesForSVGFEMorphologyElement();
4554}
4655
4756PassRefPtr<SVGFEMorphologyElement> SVGFEMorphologyElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFEMorphologyElement::svgAttribut
145154 ASSERT_NOT_REACHED();
146155}
147156
148 void SVGFEMorphologyElement::synchronizeProperty(const QualifiedName& attrName)
149 {
150  if (attrName == anyQName()) {
151  synchronize_operator();
152  synchronizeIn1();
153  synchronizeRadiusX();
154  synchronizeRadiusY();
155  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
156  return;
157  }
158 
159  if (!isSupportedAttribute(attrName)) {
160  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
161  return;
162  }
163 
164  if (attrName == SVGNames::operatorAttr) {
165  synchronize_operator();
166  return;
167  }
168 
169  if (attrName == SVGNames::inAttr) {
170  synchronizeIn1();
171  return;
172  }
173 
174  if (attrName == SVGNames::radiusAttr) {
175  synchronizeRadiusX();
176  synchronizeRadiusY();
177  return;
178  }
179 
180  ASSERT_NOT_REACHED();
181 }
182 
183 AttributeToPropertyTypeMap& SVGFEMorphologyElement::attributeToPropertyTypeMap()
184 {
185  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
186  return s_attributeToPropertyTypeMap;
187 }
188 
189 void SVGFEMorphologyElement::fillAttributeToPropertyTypeMap()
190 {
191  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
192 
193  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
194  attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
195  attributeToPropertyTypeMap.set(SVGNames::operatorAttr, AnimatedEnumeration);
196  attributeToPropertyTypeMap.set(SVGNames::radiusAttr, AnimatedNumberOptionalNumber);
197 }
198 
199157PassRefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
200158{
201159 FilterEffect* input1 = filterBuilder->getEffectById(in1());
90666

Source/WebCore/svg/SVGFEMorphologyElement.h

@@private:
7070 virtual void parseMappedAttribute(Attribute*);
7171 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
7272 virtual void svgAttributeChanged(const QualifiedName&);
73  virtual void synchronizeProperty(const QualifiedName&);
74  virtual void fillAttributeToPropertyTypeMap();
75  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
7673 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
7774
7875 static const AtomicString& radiusXIdentifier();
7976 static const AtomicString& radiusYIdentifier();
8077
81  // Animated property declarations
82  DECLARE_ANIMATED_STRING(In1, in1)
83  DECLARE_ANIMATED_ENUMERATION(_operator, _operator, MorphologyOperatorType)
84  DECLARE_ANIMATED_NUMBER(RadiusX, radiusX)
85  DECLARE_ANIMATED_NUMBER(RadiusY, radiusY)
 78 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEMorphologyElement)
 79 DECLARE_ANIMATED_STRING(In1, in1)
 80 DECLARE_ANIMATED_ENUMERATION(_operator, _operator, MorphologyOperatorType)
 81 DECLARE_ANIMATED_NUMBER(RadiusX, radiusX)
 82 DECLARE_ANIMATED_NUMBER(RadiusY, radiusY)
 83 END_DECLARE_ANIMATED_PROPERTIES
8684};
8785
8886} // namespace WebCore
90666

Source/WebCore/svg/SVGFEOffsetElement.cpp

@@DEFINE_ANIMATED_STRING(SVGFEOffsetElemen
3636DEFINE_ANIMATED_NUMBER(SVGFEOffsetElement, SVGNames::dxAttr, Dx, dx)
3737DEFINE_ANIMATED_NUMBER(SVGFEOffsetElement, SVGNames::dyAttr, Dy, dy)
3838
 39BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEOffsetElement)
 40 REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
 41 REGISTER_LOCAL_ANIMATED_PROPERTY(dx)
 42 REGISTER_LOCAL_ANIMATED_PROPERTY(dy)
 43 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 44END_REGISTER_ANIMATED_PROPERTIES
 45
3946inline SVGFEOffsetElement::SVGFEOffsetElement(const QualifiedName& tagName, Document* document)
4047 : SVGFilterPrimitiveStandardAttributes(tagName, document)
4148{
4249 ASSERT(hasTagName(SVGNames::feOffsetTag));
 50 registerAnimatedPropertiesForSVGFEOffsetElement();
4351}
4452
4553PassRefPtr<SVGFEOffsetElement> SVGFEOffsetElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFEOffsetElement::svgAttributeCha
101109 ASSERT_NOT_REACHED();
102110}
103111
104 void SVGFEOffsetElement::synchronizeProperty(const QualifiedName& attrName)
105 {
106  if (attrName == anyQName()) {
107  synchronizeDx();
108  synchronizeDy();
109  synchronizeIn1();
110  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
111  return;
112  }
113 
114  if (!isSupportedAttribute(attrName)) {
115  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
116  return;
117  }
118 
119  if (attrName == SVGNames::dxAttr) {
120  synchronizeDx();
121  return;
122  }
123 
124  if (attrName == SVGNames::dyAttr) {
125  synchronizeDy();
126  return;
127  }
128 
129  if (attrName == SVGNames::inAttr) {
130  synchronizeIn1();
131  return;
132  }
133 
134  ASSERT_NOT_REACHED();
135 }
136 
137 AttributeToPropertyTypeMap& SVGFEOffsetElement::attributeToPropertyTypeMap()
138 {
139  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
140  return s_attributeToPropertyTypeMap;
141 }
142 
143 void SVGFEOffsetElement::fillAttributeToPropertyTypeMap()
144 {
145  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
146 
147  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
148  attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
149  attributeToPropertyTypeMap.set(SVGNames::dxAttr, AnimatedNumber);
150  attributeToPropertyTypeMap.set(SVGNames::dyAttr, AnimatedNumber);
151 }
152 
153112PassRefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
154113{
155114 FilterEffect* input1 = filterBuilder->getEffectById(in1());
90666

Source/WebCore/svg/SVGFEOffsetElement.h

@@private:
3838 bool isSupportedAttribute(const QualifiedName&);
3939 virtual void parseMappedAttribute(Attribute*);
4040 virtual void svgAttributeChanged(const QualifiedName&);
41  virtual void synchronizeProperty(const QualifiedName&);
42  virtual void fillAttributeToPropertyTypeMap();
43  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
4441 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
4542
46  // Animated property declarations
47  DECLARE_ANIMATED_STRING(In1, in1)
48  DECLARE_ANIMATED_NUMBER(Dx, dx)
49  DECLARE_ANIMATED_NUMBER(Dy, dy)
 43 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEOffsetElement)
 44 DECLARE_ANIMATED_STRING(In1, in1)
 45 DECLARE_ANIMATED_NUMBER(Dx, dx)
 46 DECLARE_ANIMATED_NUMBER(Dy, dy)
 47 END_DECLARE_ANIMATED_PROPERTIES
5048};
5149
5250} // namespace WebCore
90666

Source/WebCore/svg/SVGFESpecularLightingElement.cpp

@@DEFINE_ANIMATED_NUMBER(SVGFESpecularLigh
4444DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), KernelUnitLengthX, kernelUnitLengthX)
4545DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), KernelUnitLengthY, kernelUnitLengthY)
4646
 47BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFESpecularLightingElement)
 48 REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
 49 REGISTER_LOCAL_ANIMATED_PROPERTY(specularConstant)
 50 REGISTER_LOCAL_ANIMATED_PROPERTY(specularExponent)
 51 REGISTER_LOCAL_ANIMATED_PROPERTY(surfaceScale)
 52 REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthX)
 53 REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthY)
 54 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 55END_REGISTER_ANIMATED_PROPERTIES
 56
4757inline SVGFESpecularLightingElement::SVGFESpecularLightingElement(const QualifiedName& tagName, Document* document)
4858 : SVGFilterPrimitiveStandardAttributes(tagName, document)
4959 , m_specularConstant(1)

@@inline SVGFESpecularLightingElement::SVG
5161 , m_surfaceScale(1)
5262{
5363 ASSERT(hasTagName(SVGNames::feSpecularLightingTag));
 64 registerAnimatedPropertiesForSVGFESpecularLightingElement();
5465}
5566
5667PassRefPtr<SVGFESpecularLightingElement> SVGFESpecularLightingElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFESpecularLightingElement::light
204215 primitiveAttributeChanged(attrName);
205216}
206217
207 void SVGFESpecularLightingElement::synchronizeProperty(const QualifiedName& attrName)
208 {
209  if (attrName == anyQName()) {
210  synchronizeIn1();
211  synchronizeSurfaceScale();
212  synchronizeSpecularConstant();
213  synchronizeSpecularExponent();
214  synchronizeKernelUnitLengthX();
215  synchronizeKernelUnitLengthY();
216  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
217  return;
218  }
219 
220  if (!isSupportedAttribute(attrName)) {
221  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
222  return;
223  }
224 
225  if (attrName == SVGNames::inAttr) {
226  synchronizeIn1();
227  return;
228  }
229 
230  if (attrName == SVGNames::surfaceScaleAttr) {
231  synchronizeSurfaceScale();
232  return;
233  }
234 
235  if (attrName == SVGNames::specularConstantAttr) {
236  synchronizeSpecularConstant();
237  return;
238  }
239 
240  if (attrName == SVGNames::specularExponentAttr) {
241  synchronizeSpecularExponent();
242  return;
243  }
244 
245  if (attrName == SVGNames::kernelUnitLengthAttr) {
246  synchronizeKernelUnitLengthX();
247  synchronizeKernelUnitLengthY();
248  return;
249  }
250 
251  ASSERT_NOT_REACHED();
252 }
253 
254 AttributeToPropertyTypeMap& SVGFESpecularLightingElement::attributeToPropertyTypeMap()
255 {
256  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
257  return s_attributeToPropertyTypeMap;
258 }
259 
260 void SVGFESpecularLightingElement::fillAttributeToPropertyTypeMap()
261 {
262  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
263 
264  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
265  attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
266  attributeToPropertyTypeMap.set(SVGNames::specularConstantAttr, AnimatedNumber);
267  attributeToPropertyTypeMap.set(SVGNames::specularExponentAttr, AnimatedNumber);
268  attributeToPropertyTypeMap.set(SVGNames::surfaceScaleAttr, AnimatedNumber);
269  attributeToPropertyTypeMap.set(SVGNames::kernelUnitLengthAttr, AnimatedNumberOptionalNumber);
270 }
271 
272218PassRefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
273219{
274220 FilterEffect* input1 = filterBuilder->getEffectById(in1());
90666

Source/WebCore/svg/SVGFESpecularLightingElement.h

@@private:
4242 virtual void parseMappedAttribute(Attribute*);
4343 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
4444 virtual void svgAttributeChanged(const QualifiedName&);
45  virtual void synchronizeProperty(const QualifiedName&);
46  virtual void fillAttributeToPropertyTypeMap();
47  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
4845 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
4946
5047 static const AtomicString& kernelUnitLengthXIdentifier();
5148 static const AtomicString& kernelUnitLengthYIdentifier();
5249
53  // Animated property declarations
54  DECLARE_ANIMATED_STRING(In1, in1)
55  DECLARE_ANIMATED_NUMBER(SpecularConstant, specularConstant)
56  DECLARE_ANIMATED_NUMBER(SpecularExponent, specularExponent)
57  DECLARE_ANIMATED_NUMBER(SurfaceScale, surfaceScale)
58  DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
59  DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
 50 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFESpecularLightingElement)
 51 DECLARE_ANIMATED_STRING(In1, in1)
 52 DECLARE_ANIMATED_NUMBER(SpecularConstant, specularConstant)
 53 DECLARE_ANIMATED_NUMBER(SpecularExponent, specularExponent)
 54 DECLARE_ANIMATED_NUMBER(SurfaceScale, surfaceScale)
 55 DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
 56 DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
 57 END_DECLARE_ANIMATED_PROPERTIES
6058};
6159
6260} // namespace WebCore
90666

Source/WebCore/svg/SVGFETileElement.cpp

@@namespace WebCore {
3535// Animated property definitions
3636DEFINE_ANIMATED_STRING(SVGFETileElement, SVGNames::inAttr, In1, in1)
3737
 38BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFETileElement)
 39 REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
 40 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 41END_REGISTER_ANIMATED_PROPERTIES
 42
3843inline SVGFETileElement::SVGFETileElement(const QualifiedName& tagName, Document* document)
3944 : SVGFilterPrimitiveStandardAttributes(tagName, document)
4045{
4146 ASSERT(hasTagName(SVGNames::feTileTag));
 47 registerAnimatedPropertiesForSVGFETileElement();
4248}
4349
4450PassRefPtr<SVGFETileElement> SVGFETileElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFETileElement::svgAttributeChang
8692 ASSERT_NOT_REACHED();
8793}
8894
89 void SVGFETileElement::synchronizeProperty(const QualifiedName& attrName)
90 {
91  if (attrName == anyQName()) {
92  synchronizeIn1();
93  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
94  return;
95  }
96 
97  if (!isSupportedAttribute(attrName)) {
98  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
99  return;
100  }
101 
102  if (attrName == SVGNames::inAttr) {
103  synchronizeIn1();
104  return;
105  }
106 
107  ASSERT_NOT_REACHED();
108 }
109 
110 AttributeToPropertyTypeMap& SVGFETileElement::attributeToPropertyTypeMap()
111 {
112  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
113  return s_attributeToPropertyTypeMap;
114 }
115 
116 void SVGFETileElement::fillAttributeToPropertyTypeMap()
117 {
118  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
119 
120  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
121  attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
122 }
123 
12495PassRefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
12596{
12697 FilterEffect* input1 = filterBuilder->getEffectById(in1());
90666

Source/WebCore/svg/SVGFETileElement.h

@@private:
3737 bool isSupportedAttribute(const QualifiedName&);
3838 virtual void parseMappedAttribute(Attribute*);
3939 virtual void svgAttributeChanged(const QualifiedName&);
40  virtual void synchronizeProperty(const QualifiedName&);
41  virtual void fillAttributeToPropertyTypeMap();
42  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
4340 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
4441
45  // Animated property declarations
46  DECLARE_ANIMATED_STRING(In1, in1)
 42 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFETileElement)
 43 DECLARE_ANIMATED_STRING(In1, in1)
 44 END_DECLARE_ANIMATED_PROPERTIES
4745};
4846
4947} // namespace WebCore
90666

Source/WebCore/svg/SVGFETurbulenceElement.cpp

@@DEFINE_ANIMATED_NUMBER(SVGFETurbulenceEl
3838DEFINE_ANIMATED_ENUMERATION(SVGFETurbulenceElement, SVGNames::stitchTilesAttr, StitchTiles, stitchTiles, SVGStitchOptions)
3939DEFINE_ANIMATED_ENUMERATION(SVGFETurbulenceElement, SVGNames::typeAttr, Type, type, TurbulenceType)
4040
 41BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFETurbulenceElement)
 42 REGISTER_LOCAL_ANIMATED_PROPERTY(baseFrequencyX)
 43 REGISTER_LOCAL_ANIMATED_PROPERTY(baseFrequencyY)
 44 REGISTER_LOCAL_ANIMATED_PROPERTY(numOctaves)
 45 REGISTER_LOCAL_ANIMATED_PROPERTY(seed)
 46 REGISTER_LOCAL_ANIMATED_PROPERTY(stitchTiles)
 47 REGISTER_LOCAL_ANIMATED_PROPERTY(type)
 48 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 49END_REGISTER_ANIMATED_PROPERTIES
 50
4151inline SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagName, Document* document)
4252 : SVGFilterPrimitiveStandardAttributes(tagName, document)
4353 , m_numOctaves(1)

@@inline SVGFETurbulenceElement::SVGFETurb
4555 , m_type(FETURBULENCE_TYPE_TURBULENCE)
4656{
4757 ASSERT(hasTagName(SVGNames::feTurbulenceTag));
 58 registerAnimatedPropertiesForSVGFETurbulenceElement();
4859}
4960
5061PassRefPtr<SVGFETurbulenceElement> SVGFETurbulenceElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFETurbulenceElement::svgAttribut
160171 ASSERT_NOT_REACHED();
161172}
162173
163 void SVGFETurbulenceElement::synchronizeProperty(const QualifiedName& attrName)
164 {
165  if (attrName == anyQName()) {
166  synchronizeType();
167  synchronizeStitchTiles();
168  synchronizeBaseFrequencyX();
169  synchronizeBaseFrequencyY();
170  synchronizeSeed();
171  synchronizeNumOctaves();
172  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
173  return;
174  }
175 
176  if (!isSupportedAttribute(attrName)) {
177  SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
178  return;
179  }
180 
181  if (attrName == SVGNames::typeAttr) {
182  synchronizeType();
183  return;
184  }
185 
186  if (attrName == SVGNames::stitchTilesAttr) {
187  synchronizeStitchTiles();
188  return;
189  }
190 
191  if (attrName == SVGNames::baseFrequencyAttr) {
192  synchronizeBaseFrequencyX();
193  synchronizeBaseFrequencyY();
194  return;
195  }
196 
197  if (attrName == SVGNames::seedAttr) {
198  synchronizeSeed();
199  return;
200  }
201 
202  if (attrName == SVGNames::numOctavesAttr) {
203  synchronizeNumOctaves();
204  return;
205  }
206 
207  ASSERT_NOT_REACHED();
208 }
209 
210 AttributeToPropertyTypeMap& SVGFETurbulenceElement::attributeToPropertyTypeMap()
211 {
212  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
213  return s_attributeToPropertyTypeMap;
214 }
215 
216 void SVGFETurbulenceElement::fillAttributeToPropertyTypeMap()
217 {
218  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
219 
220  SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
221  attributeToPropertyTypeMap.set(SVGNames::baseFrequencyAttr, AnimatedNumberOptionalNumber);
222  attributeToPropertyTypeMap.set(SVGNames::numOctavesAttr, AnimatedInteger);
223  attributeToPropertyTypeMap.set(SVGNames::seedAttr, AnimatedNumber);
224  attributeToPropertyTypeMap.set(SVGNames::stitchTilesAttr, AnimatedEnumeration);
225  attributeToPropertyTypeMap.set(SVGNames::typeAttr, AnimatedEnumeration);
226 }
227 
228174PassRefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter* filter)
229175{
230176 if (baseFrequencyX() < 0 || baseFrequencyY() < 0)
90666

Source/WebCore/svg/SVGFETurbulenceElement.h

@@private:
105105 virtual void parseMappedAttribute(Attribute*);
106106 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName);
107107 virtual void svgAttributeChanged(const QualifiedName&);
108  virtual void synchronizeProperty(const QualifiedName&);
109  virtual void fillAttributeToPropertyTypeMap();
110  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
111108 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
112109
113110 static const AtomicString& baseFrequencyXIdentifier();
114111 static const AtomicString& baseFrequencyYIdentifier();
115112
116  // Animated property declarations
117  DECLARE_ANIMATED_NUMBER(BaseFrequencyX, baseFrequencyX)
118  DECLARE_ANIMATED_NUMBER(BaseFrequencyY, baseFrequencyY)
119  DECLARE_ANIMATED_INTEGER(NumOctaves, numOctaves)
120  DECLARE_ANIMATED_NUMBER(Seed, seed)
121  DECLARE_ANIMATED_ENUMERATION(StitchTiles, stitchTiles, SVGStitchOptions)
122  DECLARE_ANIMATED_ENUMERATION(Type, type, TurbulenceType)
 113 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFETurbulenceElement)
 114 DECLARE_ANIMATED_NUMBER(BaseFrequencyX, baseFrequencyX)
 115 DECLARE_ANIMATED_NUMBER(BaseFrequencyY, baseFrequencyY)
 116 DECLARE_ANIMATED_INTEGER(NumOctaves, numOctaves)
 117 DECLARE_ANIMATED_NUMBER(Seed, seed)
 118 DECLARE_ANIMATED_ENUMERATION(StitchTiles, stitchTiles, SVGStitchOptions)
 119 DECLARE_ANIMATED_ENUMERATION(Type, type, TurbulenceType)
 120 END_DECLARE_ANIMATED_PROPERTIES
123121};
124122
125123} // namespace WebCore
90666

Source/WebCore/svg/SVGFilterElement.cpp

@@DEFINE_ANIMATED_INTEGER_MULTIPLE_WRAPPER
4848DEFINE_ANIMATED_STRING(SVGFilterElement, XLinkNames::hrefAttr, Href, href)
4949DEFINE_ANIMATED_BOOLEAN(SVGFilterElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
5050
 51BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFilterElement)
 52 REGISTER_LOCAL_ANIMATED_PROPERTY(filterUnits)
 53 REGISTER_LOCAL_ANIMATED_PROPERTY(primitiveUnits)
 54 REGISTER_LOCAL_ANIMATED_PROPERTY(x)
 55 REGISTER_LOCAL_ANIMATED_PROPERTY(y)
 56 REGISTER_LOCAL_ANIMATED_PROPERTY(width)
 57 REGISTER_LOCAL_ANIMATED_PROPERTY(height)
 58 REGISTER_LOCAL_ANIMATED_PROPERTY(filterResX)
 59 REGISTER_LOCAL_ANIMATED_PROPERTY(filterResY)
 60 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
 61 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 62END_REGISTER_ANIMATED_PROPERTIES
 63
5164inline SVGFilterElement::SVGFilterElement(const QualifiedName& tagName, Document* document)
5265 : SVGStyledElement(tagName, document)
53  , SVGURIReference()
54  , SVGLangSpace()
55  , SVGExternalResourcesRequired()
5666 , m_filterUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
5767 , m_primitiveUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
5868 , m_x(LengthModeWidth, "-10%")

@@inline SVGFilterElement::SVGFilterElemen
6373 // Spec: If the x/y attribute is not specified, the effect is as if a value of "-10%" were specified.
6474 // Spec: If the width/height attribute is not specified, the effect is as if a value of "120%" were specified.
6575 ASSERT(hasTagName(SVGNames::filterTag));
 76 registerAnimatedPropertiesForSVGFilterElement();
6677}
6778
6879PassRefPtr<SVGFilterElement> SVGFilterElement::create(const QualifiedName& tagName, Document* document)

@@void SVGFilterElement::svgAttributeChang
189200 object->setNeedsLayout(true);
190201}
191202
192 void SVGFilterElement::synchronizeProperty(const QualifiedName& attrName)
193 {
194  if (attrName == anyQName()) {
195  synchronizeX();
196  synchronizeY();
197  synchronizeWidth();
198  synchronizeHeight();
199  synchronizeFilterUnits();
200  synchronizePrimitiveUnits();
201  synchronizeFilterResX();
202  synchronizeFilterResY();
203  synchronizeExternalResourcesRequired();
204  synchronizeHref();
205  SVGStyledElement::synchronizeProperty(attrName);
206  return;
207  }
208 
209  if (!isSupportedAttribute(attrName)) {
210  SVGStyledElement::synchronizeProperty(attrName);
211  return;
212  }
213 
214  if (attrName == SVGNames::xAttr) {
215  synchronizeX();
216  return;
217  }
218 
219  if (attrName == SVGNames::yAttr) {
220  synchronizeY();
221  return;
222  }
223 
224  if (attrName == SVGNames::widthAttr) {
225  synchronizeWidth();
226  return;
227  }
228 
229  if (attrName == SVGNames::heightAttr) {
230  synchronizeHeight();
231  return;
232  }
233 
234  if (attrName == SVGNames::filterUnitsAttr) {
235  synchronizeFilterUnits();
236  return;
237  }
238 
239  if (attrName == SVGNames::primitiveUnitsAttr) {
240  synchronizePrimitiveUnits();
241  return;
242  }
243 
244  if (attrName == SVGNames::filterResAttr) {
245  synchronizeFilterResX();
246  synchronizeFilterResY();
247  return;
248  }
249 
250  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
251  synchronizeExternalResourcesRequired();
252  return;
253  }
254 
255  if (SVGURIReference::isKnownAttribute(attrName)) {
256  synchronizeHref();
257  return;
258  }
259 
260  ASSERT_NOT_REACHED();
261 }
262 
263 AttributeToPropertyTypeMap& SVGFilterElement::attributeToPropertyTypeMap()
264 {
265  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
266  return s_attributeToPropertyTypeMap;
267 }
268 
269 void SVGFilterElement::fillAttributeToPropertyTypeMap()
270 {
271  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
272 
273  SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
274  attributeToPropertyTypeMap.set(SVGNames::filterUnitsAttr, AnimatedEnumeration);
275  attributeToPropertyTypeMap.set(SVGNames::primitiveUnitsAttr, AnimatedEnumeration);
276  attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
277  attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
278  attributeToPropertyTypeMap.set(SVGNames::widthAttr, AnimatedLength);
279  attributeToPropertyTypeMap.set(SVGNames::heightAttr, AnimatedLength);
280  attributeToPropertyTypeMap.set(SVGNames::filterResAttr, AnimatedNumberOptionalNumber);
281  attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
282 }
283 
284203void SVGFilterElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
285204{
286205 SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
90666

Source/WebCore/svg/SVGFilterElement.h

@@private:
5454 bool isSupportedAttribute(const QualifiedName&);
5555 virtual void parseMappedAttribute(Attribute*);
5656 virtual void svgAttributeChanged(const QualifiedName&);
57  virtual void synchronizeProperty(const QualifiedName&);
58  virtual void fillAttributeToPropertyTypeMap();
59  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
6057 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
6158
6259 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);

@@private:
6663 static const AtomicString& filterResXIdentifier();
6764 static const AtomicString& filterResYIdentifier();
6865
69  // Animated property declarations
70  DECLARE_ANIMATED_ENUMERATION(FilterUnits, filterUnits, SVGUnitTypes::SVGUnitType)
71  DECLARE_ANIMATED_ENUMERATION(PrimitiveUnits, primitiveUnits, SVGUnitTypes::SVGUnitType)
72  DECLARE_ANIMATED_LENGTH(X, x)
73  DECLARE_ANIMATED_LENGTH(Y, y)
74  DECLARE_ANIMATED_LENGTH(Width, width)
75  DECLARE_ANIMATED_LENGTH(Height, height)
76  DECLARE_ANIMATED_INTEGER(FilterResX, filterResX)
77  DECLARE_ANIMATED_INTEGER(FilterResY, filterResY)
78 
79  // SVGURIReference
80  DECLARE_ANIMATED_STRING(Href, href)
81 
82  // SVGExternalResourcesRequired
83  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 66 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFilterElement)
 67 DECLARE_ANIMATED_ENUMERATION(FilterUnits, filterUnits, SVGUnitTypes::SVGUnitType)
 68 DECLARE_ANIMATED_ENUMERATION(PrimitiveUnits, primitiveUnits, SVGUnitTypes::SVGUnitType)
 69 DECLARE_ANIMATED_LENGTH(X, x)
 70 DECLARE_ANIMATED_LENGTH(Y, y)
 71 DECLARE_ANIMATED_LENGTH(Width, width)
 72 DECLARE_ANIMATED_LENGTH(Height, height)
 73 DECLARE_ANIMATED_INTEGER(FilterResX, filterResX)
 74 DECLARE_ANIMATED_INTEGER(FilterResY, filterResY)
 75 DECLARE_ANIMATED_STRING(Href, href)
 76 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 77 END_DECLARE_ANIMATED_PROPERTIES
8478};
8579
8680}
90666

Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp

@@DEFINE_ANIMATED_LENGTH(SVGFilterPrimitiv
4343DEFINE_ANIMATED_LENGTH(SVGFilterPrimitiveStandardAttributes, SVGNames::heightAttr, Height, height)
4444DEFINE_ANIMATED_STRING(SVGFilterPrimitiveStandardAttributes, SVGNames::resultAttr, Result, result)
4545
 46BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 47 REGISTER_LOCAL_ANIMATED_PROPERTY(x)
 48 REGISTER_LOCAL_ANIMATED_PROPERTY(y)
 49 REGISTER_LOCAL_ANIMATED_PROPERTY(width)
 50 REGISTER_LOCAL_ANIMATED_PROPERTY(height)
 51 REGISTER_LOCAL_ANIMATED_PROPERTY(result)
 52 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
 53END_REGISTER_ANIMATED_PROPERTIES
 54
4655SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const QualifiedName& tagName, Document* document)
4756 : SVGStyledElement(tagName, document)
4857 , m_x(LengthModeWidth, "0%")

@@SVGFilterPrimitiveStandardAttributes::SV
5261{
5362 // Spec: If the x/y attribute is not specified, the effect is as if a value of "0%" were specified.
5463 // Spec: If the width/height attribute is not specified, the effect is as if a value of "100%" were specified.
 64 registerAnimatedPropertiesForSVGFilterPrimitiveStandardAttributes();
5565}
5666
5767bool SVGFilterPrimitiveStandardAttributes::isSupportedAttribute(const QualifiedName& attrName)

@@void SVGFilterPrimitiveStandardAttribute
121131 invalidate();
122132}
123133
124 void SVGFilterPrimitiveStandardAttributes::synchronizeProperty(const QualifiedName& attrName)
125 {
126  if (attrName == anyQName()) {
127  synchronizeX();
128  synchronizeY();
129  synchronizeWidth();
130  synchronizeHeight();
131  synchronizeResult();
132  SVGStyledElement::synchronizeProperty(attrName);
133  return;
134  }
135 
136  if (!isSupportedAttribute(attrName)) {
137  SVGStyledElement::synchronizeProperty(attrName);
138  return;
139  }
140 
141  if (attrName == SVGNames::xAttr) {
142  synchronizeX();
143  return;
144  }
145 
146  if (attrName == SVGNames::yAttr) {
147  synchronizeY();
148  return;
149  }
150 
151  if (attrName == SVGNames::widthAttr) {
152  synchronizeWidth();
153  return;
154  }
155 
156  if (attrName == SVGNames::heightAttr) {
157  synchronizeHeight();
158  return;
159  }
160 
161  if (attrName == SVGNames::resultAttr) {
162  synchronizeResult();
163  return;
164  }
165 
166  ASSERT_NOT_REACHED();
167 }
168 
169134void SVGFilterPrimitiveStandardAttributes::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
170135{
171136 SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);

@@void SVGFilterPrimitiveStandardAttribute
204169 filterEffect->setEffectBoundaries(effectBBox);
205170}
206171
207 void SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap& attributeToPropertyTypeMap)
208 {
209  SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
210 
211  attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
212  attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
213  attributeToPropertyTypeMap.set(SVGNames::widthAttr, AnimatedLength);
214  attributeToPropertyTypeMap.set(SVGNames::heightAttr, AnimatedLength);
215  attributeToPropertyTypeMap.set(SVGNames::resultAttr, AnimatedString);
216 }
217 
218172RenderObject* SVGFilterPrimitiveStandardAttributes::createRenderer(RenderArena* arena, RenderStyle*)
219173{
220174 return new (arena) RenderSVGResourceFilterPrimitive(this);
90666

Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h

@@protected:
5151 bool isSupportedAttribute(const QualifiedName&);
5252 virtual void parseMappedAttribute(Attribute*);
5353 virtual void svgAttributeChanged(const QualifiedName&);
54  virtual void synchronizeProperty(const QualifiedName&);
55  void fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap&);
5654 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
5755
5856 inline void invalidate()

@@private:
7371 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
7472 virtual bool rendererIsNeeded(const NodeRenderingContext&);
7573
76  // Animated property declarations
77  DECLARE_ANIMATED_LENGTH(X, x)
78  DECLARE_ANIMATED_LENGTH(Y, y)
79  DECLARE_ANIMATED_LENGTH(Width, width)
80  DECLARE_ANIMATED_LENGTH(Height, height)
81  DECLARE_ANIMATED_STRING(Result, result)
 74 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
 75 DECLARE_ANIMATED_LENGTH(X, x)
 76 DECLARE_ANIMATED_LENGTH(Y, y)
 77 DECLARE_ANIMATED_LENGTH(Width, width)
 78 DECLARE_ANIMATED_LENGTH(Height, height)
 79 DECLARE_ANIMATED_STRING(Result, result)
 80 END_DECLARE_ANIMATED_PROPERTIES
8281};
8382
8483} // namespace WebCore
90666

Source/WebCore/svg/SVGFitToViewBox.cpp

@@bool SVGFitToViewBox::parseMappedAttribu
104104 return false;
105105}
106106
107 void SVGFitToViewBox::synchronizeProperties(const QualifiedName& attrName)
108 {
109  if (attrName == anyQName()) {
110  synchronizeViewBox();
111  synchronizePreserveAspectRatio();
112  return;
113  }
114 
115  if (attrName == SVGNames::viewBoxAttr)
116  synchronizeViewBox();
117  else if (attrName == SVGNames::preserveAspectRatioAttr)
118  synchronizePreserveAspectRatio();
119 }
120 
121107bool SVGFitToViewBox::isKnownAttribute(const QualifiedName& attrName)
122108{
123109 return attrName == SVGNames::viewBoxAttr || attrName == SVGNames::preserveAspectRatioAttr;
90666

Source/WebCore/svg/SVGFitToViewBox.h

@@public:
4343 bool parseMappedAttribute(Document*, Attribute*);
4444 bool isKnownAttribute(const QualifiedName&);
4545 void addSupportedAttributes(HashSet<QualifiedName>&);
46  void synchronizeProperties(const QualifiedName&);
4746
4847 virtual void setViewBoxBaseValue(const FloatRect&) = 0;
4948 virtual void setPreserveAspectRatioBaseValue(const SVGPreserveAspectRatio&) = 0;
5049
51  virtual void synchronizeViewBox() = 0;
52  virtual void synchronizePreserveAspectRatio() = 0;
53 
5450private:
5551 bool parseViewBox(Document*, const String&, FloatRect&);
5652};
90666

Source/WebCore/svg/SVGFontElement.cpp

3636
3737namespace WebCore {
3838
39 // Animated property declarations
 39// Animated property definitions
4040DEFINE_ANIMATED_BOOLEAN(SVGFontElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
4141
 42BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFontElement)
 43 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 44 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
 45END_REGISTER_ANIMATED_PROPERTIES
 46
4247inline SVGFontElement::SVGFontElement(const QualifiedName& tagName, Document* document)
4348 : SVGStyledElement(tagName, document)
4449 , m_missingGlyph(0)
4550 , m_isGlyphCacheValid(false)
4651{
4752 ASSERT(hasTagName(SVGNames::fontTag));
 53 registerAnimatedPropertiesForSVGFontElement();
4854}
4955
5056PassRefPtr<SVGFontElement> SVGFontElement::create(const QualifiedName& tagName, Document* document)

@@PassRefPtr<SVGFontElement> SVGFontElemen
5258 return adoptRef(new SVGFontElement(tagName, document));
5359}
5460
55 void SVGFontElement::synchronizeProperty(const QualifiedName& attrName)
56 {
57  SVGStyledElement::synchronizeProperty(attrName);
58 
59  if (attrName == anyQName() || SVGExternalResourcesRequired::isKnownAttribute(attrName))
60  synchronizeExternalResourcesRequired();
61 }
62 
6361void SVGFontElement::invalidateGlyphCache()
6462{
6563 if (m_isGlyphCacheValid) {

@@Glyph SVGFontElement::missingGlyph()
259257 return m_missingGlyph;
260258}
261259
262 AttributeToPropertyTypeMap& SVGFontElement::attributeToPropertyTypeMap()
263 {
264  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
265  return s_attributeToPropertyTypeMap;
266 }
267 
268 void SVGFontElement::fillAttributeToPropertyTypeMap()
269 {
270  SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap());
271 }
272 
273260}
274261
275262#endif // ENABLE(SVG_FONTS)
90666

Source/WebCore/svg/SVGFontElement.h

@@public:
7373private:
7474 SVGFontElement(const QualifiedName&, Document*);
7575
76  virtual void synchronizeProperty(const QualifiedName&);
7776 virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }
78  virtual void fillAttributeToPropertyTypeMap();
79  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
8077
8178 void ensureGlyphCache();
8279 void registerLigaturesInGlyphCache(Vector<String>&);
8380
84  // Animated property declarations
85 
86  // SVGExternalResourcesRequired
87  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 81 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFontElement)
 82 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 83 END_DECLARE_ANIMATED_PROPERTIES
8884
8985 KerningPairVector m_horizontalKerningPairs;
9086 KerningPairVector m_verticalKerningPairs;
90666

Source/WebCore/svg/SVGForeignObjectElement.cpp

@@DEFINE_ANIMATED_LENGTH(SVGForeignObjectE
4242DEFINE_ANIMATED_STRING(SVGForeignObjectElement, XLinkNames::hrefAttr, Href, href)
4343DEFINE_ANIMATED_BOOLEAN(SVGForeignObjectElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
4444
 45BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGForeignObjectElement)
 46 REGISTER_LOCAL_ANIMATED_PROPERTY(x)
 47 REGISTER_LOCAL_ANIMATED_PROPERTY(y)
 48 REGISTER_LOCAL_ANIMATED_PROPERTY(width)
 49 REGISTER_LOCAL_ANIMATED_PROPERTY(height)
 50 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
 51 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 52 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 53 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 54END_REGISTER_ANIMATED_PROPERTIES
 55
4556inline SVGForeignObjectElement::SVGForeignObjectElement(const QualifiedName& tagName, Document* document)
4657 : SVGStyledTransformableElement(tagName, document)
4758 , m_x(LengthModeWidth)

@@inline SVGForeignObjectElement::SVGForei
5061 , m_height(LengthModeHeight)
5162{
5263 ASSERT(hasTagName(SVGNames::foreignObjectTag));
 64 registerAnimatedPropertiesForSVGForeignObjectElement();
5365}
5466
5567PassRefPtr<SVGForeignObjectElement> SVGForeignObjectElement::create(const QualifiedName& tagName, Document* document)

@@void SVGForeignObjectElement::svgAttribu
134146 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
135147}
136148
137 void SVGForeignObjectElement::synchronizeProperty(const QualifiedName& attrName)
138 {
139  if (attrName == anyQName()) {
140  synchronizeX();
141  synchronizeY();
142  synchronizeWidth();
143  synchronizeHeight();
144  synchronizeExternalResourcesRequired();
145  synchronizeHref();
146  SVGTests::synchronizeProperties(this, attrName);
147  SVGStyledTransformableElement::synchronizeProperty(attrName);
148  return;
149  }
150 
151  if (!isSupportedAttribute(attrName)) {
152  SVGStyledTransformableElement::synchronizeProperty(attrName);
153  return;
154  }
155 
156  if (attrName == SVGNames::xAttr) {
157  synchronizeX();
158  return;
159  }
160 
161  if (attrName == SVGNames::yAttr) {
162  synchronizeY();
163  return;
164  }
165 
166  if (attrName == SVGNames::widthAttr) {
167  synchronizeWidth();
168  return;
169  }
170 
171  if (attrName == SVGNames::heightAttr) {
172  synchronizeHeight();
173  return;
174  }
175 
176  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
177  synchronizeExternalResourcesRequired();
178  return;
179  }
180 
181  if (SVGTests::isKnownAttribute(attrName)) {
182  SVGTests::synchronizeProperties(this, attrName);
183  return;
184  }
185 
186  ASSERT_NOT_REACHED();
187 }
188 
189 AttributeToPropertyTypeMap& SVGForeignObjectElement::attributeToPropertyTypeMap()
190 {
191  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
192  return s_attributeToPropertyTypeMap;
193 }
194 
195 void SVGForeignObjectElement::fillAttributeToPropertyTypeMap()
196 {
197  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
198 
199  SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
200  attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
201  attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
202  attributeToPropertyTypeMap.set(SVGNames::widthAttr, AnimatedLength);
203  attributeToPropertyTypeMap.set(SVGNames::heightAttr, AnimatedLength);
204  attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
205 }
206 
207149RenderObject* SVGForeignObjectElement::createRenderer(RenderArena* arena, RenderStyle*)
208150{
209151 return new (arena) RenderSVGForeignObject(this);
90666

Source/WebCore/svg/SVGForeignObjectElement.h

@@private:
4545 bool isSupportedAttribute(const QualifiedName&);
4646 virtual void parseMappedAttribute(Attribute*);
4747 virtual void svgAttributeChanged(const QualifiedName&);
48  virtual void synchronizeProperty(const QualifiedName&);
49  virtual void fillAttributeToPropertyTypeMap();
50  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5148
5249 virtual bool childShouldCreateRenderer(Node*) const;
5350 virtual RenderObject* createRenderer(RenderArena* arena, RenderStyle* style);
5451
5552 virtual bool selfHasRelativeLengths() const;
5653
57  // Animated property declarations
58  DECLARE_ANIMATED_LENGTH(X, x)
59  DECLARE_ANIMATED_LENGTH(Y, y)
60  DECLARE_ANIMATED_LENGTH(Width, width)
61  DECLARE_ANIMATED_LENGTH(Height, height)
62 
63  // SVGURIReference
64  DECLARE_ANIMATED_STRING(Href, href)
65 
66  // SVGExternalResourcesRequired
67  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 54 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGForeignObjectElement)
 55 DECLARE_ANIMATED_LENGTH(X, x)
 56 DECLARE_ANIMATED_LENGTH(Y, y)
 57 DECLARE_ANIMATED_LENGTH(Width, width)
 58 DECLARE_ANIMATED_LENGTH(Height, height)
 59 DECLARE_ANIMATED_STRING(Href, href)
 60 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 61 END_DECLARE_ANIMATED_PROPERTIES
 62
 63 // SVGTests
 64 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 65 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 66 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
6867};
6968
7069} // namespace WebCore
90666

Source/WebCore/svg/SVGGElement.cpp

3131
3232namespace WebCore {
3333
34 // Animated property declarations
 34// Animated property definitions
3535DEFINE_ANIMATED_BOOLEAN(SVGGElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
3636
 37BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGGElement)
 38 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 39 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 40 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 41END_REGISTER_ANIMATED_PROPERTIES
 42
3743SVGGElement::SVGGElement(const QualifiedName& tagName, Document* document)
3844 : SVGStyledTransformableElement(tagName, document)
3945{
4046 ASSERT(hasTagName(SVGNames::gTag));
 47 registerAnimatedPropertiesForSVGGElement();
4148}
4249
4350PassRefPtr<SVGGElement> SVGGElement::create(const QualifiedName& tagName, Document* document)

@@void SVGGElement::svgAttributeChanged(co
8996 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
9097}
9198
92 void SVGGElement::synchronizeProperty(const QualifiedName& attrName)
93 {
94  if (attrName == anyQName()) {
95  synchronizeExternalResourcesRequired();
96  SVGTests::synchronizeProperties(this, attrName);
97  SVGStyledTransformableElement::synchronizeProperty(attrName);
98  return;
99  }
100 
101  if (!isSupportedAttribute(attrName)) {
102  SVGStyledTransformableElement::synchronizeProperty(attrName);
103  return;
104  }
105 
106  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
107  synchronizeExternalResourcesRequired();
108  return;
109  }
110 
111  if (SVGTests::isKnownAttribute(attrName)) {
112  SVGTests::synchronizeProperties(this, attrName);
113  return;
114  }
115 
116  ASSERT_NOT_REACHED();
117 }
118 
119 AttributeToPropertyTypeMap& SVGGElement::attributeToPropertyTypeMap()
120 {
121  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
122  return s_attributeToPropertyTypeMap;
123 }
124 
125 void SVGGElement::fillAttributeToPropertyTypeMap()
126 {
127  SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap());
128 }
129 
13099RenderObject* SVGGElement::createRenderer(RenderArena* arena, RenderStyle* style)
131100{
132101 // SVG 1.1 testsuite explicitely uses constructs like <g display="none"><linearGradient>
90666

Source/WebCore/svg/SVGGElement.h

@@private:
5151 bool isSupportedAttribute(const QualifiedName&);
5252 virtual void parseMappedAttribute(Attribute*);
5353 virtual void svgAttributeChanged(const QualifiedName&);
54  virtual void synchronizeProperty(const QualifiedName&);
55  virtual void fillAttributeToPropertyTypeMap();
56  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5754
5855 virtual bool rendererIsNeeded(const NodeRenderingContext&);
5956
60  // Animated property declarations
 57 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGGElement)
 58 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 59 END_DECLARE_ANIMATED_PROPERTIES
6160
62  // SVGExternalResourcesRequired
63  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 61 // SVGTests
 62 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 63 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 64 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
6465};
6566
6667} // namespace WebCore
90666

Source/WebCore/svg/SVGGlyphElement.cpp

@@static inline float parseSVGGlyphAttribu
129129 return value.toFloat();
130130}
131131
132 AttributeToPropertyTypeMap& SVGGlyphElement::attributeToPropertyTypeMap()
133 {
134  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
135  return s_attributeToPropertyTypeMap;
136 }
137 
138 void SVGGlyphElement::fillAttributeToPropertyTypeMap()
139 {
140  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
141 
142  SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
143  attributeToPropertyTypeMap.set(SVGNames::dAttr, AnimatedPath);
144 }
145 
146132SVGGlyph SVGGlyphElement::buildGenericGlyphIdentifier(const SVGElement* element)
147133{
148134 SVGGlyph identifier;
90666

Source/WebCore/svg/SVGGlyphElement.h

@@public:
4646private:
4747 SVGGlyphElement(const QualifiedName&, Document*);
4848
 49 // FIXME: svgAttributeChanged missing.
4950 virtual void parseMappedAttribute(Attribute*);
50  virtual void fillAttributeToPropertyTypeMap();
51  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5251
5352 virtual void insertedIntoDocument();
5453 virtual void removedFromDocument();
90666

Source/WebCore/svg/SVGGradientElement.cpp

@@DEFINE_ANIMATED_TRANSFORM_LIST(SVGGradie
4545DEFINE_ANIMATED_STRING(SVGGradientElement, XLinkNames::hrefAttr, Href, href)
4646DEFINE_ANIMATED_BOOLEAN(SVGGradientElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
4747
 48BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGGradientElement)
 49 REGISTER_LOCAL_ANIMATED_PROPERTY(spreadMethod)
 50 REGISTER_LOCAL_ANIMATED_PROPERTY(gradientUnits)
 51 REGISTER_LOCAL_ANIMATED_PROPERTY(gradientTransform)
 52 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
 53 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 54 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
 55END_REGISTER_ANIMATED_PROPERTIES
 56
4857SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, Document* document)
4958 : SVGStyledElement(tagName, document)
5059 , m_spreadMethod(SVGSpreadMethodPad)
5160 , m_gradientUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
5261{
 62 registerAnimatedPropertiesForSVGGradientElement();
5363}
5464
5565bool SVGGradientElement::isSupportedAttribute(const QualifiedName& attrName)

@@void SVGGradientElement::svgAttributeCha
116126 if (RenderObject* object = renderer())
117127 object->setNeedsLayout(true);
118128}
119 
120 void SVGGradientElement::synchronizeProperty(const QualifiedName& attrName)
121 {
122  if (attrName == anyQName()) {
123  synchronizeGradientUnits();
124  synchronizeGradientTransform();
125  synchronizeSpreadMethod();
126  synchronizeExternalResourcesRequired();
127  synchronizeHref();
128  SVGStyledElement::synchronizeProperty(attrName);
129  return;
130  }
131 
132  if (!isSupportedAttribute(attrName)) {
133  SVGStyledElement::synchronizeProperty(attrName);
134  return;
135  }
136 
137  if (attrName == SVGNames::gradientUnitsAttr) {
138  synchronizeGradientUnits();
139  return;
140  }
141 
142  if (attrName == SVGNames::gradientTransformAttr) {
143  synchronizeGradientTransform();
144  return;
145  }
146 
147  if (attrName == SVGNames::spreadMethodAttr) {
148  synchronizeSpreadMethod();
149  return;
150  }
151 
152  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
153  synchronizeExternalResourcesRequired();
154  return;
155  }
156 
157  if (SVGURIReference::isKnownAttribute(attrName)) {
158  synchronizeHref();
159  return;
160  }
161 
162  ASSERT_NOT_REACHED();
163 }
164 
165 void SVGGradientElement::fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap& attributeToPropertyTypeMap)
166 {
167  SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
168 
169  attributeToPropertyTypeMap.set(SVGNames::spreadMethodAttr, AnimatedEnumeration);
170  attributeToPropertyTypeMap.set(SVGNames::gradientUnitsAttr, AnimatedEnumeration);
171  attributeToPropertyTypeMap.set(SVGNames::gradientTransformAttr, AnimatedTransformList);
172  attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
173 }
174129
175130void SVGGradientElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
176131{
90666

Source/WebCore/svg/SVGGradientElement.h

@@struct SVGPropertyTraits<SVGSpreadMethod
7373 }
7474};
7575
76 
7776class SVGGradientElement : public SVGStyledElement,
7877 public SVGURIReference,
7978 public SVGExternalResourcesRequired {

@@protected:
9392 bool isSupportedAttribute(const QualifiedName&);
9493 virtual void parseMappedAttribute(Attribute*);
9594 virtual void svgAttributeChanged(const QualifiedName&);
96  virtual void synchronizeProperty(const QualifiedName&);
97  void fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap&);
9895
9996private:
10097 virtual bool needsPendingResourceHandling() const { return false; }
10198
10299 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
103100
104  // Animated property declarations
105  DECLARE_ANIMATED_ENUMERATION(SpreadMethod, spreadMethod, SVGSpreadMethodType)
106  DECLARE_ANIMATED_ENUMERATION(GradientUnits, gradientUnits, SVGUnitTypes::SVGUnitType)
107  DECLARE_ANIMATED_TRANSFORM_LIST(GradientTransform, gradientTransform)
108 
109  // SVGURIReference
110  DECLARE_ANIMATED_STRING(Href, href)
111 
112  // SVGExternalResourcesRequired
113  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 101 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGGradientElement)
 102 DECLARE_ANIMATED_ENUMERATION(SpreadMethod, spreadMethod, SVGSpreadMethodType)
 103 DECLARE_ANIMATED_ENUMERATION(GradientUnits, gradientUnits, SVGUnitTypes::SVGUnitType)
 104 DECLARE_ANIMATED_TRANSFORM_LIST(GradientTransform, gradientTransform)
 105 DECLARE_ANIMATED_STRING(Href, href)
 106 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 107 END_DECLARE_ANIMATED_PROPERTIES
114108};
115109
116110} // namespace WebCore
90666

Source/WebCore/svg/SVGImageElement.cpp

@@DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGI
4545DEFINE_ANIMATED_STRING(SVGImageElement, XLinkNames::hrefAttr, Href, href)
4646DEFINE_ANIMATED_BOOLEAN(SVGImageElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
4747
 48BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGImageElement)
 49 REGISTER_LOCAL_ANIMATED_PROPERTY(x)
 50 REGISTER_LOCAL_ANIMATED_PROPERTY(y)
 51 REGISTER_LOCAL_ANIMATED_PROPERTY(width)
 52 REGISTER_LOCAL_ANIMATED_PROPERTY(height)
 53 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
 54 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
 55 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 56 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 57 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 58END_REGISTER_ANIMATED_PROPERTIES
 59
4860inline SVGImageElement::SVGImageElement(const QualifiedName& tagName, Document* document)
4961 : SVGStyledTransformableElement(tagName, document)
5062 , m_x(LengthModeWidth)

@@inline SVGImageElement::SVGImageElement(
5466 , m_imageLoader(this)
5567{
5668 ASSERT(hasTagName(SVGNames::imageTag));
 69 registerAnimatedPropertiesForSVGImageElement();
5770}
5871
5972PassRefPtr<SVGImageElement> SVGImageElement::create(const QualifiedName& tagName, Document* document)

@@void SVGImageElement::svgAttributeChange
173186 ASSERT_NOT_REACHED();
174187}
175188
176 void SVGImageElement::synchronizeProperty(const QualifiedName& attrName)
177 {
178  if (attrName == anyQName()) {
179  synchronizeX();
180  synchronizeY();
181  synchronizeWidth();
182  synchronizeHeight();
183  synchronizePreserveAspectRatio();
184  synchronizeExternalResourcesRequired();
185  synchronizeHref();
186  SVGTests::synchronizeProperties(this, attrName);
187  SVGStyledTransformableElement::synchronizeProperty(attrName);
188  return;
189  }
190 
191  if (!isSupportedAttribute(attrName)) {
192  SVGStyledTransformableElement::synchronizeProperty(attrName);
193  return;
194  }
195 
196  if (attrName == SVGNames::xAttr) {
197  synchronizeX();
198  return;
199  }
200 
201  if (attrName == SVGNames::yAttr) {
202  synchronizeY();
203  return;
204  }
205 
206  if (attrName == SVGNames::widthAttr) {
207  synchronizeWidth();
208  return;
209  }
210 
211  if (attrName == SVGNames::heightAttr) {
212  synchronizeHeight();
213  return;
214  }
215 
216  if (attrName == SVGNames::preserveAspectRatioAttr) {
217  synchronizePreserveAspectRatio();
218  return;
219  }
220 
221  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
222  synchronizeExternalResourcesRequired();
223  return;
224  }
225 
226  if (SVGURIReference::isKnownAttribute(attrName)) {
227  synchronizeHref();
228  return;
229  }
230 
231  if (SVGTests::isKnownAttribute(attrName)) {
232  SVGTests::synchronizeProperties(this, attrName);
233  return;
234  }
235 
236  ASSERT_NOT_REACHED();
237 }
238 
239 AttributeToPropertyTypeMap& SVGImageElement::attributeToPropertyTypeMap()
240 {
241  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
242  return s_attributeToPropertyTypeMap;
243 }
244 
245 void SVGImageElement::fillAttributeToPropertyTypeMap()
246 {
247  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
248 
249  SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
250  attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
251  attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
252  attributeToPropertyTypeMap.set(SVGNames::widthAttr, AnimatedLength);
253  attributeToPropertyTypeMap.set(SVGNames::heightAttr, AnimatedLength);
254  attributeToPropertyTypeMap.set(SVGNames::preserveAspectRatioAttr, AnimatedPreserveAspectRatio);
255  attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
256 }
257 
258189bool SVGImageElement::selfHasRelativeLengths() const
259190{
260191 return x().isRelative()
90666

Source/WebCore/svg/SVGImageElement.h

@@private:
5151 bool isSupportedAttribute(const QualifiedName&);
5252 virtual void parseMappedAttribute(Attribute*);
5353 virtual void svgAttributeChanged(const QualifiedName&);
54  virtual void synchronizeProperty(const QualifiedName&);
55  virtual void fillAttributeToPropertyTypeMap();
56  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5754
5855 virtual void attach();
5956 virtual void insertedIntoDocument();

@@private:
6865 virtual bool selfHasRelativeLengths() const;
6966 virtual void willMoveToNewOwnerDocument();
7067
71  // Animated property declarations
72  DECLARE_ANIMATED_LENGTH(X, x)
73  DECLARE_ANIMATED_LENGTH(Y, y)
74  DECLARE_ANIMATED_LENGTH(Width, width)
75  DECLARE_ANIMATED_LENGTH(Height, height)
76  DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
77 
78  // SVGURIReference
79  DECLARE_ANIMATED_STRING(Href, href)
80 
81  // SVGExternalResourcesRequired
82  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 68 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGImageElement)
 69 DECLARE_ANIMATED_LENGTH(X, x)
 70 DECLARE_ANIMATED_LENGTH(Y, y)
 71 DECLARE_ANIMATED_LENGTH(Width, width)
 72 DECLARE_ANIMATED_LENGTH(Height, height)
 73 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
 74 DECLARE_ANIMATED_STRING(Href, href)
 75 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 76 END_DECLARE_ANIMATED_PROPERTIES
 77
 78 // SVGTests
 79 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 80 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 81 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
8382
8483 SVGImageLoader m_imageLoader;
8584};
90666

Source/WebCore/svg/SVGLineElement.cpp

@@DEFINE_ANIMATED_LENGTH(SVGLineElement, S
4040DEFINE_ANIMATED_LENGTH(SVGLineElement, SVGNames::y2Attr, Y2, y2)
4141DEFINE_ANIMATED_BOOLEAN(SVGLineElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
4242
 43BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGLineElement)
 44 REGISTER_LOCAL_ANIMATED_PROPERTY(x1)
 45 REGISTER_LOCAL_ANIMATED_PROPERTY(y1)
 46 REGISTER_LOCAL_ANIMATED_PROPERTY(x2)
 47 REGISTER_LOCAL_ANIMATED_PROPERTY(y2)
 48 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 49 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 50 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 51END_REGISTER_ANIMATED_PROPERTIES
 52
4353inline SVGLineElement::SVGLineElement(const QualifiedName& tagName, Document* document)
4454 : SVGStyledTransformableElement(tagName, document)
4555 , m_x1(LengthModeWidth)

@@inline SVGLineElement::SVGLineElement(co
4858 , m_y2(LengthModeHeight)
4959{
5060 ASSERT(hasTagName(SVGNames::lineTag));
 61 registerAnimatedPropertiesForSVGLineElement();
5162}
5263
5364PassRefPtr<SVGLineElement> SVGLineElement::create(const QualifiedName& tagName, Document* document)

@@void SVGLineElement::svgAttributeChanged
145156 ASSERT_NOT_REACHED();
146157}
147158
148 void SVGLineElement::synchronizeProperty(const QualifiedName& attrName)
149 {
150  if (attrName == anyQName()) {
151  synchronizeX1();
152  synchronizeY1();
153  synchronizeX2();
154  synchronizeY2();
155  synchronizeExternalResourcesRequired();
156  SVGTests::synchronizeProperties(this, attrName);
157  SVGStyledTransformableElement::synchronizeProperty(attrName);
158  return;
159  }
160 
161  if (!isSupportedAttribute(attrName)) {
162  SVGStyledTransformableElement::synchronizeProperty(attrName);
163  return;
164  }
165 
166  if (attrName == SVGNames::x1Attr) {
167  synchronizeX1();
168  return;
169  }
170 
171  if (attrName == SVGNames::y1Attr) {
172  synchronizeY1();
173  return;
174  }
175 
176  if (attrName == SVGNames::x2Attr) {
177  synchronizeX2();
178  return;
179  }
180 
181  if (attrName == SVGNames::y2Attr) {
182  synchronizeY2();
183  return;
184  }
185 
186  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
187  synchronizeExternalResourcesRequired();
188  return;
189  }
190 
191  if (SVGTests::isKnownAttribute(attrName)) {
192  SVGTests::synchronizeProperties(this, attrName);
193  return;
194  }
195 
196  ASSERT_NOT_REACHED();
197 }
198 
199 AttributeToPropertyTypeMap& SVGLineElement::attributeToPropertyTypeMap()
200 {
201  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
202  return s_attributeToPropertyTypeMap;
203 }
204 
205 void SVGLineElement::fillAttributeToPropertyTypeMap()
206 {
207  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
208 
209  SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
210  attributeToPropertyTypeMap.set(SVGNames::x1Attr, AnimatedLength);
211  attributeToPropertyTypeMap.set(SVGNames::y1Attr, AnimatedLength);
212  attributeToPropertyTypeMap.set(SVGNames::x2Attr, AnimatedLength);
213  attributeToPropertyTypeMap.set(SVGNames::y2Attr, AnimatedLength);
214 }
215 
216159void SVGLineElement::toPathData(Path& path) const
217160{
218161 ASSERT(path.isEmpty());
90666

Source/WebCore/svg/SVGLineElement.h

@@private:
4747 bool isSupportedAttribute(const QualifiedName&);
4848 virtual void parseMappedAttribute(Attribute*);
4949 virtual void svgAttributeChanged(const QualifiedName&);
50  virtual void synchronizeProperty(const QualifiedName&);
51  virtual void fillAttributeToPropertyTypeMap();
52  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5350
5451 virtual void toPathData(Path&) const;
5552

@@private:
5754
5855 virtual bool selfHasRelativeLengths() const;
5956
60  // Animated property declarations
61  DECLARE_ANIMATED_LENGTH(X1, x1)
62  DECLARE_ANIMATED_LENGTH(Y1, y1)
63  DECLARE_ANIMATED_LENGTH(X2, x2)
64  DECLARE_ANIMATED_LENGTH(Y2, y2)
65 
66  // SVGExternalResourcesRequired
67  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 57 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGLineElement)
 58 DECLARE_ANIMATED_LENGTH(X1, x1)
 59 DECLARE_ANIMATED_LENGTH(Y1, y1)
 60 DECLARE_ANIMATED_LENGTH(X2, x2)
 61 DECLARE_ANIMATED_LENGTH(Y2, y2)
 62 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 63 END_DECLARE_ANIMATED_PROPERTIES
 64
 65 // SVGTests
 66 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 67 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 68 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
6869};
6970
7071} // namespace WebCore
90666

Source/WebCore/svg/SVGLinearGradientElement.cpp

@@DEFINE_ANIMATED_LENGTH(SVGLinearGradient
4646DEFINE_ANIMATED_LENGTH(SVGLinearGradientElement, SVGNames::x2Attr, X2, x2)
4747DEFINE_ANIMATED_LENGTH(SVGLinearGradientElement, SVGNames::y2Attr, Y2, y2)
4848
 49BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGLinearGradientElement)
 50 REGISTER_LOCAL_ANIMATED_PROPERTY(x1)
 51 REGISTER_LOCAL_ANIMATED_PROPERTY(y1)
 52 REGISTER_LOCAL_ANIMATED_PROPERTY(x2)
 53 REGISTER_LOCAL_ANIMATED_PROPERTY(y2)
 54 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGradientElement)
 55END_REGISTER_ANIMATED_PROPERTIES
 56
4957inline SVGLinearGradientElement::SVGLinearGradientElement(const QualifiedName& tagName, Document* document)
5058 : SVGGradientElement(tagName, document)
5159 , m_x1(LengthModeWidth)

@@inline SVGLinearGradientElement::SVGLine
5563{
5664 // Spec: If the x2 attribute is not specified, the effect is as if a value of "100%" were specified.
5765 ASSERT(hasTagName(SVGNames::linearGradientTag));
 66 registerAnimatedPropertiesForSVGLinearGradientElement();
5867}
5968
6069PassRefPtr<SVGLinearGradientElement> SVGLinearGradientElement::create(const QualifiedName& tagName, Document* document)

@@void SVGLinearGradientElement::svgAttrib
119128 object->setNeedsLayout(true);
120129}
121130
122 void SVGLinearGradientElement::synchronizeProperty(const QualifiedName& attrName)
123 {
124  if (attrName == anyQName()) {
125  synchronizeX1();
126  synchronizeY1();
127  synchronizeX2();
128  synchronizeY2();
129  SVGGradientElement::synchronizeProperty(attrName);
130  return;
131  }
132 
133  if (!isSupportedAttribute(attrName)) {
134  SVGGradientElement::synchronizeProperty(attrName);
135  return;
136  }
137 
138  if (attrName == SVGNames::x1Attr) {
139  synchronizeX1();
140  return;
141  }
142 
143  if (attrName == SVGNames::y1Attr) {
144  synchronizeY1();
145  return;
146  }
147 
148  if (attrName == SVGNames::x2Attr) {
149  synchronizeX2();
150  return;
151  }
152 
153  if (attrName == SVGNames::y2Attr) {
154  synchronizeY2();
155  return;
156  }
157 
158  ASSERT_NOT_REACHED();
159 }
160 
161 AttributeToPropertyTypeMap& SVGLinearGradientElement::attributeToPropertyTypeMap()
162 {
163  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
164  return s_attributeToPropertyTypeMap;
165 }
166 
167 void SVGLinearGradientElement::fillAttributeToPropertyTypeMap()
168 {
169  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
170 
171  SVGGradientElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
172  attributeToPropertyTypeMap.set(SVGNames::x1Attr, AnimatedLength);
173  attributeToPropertyTypeMap.set(SVGNames::y1Attr, AnimatedLength);
174  attributeToPropertyTypeMap.set(SVGNames::x2Attr, AnimatedLength);
175  attributeToPropertyTypeMap.set(SVGNames::y2Attr, AnimatedLength);
176 }
177 
178131RenderObject* SVGLinearGradientElement::createRenderer(RenderArena* arena, RenderStyle*)
179132{
180133 return new (arena) RenderSVGResourceLinearGradient(this);
90666

Source/WebCore/svg/SVGLinearGradientElement.h

@@private:
4242 bool isSupportedAttribute(const QualifiedName&);
4343 virtual void parseMappedAttribute(Attribute*);
4444 virtual void svgAttributeChanged(const QualifiedName&);
45  virtual void synchronizeProperty(const QualifiedName&);
46  virtual void fillAttributeToPropertyTypeMap();
47  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
4845
4946 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
5047
5148 virtual bool selfHasRelativeLengths() const;
5249
53  // Animated property declarations
54  DECLARE_ANIMATED_LENGTH(X1, x1)
55  DECLARE_ANIMATED_LENGTH(Y1, y1)
56  DECLARE_ANIMATED_LENGTH(X2, x2)
57  DECLARE_ANIMATED_LENGTH(Y2, y2)
 50 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGLinearGradientElement)
 51 DECLARE_ANIMATED_LENGTH(X1, x1)
 52 DECLARE_ANIMATED_LENGTH(Y1, y1)
 53 DECLARE_ANIMATED_LENGTH(X2, x2)
 54 DECLARE_ANIMATED_LENGTH(Y2, y2)
 55 END_DECLARE_ANIMATED_PROPERTIES
5856};
5957
6058} // namespace WebCore
90666

Source/WebCore/svg/SVGMPathElement.cpp

@@namespace WebCore {
3232DEFINE_ANIMATED_STRING(SVGMPathElement, XLinkNames::hrefAttr, Href, href)
3333DEFINE_ANIMATED_BOOLEAN(SVGMPathElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
3434
 35BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGMPathElement)
 36 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
 37 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 38END_REGISTER_ANIMATED_PROPERTIES
 39
3540inline SVGMPathElement::SVGMPathElement(const QualifiedName& tagName, Document* document)
3641 : SVGElement(tagName, document)
3742{
3843 ASSERT(hasTagName(SVGNames::mpathTag));
 44 registerAnimatedPropertiesForSVGMPathElement();
3945}
4046
4147PassRefPtr<SVGMPathElement> SVGMPathElement::create(const QualifiedName& tagName, Document* document)

@@void SVGMPathElement::parseMappedAttribu
6874 ASSERT_NOT_REACHED();
6975}
7076
71 void SVGMPathElement::synchronizeProperty(const QualifiedName& attrName)
72 {
73  if (attrName == anyQName()) {
74  synchronizeExternalResourcesRequired();
75  synchronizeHref();
76  return;
77  }
78 
79  if (!isSupportedAttribute(attrName))
80  return;
81 
82  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
83  synchronizeExternalResourcesRequired();
84  return;
85  }
86 
87  if (SVGURIReference::isKnownAttribute(attrName)) {
88  synchronizeHref();
89  return;
90  }
91 
92  ASSERT_NOT_REACHED();
93 }
94 
95 AttributeToPropertyTypeMap& SVGMPathElement::attributeToPropertyTypeMap()
96 {
97  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
98  return s_attributeToPropertyTypeMap;
99 }
100 
101 void SVGMPathElement::fillAttributeToPropertyTypeMap()
102 {
103  attributeToPropertyTypeMap().set(XLinkNames::hrefAttr, AnimatedString);
104 }
105 
10677SVGPathElement* SVGMPathElement::pathElement()
10778{
10879 Element* target = treeScope()->getElementById(getTarget(href()));
90666

Source/WebCore/svg/SVGMPathElement.h

@@private:
4444 // FIXME: svgAttributeChanged missing.
4545 bool isSupportedAttribute(const QualifiedName&);
4646 virtual void parseMappedAttribute(Attribute*);
47  virtual void synchronizeProperty(const QualifiedName&);
48  virtual void fillAttributeToPropertyTypeMap();
49  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5047
51  // Animated property declarations
52 
53  // SVGURIReference
54  DECLARE_ANIMATED_STRING(Href, href)
55 
56  // SVGExternalResourcesRequired
57  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 48 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGMPathElement)
 49 DECLARE_ANIMATED_STRING(Href, href)
 50 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 51 END_DECLARE_ANIMATED_PROPERTIES
5852};
5953
6054} // namespace WebCore
90666

Source/WebCore/svg/SVGMarkerElement.cpp

3232#include "SVGSVGElement.h"
3333
3434namespace WebCore {
 35
 36// Define custom animated property 'orientType'.
 37const SVGPropertyInfo* SVGMarkerElement::orientTypePropertyInfo()
 38{
 39 static const SVGPropertyInfo* s_propertyInfo = 0;
 40 if (!s_propertyInfo) {
 41 s_propertyInfo = new SVGPropertyInfo(AnimatedEnumeration,
 42 SVGNames::orientAttr,
 43 orientTypeIdentifier(),
 44 &SVGMarkerElement::synchronizeOrientType,
 45 &SVGMarkerElement::lookupOrCreateOrientTypeWrapper);
 46 }
 47 return s_propertyInfo;
 48}
3549
3650// Animated property definitions
3751DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::refXAttr, RefX, refX)

@@DEFINE_ANIMATED_BOOLEAN(SVGMarkerElement
4458DEFINE_ANIMATED_RECT(SVGMarkerElement, SVGNames::viewBoxAttr, ViewBox, viewBox)
4559DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGMarkerElement, SVGNames::preserveAspectRatioAttr, PreserveAspectRatio, preserveAspectRatio)
4660
 61BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGMarkerElement)
 62 REGISTER_LOCAL_ANIMATED_PROPERTY(refX)
 63 REGISTER_LOCAL_ANIMATED_PROPERTY(refY)
 64 REGISTER_LOCAL_ANIMATED_PROPERTY(markerWidth)
 65 REGISTER_LOCAL_ANIMATED_PROPERTY(markerHeight)
 66 REGISTER_LOCAL_ANIMATED_PROPERTY(markerUnits)
 67 REGISTER_LOCAL_ANIMATED_PROPERTY(orientAngle)
 68 REGISTER_LOCAL_ANIMATED_PROPERTY(orientType)
 69 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 70 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox)
 71 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
 72 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
 73END_REGISTER_ANIMATED_PROPERTIES
 74
4775inline SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document* document)
4876 : SVGStyledElement(tagName, document)
4977 , m_refX(LengthModeWidth)

@@inline SVGMarkerElement::SVGMarkerElemen
5583{
5684 // Spec: If the markerWidth/markerHeight attribute is not specified, the effect is as if a value of "3" were specified.
5785 ASSERT(hasTagName(SVGNames::markerTag));
 86 registerAnimatedPropertiesForSVGMarkerElement();
5887}
5988
6089PassRefPtr<SVGMarkerElement> SVGMarkerElement::create(const QualifiedName& tagName, Document* document)

@@void SVGMarkerElement::svgAttributeChang
170199 object->setNeedsLayout(true);
171200}
172201
173 void SVGMarkerElement::synchronizeProperty(const QualifiedName& attrName)
174 {
175  if (attrName == anyQName()) {
176  synchronizeMarkerUnits();
177  synchronizeRefX();
178  synchronizeRefY();
179  synchronizeMarkerWidth();
180  synchronizeMarkerHeight();
181  synchronizeOrientAngle();
182  synchronizeOrientType();
183  synchronizeExternalResourcesRequired();
184  SVGFitToViewBox::synchronizeProperties(attrName);
185  SVGStyledElement::synchronizeProperty(attrName);
186  return;
187  }
188 
189  if (!isSupportedAttribute(attrName)) {
190  SVGStyledElement::synchronizeProperty(attrName);
191  return;
192  }
193 
194  if (attrName == SVGNames::markerUnitsAttr) {
195  synchronizeMarkerUnits();
196  return;
197  }
198 
199  if (attrName == SVGNames::refXAttr) {
200  synchronizeRefX();
201  return;
202  }
203 
204  if (attrName == SVGNames::refYAttr) {
205  synchronizeRefY();
206  return;
207  }
208 
209  if (attrName == SVGNames::markerWidthAttr) {
210  synchronizeMarkerWidth();
211  return;
212  }
213 
214  if (attrName == SVGNames::markerHeightAttr) {
215  synchronizeMarkerHeight();
216  return;
217  }
218 
219  if (attrName == SVGNames::orientAttr) {
220  synchronizeOrientAngle();
221  synchronizeOrientType();
222  return;
223  }
224 
225  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
226  synchronizeExternalResourcesRequired();
227  return;
228  }
229 
230  if (SVGFitToViewBox::isKnownAttribute(attrName)) {
231  SVGFitToViewBox::synchronizeProperties(attrName);
232  return;
233  }
234 
235  ASSERT_NOT_REACHED();
236 }
237 
238 AttributeToPropertyTypeMap& SVGMarkerElement::attributeToPropertyTypeMap()
239 {
240  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
241  return s_attributeToPropertyTypeMap;
242 }
243 
244 void SVGMarkerElement::fillAttributeToPropertyTypeMap()
245 {
246  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
247 
248  SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
249  attributeToPropertyTypeMap.set(SVGNames::refXAttr, AnimatedLength);
250  attributeToPropertyTypeMap.set(SVGNames::refYAttr, AnimatedLength);
251  attributeToPropertyTypeMap.set(SVGNames::markerWidthAttr, AnimatedLength);
252  attributeToPropertyTypeMap.set(SVGNames::markerHeightAttr, AnimatedLength);
253  attributeToPropertyTypeMap.set(SVGNames::markerUnitsAttr, AnimatedEnumeration);
254  attributeToPropertyTypeMap.set(SVGNames::orientAttr, AnimatedAngle);
255  attributeToPropertyTypeMap.set(SVGNames::viewBoxAttr, AnimatedRect);
256 }
257 
258202void SVGMarkerElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
259203{
260204 SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);

@@void SVGMarkerElement::setOrientToAuto()
270214{
271215 setOrientTypeBaseValue(SVGMarkerOrientAuto);
272216 setOrientAngleBaseValue(SVGAngle());
273 
274  if (RenderObject* object = renderer())
275  object->setNeedsLayout(true);
 217
 218 // Mark orientAttr dirty - the next XML DOM access of that attribute kicks in synchronization.
 219 m_orientAngle.shouldSynchronize = true;
 220 m_orientType.shouldSynchronize = true;
 221 invalidateSVGAttributes();
 222 svgAttributeChanged(orientAnglePropertyInfo()->attributeName);
276223}
277224
278225void SVGMarkerElement::setOrientToAngle(const SVGAngle& angle)

@@void SVGMarkerElement::setOrientToAngle(
280227 setOrientTypeBaseValue(SVGMarkerOrientAngle);
281228 setOrientAngleBaseValue(angle);
282229
283  if (RenderObject* object = renderer())
284  object->setNeedsLayout(true);
 230 // Mark orientAttr dirty - the next XML DOM access of that attribute kicks in synchronization.
 231 m_orientAngle.shouldSynchronize = true;
 232 m_orientType.shouldSynchronize = true;
 233 invalidateSVGAttributes();
 234 svgAttributeChanged(orientAnglePropertyInfo()->attributeName);
285235}
286236
287237RenderObject* SVGMarkerElement::createRenderer(RenderArena* arena, RenderStyle*)

@@bool SVGMarkerElement::selfHasRelativeLe
297247 || markerHeight().isRelative();
298248}
299249
300 void SVGMarkerElement::synchronizeOrientType()
 250void SVGMarkerElement::synchronizeOrientType(void* contextElement)
301251{
302  if (!m_orientType.shouldSynchronize)
 252 ASSERT(contextElement);
 253 SVGMarkerElement* ownerType = static_cast<SVGMarkerElement*>(contextElement);
 254 if (!ownerType->m_orientType.shouldSynchronize)
303255 return;
304 
305  AtomicString value;
306  if (m_orientType.value == SVGMarkerOrientAuto)
307  value = "auto";
308  else if (m_orientType.value == SVGMarkerOrientAngle)
309  value = orientAngle().valueAsString();
310256
311  SVGAnimatedPropertySynchronizer<true>::synchronize(this, SVGNames::orientAttr, value);
 257 // If orient is not auto, the previous call to synchronizeOrientAngle already set the orientAttr to the right angle.
 258 if (ownerType->m_orientType.value != SVGMarkerOrientAuto)
 259 return;
 260
 261 DEFINE_STATIC_LOCAL(AtomicString, autoString, ("auto"));
 262 SVGAnimatedPropertySynchronizer<true>::synchronize(ownerType, orientTypePropertyInfo()->attributeName, autoString);
312263}
313264
 265PassRefPtr<SVGAnimatedProperty> SVGMarkerElement::lookupOrCreateOrientTypeWrapper(void* contextElement)
 266{
 267 ASSERT(contextElement);
 268 SVGMarkerElement* ownerType = static_cast<SVGMarkerElement*>(contextElement);
 269 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGMarkerElement, SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType>, SVGMarkerOrientType, true>
 270 (ownerType, orientTypePropertyInfo(), ownerType->m_orientType.value);
 271}
 272
314273PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > SVGMarkerElement::orientTypeAnimated()
315274{
316275 m_orientType.shouldSynchronize = true;
317  return SVGAnimatedProperty::lookupOrCreateWrapper<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType>, SVGMarkerOrientType>(this, SVGNames::orientAttr, orientTypeIdentifier(), m_orientType.value);
 276 return static_pointer_cast<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> >(lookupOrCreateOrientTypeWrapper(this));
318277}
319278
320279}
90666

Source/WebCore/svg/SVGMarkerElement.h

@@public:
120120 void setOrientToAuto();
121121 void setOrientToAngle(const SVGAngle&);
122122
 123 static const SVGPropertyInfo* orientTypePropertyInfo();
 124
123125private:
124126 SVGMarkerElement(const QualifiedName&, Document*);
125127

@@private:
128130 bool isSupportedAttribute(const QualifiedName&);
129131 virtual void parseMappedAttribute(Attribute*);
130132 virtual void svgAttributeChanged(const QualifiedName&);
131  virtual void synchronizeProperty(const QualifiedName&);
132  virtual void fillAttributeToPropertyTypeMap();
133  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
134133 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
135134
136135 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);

@@private:
138137
139138 virtual bool selfHasRelativeLengths() const;
140139
 140 void synchronizeOrientType();
 141
141142 static const AtomicString& orientTypeIdentifier();
142143 static const AtomicString& orientAngleIdentifier();
143 
144  // Animated property declarations
145  DECLARE_ANIMATED_LENGTH(RefX, refX)
146  DECLARE_ANIMATED_LENGTH(RefY, refY)
147  DECLARE_ANIMATED_LENGTH(MarkerWidth, markerWidth)
148  DECLARE_ANIMATED_LENGTH(MarkerHeight, markerHeight)
149  DECLARE_ANIMATED_ENUMERATION(MarkerUnits, markerUnits, SVGMarkerUnitsType)
150  DECLARE_ANIMATED_ANGLE(OrientAngle, orientAngle)
151 
152  // SVGExternalResourcesRequired
153  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
154 
155  // SVGFitToViewBox
156  DECLARE_ANIMATED_RECT(ViewBox, viewBox)
157  DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
158 
 144
 145 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGMarkerElement)
 146 DECLARE_ANIMATED_LENGTH(RefX, refX)
 147 DECLARE_ANIMATED_LENGTH(RefY, refY)
 148 DECLARE_ANIMATED_LENGTH(MarkerWidth, markerWidth)
 149 DECLARE_ANIMATED_LENGTH(MarkerHeight, markerHeight)
 150 DECLARE_ANIMATED_ENUMERATION(MarkerUnits, markerUnits, SVGMarkerUnitsType)
 151 DECLARE_ANIMATED_ANGLE(OrientAngle, orientAngle)
 152 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 153 DECLARE_ANIMATED_RECT(ViewBox, viewBox)
 154 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
 155 END_DECLARE_ANIMATED_PROPERTIES
 156
159157public:
160  // Custom animated property: orientType
 158 // Custom 'orientType' property.
 159 static void synchronizeOrientType(void* contextElement);
 160 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateOrientTypeWrapper(void* contextElement);
161161 SVGMarkerOrientType& orientType() const { return m_orientType.value; }
162162 SVGMarkerOrientType& orientTypeBaseValue() const { return m_orientType.value; }
163163 void setOrientTypeBaseValue(const SVGMarkerOrientType& type) { m_orientType.value = type; }
164164 PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > orientTypeAnimated();
165165
166166private:
167  void synchronizeOrientType();
168167 mutable SVGSynchronizableAnimatedProperty<SVGMarkerOrientType> m_orientType;
169168};
170169
90666

Source/WebCore/svg/SVGMaskElement.cpp

@@DEFINE_ANIMATED_LENGTH(SVGMaskElement, S
4545DEFINE_ANIMATED_LENGTH(SVGMaskElement, SVGNames::heightAttr, Height, height)
4646DEFINE_ANIMATED_BOOLEAN(SVGMaskElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
4747
 48BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGMaskElement)
 49 REGISTER_LOCAL_ANIMATED_PROPERTY(maskUnits)
 50 REGISTER_LOCAL_ANIMATED_PROPERTY(maskContentUnits)
 51 REGISTER_LOCAL_ANIMATED_PROPERTY(x)
 52 REGISTER_LOCAL_ANIMATED_PROPERTY(y)
 53 REGISTER_LOCAL_ANIMATED_PROPERTY(width)
 54 REGISTER_LOCAL_ANIMATED_PROPERTY(height)
 55 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 56 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledLocatableElement)
 57 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 58END_REGISTER_ANIMATED_PROPERTIES
 59
4860inline SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document* document)
4961 : SVGStyledLocatableElement(tagName, document)
5062 , m_maskUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)

@@inline SVGMaskElement::SVGMaskElement(co
5769 // Spec: If the x/y attribute is not specified, the effect is as if a value of "-10%" were specified.
5870 // Spec: If the width/height attribute is not specified, the effect is as if a value of "120%" were specified.
5971 ASSERT(hasTagName(SVGNames::maskTag));
 72 registerAnimatedPropertiesForSVGMaskElement();
6073}
6174
6275PassRefPtr<SVGMaskElement> SVGMaskElement::create(const QualifiedName& tagName, Document* document)

@@void SVGMaskElement::svgAttributeChanged
151164 object->setNeedsLayout(true);
152165}
153166
154 void SVGMaskElement::synchronizeProperty(const QualifiedName& attrName)
155 {
156  if (attrName == anyQName()) {
157  synchronizeMaskUnits();
158  synchronizeMaskContentUnits();
159  synchronizeX();
160  synchronizeY();
161  synchronizeWidth();
162  synchronizeHeight();
163  synchronizeExternalResourcesRequired();
164  SVGTests::synchronizeProperties(this, attrName);
165  SVGStyledElement::synchronizeProperty(attrName);
166  return;
167  }
168 
169  if (!isSupportedAttribute(attrName)) {
170  SVGStyledElement::synchronizeProperty(attrName);
171  return;
172  }
173 
174  if (attrName == SVGNames::maskUnitsAttr) {
175  synchronizeMaskUnits();
176  return;
177  }
178 
179  if (attrName == SVGNames::maskContentUnitsAttr) {
180  synchronizeMaskContentUnits();
181  return;
182  }
183 
184  if (attrName == SVGNames::xAttr) {
185  synchronizeX();
186  return;
187  }
188 
189  if (attrName == SVGNames::yAttr) {
190  synchronizeY();
191  return;
192  }
193 
194  if (attrName == SVGNames::widthAttr) {
195  synchronizeWidth();
196  return;
197  }
198 
199  if (attrName == SVGNames::heightAttr) {
200  synchronizeHeight();
201  return;
202  }
203 
204  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
205  synchronizeExternalResourcesRequired();
206  return;
207  }
208 
209  if (SVGTests::isKnownAttribute(attrName)) {
210  SVGTests::synchronizeProperties(this, attrName);
211  return;
212  }
213 
214  ASSERT_NOT_REACHED();
215 }
216 
217 AttributeToPropertyTypeMap& SVGMaskElement::attributeToPropertyTypeMap()
218 {
219  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
220  return s_attributeToPropertyTypeMap;
221 }
222 
223 void SVGMaskElement::fillAttributeToPropertyTypeMap()
224 {
225  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
226 
227  SVGStyledLocatableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
228  attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
229  attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
230  attributeToPropertyTypeMap.set(SVGNames::widthAttr, AnimatedLength);
231  attributeToPropertyTypeMap.set(SVGNames::heightAttr, AnimatedLength);
232  attributeToPropertyTypeMap.set(SVGNames::maskUnitsAttr, AnimatedEnumeration);
233  attributeToPropertyTypeMap.set(SVGNames::maskContentUnitsAttr, AnimatedEnumeration);
234 }
235 
236167void SVGMaskElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
237168{
238169 SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
90666

Source/WebCore/svg/SVGMaskElement.h

@@private:
5050 bool isSupportedAttribute(const QualifiedName&);
5151 virtual void parseMappedAttribute(Attribute*);
5252 virtual void svgAttributeChanged(const QualifiedName&);
53  virtual void synchronizeProperty(const QualifiedName&);
54  virtual void fillAttributeToPropertyTypeMap();
55  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5653 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
5754
5855 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
5956
6057 virtual bool selfHasRelativeLengths() const;
6158
62  // Animated property declarations
63  DECLARE_ANIMATED_ENUMERATION(MaskUnits, maskUnits, SVGUnitTypes::SVGUnitType)
64  DECLARE_ANIMATED_ENUMERATION(MaskContentUnits, maskContentUnits, SVGUnitTypes::SVGUnitType)
65  DECLARE_ANIMATED_LENGTH(X, x)
66  DECLARE_ANIMATED_LENGTH(Y, y)
67  DECLARE_ANIMATED_LENGTH(Width, width)
68  DECLARE_ANIMATED_LENGTH(Height, height)
69 
70  // SVGExternalResourcesRequired
71  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 59 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGMaskElement)
 60 DECLARE_ANIMATED_ENUMERATION(MaskUnits, maskUnits, SVGUnitTypes::SVGUnitType)
 61 DECLARE_ANIMATED_ENUMERATION(MaskContentUnits, maskContentUnits, SVGUnitTypes::SVGUnitType)
 62 DECLARE_ANIMATED_LENGTH(X, x)
 63 DECLARE_ANIMATED_LENGTH(Y, y)
 64 DECLARE_ANIMATED_LENGTH(Width, width)
 65 DECLARE_ANIMATED_LENGTH(Height, height)
 66 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 67 END_DECLARE_ANIMATED_PROPERTIES
 68
 69 // SVGTests
 70 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 71 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 72 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
7273};
7374
7475}
90666

Source/WebCore/svg/SVGMissingGlyphElement.cpp

@@PassRefPtr<SVGMissingGlyphElement> SVGMi
3636 return adoptRef(new SVGMissingGlyphElement(tagName, document));
3737}
3838
39 AttributeToPropertyTypeMap& SVGMissingGlyphElement::attributeToPropertyTypeMap()
40 {
41  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
42  return s_attributeToPropertyTypeMap;
43 }
44 
45 void SVGMissingGlyphElement::fillAttributeToPropertyTypeMap()
46 {
47  SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap());
48 }
49 
5039}
5140
5241#endif // ENABLE(SVG_FONTS)
90666

Source/WebCore/svg/SVGMissingGlyphElement.h

@@public:
3232private:
3333 SVGMissingGlyphElement(const QualifiedName&, Document*);
3434
35  virtual void fillAttributeToPropertyTypeMap();
36  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
37 
3835 virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }
3936};
4037

@@private:
4239
4340#endif // ENABLE(SVG_FONTS)
4441#endif
45 
46 // vim:ts=4:noet
90666

Source/WebCore/svg/SVGPathElement.cpp

4646
4747namespace WebCore {
4848
 49// Define custom animated property 'd'.
 50const SVGPropertyInfo* SVGPathElement::dPropertyInfo()
 51{
 52 static const SVGPropertyInfo* s_propertyInfo = 0;
 53 if (!s_propertyInfo) {
 54 s_propertyInfo = new SVGPropertyInfo(AnimatedPath,
 55 SVGNames::dAttr,
 56 SVGNames::dAttr.localName(),
 57 &SVGPathElement::synchronizeD,
 58 &SVGPathElement::lookupOrCreateDWrapper);
 59 }
 60 return s_propertyInfo;
 61}
 62
4963// Animated property definitions
5064DEFINE_ANIMATED_NUMBER(SVGPathElement, SVGNames::pathLengthAttr, PathLength, pathLength)
5165DEFINE_ANIMATED_BOOLEAN(SVGPathElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
5266
 67BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPathElement)
 68 REGISTER_LOCAL_ANIMATED_PROPERTY(d)
 69 REGISTER_LOCAL_ANIMATED_PROPERTY(pathLength)
 70 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 71 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 72 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 73END_REGISTER_ANIMATED_PROPERTIES
 74
5375inline SVGPathElement::SVGPathElement(const QualifiedName& tagName, Document* document)
5476 : SVGStyledTransformableElement(tagName, document)
5577 , m_pathByteStream(SVGPathByteStream::create())
5678 , m_pathSegList(PathSegUnalteredRole)
5779{
5880 ASSERT(hasTagName(SVGNames::pathTag));
 81 registerAnimatedPropertiesForSVGPathElement();
5982}
6083
6184PassRefPtr<SVGPathElement> SVGPathElement::create(const QualifiedName& tagName, Document* document)

@@void SVGPathElement::svgAttributeChanged
238261 RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
239262
240263 if (attrName == SVGNames::dAttr) {
241  if (m_animatablePathSegList) {
 264 if (SVGAnimatedProperty::lookupWrapper<SVGAnimatedPathSegListPropertyTearOff>(this, dPropertyInfo())) {
242265 SVGPathSegList newList(PathSegUnalteredRole);
243266 SVGPathParserFactory* factory = SVGPathParserFactory::self();
244267 factory->buildSVGPathSegListFromByteStream(m_pathByteStream.get(), this, newList, UnalteredParsing);

@@void SVGPathElement::svgAttributeChanged
253276 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
254277}
255278
256 void SVGPathElement::synchronizeProperty(const QualifiedName& attrName)
 279PassRefPtr<SVGAnimatedProperty> SVGPathElement::lookupOrCreateDWrapper(void* contextElement)
257280{
258  if (attrName == anyQName()) {
259  synchronizeD();
260  synchronizePathLength();
261  synchronizeExternalResourcesRequired();
262  SVGTests::synchronizeProperties(this, attrName);
263  SVGStyledTransformableElement::synchronizeProperty(attrName);
264  return;
265  }
266 
267  if (!isSupportedAttribute(attrName)) {
268  SVGStyledTransformableElement::synchronizeProperty(attrName);
269  return;
270  }
 281 ASSERT(contextElement);
 282 SVGPathElement* ownerType = static_cast<SVGPathElement*>(contextElement);
271283
272  if (attrName == SVGNames::dAttr) {
273  synchronizeD();
274  return;
275  }
276 
277  if (attrName == SVGNames::pathLengthAttr) {
278  synchronizePathLength();
279  return;
280  }
281 
282  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
283  synchronizeExternalResourcesRequired();
284  return;
285  }
286 
287  if (SVGTests::isKnownAttribute(attrName)) {
288  SVGTests::synchronizeProperties(this, attrName);
289  return;
290  }
 284 SVGPathParserFactory* factory = SVGPathParserFactory::self();
 285 factory->buildSVGPathSegListFromByteStream(ownerType->m_pathByteStream.get(), ownerType, ownerType->m_pathSegList.value, UnalteredParsing);
291286
292  ASSERT_NOT_REACHED();
 287 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff, SVGPathSegList, true>
 288 (ownerType, dPropertyInfo(), ownerType->m_pathSegList.value);
293289}
294290
295 void SVGPathElement::synchronizeD()
 291void SVGPathElement::synchronizeD(void* contextElement)
296292{
297  if (!m_pathSegList.shouldSynchronize)
 293 ASSERT(contextElement);
 294 SVGPathElement* ownerType = static_cast<SVGPathElement*>(contextElement);
 295 if (!ownerType->m_pathSegList.shouldSynchronize)
298296 return;
299 
300  SVGAnimatedPropertySynchronizer<true>::synchronize(this, SVGNames::dAttr, m_pathSegList.value.valueAsString());
301 }
302 
303 AttributeToPropertyTypeMap& SVGPathElement::attributeToPropertyTypeMap()
304 {
305  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
306  return s_attributeToPropertyTypeMap;
307 }
308 
309 void SVGPathElement::fillAttributeToPropertyTypeMap()
310 {
311  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
312 
313  SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
314  attributeToPropertyTypeMap.set(SVGNames::dAttr, AnimatedPath);
315  attributeToPropertyTypeMap.set(SVGNames::pathLengthAttr, AnimatedNumber);
 297 SVGAnimatedPropertySynchronizer<true>::synchronize(ownerType, dPropertyInfo()->attributeName, ownerType->m_pathSegList.value.valueAsString());
316298}
317299
318300SVGPathSegListPropertyTearOff* SVGPathElement::pathSegList()
319301{
320  if (!m_animatablePathSegList) {
321  m_pathSegList.shouldSynchronize = true;
322 
323  SVGPathParserFactory* factory = SVGPathParserFactory::self();
324  factory->buildSVGPathSegListFromByteStream(m_pathByteStream.get(), this, m_pathSegList.value, UnalteredParsing);
325 
326  m_animatablePathSegList = SVGAnimatedProperty::lookupOrCreateWrapper<SVGAnimatedPathSegListPropertyTearOff, SVGPathSegList>
327  (this, SVGNames::dAttr, SVGNames::dAttr.localName(), m_pathSegList.value);
328  }
329 
 302 m_pathSegList.shouldSynchronize = true;
 303 if (!m_animatablePathSegList)
 304 m_animatablePathSegList = static_pointer_cast<SVGAnimatedPathSegListPropertyTearOff>(lookupOrCreateDWrapper(this));
330305 return static_cast<SVGPathSegListPropertyTearOff*>(m_animatablePathSegList->baseVal(PathSegUnalteredRole));
331306}
332307

@@SVGPathSegListPropertyTearOff* SVGPathEl
338313
339314SVGPathSegListPropertyTearOff* SVGPathElement::animatedPathSegList()
340315{
341  if (!m_animatablePathSegList) {
342  m_pathSegList.shouldSynchronize = true;
343 
344  SVGPathParserFactory* factory = SVGPathParserFactory::self();
345  factory->buildSVGPathSegListFromByteStream(m_pathByteStream.get(), this, m_pathSegList.value, UnalteredParsing);
346 
347  m_animatablePathSegList = SVGAnimatedProperty::lookupOrCreateWrapper<SVGAnimatedPathSegListPropertyTearOff, SVGPathSegList>
348  (this, SVGNames::dAttr, SVGNames::dAttr.localName(), m_pathSegList.value);
349  }
350 
 316 m_pathSegList.shouldSynchronize = true;
 317 if (!m_animatablePathSegList)
 318 m_animatablePathSegList = static_pointer_cast<SVGAnimatedPathSegListPropertyTearOff>(lookupOrCreateDWrapper(this));
351319 return static_cast<SVGPathSegListPropertyTearOff*>(m_animatablePathSegList->animVal(PathSegUnalteredRole));
352320}
353321
90666

Source/WebCore/svg/SVGPathElement.h

@@public:
9191 SVGPathSegListPropertyTearOff* animatedNormalizedPathSegList();
9292
9393 SVGPathByteStream* pathByteStream() const { return m_pathByteStream.get(); }
94  SVGAnimatedProperty* animatablePathSegList() const { return m_animatablePathSegList.get(); }
9594
9695 virtual void toPathData(Path&) const;
9796 void pathSegListChanged(SVGPathSegRole);
9897
 98 static const SVGPropertyInfo* dPropertyInfo();
 99
99100private:
100101 SVGPathElement(const QualifiedName&, Document*);
101102

@@private:
104105
105106 bool isSupportedAttribute(const QualifiedName&);
106107 virtual void parseMappedAttribute(Attribute*);
107  virtual void synchronizeProperty(const QualifiedName&);
108108 virtual void svgAttributeChanged(const QualifiedName&);
109  virtual void fillAttributeToPropertyTypeMap();
110  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
111109 virtual bool supportsMarkers() const { return true; }
112110
113  // Animated property declarations
114  DECLARE_ANIMATED_NUMBER(PathLength, pathLength)
115 
116  // SVGExternalResourcesRequired
117  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 111 // Custom 'd' property
 112 static void synchronizeD(void* contextElement);
 113 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateDWrapper(void* contextElement);
 114
 115 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPathElement)
 116 DECLARE_ANIMATED_NUMBER(PathLength, pathLength)
 117 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 118 END_DECLARE_ANIMATED_PROPERTIES
 119
 120 // SVGTests
 121 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 122 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 123 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
118124
119  void synchronizeD();
120 
121 protected:
 125private:
122126 OwnPtr<SVGPathByteStream> m_pathByteStream;
123127 mutable SVGSynchronizableAnimatedProperty<SVGPathSegList> m_pathSegList;
124128 RefPtr<SVGAnimatedPathSegListPropertyTearOff> m_animatablePathSegList;
90666

Source/WebCore/svg/SVGPathSegWithContext.h

@@public:
3939 case PathSegUndefinedRole:
4040 return 0;
4141 case PathSegUnalteredRole:
42  return m_element->animatablePathSegList();
 42 return SVGAnimatedProperty::lookupWrapper<SVGAnimatedPathSegListPropertyTearOff>(m_element.get(), SVGPathElement::dPropertyInfo());
4343 case PathSegNormalizedRole:
4444 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists!
4545 return 0;
90666

Source/WebCore/svg/SVGPatternElement.cpp

@@DEFINE_ANIMATED_BOOLEAN(SVGPatternElemen
5555DEFINE_ANIMATED_RECT(SVGPatternElement, SVGNames::viewBoxAttr, ViewBox, viewBox)
5656DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGPatternElement, SVGNames::preserveAspectRatioAttr, PreserveAspectRatio, preserveAspectRatio)
5757
 58BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPatternElement)
 59 REGISTER_LOCAL_ANIMATED_PROPERTY(x)
 60 REGISTER_LOCAL_ANIMATED_PROPERTY(y)
 61 REGISTER_LOCAL_ANIMATED_PROPERTY(width)
 62 REGISTER_LOCAL_ANIMATED_PROPERTY(height)
 63 REGISTER_LOCAL_ANIMATED_PROPERTY(patternUnits)
 64 REGISTER_LOCAL_ANIMATED_PROPERTY(patternContentUnits)
 65 REGISTER_LOCAL_ANIMATED_PROPERTY(patternTransform)
 66 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
 67 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 68 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox)
 69 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
 70 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
 71 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 72END_REGISTER_ANIMATED_PROPERTIES
 73
5874inline SVGPatternElement::SVGPatternElement(const QualifiedName& tagName, Document* document)
5975 : SVGStyledElement(tagName, document)
6076 , m_x(LengthModeWidth)

@@inline SVGPatternElement::SVGPatternElem
6581 , m_patternContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
6682{
6783 ASSERT(hasTagName(SVGNames::patternTag));
 84 registerAnimatedPropertiesForSVGPatternElement();
6885}
6986
7087PassRefPtr<SVGPatternElement> SVGPatternElement::create(const QualifiedName& tagName, Document* document)

@@void SVGPatternElement::svgAttributeChan
180197 object->setNeedsLayout(true);
181198}
182199
183 void SVGPatternElement::synchronizeProperty(const QualifiedName& attrName)
184 {
185  if (attrName == anyQName()) {
186  synchronizePatternUnits();
187  synchronizePatternContentUnits();
188  synchronizePatternTransform();
189  synchronizeX();
190  synchronizeY();
191  synchronizeWidth();
192  synchronizeHeight();
193  synchronizeExternalResourcesRequired();
194  synchronizeHref();
195  SVGFitToViewBox::synchronizeProperties(attrName);
196  SVGTests::synchronizeProperties(this, attrName);
197  SVGStyledElement::synchronizeProperty(attrName);
198  return;
199  }
200 
201  if (!isSupportedAttribute(attrName)) {
202  SVGStyledElement::synchronizeProperty(attrName);
203  return;
204  }
205 
206  if (attrName == SVGNames::patternUnitsAttr) {
207  synchronizePatternUnits();
208  return;
209  }
210 
211  if (attrName == SVGNames::patternContentUnitsAttr) {
212  synchronizePatternContentUnits();
213  return;
214  }
215 
216  if (attrName == SVGNames::patternTransformAttr) {
217  synchronizePatternTransform();
218  return;
219  }
220 
221  if (attrName == SVGNames::xAttr) {
222  synchronizeX();
223  return;
224  }
225 
226  if (attrName == SVGNames::yAttr) {
227  synchronizeY();
228  return;
229  }
230 
231  if (attrName == SVGNames::widthAttr) {
232  synchronizeWidth();
233  return;
234  }
235 
236  if (attrName == SVGNames::heightAttr) {
237  synchronizeHeight();
238  return;
239  }
240 
241  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
242  synchronizeExternalResourcesRequired();
243  return;
244  }
245 
246  if (SVGFitToViewBox::isKnownAttribute(attrName)) {
247  SVGFitToViewBox::synchronizeProperties(attrName);
248  return;
249  }
250 
251  if (SVGURIReference::isKnownAttribute(attrName)) {
252  synchronizeHref();
253  return;
254  }
255 
256  if (SVGTests::isKnownAttribute(attrName)) {
257  SVGTests::synchronizeProperties(this, attrName);
258  return;
259  }
260 
261  ASSERT_NOT_REACHED();
262 }
263 
264 AttributeToPropertyTypeMap& SVGPatternElement::attributeToPropertyTypeMap()
265 {
266  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
267  return s_attributeToPropertyTypeMap;
268 }
269 
270 void SVGPatternElement::fillAttributeToPropertyTypeMap()
271 {
272  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
273 
274  SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
275  attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
276  attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
277  attributeToPropertyTypeMap.set(SVGNames::widthAttr, AnimatedLength);
278  attributeToPropertyTypeMap.set(SVGNames::heightAttr, AnimatedLength);
279  attributeToPropertyTypeMap.set(SVGNames::patternUnitsAttr, AnimatedEnumeration);
280  attributeToPropertyTypeMap.set(SVGNames::patternContentUnitsAttr, AnimatedEnumeration);
281  attributeToPropertyTypeMap.set(SVGNames::patternTransformAttr, AnimatedTransformList);
282  attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
283  attributeToPropertyTypeMap.set(SVGNames::viewBoxAttr, AnimatedRect);
284  attributeToPropertyTypeMap.set(SVGNames::preserveAspectRatioAttr, AnimatedPreserveAspectRatio);
285 }
286 
287200void SVGPatternElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
288201{
289202 SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
90666

Source/WebCore/svg/SVGPatternElement.h

@@private:
6060 bool isSupportedAttribute(const QualifiedName&);
6161 virtual void parseMappedAttribute(Attribute*);
6262 virtual void svgAttributeChanged(const QualifiedName&);
63  virtual void synchronizeProperty(const QualifiedName&);
64  virtual void fillAttributeToPropertyTypeMap();
65  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
6663 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
6764
6865 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
6966
7067 virtual bool selfHasRelativeLengths() const;
7168
72  // Animated property declarations
73  DECLARE_ANIMATED_LENGTH(X, x)
74  DECLARE_ANIMATED_LENGTH(Y, y)
75  DECLARE_ANIMATED_LENGTH(Width, width)
76  DECLARE_ANIMATED_LENGTH(Height, height)
77  DECLARE_ANIMATED_ENUMERATION(PatternUnits, patternUnits, SVGUnitTypes::SVGUnitType)
78  DECLARE_ANIMATED_ENUMERATION(PatternContentUnits, patternContentUnits, SVGUnitTypes::SVGUnitType)
79  DECLARE_ANIMATED_TRANSFORM_LIST(PatternTransform, patternTransform)
80 
81  // SVGURIReference
82  DECLARE_ANIMATED_STRING(Href, href)
83 
84  // SVGExternalResourcesRequired
85  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
86 
87  // SVGPatternElement
88  DECLARE_ANIMATED_RECT(ViewBox, viewBox)
89  DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
 69 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPatternElement)
 70 DECLARE_ANIMATED_LENGTH(X, x)
 71 DECLARE_ANIMATED_LENGTH(Y, y)
 72 DECLARE_ANIMATED_LENGTH(Width, width)
 73 DECLARE_ANIMATED_LENGTH(Height, height)
 74 DECLARE_ANIMATED_ENUMERATION(PatternUnits, patternUnits, SVGUnitTypes::SVGUnitType)
 75 DECLARE_ANIMATED_ENUMERATION(PatternContentUnits, patternContentUnits, SVGUnitTypes::SVGUnitType)
 76 DECLARE_ANIMATED_TRANSFORM_LIST(PatternTransform, patternTransform)
 77 DECLARE_ANIMATED_STRING(Href, href)
 78 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 79 DECLARE_ANIMATED_RECT(ViewBox, viewBox)
 80 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
 81 END_DECLARE_ANIMATED_PROPERTIES
 82
 83 // SVGTests
 84 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 85 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 86 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
9087};
9188
9289} // namespace WebCore
90666

Source/WebCore/svg/SVGPolyElement.cpp

3535
3636namespace WebCore {
3737
 38// Define custom animated property 'points'.
 39const SVGPropertyInfo* SVGPolyElement::pointsPropertyInfo()
 40{
 41 static const SVGPropertyInfo* s_propertyInfo = 0;
 42 if (!s_propertyInfo) {
 43 s_propertyInfo = new SVGPropertyInfo(AnimatedPoints,
 44 SVGNames::pointsAttr,
 45 SVGNames::pointsAttr.localName(),
 46 &SVGPolyElement::synchronizePoints,
 47 &SVGPolyElement::lookupOrCreatePointsWrapper);
 48 }
 49 return s_propertyInfo;
 50}
 51
3852// Animated property definitions
3953DEFINE_ANIMATED_BOOLEAN(SVGPolyElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
4054
 55BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPolyElement)
 56 REGISTER_LOCAL_ANIMATED_PROPERTY(points)
 57 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 58 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 59 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 60END_REGISTER_ANIMATED_PROPERTIES
 61
4162SVGPolyElement::SVGPolyElement(const QualifiedName& tagName, Document* document)
4263 : SVGStyledTransformableElement(tagName, document)
4364{
 65 registerAnimatedPropertiesForSVGPolyElement();
4466}
4567
4668bool SVGPolyElement::isSupportedAttribute(const QualifiedName& attrName)

@@void SVGPolyElement::parseMappedAttribut
6890 if (!pointsListFromSVGData(newList, value))
6991 document()->accessSVGExtensions()->reportError("Problem parsing points=\"" + value + "\"");
7092
71  if (SVGAnimatedListPropertyTearOff<SVGPointList>* list = m_animatablePointsList.get())
72  list->detachListWrappers(newList.size());
 93 if (SVGAnimatedProperty* wrapper = SVGAnimatedProperty::lookupWrapper<SVGAnimatedListPropertyTearOff<SVGPointList> >(this, pointsPropertyInfo()))
 94 static_cast<SVGAnimatedListPropertyTearOff<SVGPointList>*>(wrapper)->detachListWrappers(newList.size());
7395
7496 m_points.value = newList;
7597 return;

@@void SVGPolyElement::svgAttributeChanged
115137 ASSERT_NOT_REACHED();
116138}
117139
118 void SVGPolyElement::synchronizeProperty(const QualifiedName& attrName)
 140void SVGPolyElement::synchronizePoints(void* contextElement)
119141{
120  SVGStyledTransformableElement::synchronizeProperty(attrName);
121 
122  if (attrName == anyQName()) {
123  synchronizeExternalResourcesRequired();
124  synchronizePoints();
125  SVGTests::synchronizeProperties(this, attrName);
 142 ASSERT(contextElement);
 143 SVGPolyElement* ownerType = static_cast<SVGPolyElement*>(contextElement);
 144 if (!ownerType->m_points.shouldSynchronize)
126145 return;
127  }
128 
129  if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
130  synchronizeExternalResourcesRequired();
131  else if (attrName == SVGNames::pointsAttr)
132  synchronizePoints();
133  else if (SVGTests::isKnownAttribute(attrName))
134  SVGTests::synchronizeProperties(this, attrName);
 146 SVGAnimatedPropertySynchronizer<true>::synchronize(ownerType, pointsPropertyInfo()->attributeName, ownerType->m_points.value.valueAsString());
135147}
136148
137 AttributeToPropertyTypeMap& SVGPolyElement::attributeToPropertyTypeMap()
 149PassRefPtr<SVGAnimatedProperty> SVGPolyElement::lookupOrCreatePointsWrapper(void* contextElement)
138150{
139  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
140  return s_attributeToPropertyTypeMap;
141 }
142 
143 void SVGPolyElement::fillAttributeToPropertyTypeMap()
144 {
145  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
146 
147  SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
148  attributeToPropertyTypeMap.set(SVGNames::pointsAttr, AnimatedPoints);
149 }
150 
151 void SVGPolyElement::synchronizePoints()
152 {
153  if (!m_points.shouldSynchronize)
154  return;
155 
156  SVGAnimatedPropertySynchronizer<true>::synchronize(this, SVGNames::pointsAttr, m_points.value.valueAsString());
 151 ASSERT(contextElement);
 152 SVGPolyElement* ownerType = static_cast<SVGPolyElement*>(contextElement);
 153 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGPolyElement, SVGAnimatedListPropertyTearOff<SVGPointList>, SVGPointList, true>
 154 (ownerType, pointsPropertyInfo(), ownerType->m_points.value);
157155}
158156
159157SVGListPropertyTearOff<SVGPointList>* SVGPolyElement::points()
160158{
161  if (!m_animatablePointsList) {
162  m_points.shouldSynchronize = true;
163  m_animatablePointsList = SVGAnimatedProperty::lookupOrCreateWrapper<SVGAnimatedListPropertyTearOff<SVGPointList> , SVGPointList>
164  (this, SVGNames::pointsAttr, SVGNames::pointsAttr.localName(), m_points.value);
165  }
166 
167  return static_cast<SVGListPropertyTearOff<SVGPointList>*>(m_animatablePointsList->baseVal());
 159 m_points.shouldSynchronize = true;
 160 return static_cast<SVGListPropertyTearOff<SVGPointList>*>(static_pointer_cast<SVGAnimatedListPropertyTearOff<SVGPointList> >(lookupOrCreatePointsWrapper(this))->baseVal());
168161}
169162
170163SVGListPropertyTearOff<SVGPointList>* SVGPolyElement::animatedPoints()
171164{
172  if (!m_animatablePointsList) {
173  m_points.shouldSynchronize = true;
174  m_animatablePointsList = SVGAnimatedProperty::lookupOrCreateWrapper<SVGAnimatedListPropertyTearOff<SVGPointList> , SVGPointList>
175  (this, SVGNames::pointsAttr, SVGNames::pointsAttr.localName(), m_points.value);
176  }
177 
178  return static_cast<SVGListPropertyTearOff<SVGPointList>*>(m_animatablePointsList->animVal());
 165 m_points.shouldSynchronize = true;
 166 return static_cast<SVGListPropertyTearOff<SVGPointList>*>(static_pointer_cast<SVGAnimatedListPropertyTearOff<SVGPointList> >(lookupOrCreatePointsWrapper(this))->animVal());
179167}
180168
181169}
90666

Source/WebCore/svg/SVGPolyElement.h

@@public:
4141
4242 SVGPointList& pointList() const { return m_points.value; }
4343
 44 static const SVGPropertyInfo* pointsPropertyInfo();
 45
4446protected:
4547 SVGPolyElement(const QualifiedName&, Document*);
4648

@@private:
5153 bool isSupportedAttribute(const QualifiedName&);
5254 virtual void parseMappedAttribute(Attribute*);
5355 virtual void svgAttributeChanged(const QualifiedName&);
54  virtual void synchronizeProperty(const QualifiedName&);
55  virtual void fillAttributeToPropertyTypeMap();
56  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5756
5857 virtual bool supportsMarkers() const { return true; }
5958
60  // SVGExternalResourcesRequired
61  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
62 
63  void synchronizePoints();
 59 // Custom 'points' property
 60 static void synchronizePoints(void* contextElement);
 61 static PassRefPtr<SVGAnimatedProperty> lookupOrCreatePointsWrapper(void* contextElement);
 62
 63 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPolyElement)
 64 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 65 END_DECLARE_ANIMATED_PROPERTIES
 66
 67 // SVGTests
 68 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 69 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 70 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
6471
6572protected:
6673 mutable SVGSynchronizableAnimatedProperty<SVGPointList> m_points;
67  RefPtr<SVGAnimatedListPropertyTearOff<SVGPointList> > m_animatablePointsList;
6874};
6975
7076} // namespace WebCore
90666

Source/WebCore/svg/SVGRadialGradientElement.cpp

@@DEFINE_ANIMATED_LENGTH(SVGRadialGradient
4747DEFINE_ANIMATED_LENGTH(SVGRadialGradientElement, SVGNames::fxAttr, Fx, fx)
4848DEFINE_ANIMATED_LENGTH(SVGRadialGradientElement, SVGNames::fyAttr, Fy, fy)
4949
 50BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGRadialGradientElement)
 51 REGISTER_LOCAL_ANIMATED_PROPERTY(cx)
 52 REGISTER_LOCAL_ANIMATED_PROPERTY(cy)
 53 REGISTER_LOCAL_ANIMATED_PROPERTY(r)
 54 REGISTER_LOCAL_ANIMATED_PROPERTY(fx)
 55 REGISTER_LOCAL_ANIMATED_PROPERTY(fy)
 56 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGradientElement)
 57END_REGISTER_ANIMATED_PROPERTIES
 58
5059inline SVGRadialGradientElement::SVGRadialGradientElement(const QualifiedName& tagName, Document* document)
5160 : SVGGradientElement(tagName, document)
5261 , m_cx(LengthModeWidth, "50%")

@@inline SVGRadialGradientElement::SVGRadi
5766{
5867 // Spec: If the cx/cy/r attribute is not specified, the effect is as if a value of "50%" were specified.
5968 ASSERT(hasTagName(SVGNames::radialGradientTag));
 69 registerAnimatedPropertiesForSVGRadialGradientElement();
6070}
6171
6272PassRefPtr<SVGRadialGradientElement> SVGRadialGradientElement::create(const QualifiedName& tagName, Document* document)

@@void SVGRadialGradientElement::svgAttrib
129139 object->setNeedsLayout(true);
130140}
131141
132 void SVGRadialGradientElement::synchronizeProperty(const QualifiedName& attrName)
133 {
134  if (attrName == anyQName()) {
135  synchronizeCx();
136  synchronizeCy();
137  synchronizeFx();
138  synchronizeFy();
139  synchronizeR();
140  SVGGradientElement::synchronizeProperty(attrName);
141  return;
142  }
143 
144  if (!isSupportedAttribute(attrName)) {
145  SVGGradientElement::synchronizeProperty(attrName);
146  return;
147  }
148 
149  if (attrName == SVGNames::cxAttr) {
150  synchronizeCx();
151  return;
152  }
153 
154  if (attrName == SVGNames::cyAttr) {
155  synchronizeCy();
156  return;
157  }
158 
159  if (attrName == SVGNames::fxAttr) {
160  synchronizeFx();
161  return;
162  }
163 
164  if (attrName == SVGNames::fyAttr) {
165  synchronizeFy();
166  return;
167  }
168 
169  if (attrName == SVGNames::rAttr) {
170  synchronizeR();
171  return;
172  }
173 
174  ASSERT_NOT_REACHED();
175 }
176 
177 AttributeToPropertyTypeMap& SVGRadialGradientElement::attributeToPropertyTypeMap()
178 {
179  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
180  return s_attributeToPropertyTypeMap;
181 }
182 
183 void SVGRadialGradientElement::fillAttributeToPropertyTypeMap()
184 {
185  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
186 
187  SVGGradientElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
188  attributeToPropertyTypeMap.set(SVGNames::cxAttr, AnimatedLength);
189  attributeToPropertyTypeMap.set(SVGNames::cyAttr, AnimatedLength);
190  attributeToPropertyTypeMap.set(SVGNames::rAttr, AnimatedLength);
191  attributeToPropertyTypeMap.set(SVGNames::fxAttr, AnimatedLength);
192  attributeToPropertyTypeMap.set(SVGNames::fyAttr, AnimatedLength);
193 }
194 
195142RenderObject* SVGRadialGradientElement::createRenderer(RenderArena* arena, RenderStyle*)
196143{
197144 return new (arena) RenderSVGResourceRadialGradient(this);
90666

Source/WebCore/svg/SVGRadialGradientElement.h

@@private:
4242 bool isSupportedAttribute(const QualifiedName&);
4343 virtual void parseMappedAttribute(Attribute*);
4444 virtual void svgAttributeChanged(const QualifiedName&);
45  virtual void synchronizeProperty(const QualifiedName&);
46  virtual void fillAttributeToPropertyTypeMap();
47  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
4845
4946 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
5047
5148 virtual bool selfHasRelativeLengths() const;
5249
53  // Animated property declarations
54  DECLARE_ANIMATED_LENGTH(Cx, cx)
55  DECLARE_ANIMATED_LENGTH(Cy, cy)
56  DECLARE_ANIMATED_LENGTH(R, r)
57  DECLARE_ANIMATED_LENGTH(Fx, fx)
58  DECLARE_ANIMATED_LENGTH(Fy, fy)
 50 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGRadialGradientElement)
 51 DECLARE_ANIMATED_LENGTH(Cx, cx)
 52 DECLARE_ANIMATED_LENGTH(Cy, cy)
 53 DECLARE_ANIMATED_LENGTH(R, r)
 54 DECLARE_ANIMATED_LENGTH(Fx, fx)
 55 DECLARE_ANIMATED_LENGTH(Fy, fy)
 56 END_DECLARE_ANIMATED_PROPERTIES
5957};
6058
6159} // namespace WebCore
90666

Source/WebCore/svg/SVGRectElement.cpp

@@DEFINE_ANIMATED_LENGTH(SVGRectElement, S
4141DEFINE_ANIMATED_LENGTH(SVGRectElement, SVGNames::ryAttr, Ry, ry)
4242DEFINE_ANIMATED_BOOLEAN(SVGRectElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
4343
 44BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGRectElement)
 45 REGISTER_LOCAL_ANIMATED_PROPERTY(x)
 46 REGISTER_LOCAL_ANIMATED_PROPERTY(y)
 47 REGISTER_LOCAL_ANIMATED_PROPERTY(width)
 48 REGISTER_LOCAL_ANIMATED_PROPERTY(height)
 49 REGISTER_LOCAL_ANIMATED_PROPERTY(rx)
 50 REGISTER_LOCAL_ANIMATED_PROPERTY(ry)
 51 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 52 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 53 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 54END_REGISTER_ANIMATED_PROPERTIES
 55
4456inline SVGRectElement::SVGRectElement(const QualifiedName& tagName, Document* document)
4557 : SVGStyledTransformableElement(tagName, document)
4658 , m_x(LengthModeWidth)

@@inline SVGRectElement::SVGRectElement(co
5163 , m_ry(LengthModeHeight)
5264{
5365 ASSERT(hasTagName(SVGNames::rectTag));
 66 registerAnimatedPropertiesForSVGRectElement();
5467}
5568
5669PassRefPtr<SVGRectElement> SVGRectElement::create(const QualifiedName& tagName, Document* document)

@@void SVGRectElement::svgAttributeChanged
170183 ASSERT_NOT_REACHED();
171184}
172185
173 void SVGRectElement::synchronizeProperty(const QualifiedName& attrName)
174 {
175  if (attrName == anyQName()) {
176  synchronizeX();
177  synchronizeY();
178  synchronizeWidth();
179  synchronizeHeight();
180  synchronizeRx();
181  synchronizeRy();
182  synchronizeExternalResourcesRequired();
183  SVGTests::synchronizeProperties(this, attrName);
184  SVGStyledTransformableElement::synchronizeProperty(attrName);
185  return;
186  }
187 
188  if (!isSupportedAttribute(attrName)) {
189  SVGStyledTransformableElement::synchronizeProperty(attrName);
190  return;
191  }
192 
193  if (attrName == SVGNames::xAttr) {
194  synchronizeX();
195  return;
196  }
197 
198  if (attrName == SVGNames::yAttr) {
199  synchronizeY();
200  return;
201  }
202 
203  if (attrName == SVGNames::widthAttr) {
204  synchronizeWidth();
205  return;
206  }
207 
208  if (attrName == SVGNames::heightAttr) {
209  synchronizeHeight();
210  return;
211  }
212 
213  if (attrName == SVGNames::rxAttr) {
214  synchronizeRx();
215  return;
216  }
217 
218  if (attrName == SVGNames::ryAttr) {
219  synchronizeRy();
220  return;
221  }
222 
223  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
224  synchronizeExternalResourcesRequired();
225  return;
226  }
227 
228  if (SVGTests::isKnownAttribute(attrName)) {
229  SVGTests::synchronizeProperties(this, attrName);
230  return;
231  }
232 
233  ASSERT_NOT_REACHED();
234 }
235 
236 AttributeToPropertyTypeMap& SVGRectElement::attributeToPropertyTypeMap()
237 {
238  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
239  return s_attributeToPropertyTypeMap;
240 }
241 
242 void SVGRectElement::fillAttributeToPropertyTypeMap()
243 {
244  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
245 
246  SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
247  attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
248  attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
249  attributeToPropertyTypeMap.set(SVGNames::widthAttr, AnimatedLength);
250  attributeToPropertyTypeMap.set(SVGNames::heightAttr, AnimatedLength);
251  attributeToPropertyTypeMap.set(SVGNames::rxAttr, AnimatedLength);
252  attributeToPropertyTypeMap.set(SVGNames::ryAttr, AnimatedLength);
253 }
254 
255186void SVGRectElement::toPathData(Path& path) const
256187{
257188 ASSERT(path.isEmpty());
90666

Source/WebCore/svg/SVGRectElement.h

@@private:
4747 bool isSupportedAttribute(const QualifiedName&);
4848 virtual void parseMappedAttribute(Attribute*);
4949 virtual void svgAttributeChanged(const QualifiedName&);
50  virtual void synchronizeProperty(const QualifiedName&);
51  virtual void fillAttributeToPropertyTypeMap();
52  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5350
5451 virtual void toPathData(Path&) const;
5552
5653 virtual bool selfHasRelativeLengths() const;
5754
58  // Animated property declarations
59  DECLARE_ANIMATED_LENGTH(X, x)
60  DECLARE_ANIMATED_LENGTH(Y, y)
61  DECLARE_ANIMATED_LENGTH(Width, width)
62  DECLARE_ANIMATED_LENGTH(Height, height)
63  DECLARE_ANIMATED_LENGTH(Rx, rx)
64  DECLARE_ANIMATED_LENGTH(Ry, ry)
65 
66  // SVGExternalResourcesRequired
67  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 55 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGRectElement)
 56 DECLARE_ANIMATED_LENGTH(X, x)
 57 DECLARE_ANIMATED_LENGTH(Y, y)
 58 DECLARE_ANIMATED_LENGTH(Width, width)
 59 DECLARE_ANIMATED_LENGTH(Height, height)
 60 DECLARE_ANIMATED_LENGTH(Rx, rx)
 61 DECLARE_ANIMATED_LENGTH(Ry, ry)
 62 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 63 END_DECLARE_ANIMATED_PROPERTIES
 64
 65 // SVGTests
 66 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 67 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 68 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
6869};
6970
7071} // namespace WebCore
90666

Source/WebCore/svg/SVGSVGElement.cpp

@@DEFINE_ANIMATED_BOOLEAN(SVGSVGElement, S
6565DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGSVGElement, SVGNames::preserveAspectRatioAttr, PreserveAspectRatio, preserveAspectRatio)
6666DEFINE_ANIMATED_RECT(SVGSVGElement, SVGNames::viewBoxAttr, ViewBox, viewBox)
6767
 68BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGSVGElement)
 69 REGISTER_LOCAL_ANIMATED_PROPERTY(x)
 70 REGISTER_LOCAL_ANIMATED_PROPERTY(y)
 71 REGISTER_LOCAL_ANIMATED_PROPERTY(width)
 72 REGISTER_LOCAL_ANIMATED_PROPERTY(height)
 73 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 74 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox)
 75 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
 76 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledLocatableElement)
 77 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 78END_REGISTER_ANIMATED_PROPERTIES
 79
6880inline SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document* doc)
6981 : SVGStyledLocatableElement(tagName, doc)
7082 , m_x(LengthModeWidth)

@@inline SVGSVGElement::SVGSVGElement(cons
7789 , m_hasSetContainerSize(false)
7890{
7991 ASSERT(hasTagName(SVGNames::svgTag));
 92 registerAnimatedPropertiesForSVGSVGElement();
8093 doc->registerForDocumentActivationCallbacks(this);
8194}
8295

@@void SVGSVGElement::svgAttributeChanged(
355368 SVGStyledElement::svgAttributeChanged(attrName);
356369}
357370
358 void SVGSVGElement::synchronizeProperty(const QualifiedName& attrName)
359 {
360  if (attrName == anyQName()) {
361  synchronizeX();
362  synchronizeY();
363  synchronizeWidth();
364  synchronizeHeight();
365  synchronizeExternalResourcesRequired();
366  SVGFitToViewBox::synchronizeProperties(attrName);
367  SVGTests::synchronizeProperties(this, attrName);
368  SVGStyledElement::synchronizeProperty(attrName);
369  return;
370  }
371 
372  if (attrName == SVGNames::xAttr)
373  synchronizeX();
374  else if (attrName == SVGNames::yAttr)
375  synchronizeY();
376  else if (attrName == SVGNames::widthAttr)
377  synchronizeWidth();
378  else if (attrName == SVGNames::heightAttr)
379  synchronizeHeight();
380  else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
381  synchronizeExternalResourcesRequired();
382  else if (SVGFitToViewBox::isKnownAttribute(attrName))
383  SVGFitToViewBox::synchronizeProperties(attrName);
384  else if (SVGTests::isKnownAttribute(attrName))
385  SVGTests::synchronizeProperties(this, attrName);
386  else
387  SVGStyledElement::synchronizeProperty(attrName);
388 }
389 
390 AttributeToPropertyTypeMap& SVGSVGElement::attributeToPropertyTypeMap()
391 {
392  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
393  return s_attributeToPropertyTypeMap;
394 }
395 
396 void SVGSVGElement::fillAttributeToPropertyTypeMap()
397 {
398  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
399  attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
400  attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
401  attributeToPropertyTypeMap.set(SVGNames::widthAttr, AnimatedLength);
402  attributeToPropertyTypeMap.set(SVGNames::heightAttr, AnimatedLength);
403  attributeToPropertyTypeMap.set(SVGNames::viewBoxAttr, AnimatedRect);
404  attributeToPropertyTypeMap.set(SVGNames::preserveAspectRatioAttr, AnimatedPreserveAspectRatio);
405 }
406 
407371unsigned SVGSVGElement::suspendRedraw(unsigned /* maxWaitMilliseconds */)
408372{
409373 // FIXME: Implement me (see bug 11275)
90666

Source/WebCore/svg/SVGSVGElement.h

@@private:
145145 virtual void removedFromDocument();
146146
147147 virtual void svgAttributeChanged(const QualifiedName&);
148  virtual void synchronizeProperty(const QualifiedName&);
149  virtual void fillAttributeToPropertyTypeMap();
150  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
151148
152149 virtual bool selfHasRelativeLengths() const;
153150
154151 void inheritViewAttributes(SVGViewElement*);
155152
156  // Animated property declarations
157  DECLARE_ANIMATED_LENGTH(X, x)
158  DECLARE_ANIMATED_LENGTH(Y, y)
159  DECLARE_ANIMATED_LENGTH(Width, width)
160  DECLARE_ANIMATED_LENGTH(Height, height)
161 
162  // SVGExternalResourcesRequired
163  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
164 
165  // SVGFitToViewBox
166  DECLARE_ANIMATED_RECT(ViewBox, viewBox)
167  DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
168 
 153 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGSVGElement)
 154 DECLARE_ANIMATED_LENGTH(X, x)
 155 DECLARE_ANIMATED_LENGTH(Y, y)
 156 DECLARE_ANIMATED_LENGTH(Width, width)
 157 DECLARE_ANIMATED_LENGTH(Height, height)
 158 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 159 DECLARE_ANIMATED_RECT(ViewBox, viewBox)
 160 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
 161 END_DECLARE_ANIMATED_PROPERTIES
 162
 163 // SVGTests
 164 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 165 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 166 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
 167
169168 virtual void documentWillBecomeInactive();
170169 virtual void documentDidBecomeActive();
171170
90666

Source/WebCore/svg/SVGScriptElement.cpp

2828#include "Event.h"
2929#include "EventNames.h"
3030#include "HTMLNames.h"
 31#include "SVGAnimatedStaticPropertyTearOff.h"
3132#include "SVGElementInstance.h"
3233#include "SVGNames.h"
3334#include "ScriptEventListener.h"

@@namespace WebCore {
3839DEFINE_ANIMATED_STRING(SVGScriptElement, XLinkNames::hrefAttr, Href, href)
3940DEFINE_ANIMATED_BOOLEAN(SVGScriptElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
4041
 42BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGScriptElement)
 43 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
 44 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 45END_REGISTER_ANIMATED_PROPERTIES
 46
4147inline SVGScriptElement::SVGScriptElement(const QualifiedName& tagName, Document* document, bool wasInsertedByParser, bool alreadyStarted)
4248 : SVGElement(tagName, document)
4349 , ScriptElement(this, wasInsertedByParser, alreadyStarted)
4450{
4551 ASSERT(hasTagName(SVGNames::scriptTag));
 52 registerAnimatedPropertiesForSVGScriptElement();
4653}
4754
4855PassRefPtr<SVGScriptElement> SVGScriptElement::create(const QualifiedName& tagName, Document* document, bool insertedByParser)

@@void SVGScriptElement::svgAttributeChang
120127 ASSERT_NOT_REACHED();
121128}
122129
123 void SVGScriptElement::synchronizeProperty(const QualifiedName& attrName)
124 {
125  if (attrName == anyQName()) {
126  synchronizeExternalResourcesRequired();
127  synchronizeHref();
128  SVGElement::synchronizeProperty(attrName);
129  return;
130  }
131 
132  if (!isSupportedAttribute(attrName)) {
133  SVGElement::synchronizeProperty(attrName);
134  return;
135  }
136 
137  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
138  synchronizeExternalResourcesRequired();
139  return;
140  }
141 
142  if (SVGURIReference::isKnownAttribute(attrName)) {
143  synchronizeHref();
144  return;
145  }
146 
147  ASSERT_NOT_REACHED();
148 }
149 
150 AttributeToPropertyTypeMap& SVGScriptElement::attributeToPropertyTypeMap()
151 {
152  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
153  return s_attributeToPropertyTypeMap;
154 }
155 
156 void SVGScriptElement::fillAttributeToPropertyTypeMap()
157 {
158  attributeToPropertyTypeMap().set(XLinkNames::hrefAttr, AnimatedString);
159 }
160 
161130void SVGScriptElement::insertedIntoDocument()
162131{
163132 SVGElement::insertedIntoDocument();
90666

Source/WebCore/svg/SVGScriptElement.h

@@private:
5151 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
5252
5353 virtual void svgAttributeChanged(const QualifiedName&);
54  virtual void synchronizeProperty(const QualifiedName&);
55  virtual void fillAttributeToPropertyTypeMap();
56  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5754 virtual bool isURLAttribute(Attribute*) const;
5855 virtual void finishParsingChildren();
5956

@@private:
7572
7673 PassRefPtr<Element> cloneElementWithoutAttributesAndChildren() const;
7774
78  // Animated property declarations
79 
80  // SVGURIReference
81  DECLARE_ANIMATED_STRING(Href, href)
82 
83  // SVGExternalResourcesRequired
84  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 75 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGScriptElement)
 76 DECLARE_ANIMATED_STRING(Href, href)
 77 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 78 END_DECLARE_ANIMATED_PROPERTIES
8579
8680 String m_type;
8781};
90666

Source/WebCore/svg/SVGStopElement.cpp

@@namespace WebCore {
3636// Animated property definitions
3737DEFINE_ANIMATED_NUMBER(SVGStopElement, SVGNames::offsetAttr, Offset, offset)
3838
 39BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGStopElement)
 40 REGISTER_LOCAL_ANIMATED_PROPERTY(offset)
 41 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
 42END_REGISTER_ANIMATED_PROPERTIES
 43
3944inline SVGStopElement::SVGStopElement(const QualifiedName& tagName, Document* document)
4045 : SVGStyledElement(tagName, document)
4146 , m_offset(0)
4247{
4348 ASSERT(hasTagName(SVGNames::stopTag));
 49 registerAnimatedPropertiesForSVGStopElement();
4450}
4551
4652PassRefPtr<SVGStopElement> SVGStopElement::create(const QualifiedName& tagName, Document* document)

@@void SVGStopElement::svgAttributeChanged
95101 ASSERT_NOT_REACHED();
96102}
97103
98 void SVGStopElement::synchronizeProperty(const QualifiedName& attrName)
99 {
100  if (attrName == anyQName()) {
101  synchronizeOffset();
102  SVGStyledElement::synchronizeProperty(attrName);
103  return;
104  }
105 
106  if (!isSupportedAttribute(attrName)) {
107  SVGStyledElement::synchronizeProperty(attrName);
108  return;
109  }
110 
111  if (attrName == SVGNames::offsetAttr) {
112  synchronizeOffset();
113  return;
114  }
115 
116  ASSERT_NOT_REACHED();
117 }
118 
119 AttributeToPropertyTypeMap& SVGStopElement::attributeToPropertyTypeMap()
120 {
121  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
122  return s_attributeToPropertyTypeMap;
123 }
124 
125 void SVGStopElement::fillAttributeToPropertyTypeMap()
126 {
127  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
128 
129  SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
130  attributeToPropertyTypeMap.set(SVGNames::offsetAttr, AnimatedLength);
131 }
132 
133104RenderObject* SVGStopElement::createRenderer(RenderArena* arena, RenderStyle*)
134105{
135106 return new (arena) RenderSVGGradientStop(this);
90666

Source/WebCore/svg/SVGStopElement.h

@@private:
3939 bool isSupportedAttribute(const QualifiedName&);
4040 virtual void parseMappedAttribute(Attribute*);
4141 virtual void svgAttributeChanged(const QualifiedName&);
42  virtual void synchronizeProperty(const QualifiedName&);
43  virtual void fillAttributeToPropertyTypeMap();
44  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
4542
4643 virtual bool isGradientStop() const { return true; }
4744
4845 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
4946
50  // Animated property declarations
51  DECLARE_ANIMATED_NUMBER(Offset, offset)
 47 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGStopElement)
 48 DECLARE_ANIMATED_NUMBER(Offset, offset)
 49 END_DECLARE_ANIMATED_PROPERTIES
5250};
5351
5452} // namespace WebCore
90666

Source/WebCore/svg/SVGStyledElement.cpp

4444#include "SVGUseElement.h"
4545#include <wtf/Assertions.h>
4646#include <wtf/HashMap.h>
 47#include <wtf/StdLibExtras.h>
4748
4849namespace WebCore {
4950
5051// Animated property definitions
5152DEFINE_ANIMATED_STRING(SVGStyledElement, HTMLNames::classAttr, ClassName, className)
5253
 54BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGStyledElement)
 55 REGISTER_LOCAL_ANIMATED_PROPERTY(className)
 56END_REGISTER_ANIMATED_PROPERTIES
 57
5358using namespace SVGNames;
5459
5560void mapAttributeToCSSProperty(HashMap<AtomicStringImpl*, int>* propertyNameToIdMap, const QualifiedName& attrName)

@@void mapAttributeToCSSProperty(HashMap<A
6267SVGStyledElement::SVGStyledElement(const QualifiedName& tagName, Document* document)
6368 : SVGElement(tagName, document)
6469{
 70 registerAnimatedPropertiesForSVGStyledElement();
6571}
6672
6773SVGStyledElement::~SVGStyledElement()

@@int SVGStyledElement::cssPropertyIdForSV
205211 return propertyNameToIdMap->get(attrName.localName().impl());
206212}
207213
 214typedef HashMap<QualifiedName, AnimatedPropertyType> AttributeToPropertyTypeMap;
208215static inline AttributeToPropertyTypeMap& cssPropertyToTypeMap()
209216{
210217 DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_cssPropertyMap, ());
211 
 218
212219 if (!s_cssPropertyMap.isEmpty())
213220 return s_cssPropertyMap;
214221

@@static inline AttributeToPropertyTypeMap
269276 return s_cssPropertyMap;
270277}
271278
272 AnimatedAttributeType SVGStyledElement::animatedPropertyTypeForCSSProperty(const QualifiedName& attrName)
 279void SVGStyledElement::animatedPropertyTypeForAttribute(const QualifiedName& attrName, Vector<AnimatedPropertyType>& propertyTypes)
273280{
 281 SVGElement::animatedPropertyTypeForAttribute(attrName, propertyTypes);
 282 if (!propertyTypes.isEmpty())
 283 return;
 284
274285 AttributeToPropertyTypeMap& cssPropertyTypeMap = cssPropertyToTypeMap();
275286 if (cssPropertyTypeMap.contains(attrName))
276  return cssPropertyTypeMap.get(attrName);
277  return AnimatedUnknown;
 287 propertyTypes.append(cssPropertyTypeMap.get(attrName));
278288}
279289
280290bool SVGStyledElement::isAnimatableCSSProperty(const QualifiedName& attrName)

@@bool SVGStyledElement::isAnimatableCSSPr
282292 return cssPropertyToTypeMap().contains(attrName);
283293}
284294
285 void SVGStyledElement::fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap& attributeToPropertyTypeMap)
286 {
287  attributeToPropertyTypeMap.set(HTMLNames::classAttr, AnimatedString);
288 }
289 
290295bool SVGStyledElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
291296{
292297 if (SVGStyledElement::cssPropertyIdForSVGAttributeName(attrName) > 0) {

@@void SVGStyledElement::svgAttributeChang
351356 }
352357}
353358
354 void SVGStyledElement::synchronizeProperty(const QualifiedName& attrName)
355 {
356  if (attrName == anyQName() || attrName == HTMLNames::classAttr)
357  synchronizeClassName();
358 }
359 
360359void SVGStyledElement::attach()
361360{
362361 SVGElement::attach();
90666

Source/WebCore/svg/SVGStyledElement.h

@@public:
5252 bool hasPendingResources() const;
5353 void setHasPendingResources(bool);
5454
55  AnimatedAttributeType animatedPropertyTypeForCSSProperty(const QualifiedName&);
 55 virtual void animatedPropertyTypeForAttribute(const QualifiedName&, Vector<AnimatedPropertyType>&);
5656 static bool isAnimatableCSSProperty(const QualifiedName&);
5757
5858 virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const;

@@public:
6262
6363protected:
6464 SVGStyledElement(const QualifiedName&, Document*);
65 
6665 virtual bool rendererIsNeeded(const NodeRenderingContext&);
6766
6867 virtual bool mapToEntry(const QualifiedName&, MappedAttributeEntry&) const;
6968 virtual void parseMappedAttribute(Attribute*);
7069 virtual void svgAttributeChanged(const QualifiedName&);
71  virtual void synchronizeProperty(const QualifiedName&);
72 
73  void fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap&);
7470
7571 virtual void attach();
7672 virtual void insertedIntoDocument();

@@private:
9490
9591 HashSet<SVGStyledElement*> m_elementsWithRelativeLengths;
9692
97  // Animated property declarations
98  DECLARE_ANIMATED_STRING(ClassName, className)
 93 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGStyledElement)
 94 DECLARE_ANIMATED_STRING(ClassName, className)
 95 END_DECLARE_ANIMATED_PROPERTIES
9996};
10097
10198} // namespace WebCore
90666

Source/WebCore/svg/SVGStyledTransformableElement.cpp

@@namespace WebCore {
3535// Animated property definitions
3636DEFINE_ANIMATED_TRANSFORM_LIST(SVGStyledTransformableElement, SVGNames::transformAttr, Transform, transform)
3737
 38BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 39 REGISTER_LOCAL_ANIMATED_PROPERTY(transform)
 40 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledLocatableElement)
 41END_REGISTER_ANIMATED_PROPERTIES
 42
3843SVGStyledTransformableElement::SVGStyledTransformableElement(const QualifiedName& tagName, Document* document)
3944 : SVGStyledLocatableElement(tagName, document)
4045{
 46 registerAnimatedPropertiesForSVGStyledTransformableElement();
4147}
4248
4349SVGStyledTransformableElement::~SVGStyledTransformableElement()

@@void SVGStyledTransformableElement::svgA
119125 ASSERT_NOT_REACHED();
120126}
121127
122 void SVGStyledTransformableElement::synchronizeProperty(const QualifiedName& attrName)
123 {
124  if (attrName == anyQName()) {
125  synchronizeTransform();
126  SVGStyledLocatableElement::synchronizeProperty(attrName);
127  return;
128  }
129 
130  if (!isSupportedAttribute(attrName)) {
131  SVGStyledLocatableElement::synchronizeProperty(attrName);
132  return;
133  }
134 
135  if (attrName == SVGNames::transformAttr) {
136  synchronizeTransform();
137  return;
138  }
139 
140  ASSERT_NOT_REACHED();
141 }
142 
143128SVGElement* SVGStyledTransformableElement::nearestViewportElement() const
144129{
145130 return SVGTransformable::nearestViewportElement(this);

@@RenderObject* SVGStyledTransformableElem
161146 return new (arena) RenderSVGPath(this);
162147}
163148
164 void SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap& attributeToPropertyTypeMap)
165 {
166  SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
167 
168  attributeToPropertyTypeMap.set(SVGNames::transformAttr, AnimatedTransformList);
169 }
170 
171149void SVGStyledTransformableElement::toClipPath(Path& path) const
172150{
173151 toPathData(path);
90666

Source/WebCore/svg/SVGStyledTransformableElement.h

@@protected:
5858 bool isSupportedAttribute(const QualifiedName&);
5959 virtual void parseMappedAttribute(Attribute*);
6060 virtual void svgAttributeChanged(const QualifiedName&);
61  virtual void synchronizeProperty(const QualifiedName&);
62  void fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap&);
6361
64  // Animated property declarations
65  DECLARE_ANIMATED_TRANSFORM_LIST(Transform, transform)
 62 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 63 DECLARE_ANIMATED_TRANSFORM_LIST(Transform, transform)
 64 END_DECLARE_ANIMATED_PROPERTIES
6665
6766private:
6867 virtual bool isStyledTransformable() const { return true; }
90666

Source/WebCore/svg/SVGSwitchElement.cpp

@@namespace WebCore {
3131// Animated property definitions
3232DEFINE_ANIMATED_BOOLEAN(SVGSwitchElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
3333
 34BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGSwitchElement)
 35 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 36 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 37 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 38END_REGISTER_ANIMATED_PROPERTIES
 39
3440inline SVGSwitchElement::SVGSwitchElement(const QualifiedName& tagName, Document* document)
3541 : SVGStyledTransformableElement(tagName, document)
3642{
3743 ASSERT(hasTagName(SVGNames::switchTag));
 44 registerAnimatedPropertiesForSVGSwitchElement();
3845}
3946
4047PassRefPtr<SVGSwitchElement> SVGSwitchElement::create(const QualifiedName& tagName, Document* document)

@@RenderObject* SVGSwitchElement::createRe
6572 return new (arena) RenderSVGTransformableContainer(this);
6673}
6774
68 void SVGSwitchElement::synchronizeProperty(const QualifiedName& attrName)
69 {
70  SVGStyledTransformableElement::synchronizeProperty(attrName);
71 
72  if (attrName == anyQName()) {
73  synchronizeExternalResourcesRequired();
74  SVGTests::synchronizeProperties(this, attrName);
75  return;
76  }
77 
78  if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
79  synchronizeExternalResourcesRequired();
80  else if (SVGTests::isKnownAttribute(attrName))
81  SVGTests::synchronizeProperties(this, attrName);
82 }
83 
84 AttributeToPropertyTypeMap& SVGSwitchElement::attributeToPropertyTypeMap()
85 {
86  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
87  return s_attributeToPropertyTypeMap;
88 }
89 
90 void SVGSwitchElement::fillAttributeToPropertyTypeMap()
91 {
92  SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap());
93 }
94 
9575}
9676
9777#endif // ENABLE(SVG)
90666

Source/WebCore/svg/SVGSwitchElement.h

@@private:
4646 virtual bool childShouldCreateRenderer(Node*) const;
4747
4848 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
49  virtual void synchronizeProperty(const QualifiedName&);
50 
51  virtual void fillAttributeToPropertyTypeMap();
52  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5349
54  // Animated property declarations
 50 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGSwitchElement)
 51 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 52 END_DECLARE_ANIMATED_PROPERTIES
5553
56  // SVGExternalResourcesRequired
57  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 54 // SVGTests
 55 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 56 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 57 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
5858};
5959
6060} // namespace WebCore
90666

Source/WebCore/svg/SVGSymbolElement.cpp

@@DEFINE_ANIMATED_BOOLEAN(SVGSymbolElement
3434DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGSymbolElement, SVGNames::preserveAspectRatioAttr, PreserveAspectRatio, preserveAspectRatio)
3535DEFINE_ANIMATED_RECT(SVGSymbolElement, SVGNames::viewBoxAttr, ViewBox, viewBox)
3636
 37BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGSymbolElement)
 38 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 39 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox)
 40 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
 41 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
 42END_REGISTER_ANIMATED_PROPERTIES
 43
3744inline SVGSymbolElement::SVGSymbolElement(const QualifiedName& tagName, Document* document)
3845 : SVGStyledElement(tagName, document)
3946{
4047 ASSERT(hasTagName(SVGNames::symbolTag));
 48 registerAnimatedPropertiesForSVGSymbolElement();
4149}
4250
4351PassRefPtr<SVGSymbolElement> SVGSymbolElement::create(const QualifiedName& tagName, Document* document)

@@void SVGSymbolElement::svgAttributeChang
8795 updateRelativeLengthsInformation();
8896}
8997
90 void SVGSymbolElement::synchronizeProperty(const QualifiedName& attrName)
91 {
92  if (attrName == anyQName()) {
93  synchronizeExternalResourcesRequired();
94  SVGFitToViewBox::synchronizeProperties(attrName);
95  SVGStyledElement::synchronizeProperty(attrName);
96  return;
97  }
98 
99  if (!isSupportedAttribute(attrName)) {
100  SVGStyledElement::synchronizeProperty(attrName);
101  return;
102  }
103 
104  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
105  synchronizeExternalResourcesRequired();
106  return;
107  }
108 
109  if (SVGFitToViewBox::isKnownAttribute(attrName)) {
110  SVGFitToViewBox::synchronizeProperties(attrName);
111  return;
112  }
113 
114  ASSERT_NOT_REACHED();
115 }
116 
117 AttributeToPropertyTypeMap& SVGSymbolElement::attributeToPropertyTypeMap()
118 {
119  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
120  return s_attributeToPropertyTypeMap;
121 }
122 
123 void SVGSymbolElement::fillAttributeToPropertyTypeMap()
124 {
125  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
126 
127  SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
128  attributeToPropertyTypeMap.set(SVGNames::viewBoxAttr, AnimatedRect);
129  attributeToPropertyTypeMap.set(SVGNames::preserveAspectRatioAttr, AnimatedPreserveAspectRatio);
130 }
131 
13298bool SVGSymbolElement::selfHasRelativeLengths() const
13399{
134100 return hasAttribute(SVGNames::viewBoxAttr);
90666

Source/WebCore/svg/SVGSymbolElement.h

@@private:
4747 bool isSupportedAttribute(const QualifiedName&);
4848 virtual void parseMappedAttribute(Attribute*);
4949 virtual void svgAttributeChanged(const QualifiedName&);
50  virtual void synchronizeProperty(const QualifiedName&);
51  virtual void fillAttributeToPropertyTypeMap();
52  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5350 virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }
5451
5552 virtual bool selfHasRelativeLengths() const;
5653
57  // Animated property declarations
58 
59  // SVGExternalResourcesRequired
60  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
61 
62  // SVGFitToViewBox
63  DECLARE_ANIMATED_RECT(ViewBox, viewBox)
64  DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
 54 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGSymbolElement)
 55 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 56 DECLARE_ANIMATED_RECT(ViewBox, viewBox)
 57 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
 58 END_DECLARE_ANIMATED_PROPERTIES
6559};
6660
6761} // namespace WebCore
90666

Source/WebCore/svg/SVGTRefElement.cpp

@@namespace WebCore {
4040// Animated property definitions
4141DEFINE_ANIMATED_STRING(SVGTRefElement, XLinkNames::hrefAttr, Href, href)
4242
 43BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGTRefElement)
 44 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
 45 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTextPositioningElement)
 46END_REGISTER_ANIMATED_PROPERTIES
 47
4348inline SVGTRefElement::SVGTRefElement(const QualifiedName& tagName, Document* document)
4449 : SVGTextPositioningElement(tagName, document)
4550{
4651 ASSERT(hasTagName(SVGNames::trefTag));
 52 registerAnimatedPropertiesForSVGTRefElement();
4753}
4854
4955PassRefPtr<SVGTRefElement> SVGTRefElement::create(const QualifiedName& tagName, Document* document)

@@void SVGTRefElement::svgAttributeChanged
164170 ASSERT_NOT_REACHED();
165171}
166172
167 void SVGTRefElement::synchronizeProperty(const QualifiedName& attrName)
168 {
169  if (attrName == anyQName()) {
170  synchronizeHref();
171  SVGTextPositioningElement::synchronizeProperty(attrName);
172  return;
173  }
174 
175  if (!isSupportedAttribute(attrName)) {
176  SVGTextPositioningElement::synchronizeProperty(attrName);
177  return;
178  }
179 
180  if (SVGURIReference::isKnownAttribute(attrName)) {
181  synchronizeHref();
182  return;
183  }
184 
185  ASSERT_NOT_REACHED();
186 }
187 
188 AttributeToPropertyTypeMap& SVGTRefElement::attributeToPropertyTypeMap()
189 {
190  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
191  return s_attributeToPropertyTypeMap;
192 }
193 
194 void SVGTRefElement::fillAttributeToPropertyTypeMap()
195 {
196  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
197 
198  SVGTextPositioningElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
199  attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
200 }
201 
202173RenderObject* SVGTRefElement::createRenderer(RenderArena* arena, RenderStyle*)
203174{
204175 return new (arena) RenderSVGInline(this);
90666

Source/WebCore/svg/SVGTRefElement.h

@@private:
4242 bool isSupportedAttribute(const QualifiedName&);
4343 virtual void parseMappedAttribute(Attribute*);
4444 virtual void svgAttributeChanged(const QualifiedName&);
45  virtual void synchronizeProperty(const QualifiedName&);
46  virtual void fillAttributeToPropertyTypeMap();
47  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
4845
4946 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
5047 virtual bool childShouldCreateRenderer(Node*) const;

@@private:
5653
5754 virtual void buildPendingResource();
5855
59  // Animated property declarations
60 
61  // SVGURIReference
62  DECLARE_ANIMATED_STRING(Href, href)
 56 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGTRefElement)
 57 DECLARE_ANIMATED_STRING(Href, href)
 58 END_DECLARE_ANIMATED_PROPERTIES
6359
6460 RefPtr<SubtreeModificationEventListener> m_eventListener;
6561};
90666

Source/WebCore/svg/SVGTSpanElement.cpp

@@bool SVGTSpanElement::rendererIsNeeded(c
7474 return false;
7575}
7676
77 AttributeToPropertyTypeMap& SVGTSpanElement::attributeToPropertyTypeMap()
78 {
79  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
80  return s_attributeToPropertyTypeMap;
81 }
82 
83 void SVGTSpanElement::fillAttributeToPropertyTypeMap()
84 {
85  SVGTextPositioningElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap());
86 }
87 
8877}
8978
9079#endif // ENABLE(SVG)
91 
92 // vim:ts=4:noet
90666

Source/WebCore/svg/SVGTSpanElement.h

@@private:
3636 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
3737 virtual bool childShouldCreateRenderer(Node*) const;
3838 virtual bool rendererIsNeeded(const NodeRenderingContext&);
39 
40  virtual void fillAttributeToPropertyTypeMap();
41  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
4239};
4340
4441} // namespace WebCore
90666

Source/WebCore/svg/SVGTests.cpp

3232
3333namespace WebCore {
3434
 35// Define custom non-animated property 'requiredFeatures'.
 36const SVGPropertyInfo* SVGTests::requiredFeaturesPropertyInfo()
 37{
 38 static const SVGPropertyInfo* s_propertyInfo = 0;
 39 if (!s_propertyInfo) {
 40 s_propertyInfo = new SVGPropertyInfo(AnimatedUnknown,
 41 SVGNames::requiredFeaturesAttr,
 42 SVGNames::requiredFeaturesAttr.localName(),
 43 &SVGElement::synchronizeRequiredFeatures,
 44 0);
 45 }
 46 return s_propertyInfo;
 47}
 48
 49// Define custom non-animated property 'requiredExtensions'.
 50const SVGPropertyInfo* SVGTests::requiredExtensionsPropertyInfo()
 51{
 52 static const SVGPropertyInfo* s_propertyInfo = 0;
 53 if (!s_propertyInfo) {
 54 s_propertyInfo = new SVGPropertyInfo(AnimatedUnknown,
 55 SVGNames::requiredExtensionsAttr,
 56 SVGNames::requiredExtensionsAttr.localName(),
 57 &SVGElement::synchronizeRequiredExtensions,
 58 0);
 59 }
 60 return s_propertyInfo;
 61}
 62
 63// Define custom non-animated property 'systemLanguage'.
 64const SVGPropertyInfo* SVGTests::systemLanguagePropertyInfo()
 65{
 66 static const SVGPropertyInfo* s_propertyInfo = 0;
 67 if (!s_propertyInfo) {
 68 s_propertyInfo = new SVGPropertyInfo(AnimatedUnknown,
 69 SVGNames::systemLanguageAttr,
 70 SVGNames::systemLanguageAttr.localName(),
 71 &SVGElement::synchronizeSystemLanguage,
 72 0);
 73 }
 74 return s_propertyInfo;
 75}
 76
3577SVGTests::SVGTests()
3678 : m_requiredFeatures(SVGNames::requiredFeaturesAttr)
3779 , m_requiredExtensions(SVGNames::requiredExtensionsAttr)

@@SVGTests::SVGTests()
3981{
4082}
4183
 84SVGAttributeToPropertyMap& SVGTests::attributeToPropertyMap()
 85{
 86 DEFINE_STATIC_LOCAL(SVGAttributeToPropertyMap, map, ());
 87 if (!map.isEmpty())
 88 return map;
 89 map.addProperty(requiredFeaturesPropertyInfo());
 90 map.addProperty(requiredExtensionsPropertyInfo());
 91 map.addProperty(systemLanguagePropertyInfo());
 92 return map;
 93}
 94
4295bool SVGTests::hasExtension(const String&) const
4396{
4497 // FIXME: Implement me!

@@void SVGTests::addSupportedAttributes(Ha
115168 supportedAttributes.add(SVGNames::systemLanguageAttr);
116169}
117170
118 void SVGTests::synchronizeProperties(SVGElement* contextElement, const QualifiedName& attrName)
119 {
120  if (attrName == anyQName()) {
121  synchronizeRequiredFeatures(contextElement);
122  synchronizeRequiredExtensions(contextElement);
123  synchronizeSystemLanguage(contextElement);
124  return;
125  }
126 
127  if (attrName == SVGNames::requiredFeaturesAttr)
128  synchronizeRequiredFeatures(contextElement);
129  else if (attrName == SVGNames::requiredExtensionsAttr)
130  synchronizeRequiredExtensions(contextElement);
131  else if (attrName == SVGNames::systemLanguageAttr)
132  synchronizeSystemLanguage(contextElement);
133 }
134 
135171void SVGTests::synchronizeRequiredFeatures(SVGElement* contextElement)
136172{
 173 ASSERT(contextElement);
137174 if (!m_requiredFeatures.shouldSynchronize)
138175 return;
139176 AtomicString value(m_requiredFeatures.value.valueAsString());
140  SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, SVGNames::requiredFeaturesAttr, value);
 177 SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, requiredFeaturesPropertyInfo()->attributeName, value);
141178}
142179
143180void SVGTests::synchronizeRequiredExtensions(SVGElement* contextElement)
144181{
 182 ASSERT(contextElement);
145183 if (!m_requiredExtensions.shouldSynchronize)
146184 return;
147185 AtomicString value(m_requiredExtensions.value.valueAsString());
148  SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, SVGNames::requiredExtensionsAttr, value);
 186 SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, requiredExtensionsPropertyInfo()->attributeName, value);
149187}
150188
151189void SVGTests::synchronizeSystemLanguage(SVGElement* contextElement)
152190{
 191 ASSERT(contextElement);
153192 if (!m_systemLanguage.shouldSynchronize)
154193 return;
155194 AtomicString value(m_systemLanguage.value.valueAsString());
156  SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, SVGNames::systemLanguageAttr, value);
 195 SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, systemLanguagePropertyInfo()->attributeName, value);
157196}
158197
159198SVGStringList& SVGTests::requiredFeatures()
90666

Source/WebCore/svg/SVGTests.h

2222#define SVGTests_h
2323
2424#if ENABLE(SVG)
 25#include "SVGAnimatedProperty.h"
2526#include "SVGAnimatedPropertyMacros.h"
2627#include "SVGStringList.h"
2728

@@public:
4546
4647 void addSupportedAttributes(HashSet<QualifiedName>&);
4748 bool handleAttributeChange(const SVGElement*, const QualifiedName&);
48  void synchronizeProperties(SVGElement*, const QualifiedName&);
 49
 50 static SVGAttributeToPropertyMap& attributeToPropertyMap();
4951
5052protected:
5153 SVGTests();
5254
53 private:
54  void synchronizeRequiredFeatures(SVGElement*);
55  void synchronizeRequiredExtensions(SVGElement*);
56  void synchronizeSystemLanguage(SVGElement*);
 55 void synchronizeRequiredFeatures(SVGElement* contextElement);
 56 void synchronizeRequiredExtensions(SVGElement* contextElement);
 57 void synchronizeSystemLanguage(SVGElement* contextElement);
5758
 59private:
 60 // Custom 'requiredFeatures' property
 61 static const SVGPropertyInfo* requiredFeaturesPropertyInfo();
5862 SVGSynchronizableAnimatedProperty<SVGStringList> m_requiredFeatures;
 63
 64 // Custom 'requiredExtensions' property
 65 static const SVGPropertyInfo* requiredExtensionsPropertyInfo();
5966 SVGSynchronizableAnimatedProperty<SVGStringList> m_requiredExtensions;
 67
 68 // Custom 'systemLanguage' property
 69 static const SVGPropertyInfo* systemLanguagePropertyInfo();
6070 SVGSynchronizableAnimatedProperty<SVGStringList> m_systemLanguage;
6171};
6272
90666

Source/WebCore/svg/SVGTextContentElement.cpp

3737#include "XMLNames.h"
3838
3939namespace WebCore {
 40
 41// Define custom animated property 'textLength'.
 42const SVGPropertyInfo* SVGTextContentElement::textLengthPropertyInfo()
 43{
 44 static const SVGPropertyInfo* s_propertyInfo = 0;
 45 if (!s_propertyInfo) {
 46 s_propertyInfo = new SVGPropertyInfo(AnimatedLength,
 47 SVGNames::textLengthAttr,
 48 SVGNames::textLengthAttr.localName(),
 49 &SVGTextContentElement::synchronizeTextLength,
 50 &SVGTextContentElement::lookupOrCreateTextLengthWrapper);
 51 }
 52 return s_propertyInfo;
 53}
4054
4155// Animated property definitions
4256DEFINE_ANIMATED_ENUMERATION(SVGTextContentElement, SVGNames::lengthAdjustAttr, LengthAdjust, lengthAdjust, SVGLengthAdjustType)
4357DEFINE_ANIMATED_BOOLEAN(SVGTextContentElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
4458
 59BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGTextContentElement)
 60 REGISTER_LOCAL_ANIMATED_PROPERTY(textLength)
 61 REGISTER_LOCAL_ANIMATED_PROPERTY(lengthAdjust)
 62 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 63 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
 64 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 65END_REGISTER_ANIMATED_PROPERTIES
 66
4567SVGTextContentElement::SVGTextContentElement(const QualifiedName& tagName, Document* document)
4668 : SVGStyledElement(tagName, document)
47  , m_specifiedTextLength(LengthModeOther)
4869 , m_textLength(LengthModeOther)
 70 , m_specifiedTextLength(LengthModeOther)
4971 , m_lengthAdjust(SVGLengthAdjustSpacing)
5072{
 73 registerAnimatedPropertiesForSVGTextContentElement();
5174}
5275
53 void SVGTextContentElement::synchronizeTextLength()
 76void SVGTextContentElement::synchronizeTextLength(void* contextElement)
5477{
55  if (!m_textLength.shouldSynchronize)
 78 ASSERT(contextElement);
 79 SVGTextContentElement* ownerType = static_cast<SVGTextContentElement*>(contextElement);
 80 if (!ownerType->m_textLength.shouldSynchronize)
5681 return;
57  AtomicString value(SVGPropertyTraits<SVGLength>::toString(m_specifiedTextLength));
58  SVGAnimatedPropertySynchronizer<true>::synchronize(this, SVGNames::textLengthAttr, value);
 82 AtomicString value(SVGPropertyTraits<SVGLength>::toString(ownerType->m_specifiedTextLength));
 83 SVGAnimatedPropertySynchronizer<true>::synchronize(ownerType, textLengthPropertyInfo()->attributeName, value);
 84}
 85
 86PassRefPtr<SVGAnimatedProperty> SVGTextContentElement::lookupOrCreateTextLengthWrapper(void* contextElement)
 87{
 88 ASSERT(contextElement);
 89 SVGTextContentElement* ownerType = static_cast<SVGTextContentElement*>(contextElement);
 90 return SVGAnimatedProperty::lookupOrCreateWrapper<SVGTextContentElement, SVGAnimatedLength, SVGLength, true>
 91 (ownerType, textLengthPropertyInfo(), ownerType->m_textLength.value);
5992}
6093
6194PassRefPtr<SVGAnimatedLength> SVGTextContentElement::textLengthAnimated()

@@PassRefPtr<SVGAnimatedLength> SVGTextCon
68101 }
69102
70103 m_textLength.shouldSynchronize = true;
71  return SVGAnimatedProperty::lookupOrCreateWrapper<SVGAnimatedLength, SVGLength>(this, SVGNames::textLengthAttr, SVGNames::textLengthAttr.localName(), m_textLength.value);
 104 return static_pointer_cast<SVGAnimatedLength>(lookupOrCreateTextLengthWrapper(this));
 105
72106}
73107
74108unsigned SVGTextContentElement::getNumberOfChars() const

@@void SVGTextContentElement::parseMappedA
236270 ASSERT_NOT_REACHED();
237271}
238272
239 void SVGTextContentElement::synchronizeProperty(const QualifiedName& attrName)
240 {
241  if (attrName == anyQName()) {
242  synchronizeLengthAdjust();
243  synchronizeTextLength();
244  synchronizeExternalResourcesRequired();
245  SVGTests::synchronizeProperties(this, attrName);
246  SVGStyledElement::synchronizeProperty(attrName);
247  return;
248  }
249 
250  if (!isSupportedAttribute(attrName)) {
251  SVGStyledElement::synchronizeProperty(attrName);
252  return;
253  }
254 
255  if (attrName == SVGNames::lengthAdjustAttr) {
256  synchronizeLengthAdjust();
257  return;
258  }
259 
260  if (attrName == SVGNames::textLengthAttr) {
261  synchronizeTextLength();
262  return;
263  }
264 
265  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
266  synchronizeExternalResourcesRequired();
267  return;
268  }
269 
270  if (SVGTests::isKnownAttribute(attrName)) {
271  SVGTests::synchronizeProperties(this, attrName);
272  return;
273  }
274 
275  ASSERT_NOT_REACHED();
276 }
277 
278273void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName)
279274{
280275 if (!isSupportedAttribute(attrName)) {

@@void SVGTextContentElement::svgAttribute
294289 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
295290}
296291
297 void SVGTextContentElement::fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap& attributeToPropertyTypeMap)
298 {
299  SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
300 
301  attributeToPropertyTypeMap.set(SVGNames::textLengthAttr, AnimatedLength);
302  attributeToPropertyTypeMap.set(SVGNames::lengthAdjustAttr, AnimatedEnumeration);
303 }
304 
305292bool SVGTextContentElement::selfHasRelativeLengths() const
306293{
307294 // Any element of the <text> subtree is advertized as using relative lengths.
90666

Source/WebCore/svg/SVGTextContentElement.h

@@public:
9595 // as its getter needs special handling (return getComputedTextLength(), instead of m_textLength).
9696 SVGLength& specifiedTextLength() { return m_specifiedTextLength; }
9797 PassRefPtr<SVGAnimatedLength> textLengthAnimated();
 98 static const SVGPropertyInfo* textLengthPropertyInfo();
9899
99100protected:
100101 SVGTextContentElement(const QualifiedName&, Document*);

@@protected:
104105 bool isSupportedAttribute(const QualifiedName&);
105106 virtual void parseMappedAttribute(Attribute*);
106107 virtual void svgAttributeChanged(const QualifiedName&);
107  virtual void synchronizeProperty(const QualifiedName&);
108  void fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap&);
109108
110109 virtual bool selfHasRelativeLengths() const;
111110 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);

@@protected:
113112private:
114113 virtual bool isTextContent() const { return true; }
115114
116  // Animated property declarations
117  void synchronizeTextLength();
118  SVGLength m_specifiedTextLength;
 115 // Custom 'textLength' property
 116 static void synchronizeTextLength(void* contextElement);
 117 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateTextLengthWrapper(void* contextElement);
119118 mutable SVGSynchronizableAnimatedProperty<SVGLength> m_textLength;
120  DECLARE_ANIMATED_ENUMERATION(LengthAdjust, lengthAdjust, SVGLengthAdjustType)
121 
122  // SVGExternalResourcesRequired
123  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 119 SVGLength m_specifiedTextLength;
 120
 121 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGTextContentElement)
 122 DECLARE_ANIMATED_ENUMERATION(LengthAdjust, lengthAdjust, SVGLengthAdjustType)
 123 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 124 END_DECLARE_ANIMATED_PROPERTIES
 125
 126 // SVGTests
 127 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 128 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 129 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
124130};
125131
126132} // namespace WebCore
90666

Source/WebCore/svg/SVGTextElement.cpp

@@namespace WebCore {
3838// Animated property definitions
3939DEFINE_ANIMATED_TRANSFORM_LIST(SVGTextElement, SVGNames::transformAttr, Transform, transform)
4040
 41BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGTextElement)
 42 REGISTER_LOCAL_ANIMATED_PROPERTY(transform)
 43 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTextPositioningElement)
 44END_REGISTER_ANIMATED_PROPERTIES
 45
4146inline SVGTextElement::SVGTextElement(const QualifiedName& tagName, Document* doc)
4247 : SVGTextPositioningElement(tagName, doc)
4348{
4449 ASSERT(hasTagName(SVGNames::textTag));
 50 registerAnimatedPropertiesForSVGTextElement();
4551}
4652
4753PassRefPtr<SVGTextElement> SVGTextElement::create(const QualifiedName& tagName, Document* document)

@@void SVGTextElement::svgAttributeChanged
160166 ASSERT_NOT_REACHED();
161167}
162168
163 void SVGTextElement::synchronizeProperty(const QualifiedName& attrName)
164 {
165  if (attrName == anyQName()) {
166  synchronizeTransform();
167  SVGTextPositioningElement::synchronizeProperty(attrName);
168  return;
169  }
170 
171  if (!isSupportedAttribute(attrName)) {
172  SVGTextPositioningElement::synchronizeProperty(attrName);
173  return;
174  }
175 
176  if (attrName == SVGNames::transformAttr) {
177  synchronizeTransform();
178  return;
179  }
180 
181  ASSERT_NOT_REACHED();
182 }
183 
184 AttributeToPropertyTypeMap& SVGTextElement::attributeToPropertyTypeMap()
185 {
186  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
187  return s_attributeToPropertyTypeMap;
188 }
189 
190 void SVGTextElement::fillAttributeToPropertyTypeMap()
191 {
192  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
193 
194  SVGTextPositioningElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
195  attributeToPropertyTypeMap.set(SVGNames::transformAttr, AnimatedTransformList);
196 }
197 
198169}
199170
200171#endif // ENABLE(SVG)
90666

Source/WebCore/svg/SVGTextElement.h

@@private:
5656 virtual bool childShouldCreateRenderer(Node*) const;
5757
5858 virtual void svgAttributeChanged(const QualifiedName&);
59  virtual void synchronizeProperty(const QualifiedName&);
60  virtual void fillAttributeToPropertyTypeMap();
61  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
6259
63  // Animated property declarations
64  DECLARE_ANIMATED_TRANSFORM_LIST(Transform, transform)
 60 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGTextElement)
 61 DECLARE_ANIMATED_TRANSFORM_LIST(Transform, transform)
 62 END_DECLARE_ANIMATED_PROPERTIES
6563
6664 // Used by <animateMotion>
6765 OwnPtr<AffineTransform> m_supplementalTransform;
90666

Source/WebCore/svg/SVGTextPathElement.cpp

@@DEFINE_ANIMATED_ENUMERATION(SVGTextPathE
3737DEFINE_ANIMATED_ENUMERATION(SVGTextPathElement, SVGNames::spacingAttr, Spacing, spacing, SVGTextPathSpacingType)
3838DEFINE_ANIMATED_STRING(SVGTextPathElement, XLinkNames::hrefAttr, Href, href)
3939
 40BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGTextPathElement)
 41 REGISTER_LOCAL_ANIMATED_PROPERTY(startOffset)
 42 REGISTER_LOCAL_ANIMATED_PROPERTY(method)
 43 REGISTER_LOCAL_ANIMATED_PROPERTY(spacing)
 44 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
 45 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTextContentElement)
 46END_REGISTER_ANIMATED_PROPERTIES
 47
4048inline SVGTextPathElement::SVGTextPathElement(const QualifiedName& tagName, Document* document)
4149 : SVGTextContentElement(tagName, document)
4250 , m_startOffset(LengthModeOther)

@@inline SVGTextPathElement::SVGTextPathEl
4452 , m_spacing(SVGTextPathSpacingExact)
4553{
4654 ASSERT(hasTagName(SVGNames::textPathTag));
 55 registerAnimatedPropertiesForSVGTextPathElement();
4756}
4857
4958PassRefPtr<SVGTextPathElement> SVGTextPathElement::create(const QualifiedName& tagName, Document* document)

@@void SVGTextPathElement::svgAttributeCha
112121 RenderSVGResource::markForLayoutAndParentResourceInvalidation(object);
113122}
114123
115 void SVGTextPathElement::synchronizeProperty(const QualifiedName& attrName)
116 {
117  if (attrName == anyQName()) {
118  synchronizeStartOffset();
119  synchronizeMethod();
120  synchronizeSpacing();
121  synchronizeHref();
122  SVGTextContentElement::synchronizeProperty(attrName);
123  return;
124  }
125 
126  if (!isSupportedAttribute(attrName)) {
127  SVGTextContentElement::synchronizeProperty(attrName);
128  return;
129  }
130 
131  if (attrName == SVGNames::startOffsetAttr) {
132  synchronizeStartOffset();
133  return;
134  }
135 
136  if (attrName == SVGNames::methodAttr) {
137  synchronizeMethod();
138  return;
139  }
140 
141  if (attrName == SVGNames::spacingAttr) {
142  synchronizeSpacing();
143  return;
144  }
145 
146  if (SVGURIReference::isKnownAttribute(attrName)) {
147  synchronizeHref();
148  return;
149  }
150 
151  ASSERT_NOT_REACHED();
152 }
153 
154 AttributeToPropertyTypeMap& SVGTextPathElement::attributeToPropertyTypeMap()
155 {
156  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
157  return s_attributeToPropertyTypeMap;
158 }
159 
160 void SVGTextPathElement::fillAttributeToPropertyTypeMap()
161 {
162  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
163 
164  SVGTextContentElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
165  attributeToPropertyTypeMap.set(SVGNames::startOffsetAttr, AnimatedLength);
166  attributeToPropertyTypeMap.set(SVGNames::methodAttr, AnimatedEnumeration);
167  attributeToPropertyTypeMap.set(SVGNames::spacingAttr, AnimatedEnumeration);
168  attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
169 }
170 
171124RenderObject* SVGTextPathElement::createRenderer(RenderArena* arena, RenderStyle*)
172125{
173126 return new (arena) RenderSVGTextPath(this);
90666

Source/WebCore/svg/SVGTextPathElement.h

@@enum SVGTextPathSpacingType {
3939 SVGTextPathSpacingExact
4040};
4141
42 class SVGTextPathElement : public SVGTextContentElement,
43  public SVGURIReference {
44 public:
45  // Forward declare enumerations in the W3C naming scheme, for IDL generation.
46  enum {
47  TEXTPATH_METHODTYPE_UNKNOWN = SVGTextPathMethodUnknown,
48  TEXTPATH_METHODTYPE_ALIGN = SVGTextPathMethodAlign,
49  TEXTPATH_METHODTYPE_STRETCH = SVGTextPathMethodStretch,
50  TEXTPATH_SPACINGTYPE_UNKNOWN = SVGTextPathSpacingUnknown,
51  TEXTPATH_SPACINGTYPE_AUTO = SVGTextPathSpacingAuto,
52  TEXTPATH_SPACINGTYPE_EXACT = SVGTextPathSpacingExact
53  };
54 
55  static PassRefPtr<SVGTextPathElement> create(const QualifiedName&, Document*);
56 
57 private:
58  SVGTextPathElement(const QualifiedName&, Document*);
59 
60  virtual void insertedIntoDocument();
61 
62  bool isSupportedAttribute(const QualifiedName&);
63  virtual void parseMappedAttribute(Attribute*);
64  virtual void svgAttributeChanged(const QualifiedName&);
65  virtual void synchronizeProperty(const QualifiedName&);
66  virtual void fillAttributeToPropertyTypeMap();
67  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
68 
69  virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
70  virtual bool childShouldCreateRenderer(Node*) const;
71  virtual bool rendererIsNeeded(const NodeRenderingContext&);
72 
73  virtual bool selfHasRelativeLengths() const;
74 
75  // Animated property declarations
76  DECLARE_ANIMATED_LENGTH(StartOffset, startOffset)
77  DECLARE_ANIMATED_ENUMERATION(Method, method, SVGTextPathMethodType)
78  DECLARE_ANIMATED_ENUMERATION(Spacing, spacing, SVGTextPathSpacingType)
79 
80  // SVGURIReference
81  DECLARE_ANIMATED_STRING(Href, href)
82 };
83 
8442template<>
8543struct SVGPropertyTraits<SVGTextPathMethodType> {
8644 static SVGTextPathMethodType highestEnumValue() { return SVGTextPathMethodStretch; }

@@struct SVGPropertyTraits<SVGTextPathSpac
13997 }
14098};
14199
 100class SVGTextPathElement : public SVGTextContentElement,
 101 public SVGURIReference {
 102public:
 103 // Forward declare enumerations in the W3C naming scheme, for IDL generation.
 104 enum {
 105 TEXTPATH_METHODTYPE_UNKNOWN = SVGTextPathMethodUnknown,
 106 TEXTPATH_METHODTYPE_ALIGN = SVGTextPathMethodAlign,
 107 TEXTPATH_METHODTYPE_STRETCH = SVGTextPathMethodStretch,
 108 TEXTPATH_SPACINGTYPE_UNKNOWN = SVGTextPathSpacingUnknown,
 109 TEXTPATH_SPACINGTYPE_AUTO = SVGTextPathSpacingAuto,
 110 TEXTPATH_SPACINGTYPE_EXACT = SVGTextPathSpacingExact
 111 };
 112
 113 static PassRefPtr<SVGTextPathElement> create(const QualifiedName&, Document*);
 114
 115private:
 116 SVGTextPathElement(const QualifiedName&, Document*);
 117
 118 virtual void insertedIntoDocument();
 119
 120 bool isSupportedAttribute(const QualifiedName&);
 121 virtual void parseMappedAttribute(Attribute*);
 122 virtual void svgAttributeChanged(const QualifiedName&);
 123
 124 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
 125 virtual bool childShouldCreateRenderer(Node*) const;
 126 virtual bool rendererIsNeeded(const NodeRenderingContext&);
 127
 128 virtual bool selfHasRelativeLengths() const;
 129
 130 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGTextPathElement)
 131 DECLARE_ANIMATED_LENGTH(StartOffset, startOffset)
 132 DECLARE_ANIMATED_ENUMERATION(Method, method, SVGTextPathMethodType)
 133 DECLARE_ANIMATED_ENUMERATION(Spacing, spacing, SVGTextPathSpacingType)
 134 DECLARE_ANIMATED_STRING(Href, href)
 135 END_DECLARE_ANIMATED_PROPERTIES
 136};
 137
142138} // namespace WebCore
143139
144140#endif // ENABLE(SVG)
90666

Source/WebCore/svg/SVGTextPositioningElement.cpp

@@DEFINE_ANIMATED_LENGTH_LIST(SVGTextPosit
4040DEFINE_ANIMATED_LENGTH_LIST(SVGTextPositioningElement, SVGNames::dyAttr, Dy, dy)
4141DEFINE_ANIMATED_NUMBER_LIST(SVGTextPositioningElement, SVGNames::rotateAttr, Rotate, rotate)
4242
 43BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGTextPositioningElement)
 44 REGISTER_LOCAL_ANIMATED_PROPERTY(x)
 45 REGISTER_LOCAL_ANIMATED_PROPERTY(y)
 46 REGISTER_LOCAL_ANIMATED_PROPERTY(dx)
 47 REGISTER_LOCAL_ANIMATED_PROPERTY(dy)
 48 REGISTER_LOCAL_ANIMATED_PROPERTY(rotate)
 49 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTextContentElement)
 50END_REGISTER_ANIMATED_PROPERTIES
 51
4352SVGTextPositioningElement::SVGTextPositioningElement(const QualifiedName& tagName, Document* document)
4453 : SVGTextContentElement(tagName, document)
4554{
 55 registerAnimatedPropertiesForSVGTextPositioningElement();
4656}
4757
4858bool SVGTextPositioningElement::isSupportedAttribute(const QualifiedName& attrName)

@@void SVGTextPositioningElement::svgAttri
139149 ASSERT_NOT_REACHED();
140150}
141151
142 void SVGTextPositioningElement::synchronizeProperty(const QualifiedName& attrName)
143 {
144  if (attrName == anyQName()) {
145  synchronizeX();
146  synchronizeY();
147  synchronizeDx();
148  synchronizeDy();
149  synchronizeRotate();
150  SVGTextContentElement::synchronizeProperty(attrName);
151  return;
152  }
153 
154  if (!isSupportedAttribute(attrName)) {
155  SVGTextContentElement::synchronizeProperty(attrName);
156  return;
157  }
158 
159  if (attrName == SVGNames::xAttr) {
160  synchronizeX();
161  return;
162  }
163 
164  if (attrName == SVGNames::yAttr) {
165  synchronizeY();
166  return;
167  }
168 
169  if (attrName == SVGNames::dxAttr) {
170  synchronizeDx();
171  return;
172  }
173 
174  if (attrName == SVGNames::dyAttr) {
175  synchronizeDy();
176  return;
177  }
178 
179  if (attrName == SVGNames::rotateAttr) {
180  synchronizeRotate();
181  return;
182  }
183 
184  ASSERT_NOT_REACHED();
185 }
186 
187 void SVGTextPositioningElement::fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap& attributeToPropertyTypeMap)
188 {
189  SVGTextContentElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
190 
191  attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLengthList);
192  attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLengthList);
193  attributeToPropertyTypeMap.set(SVGNames::dxAttr, AnimatedLengthList);
194  attributeToPropertyTypeMap.set(SVGNames::dyAttr, AnimatedLengthList);
195  attributeToPropertyTypeMap.set(SVGNames::rotateAttr, AnimatedNumberList);
196 }
197 
198152SVGTextPositioningElement* SVGTextPositioningElement::elementFromRenderer(RenderObject* renderer)
199153{
200154 if (!renderer)
90666

Source/WebCore/svg/SVGTextPositioningElement.h

@@protected:
3838 bool isSupportedAttribute(const QualifiedName&);
3939 virtual void parseMappedAttribute(Attribute*);
4040 virtual void svgAttributeChanged(const QualifiedName&);
41  virtual void synchronizeProperty(const QualifiedName&);
42  void fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap&);
4341
44  // Animated property declarations
45  DECLARE_ANIMATED_LENGTH_LIST(X, x)
46  DECLARE_ANIMATED_LENGTH_LIST(Y, y)
47  DECLARE_ANIMATED_LENGTH_LIST(Dx, dx)
48  DECLARE_ANIMATED_LENGTH_LIST(Dy, dy)
49  DECLARE_ANIMATED_NUMBER_LIST(Rotate, rotate)
 42 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGTextPositioningElement)
 43 DECLARE_ANIMATED_LENGTH_LIST(X, x)
 44 DECLARE_ANIMATED_LENGTH_LIST(Y, y)
 45 DECLARE_ANIMATED_LENGTH_LIST(Dx, dx)
 46 DECLARE_ANIMATED_LENGTH_LIST(Dy, dy)
 47 DECLARE_ANIMATED_NUMBER_LIST(Rotate, rotate)
 48 END_DECLARE_ANIMATED_PROPERTIES
5049};
5150
5251} // namespace WebCore
90666

Source/WebCore/svg/SVGTitleElement.cpp

@@void SVGTitleElement::childrenChanged(bo
6060 document()->setTitleElement(StringWithDirection(textContent(), LTR), this);
6161}
6262
63 AttributeToPropertyTypeMap& SVGTitleElement::attributeToPropertyTypeMap()
64 {
65  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
66  return s_attributeToPropertyTypeMap;
6763}
6864
69 void SVGTitleElement::fillAttributeToPropertyTypeMap()
70 {
71  SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap());
72 }
73 
74 }
75 
76 // vim:ts=4:noet
7765#endif // ENABLE(SVG)
90666

Source/WebCore/svg/SVGTitleElement.h

@@private:
4040 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
4141
4242 virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }
43 
44  virtual void fillAttributeToPropertyTypeMap();
45  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
4643};
4744
4845} // namespace WebCore
90666

Source/WebCore/svg/SVGUseElement.cpp

@@DEFINE_ANIMATED_LENGTH(SVGUseElement, SV
6363DEFINE_ANIMATED_STRING(SVGUseElement, XLinkNames::hrefAttr, Href, href)
6464DEFINE_ANIMATED_BOOLEAN(SVGUseElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
6565
 66BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGUseElement)
 67 REGISTER_LOCAL_ANIMATED_PROPERTY(x)
 68 REGISTER_LOCAL_ANIMATED_PROPERTY(y)
 69 REGISTER_LOCAL_ANIMATED_PROPERTY(width)
 70 REGISTER_LOCAL_ANIMATED_PROPERTY(height)
 71 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
 72 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 73 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
 74 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
 75END_REGISTER_ANIMATED_PROPERTIES
 76
6677inline SVGUseElement::SVGUseElement(const QualifiedName& tagName, Document* document)
6778 : SVGStyledTransformableElement(tagName, document)
6879 , m_x(LengthModeWidth)

@@inline SVGUseElement::SVGUseElement(cons
7384 , m_needsShadowTreeRecreation(false)
7485{
7586 ASSERT(hasTagName(SVGNames::useTag));
 87 registerAnimatedPropertiesForSVGUseElement();
7688}
7789
7890PassRefPtr<SVGUseElement> SVGUseElement::create(const QualifiedName& tagName, Document* document)

@@void SVGUseElement::svgAttributeChanged(
243255 ASSERT_NOT_REACHED();
244256}
245257
246 void SVGUseElement::synchronizeProperty(const QualifiedName& attrName)
247 {
248  if (attrName == anyQName()) {
249  synchronizeX();
250  synchronizeY();
251  synchronizeWidth();
252  synchronizeHeight();
253  synchronizeExternalResourcesRequired();
254  synchronizeHref();
255  SVGTests::synchronizeProperties(this, attrName);
256  SVGStyledTransformableElement::synchronizeProperty(attrName);
257  return;
258  }
259 
260  if (!isSupportedAttribute(attrName)) {
261  SVGStyledTransformableElement::synchronizeProperty(attrName);
262  return;
263  }
264 
265  if (attrName == SVGNames::xAttr) {
266  synchronizeX();
267  return;
268  }
269 
270  if (attrName == SVGNames::yAttr) {
271  synchronizeY();
272  return;
273  }
274 
275  if (attrName == SVGNames::widthAttr) {
276  synchronizeWidth();
277  return;
278  }
279 
280  if (attrName == SVGNames::heightAttr) {
281  synchronizeHeight();
282  return;
283  }
284 
285  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
286  synchronizeExternalResourcesRequired();
287  return;
288  }
289 
290  if (SVGURIReference::isKnownAttribute(attrName)) {
291  synchronizeHref();
292  return;
293  }
294 
295  if (SVGTests::isKnownAttribute(attrName)) {
296  SVGTests::synchronizeProperties(this, attrName);
297  return;
298  }
299 
300  ASSERT_NOT_REACHED();
301 }
302 
303 AttributeToPropertyTypeMap& SVGUseElement::attributeToPropertyTypeMap()
304 {
305  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
306  return s_attributeToPropertyTypeMap;
307 }
308 
309 void SVGUseElement::fillAttributeToPropertyTypeMap()
310 {
311  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
312 
313  SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
314  attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
315  attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
316  attributeToPropertyTypeMap.set(SVGNames::widthAttr, AnimatedLength);
317  attributeToPropertyTypeMap.set(SVGNames::heightAttr, AnimatedLength);
318  attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
319 }
320 
321258static void updateContainerSize(SVGElementInstance* targetInstance)
322259{
323260 // Depth-first used to write the method in early exit style, no particular other reason.
90666

Source/WebCore/svg/SVGUseElement.h

@@private:
6363 bool isSupportedAttribute(const QualifiedName&);
6464 virtual void parseMappedAttribute(Attribute*);
6565 virtual void svgAttributeChanged(const QualifiedName&);
66  virtual void synchronizeProperty(const QualifiedName&);
67  virtual void fillAttributeToPropertyTypeMap();
68  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
6966
7067 virtual void recalcStyle(StyleChange = NoChange);
7168 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);

@@private:
106103 void updateContainerOffsets();
107104 void updateContainerSizes();
108105
109  // Animated property declarations
110  DECLARE_ANIMATED_LENGTH(X, x)
111  DECLARE_ANIMATED_LENGTH(Y, y)
112  DECLARE_ANIMATED_LENGTH(Width, width)
113  DECLARE_ANIMATED_LENGTH(Height, height)
114 
115  // SVGURIReference
116  DECLARE_ANIMATED_STRING(Href, href)
117 
118  // SVGExternalResourcesRequired
119  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 106 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGUseElement)
 107 DECLARE_ANIMATED_LENGTH(X, x)
 108 DECLARE_ANIMATED_LENGTH(Y, y)
 109 DECLARE_ANIMATED_LENGTH(Width, width)
 110 DECLARE_ANIMATED_LENGTH(Height, height)
 111 DECLARE_ANIMATED_STRING(Href, href)
 112 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 113 END_DECLARE_ANIMATED_PROPERTIES
 114
 115 // SVGTests
 116 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
 117 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
 118 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
120119
121120 bool m_updatesBlocked;
122121 bool m_needsShadowTreeRecreation;
90666

Source/WebCore/svg/SVGViewElement.cpp

@@DEFINE_ANIMATED_BOOLEAN(SVGViewElement,
3636DEFINE_ANIMATED_RECT(SVGViewElement, SVGNames::viewBoxAttr, ViewBox, viewBox)
3737DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGViewElement, SVGNames::preserveAspectRatioAttr, PreserveAspectRatio, preserveAspectRatio)
3838
 39BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGViewElement)
 40 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
 41 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox)
 42 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
 43 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
 44END_REGISTER_ANIMATED_PROPERTIES
 45
3946inline SVGViewElement::SVGViewElement(const QualifiedName& tagName, Document* document)
4047 : SVGStyledElement(tagName, document)
4148 , m_viewTarget(SVGNames::viewTargetAttr)
4249{
4350 ASSERT(hasTagName(SVGNames::viewTag));
 51 registerAnimatedPropertiesForSVGViewElement();
4452}
4553
4654PassRefPtr<SVGViewElement> SVGViewElement::create(const QualifiedName& tagName, Document* document)

@@void SVGViewElement::parseMappedAttribut
8290 ASSERT_NOT_REACHED();
8391}
8492
85 void SVGViewElement::synchronizeProperty(const QualifiedName& attrName)
86 {
87  if (attrName == anyQName()) {
88  synchronizeExternalResourcesRequired();
89  SVGFitToViewBox::synchronizeProperties(attrName);
90  SVGStyledElement::synchronizeProperty(attrName);
91  return;
92  }
93 
94  if (!isSupportedAttribute(attrName)) {
95  SVGStyledElement::synchronizeProperty(attrName);
96  return;
97  }
98 
99  if (attrName == SVGNames::viewTargetAttr)
100  return;
101 
102  if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
103  synchronizeExternalResourcesRequired();
104  return;
105  }
106 
107  if (SVGFitToViewBox::isKnownAttribute(attrName)) {
108  SVGFitToViewBox::synchronizeProperties(attrName);
109  return;
110  }
111 
112  ASSERT_NOT_REACHED();
113 }
114 
115 AttributeToPropertyTypeMap& SVGViewElement::attributeToPropertyTypeMap()
116 {
117  DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
118  return s_attributeToPropertyTypeMap;
119 }
120 
121 void SVGViewElement::fillAttributeToPropertyTypeMap()
122 {
123  AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
124 
125  SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
126  attributeToPropertyTypeMap.set(SVGNames::viewBoxAttr, AnimatedRect);
127  attributeToPropertyTypeMap.set(SVGNames::preserveAspectRatioAttr, AnimatedPreserveAspectRatio);
128 }
129 
13093}
13194
13295#endif // ENABLE(SVG)
90666

Source/WebCore/svg/SVGViewElement.h

@@private:
4848 // FIXME: svgAttributeChanged missing.
4949 bool isSupportedAttribute(const QualifiedName&);
5050 virtual void parseMappedAttribute(Attribute*);
51  virtual void synchronizeProperty(const QualifiedName&);
52  virtual void fillAttributeToPropertyTypeMap();
53  virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
5451
5552 virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }
5653
57  // Animated property declarations
58 
59  // SVGExternalResourcesRequired
60  DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
61 
62  // SVGFitToViewBox
63  DECLARE_ANIMATED_RECT(ViewBox, viewBox)
64  DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
 54 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGViewElement)
 55 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
 56 DECLARE_ANIMATED_RECT(ViewBox, viewBox)
 57 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
 58 END_DECLARE_ANIMATED_PROPERTIES
6559
6660 SVGStringList m_viewTarget;
6761};
90666

Source/WebCore/svg/SVGViewSpec.cpp

@@namespace WebCore {
3434DEFINE_ANIMATED_RECT(SVGViewSpec, SVGNames::viewBoxAttr, ViewBox, viewBox)
3535DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGViewSpec, SVGNames::preserveAspectRatioAttr, PreserveAspectRatio, preserveAspectRatio)
3636
 37BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGViewSpec)
 38 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox)
 39 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
 40END_REGISTER_ANIMATED_PROPERTIES
 41
3742SVGViewSpec::SVGViewSpec(SVGElement* contextElement)
3843 : m_contextElement(contextElement)
3944{
 45 ASSERT(m_contextElement);
 46 registerAnimatedPropertiesForSVGViewSpec();
4047}
4148
4249void SVGViewSpec::setTransform(const String& transform)
90666

Source/WebCore/svg/SVGViewSpec.h

@@public:
5050 String viewTargetString() const { return m_viewTargetString; }
5151 SVGElement* viewTarget() const;
5252
53  SVGElement* contextElement() const { return const_cast<SVGElement*>(m_contextElement); }
54 
5553private:
5654 SVGElement* m_contextElement;
5755
58  // Animated property declarations
59 
60  // SVGFitToViewBox
61  DECLARE_ANIMATED_RECT(ViewBox, viewBox)
62  DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
 56 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGViewSpec)
 57 DECLARE_ANIMATED_RECT(ViewBox, viewBox)
 58 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
 59 END_DECLARE_ANIMATED_PROPERTIES
6360
6461 SVGTransformList m_transform;
6562 String m_viewTargetString;
90666

Source/WebCore/svg/properties/SVGAnimatedProperty.h

2121#define SVGAnimatedProperty_h
2222
2323#if ENABLE(SVG)
24 #include "QualifiedName.h"
2524#include "SVGAnimatedPropertyDescription.h"
2625#include "SVGElement.h"
 26#include "SVGPropertyInfo.h"
2727#include <wtf/RefCounted.h>
2828
2929namespace WebCore {
3030
3131class SVGElement;
32 class SVGProperty;
3332
3433class SVGAnimatedProperty : public RefCounted<SVGAnimatedProperty> {
3534public:

@@public:
6160 }
6261 }
6362
 63 template<typename TearOffType, typename PropertyType, bool isDerivedFromSVGElement>
 64 struct Helper;
 65
6466 template<typename TearOffType, typename PropertyType>
65  static PassRefPtr<TearOffType> lookupOrCreateWrapper(SVGElement* element, const QualifiedName& attributeName, const AtomicString& attributeIdentifier, PropertyType& property)
66  {
67  SVGAnimatedPropertyDescription key(element, attributeIdentifier);
68  RefPtr<SVGAnimatedProperty> wrapper = animatedPropertyCache()->get(key);
69  if (!wrapper) {
70  wrapper = TearOffType::create(element, attributeName, property);
71  animatedPropertyCache()->set(key, wrapper);
 67 struct Helper<TearOffType, PropertyType, false> {
 68 static PassRefPtr<TearOffType> lookupOrCreateWrapper(void*, const SVGPropertyInfo*, PropertyType&)
 69 {
 70 ASSERT_NOT_REACHED();
 71 return PassRefPtr<TearOffType>();
7272 }
 73 };
7374
74  return static_pointer_cast<TearOffType>(wrapper).release();
 75 template<typename TearOffType, typename PropertyType>
 76 struct Helper<TearOffType, PropertyType, true> {
 77 static PassRefPtr<TearOffType> lookupOrCreateWrapper(SVGElement* element, const SVGPropertyInfo* info, PropertyType& property)
 78 {
 79 ASSERT(info);
 80 SVGAnimatedPropertyDescription key(element, info->propertyIdentifier);
 81 RefPtr<SVGAnimatedProperty> wrapper = animatedPropertyCache()->get(key);
 82 if (!wrapper) {
 83 wrapper = TearOffType::create(element, info->attributeName, property);
 84 animatedPropertyCache()->set(key, wrapper);
 85 }
 86 return static_pointer_cast<TearOffType>(wrapper).release();
 87 }
 88 };
 89
 90 template<typename OwnerType, typename TearOffType, typename PropertyType, bool isDerivedFromSVGElement>
 91 static PassRefPtr<TearOffType> lookupOrCreateWrapper(OwnerType* element, const SVGPropertyInfo* info, PropertyType& property)
 92 {
 93 return Helper<TearOffType, PropertyType, isDerivedFromSVGElement>::lookupOrCreateWrapper(element, info, property);
7594 }
7695
7796 template<typename TearOffType>
78  static TearOffType* lookupWrapper(SVGElement* element, const AtomicString& attributeIdentifier)
 97 static TearOffType* lookupWrapper(SVGElement* element, const SVGPropertyInfo* info)
7998 {
80  SVGAnimatedPropertyDescription key(element, attributeIdentifier);
 99 ASSERT(info);
 100 SVGAnimatedPropertyDescription key(element, info->propertyIdentifier);
81101 return static_pointer_cast<TearOffType>(animatedPropertyCache()->get(key)).get();
82102 }
83103
90666

Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h

11/*
22 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
33 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4  * Copyright (C) Research In Motion Limited 2010. All rights reserved.
 4 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
55 *
66 * This library is free software; you can redistribute it and/or
77 * modify it under the terms of the GNU Library General Public

2323#define SVGAnimatedPropertyMacros_h
2424
2525#if ENABLE(SVG)
26 #include "SVGAnimatedPropertySynchronizer.h"
 26#include "SVGAttributeToPropertyMap.h"
2727#include "SVGPropertyTraits.h"
 28#include <wtf/StdLibExtras.h>
2829
2930namespace WebCore {
3031
31 // GetOwnerElementForType implementation
32 template<typename OwnerType, bool isDerivedFromSVGElement>
33 struct GetOwnerElementForType;
34 
35 template<typename OwnerType>
36 struct GetOwnerElementForType<OwnerType, true> {
37  static SVGElement* ownerElement(OwnerType* type)
38  {
39  return type;
40  }
41 };
42 
43 template<typename OwnerType>
44 struct GetOwnerElementForType<OwnerType, false> {
45  static SVGElement* ownerElement(OwnerType* type)
46  {
47  SVGElement* context = type->contextElement();
48  ASSERT(context);
49  return context;
50  }
51 };
52 
5332// IsDerivedFromSVGElement implementation
5433template<typename OwnerType>
5534struct IsDerivedFromSVGElement {
5635 static const bool value = true;
5736};
5837
 38class SVGTests;
 39template<>
 40struct IsDerivedFromSVGElement<SVGTests> {
 41 static const bool value = false;
 42};
 43
5944class SVGViewSpec;
6045template<>
6146struct IsDerivedFromSVGElement<SVGViewSpec> {

@@struct SVGSynchronizableAnimatedProperty
8974 bool shouldSynchronize : 1;
9075};
9176
92 #define DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, TearOffType, PropertyType, UpperProperty, LowerProperty) \
93 void OwnerType::synchronize##UpperProperty() \
 77// Property registration helpers
 78#define BEGIN_REGISTER_ANIMATED_PROPERTIES(OwnerType) \
 79SVGAttributeToPropertyMap& OwnerType::attributeToPropertyMap() \
9480{ \
95  if (!m_##LowerProperty.shouldSynchronize) \
96  return; \
97  AtomicString value(SVGPropertyTraits<PropertyType>::toString(LowerProperty##BaseValue())); \
98  SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \
99  SVGAnimatedPropertySynchronizer<IsDerivedFromSVGElement<OwnerType>::value>::synchronize(contextElement, DOMAttribute, value); \
 81 DEFINE_STATIC_LOCAL(SVGAttributeToPropertyMap, s_attributeToPropertyMap, ()); \
 82 return s_attributeToPropertyMap; \
10083} \
10184\
102 PassRefPtr<TearOffType> OwnerType::LowerProperty##Animated() \
 85static void registerAnimatedPropertiesFor##OwnerType() \
10386{ \
104  m_##LowerProperty.shouldSynchronize = true; \
105  SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \
106  return SVGAnimatedProperty::lookupOrCreateWrapper<TearOffType, PropertyType>(contextElement, DOMAttribute, SVGDOMAttributeIdentifier, m_##LowerProperty.value); \
107 }
 87 SVGAttributeToPropertyMap& map = OwnerType::attributeToPropertyMap(); \
 88 if (!map.isEmpty()) \
 89 return; \
 90 typedef OwnerType UseOwnerType;
 91
 92#define REGISTER_LOCAL_ANIMATED_PROPERTY(LowerProperty) \
 93 map.addProperty(UseOwnerType::LowerProperty##PropertyInfo());
 94
 95#define REGISTER_PARENT_ANIMATED_PROPERTIES(ClassName) \
 96 map.addProperties(ClassName::attributeToPropertyMap()); \
 97
 98#define END_REGISTER_ANIMATED_PROPERTIES }
 99
 100// Property definition helpers (used in SVG*.cpp files)
 101#define DEFINE_ANIMATED_PROPERTY(AnimatedPropertyTypeEnum, OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty) \
 102const SVGPropertyInfo* OwnerType::LowerProperty##PropertyInfo() { \
 103 DEFINE_STATIC_LOCAL(const SVGPropertyInfo, s_propertyInfo, \
 104 (AnimatedPropertyTypeEnum, \
 105 DOMAttribute, \
 106 SVGDOMAttributeIdentifier, \
 107 &OwnerType::synchronize##UpperProperty, \
 108 &OwnerType::lookupOrCreate##UpperProperty##Wrapper)); \
 109 return &s_propertyInfo; \
 110}
 111
 112// Property declaration helpers (used in SVG*.h files)
 113#define BEGIN_DECLARE_ANIMATED_PROPERTIES(OwnerType) \
 114public: \
 115 static SVGAttributeToPropertyMap& attributeToPropertyMap(); \
 116 virtual SVGAttributeToPropertyMap& localAttributeToPropertyMap() \
 117 { \
 118 return attributeToPropertyMap(); \
 119 } \
 120 typedef OwnerType UseOwnerType;
108121
109122#define DECLARE_ANIMATED_PROPERTY(TearOffType, PropertyType, UpperProperty, LowerProperty) \
110123public: \
111 PropertyType& LowerProperty() const \
112 { \
113  return m_##LowerProperty.value; \
114 } \
115 \
116 PropertyType& LowerProperty##BaseValue() const \
117 { \
118  return m_##LowerProperty.value; \
119 } \
120 \
121 void set##UpperProperty##BaseValue(const PropertyType& type) \
122 { \
123  m_##LowerProperty.value = type; \
124 } \
125 \
126 PassRefPtr<TearOffType> LowerProperty##Animated(); \
 124 static const SVGPropertyInfo* LowerProperty##PropertyInfo(); \
 125 PropertyType& LowerProperty() const \
 126 { \
 127 return m_##LowerProperty.value; \
 128 } \
 129\
 130 PropertyType& LowerProperty##BaseValue() const \
 131 { \
 132 return m_##LowerProperty.value; \
 133 } \
 134\
 135 void set##UpperProperty##BaseValue(const PropertyType& type) \
 136 { \
 137 m_##LowerProperty.value = type; \
 138 } \
 139\
 140 PassRefPtr<TearOffType> LowerProperty##Animated() \
 141 { \
 142 m_##LowerProperty.shouldSynchronize = true; \
 143 return static_pointer_cast<TearOffType>(lookupOrCreate##UpperProperty##Wrapper(this)); \
 144 } \
127145\
128146private: \
129  void synchronize##UpperProperty(); \
 147 void synchronize##UpperProperty() \
 148 { \
 149 if (!m_##LowerProperty.shouldSynchronize) \
 150 return; \
 151 AtomicString value(SVGPropertyTraits<PropertyType>::toString(m_##LowerProperty.value)); \
 152 SVGAnimatedPropertySynchronizer<IsDerivedFromSVGElement<UseOwnerType>::value>::synchronize(this, LowerProperty##PropertyInfo()->attributeName, value); \
 153 } \
 154\
 155 static PassRefPtr<SVGAnimatedProperty> lookupOrCreate##UpperProperty##Wrapper(void* maskedOwnerType) \
 156 { \
 157 ASSERT(maskedOwnerType); \
 158 UseOwnerType* ownerType = static_cast<UseOwnerType*>(maskedOwnerType); \
 159 return SVGAnimatedProperty::lookupOrCreateWrapper<UseOwnerType, TearOffType, PropertyType, IsDerivedFromSVGElement<UseOwnerType>::value>(ownerType, LowerProperty##PropertyInfo(), ownerType->m_##LowerProperty.value); \
 160 } \
 161\
 162 static void synchronize##UpperProperty(void* maskedOwnerType) \
 163 { \
 164 ASSERT(maskedOwnerType); \
 165 UseOwnerType* ownerType = static_cast<UseOwnerType*>(maskedOwnerType); \
 166 ownerType->synchronize##UpperProperty(); \
 167 } \
130168\
131169 mutable SVGSynchronizableAnimatedProperty<PropertyType> m_##LowerProperty;
132170
 171#define END_DECLARE_ANIMATED_PROPERTIES
 172
 173// List specific definition/declaration helpers
133174#define DECLARE_ANIMATED_LIST_PROPERTY(TearOffType, PropertyType, UpperProperty, LowerProperty) \
134175DECLARE_ANIMATED_PROPERTY(TearOffType, PropertyType, UpperProperty, LowerProperty) \
135 void detachAnimated##UpperProperty##ListWrappers(unsigned newListSize);
136 
137 #define DEFINE_ANIMATED_LIST_PROPERTY(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, TearOffType, PropertyType, UpperProperty, LowerProperty) \
138 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, TearOffType, PropertyType, UpperProperty, LowerProperty) \
139 void OwnerType::detachAnimated##UpperProperty##ListWrappers(unsigned newListSize) \
 176void detachAnimated##UpperProperty##ListWrappers(unsigned newListSize) \
140177{ \
141  SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \
142  SVGAnimatedProperty* wrapper = SVGAnimatedProperty::lookupWrapper<TearOffType>(contextElement, DOMAttribute.localName()); \
143  if (!wrapper) \
144  return; \
145  static_cast<TearOffType*>(wrapper)->detachListWrappers(newListSize); \
 178 if (SVGAnimatedProperty* wrapper = SVGAnimatedProperty::lookupWrapper<TearOffType>(this, LowerProperty##PropertyInfo())) \
 179 static_cast<TearOffType*>(wrapper)->detachListWrappers(newListSize); \
146180}
147181
148182}
90666

Source/WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h

@@namespace WebCore {
2727
2828// Helper template used for synchronizing SVG <-> XML properties
2929template<bool isDerivedFromSVGElement>
30 struct SVGAnimatedPropertySynchronizer {
31  static void synchronize(SVGElement*, const QualifiedName&, const AtomicString&);
32 };
 30struct SVGAnimatedPropertySynchronizer;
3331
3432template<>
3533struct SVGAnimatedPropertySynchronizer<true> {

@@struct SVGAnimatedPropertySynchronizer<t
4846
4947template<>
5048struct SVGAnimatedPropertySynchronizer<false> {
51  static void synchronize(SVGElement*, const QualifiedName&, const AtomicString&)
 49 static void synchronize(void*, const QualifiedName&, const AtomicString&)
5250 {
5351 // no-op, for types not inheriting from Element, thus nothing to synchronize
5452 }
90666

Source/WebCore/svg/properties/SVGAttributeToPropertyMap.cpp

 1/*
 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
 3 *
 4 * This library is free software; you can redistribute it and/or
 5 * modify it under the terms of the GNU Library General Public
 6 * License as published by the Free Software Foundation; either
 7 * version 2 of the License, or (at your option) any later version.
 8 *
 9 * This library is distributed in the hope that it will be useful,
 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 12 * Library General Public License for more details.
 13 *
 14 * You should have received a copy of the GNU Library General Public License
 15 * along with this library; see the file COPYING.LIB. If not, write to
 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 17 * Boston, MA 02110-1301, USA.
 18 */
 19
 20#include "config.h"
 21
 22#if ENABLE(SVG)
 23#include "SVGAttributeToPropertyMap.h"
 24
 25#include "SVGAnimatedProperty.h"
 26#include "SVGPropertyInfo.h"
 27
 28namespace WebCore {
 29
 30void SVGAttributeToPropertyMap::addProperties(SVGAttributeToPropertyMap& map)
 31{
 32 AttributeToPropertiesMap::iterator end = map.m_map.end();
 33 for (AttributeToPropertiesMap::iterator it = map.m_map.begin(); it != end; ++it) {
 34 PropertiesVector* vector = it->second;
 35 ASSERT(vector);
 36
 37 PropertiesVector::iterator vectorEnd = vector->end();
 38 for (PropertiesVector::iterator vectorIt = vector->begin(); vectorIt != vectorEnd; ++vectorIt)
 39 addProperty(*vectorIt);
 40 }
 41}
 42
 43void SVGAttributeToPropertyMap::addProperty(const SVGPropertyInfo* info)
 44{
 45 ASSERT(info);
 46 ASSERT(info->attributeName != anyQName());
 47 if (PropertiesVector* vector = m_map.get(info->attributeName)) {
 48 vector->append(info);
 49 return;
 50 }
 51 PropertiesVector* vector = new PropertiesVector;
 52 vector->append(info);
 53 m_map.set(info->attributeName, vector);
 54}
 55
 56void SVGAttributeToPropertyMap::animatedPropertiesForAttribute(SVGElement* ownerType, const QualifiedName& attributeName, Vector<RefPtr<SVGAnimatedProperty> >& properties)
 57{
 58 ASSERT(ownerType);
 59 PropertiesVector* vector = m_map.get(attributeName);
 60 if (!vector)
 61 return;
 62
 63 PropertiesVector::iterator vectorEnd = vector->end();
 64 for (PropertiesVector::iterator vectorIt = vector->begin(); vectorIt != vectorEnd; ++vectorIt)
 65 properties.append(animatedProperty(ownerType, attributeName, *vectorIt));
 66}
 67
 68void SVGAttributeToPropertyMap::animatedPropertyTypeForAttribute(const QualifiedName& attributeName, Vector<AnimatedPropertyType>& propertyTypes)
 69{
 70 PropertiesVector* vector = m_map.get(attributeName);
 71 if (!vector)
 72 return;
 73
 74 PropertiesVector::iterator vectorEnd = vector->end();
 75 for (PropertiesVector::iterator vectorIt = vector->begin(); vectorIt != vectorEnd; ++vectorIt)
 76 propertyTypes.append((*vectorIt)->animatedPropertyType);
 77}
 78
 79void SVGAttributeToPropertyMap::synchronizeProperties(SVGElement* contextElement)
 80{
 81 ASSERT(contextElement);
 82 AttributeToPropertiesMap::iterator end = m_map.end();
 83 for (AttributeToPropertiesMap::iterator it = m_map.begin(); it != end; ++it) {
 84 PropertiesVector* vector = it->second;
 85 ASSERT(vector);
 86
 87 PropertiesVector::iterator vectorEnd = vector->end();
 88 for (PropertiesVector::iterator vectorIt = vector->begin(); vectorIt != vectorEnd; ++vectorIt)
 89 synchronizeProperty(contextElement, it->first, *vectorIt);
 90 }
 91}
 92
 93bool SVGAttributeToPropertyMap::synchronizeProperty(SVGElement* contextElement, const QualifiedName& attributeName)
 94{
 95 ASSERT(contextElement);
 96 PropertiesVector* vector = m_map.get(attributeName);
 97 if (!vector)
 98 return false;
 99
 100 PropertiesVector::iterator vectorEnd = vector->end();
 101 for (PropertiesVector::iterator vectorIt = vector->begin(); vectorIt != vectorEnd; ++vectorIt)
 102 synchronizeProperty(contextElement, attributeName, *vectorIt);
 103
 104 return true;
 105}
 106
 107void SVGAttributeToPropertyMap::synchronizeProperty(SVGElement* contextElement, const QualifiedName& attributeName, const SVGPropertyInfo* info)
 108{
 109 ASSERT(info);
 110 ASSERT_UNUSED(attributeName, attributeName == info->attributeName);
 111 ASSERT(info->synchronizeProperty);
 112 (*info->synchronizeProperty)(contextElement);
 113}
 114
 115PassRefPtr<SVGAnimatedProperty> SVGAttributeToPropertyMap::animatedProperty(SVGElement* contextElement, const QualifiedName& attributeName, const SVGPropertyInfo* info)
 116{
 117 ASSERT(info);
 118 ASSERT_UNUSED(attributeName, attributeName == info->attributeName);
 119 ASSERT(info->lookupOrCreateWrapperForAnimatedProperty);
 120 return (*info->lookupOrCreateWrapperForAnimatedProperty)(contextElement);
 121}
 122
 123}
 124
 125#endif
0

Source/WebCore/svg/properties/SVGAttributeToPropertyMap.h

 1/*
 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
 3 *
 4 * This library is free software; you can redistribute it and/or
 5 * modify it under the terms of the GNU Library General Public
 6 * License as published by the Free Software Foundation; either
 7 * version 2 of the License, or (at your option) any later version.
 8 *
 9 * This library is distributed in the hope that it will be useful,
 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 12 * Library General Public License for more details.
 13 *
 14 * You should have received a copy of the GNU Library General Public License
 15 * along with this library; see the file COPYING.LIB. If not, write to
 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 17 * Boston, MA 02110-1301, USA.
 18 */
 19
 20#ifndef SVGAttributeToPropertyMap_h
 21#define SVGAttributeToPropertyMap_h
 22
 23#if ENABLE(SVG)
 24#include "QualifiedName.h"
 25#include "SVGAnimatedPropertySynchronizer.h"
 26#include <wtf/HashMap.h>
 27
 28namespace WebCore {
 29
 30class SVGAnimatedProperty;
 31class SVGElement;
 32class SVGPropertyInfo;
 33
 34class SVGAttributeToPropertyMap {
 35public:
 36 SVGAttributeToPropertyMap() { }
 37 ~SVGAttributeToPropertyMap() { deleteAllValues(m_map); }
 38
 39 bool isEmpty() const { return m_map.isEmpty(); }
 40
 41 void addProperties(SVGAttributeToPropertyMap&);
 42 void addProperty(const SVGPropertyInfo*);
 43
 44 void animatedPropertiesForAttribute(SVGElement* contextElement, const QualifiedName& attributeName, Vector<RefPtr<SVGAnimatedProperty> >&);
 45 void animatedPropertyTypeForAttribute(const QualifiedName& attributeName, Vector<AnimatedPropertyType>&);
 46
 47 void synchronizeProperties(SVGElement* contextElement);
 48 bool synchronizeProperty(SVGElement* contextElement, const QualifiedName& attributeName);
 49
 50private:
 51 void synchronizeProperty(SVGElement* contextElement, const QualifiedName& attributeName, const SVGPropertyInfo*);
 52 PassRefPtr<SVGAnimatedProperty> animatedProperty(SVGElement* contextElement, const QualifiedName& attributeName, const SVGPropertyInfo*);
 53
 54 typedef Vector<const SVGPropertyInfo*> PropertiesVector;
 55 typedef HashMap<QualifiedName, PropertiesVector*> AttributeToPropertiesMap;
 56 AttributeToPropertiesMap m_map;
 57};
 58
 59}
 60
 61#endif
 62#endif
0

Source/WebCore/svg/properties/SVGPropertyInfo.h

 1/*
 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
 3 *
 4 * This library is free software; you can redistribute it and/or
 5 * modify it under the terms of the GNU Library General Public
 6 * License as published by the Free Software Foundation; either
 7 * version 2 of the License, or (at your option) any later version.
 8 *
 9 * This library is distributed in the hope that it will be useful,
 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 12 * Library General Public License for more details.
 13 *
 14 * You should have received a copy of the GNU Library General Public License
 15 * along with this library; see the file COPYING.LIB. If not, write to
 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 17 * Boston, MA 02110-1301, USA.
 18 */
 19
 20#ifndef SVGPropertyInfo_h
 21#define SVGPropertyInfo_h
 22
 23#if ENABLE(SVG)
 24#include "QualifiedName.h"
 25#include <wtf/PassRefPtr.h>
 26
 27namespace WebCore {
 28
 29class SVGAnimatedProperty;
 30
 31enum AnimatedPropertyType {
 32 AnimatedAngle,
 33 AnimatedBoolean,
 34 AnimatedColor,
 35 AnimatedEnumeration,
 36 AnimatedInteger,
 37 AnimatedLength,
 38 AnimatedLengthList,
 39 AnimatedNumber,
 40 AnimatedNumberList,
 41 AnimatedNumberOptionalNumber,
 42 AnimatedPath,
 43 AnimatedPoints,
 44 AnimatedPreserveAspectRatio,
 45 AnimatedRect,
 46 AnimatedString,
 47 AnimatedTransformList,
 48 AnimatedUnknown
 49};
 50
 51struct SVGPropertyInfo {
 52 typedef void (*SynchronizeProperty)(void*);
 53 typedef PassRefPtr<SVGAnimatedProperty> (*LookupOrCreateWrapperForAnimatedProperty)(void*);
 54
 55 SVGPropertyInfo(AnimatedPropertyType newType, const QualifiedName& newAttributeName,
 56 const AtomicString& newPropertyIdentifier, SynchronizeProperty newSynchronizeProperty,
 57 LookupOrCreateWrapperForAnimatedProperty newLookupOrCreateWrapperForAnimatedProperty)
 58 : animatedPropertyType(newType)
 59 , attributeName(newAttributeName)
 60 , propertyIdentifier(newPropertyIdentifier)
 61 , synchronizeProperty(newSynchronizeProperty)
 62 , lookupOrCreateWrapperForAnimatedProperty(newLookupOrCreateWrapperForAnimatedProperty)
 63 {
 64 }
 65
 66 AnimatedPropertyType animatedPropertyType;
 67 const QualifiedName& attributeName;
 68 const AtomicString& propertyIdentifier;
 69 SynchronizeProperty synchronizeProperty;
 70 LookupOrCreateWrapperForAnimatedProperty lookupOrCreateWrapperForAnimatedProperty;
 71};
 72
 73}
 74
 75#endif // ENABLE(SVG)
 76#endif // SVGPropertyInfo_h
0