2011-07-09 Nikolas Zimmermann <nzimmermann@rim.com>
authorzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Jul 2011 11:26:10 +0000 (11:26 +0000)
committerzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Jul 2011 11:26:10 +0000 (11:26 +0000)
        Add a possibility to retrieve the associated SVGAnimatedProperty object for a certain XML attribute
        https://bugs.webkit.org/show_bug.cgi?id=63797

        Reviewed by Dirk Schulze.

        In order to prepare animVal support we need a way to map a given SVG DOM attribute to a SVGAnimatedProperty.
        eg. SVGNames::xAttr -> SVGRectElement::xAnimated(), etc. This will be needed to update the animVal of the
        SVGAnimatedProperty, if an animation is running. It would required adding a new method to all SVG* classes
        that define animated properties. Unfortunately we already have lots of repeated code in methods like
        synchronizeProperty / fillAttributeToPropertyTypeMap. Look at SVGRectElement for example:

        void SVGRectElement::synchronizeProperty(const QualifiedName& attrName)
        {
            if (attrName == anyQName()) {
                synchronizeX();
                synchronizeY();
                 ...
              }

            if (attrName == SVGNames::xAttr) {
                synchronizeX();
                return;
            }

            if (attrName == SVGNames::yAttr) {
                synchronizeY();
                return;
            }
            ...
        }

        or

        void SVGRectElement::fillAttributeToPropertyTypeMap()
        {
            AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();

            SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
            attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
            attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
            ...
        }

        These lookups are all performed dynamically. Each synchronizeProperty() call does a lot of comparisons.
        fillAttributeToPropertyTypeMap() isn't that bad as the result is cached in a static HashMap per-SVGRectElement.
        There's no reason to do these things dynamically!

        Inspired by JSC, I'm adding a "static const SVGPropertyInfo s_fooPropertyInfo" object for each animated SVG property.
        For example, for SVGRectElements SVGAnimatedLength x property we're storing:
        - "AnimatedPropertyType type" (AnimatedLength -- note the enum was named AnimatedAttributeType, I renamed it to AnimatedPropertyType for clarity)
        - "const QualifiedName& attributeName" (SVGNames::xAttr)
        - "const AtomicString& propertyIdentifier" (SVGNames::xAttr.localName() -- only different if N-wrappers map to a single XML DOM attribute, eg. orientAttr)
        - "SynchronizeProperty synchronizeProperty" (callback to SVGRectElement::synchronizeX)
        - "LookupOrCreateWrapperForAnimatedProperty lookupOrCreateWrapperForAnimatedProperty" (callback to SVGRectElement::xAnimated)

        Using this information, we can replace all the various synchronizeProperty/fillAttributeToPropertyMap implementations, with a single one in SVGElement.
        All these are auto-generated, using the standard macros used to define/declare SVG animated properties. This required several changes to the macros.
        Here's a summary:

        #1) In all headers, wrap DECLARE_ANIMATED_* calls, in BEGIN_DECLARE_ANIMATED_PROPERTIES(ClassName) / END_DECLARE_ANIMATED_PROPERTIES blocks.

            Sample change for SVGRectElement:
            -    DECLARE_ANIMATED_LENGTH(X, x)
            -    DECLARE_ANIMATED_LENGTH(Y, y)
            -    ...

            +    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGRectElement)
            +        DECLARE_ANIMATED_LENGTH(X, x)
            +        DECLARE_ANIMATED_LENGTH(Y, y)
            +         ...
            +    END_DECLARE_ANIMATED_PROPERTIES

        #2) In all cpp files, add a new section wrapped in BEGIN_REGISTER_ANIMATED_PROPERTIES(ClassName / END_REGISTER_ANIMATED_PROPERTIES blocks:

            Sample change for SVGRectElement:
            +BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGRectElement)
            +    REGISTER_LOCAL_ANIMATED_PROPERTY(x)
            +    REGISTER_LOCAL_ANIMATED_PROPERTY(y)
            +    ...
            +    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
            +    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
            +END_REGISTER_ANIMATED_PROPERTIES

            This is the main piece of the logic that replaces the manual synchronizeProperty/fillAttributeToPropertyMap implementation. It expands to following:

            SVGAttributeToPropertyMap& SVGRectElement::attributeToPropertyMap()
            {
                DEFINE_STATIC_LOCAL(SVGAttributeToPropertyMap, s_attributeToPropertyMap, ());
            }

            static void registerAnimatedPropertiesForSVGRectElement()
            {
                SVGAttributeToPropertyMap& map = SVGRectElement::attributeToPropertyMap();
                if (!map.isEmpty())
                    return;
                map.addProperty(SVGRectElement::xPropertyInfo());
                map.addProperty(SVGRectElement::yPropertyInfo());
                ...
                map.addProperties(SVGStyledTransformableElement::attributeToPropertyMap());
                map.addProperties(SVGTests::attributeToPropertyMap());
            }

            A single-instance of SVGAttributeToPropertyMap is created for each SVG*Element. The constructor of SVGRectElement is supposed to call
            registerAnimatedPropertiesForSVGRectElement(), which collects all properties of SVGRectElement and all its parent classes and stores them
            in a Vector<const SVGPropertyInfo*>. This Vector is stored in a HashMap<QualifiedName, Vector<const SVGPropertyInfo*> > where the key
            is the attribute name (eg. SVGNames::xAttr -> SVGRectElement::xPropertyInfo). This is only done _once_ per SVGRectElement.

            SVGElement contains a "virtual SVGAttributeToPropertyMap& localAttributeToPropertyMap()" method, and SVGRectElement overrides it
            and returns SVGRectElement::attributeToPropertyMap() (which is static!) -- this is hidden again in the macros, no need to write any code.

            SVGAttributeToPropertyMap provides following API:
            - bool synchronizeProperty(SVGElement* contextElement, const QualifiedName& attributeName)
            - void synchronizeProperties(SVGElement* contextElement)

                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
                contextElement->localAttributeToPropertyMap().synchronizeProperty(this, SVGNames::xAttr)
                The SVGAttributeToPropertyMap will ask its HashMap for the Vector containing the properties for SVGNames::xAttr (in that case, just one xAnimated()).

            - void animatedPropertyTypeForAttribute(const QualifiedName& attributeName, Vector<AnimatedPropertyType>& propertyTypes)

                This method replaces the fillAttributeToPropertyMap implementations everywhere.

            - void animatedPropertiesForAttribute(SVGElement* contextElement, const QualifiedName& attributeName, Vector<RefPtr<SVGAnimatedProperty> >& properties);

                This method is not used yet, but allows us to collect all SVGAnimatedProperties for a QualifiedName -- the initial goal for this patch.

        #3) In all cpp files, add a call to "registerAnimatedPropertiesForClassName()" in the constructor. Forgetting this will result in a compile error.

        Doesn't affect any tests.

        * CMakeLists.txt:
        * GNUmakefile.list.am:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/scripts/CodeGeneratorJS.pm:
        (NativeToJSValue):
        * bindings/scripts/CodeGeneratorObjC.pm:
        (GenerateImplementation):
        * bindings/scripts/CodeGeneratorV8.pm:
        (GenerateNormalAttrGetter):
        * svg/SVGAElement.cpp:
        (WebCore::SVGAElement::SVGAElement):
        * svg/SVGAElement.h:
        (WebCore::SVGAElement::synchronizeRequiredFeatures):
        (WebCore::SVGAElement::synchronizeRequiredExtensions):
        (WebCore::SVGAElement::synchronizeSystemLanguage):
        * svg/SVGAltGlyphElement.cpp:
        (WebCore::SVGAltGlyphElement::SVGAltGlyphElement):
        * svg/SVGAltGlyphElement.h:
        * svg/SVGAnimateElement.cpp:
        (WebCore::SVGAnimateElement::SVGAnimateElement):
        (WebCore::SVGAnimateElement::hasValidAttributeType):
        (WebCore::SVGAnimateElement::determineAnimatedPropertyType):
        (WebCore::SVGAnimateElement::determinePropertyValueTypes):
        (WebCore::SVGAnimateElement::calculateAnimatedValue):
        (WebCore::SVGAnimateElement::calculateFromAndToValues):
        (WebCore::SVGAnimateElement::calculateFromAndByValues):
        (WebCore::SVGAnimateElement::resetToBaseValue):
        (WebCore::SVGAnimateElement::applyResultsToTarget):
        (WebCore::SVGAnimateElement::calculateDistance):
        (WebCore::SVGAnimateElement::ensureAnimator):
        * svg/SVGAnimateElement.h:
        * svg/SVGAnimateTransformElement.cpp:
        (WebCore::SVGAnimateTransformElement::hasValidAttributeType):
        (WebCore::SVGAnimateTransformElement::determineAnimatedPropertyType):
        (WebCore::SVGAnimateTransformElement::resetToBaseValue):
        (WebCore::SVGAnimateTransformElement::calculateAnimatedValue):
        (WebCore::SVGAnimateTransformElement::applyResultsToTarget):
        * svg/SVGAnimateTransformElement.h:
        * svg/SVGAnimatedAngle.h:
        * svg/SVGAnimatedBoolean.h:
        * svg/SVGAnimatedEnumeration.h:
        * svg/SVGAnimatedInteger.h:
        * svg/SVGAnimatedLength.h:
        * svg/SVGAnimatedLengthList.h:
        * svg/SVGAnimatedNumber.h:
        * svg/SVGAnimatedNumberList.h:
        * svg/SVGAnimatedPreserveAspectRatio.h:
        * svg/SVGAnimatedRect.h:
        * svg/SVGAnimatedString.h:
        * svg/SVGAnimatedTransformList.h:
        * svg/SVGAnimatedType.cpp:
        (WebCore::SVGAnimatedType::SVGAnimatedType):
        * svg/SVGAnimatedType.h:
        (WebCore::SVGAnimatedType::type):
        * svg/SVGAnimatedTypeAnimator.h:
        (WebCore::SVGAnimatedTypeAnimator::SVGAnimatedTypeAnimator):
        * svg/SVGAnimationElement.cpp:
        (WebCore::SVGAnimationElement::SVGAnimationElement):
        (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
        * svg/SVGAnimationElement.h:
        (WebCore::SVGAnimationElement::synchronizeRequiredFeatures):
        (WebCore::SVGAnimationElement::synchronizeRequiredExtensions):
        (WebCore::SVGAnimationElement::synchronizeSystemLanguage):
        * svg/SVGAnimatorFactory.h:
        (WebCore::SVGAnimatorFactory::create):
        * svg/SVGCircleElement.cpp:
        (WebCore::SVGCircleElement::SVGCircleElement):
        * svg/SVGCircleElement.h:
        (WebCore::SVGCircleElement::synchronizeRequiredFeatures):
        (WebCore::SVGCircleElement::synchronizeRequiredExtensions):
        (WebCore::SVGCircleElement::synchronizeSystemLanguage):
        * svg/SVGClipPathElement.cpp:
        (WebCore::SVGClipPathElement::SVGClipPathElement):
        * svg/SVGClipPathElement.h:
        (WebCore::SVGClipPathElement::synchronizeRequiredFeatures):
        (WebCore::SVGClipPathElement::synchronizeRequiredExtensions):
        (WebCore::SVGClipPathElement::synchronizeSystemLanguage):
        * svg/SVGComponentTransferFunctionElement.cpp:
        (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
        * svg/SVGComponentTransferFunctionElement.h:
        * svg/SVGCursorElement.cpp:
        (WebCore::SVGCursorElement::SVGCursorElement):
        * svg/SVGCursorElement.h:
        (WebCore::SVGCursorElement::synchronizeRequiredFeatures):
        (WebCore::SVGCursorElement::synchronizeRequiredExtensions):
        (WebCore::SVGCursorElement::synchronizeSystemLanguage):
        * svg/SVGDefsElement.cpp:
        (WebCore::SVGDefsElement::SVGDefsElement):
        * svg/SVGDefsElement.h:
        (WebCore::SVGDefsElement::synchronizeRequiredFeatures):
        (WebCore::SVGDefsElement::synchronizeRequiredExtensions):
        (WebCore::SVGDefsElement::synchronizeSystemLanguage):
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::animatedPropertyTypeForAttribute):
        (WebCore::SVGElement::updateAnimatedSVGAttribute):
        (WebCore::SVGElement::localAttributeToPropertyMap):
        (WebCore::SVGElement::synchronizeRequiredFeatures):
        (WebCore::SVGElement::synchronizeRequiredExtensions):
        (WebCore::SVGElement::synchronizeSystemLanguage):
        * svg/SVGElement.h:
        (WebCore::SVGElement::svgAttributeChanged):
        (WebCore::SVGElement::synchronizeRequiredFeatures):
        (WebCore::SVGElement::synchronizeRequiredExtensions):
        (WebCore::SVGElement::synchronizeSystemLanguage):
        * svg/SVGEllipseElement.cpp:
        (WebCore::SVGEllipseElement::SVGEllipseElement):
        * svg/SVGEllipseElement.h:
        (WebCore::SVGEllipseElement::synchronizeRequiredFeatures):
        (WebCore::SVGEllipseElement::synchronizeRequiredExtensions):
        (WebCore::SVGEllipseElement::synchronizeSystemLanguage):
        * svg/SVGFEBlendElement.cpp:
        (WebCore::SVGFEBlendElement::SVGFEBlendElement):
        * svg/SVGFEBlendElement.h:
        * svg/SVGFEColorMatrixElement.cpp:
        (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
        * svg/SVGFEColorMatrixElement.h:
        * svg/SVGFEComponentTransferElement.cpp:
        (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement):
        * svg/SVGFEComponentTransferElement.h:
        * svg/SVGFECompositeElement.cpp:
        (WebCore::SVGFECompositeElement::SVGFECompositeElement):
        * svg/SVGFECompositeElement.h:
        * svg/SVGFEConvolveMatrixElement.cpp:
        (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
        * svg/SVGFEConvolveMatrixElement.h:
        * svg/SVGFEDiffuseLightingElement.cpp:
        (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
        * svg/SVGFEDiffuseLightingElement.h:
        * svg/SVGFEDisplacementMapElement.cpp:
        (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
        * svg/SVGFEDisplacementMapElement.h:
        * svg/SVGFEDropShadowElement.cpp:
        (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
        * svg/SVGFEDropShadowElement.h:
        * svg/SVGFEFloodElement.cpp:
        * svg/SVGFEFloodElement.h:
        * svg/SVGFEGaussianBlurElement.cpp:
        (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
        * svg/SVGFEGaussianBlurElement.h:
        * svg/SVGFEImageElement.cpp:
        (WebCore::SVGFEImageElement::SVGFEImageElement):
        * svg/SVGFEImageElement.h:
        * svg/SVGFELightElement.cpp:
        (WebCore::SVGFELightElement::SVGFELightElement):
        * svg/SVGFELightElement.h:
        * svg/SVGFEMergeElement.cpp:
        * svg/SVGFEMergeElement.h:
        * svg/SVGFEMergeNodeElement.cpp:
        (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement):
        * svg/SVGFEMergeNodeElement.h:
        * svg/SVGFEMorphologyElement.cpp:
        (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
        * svg/SVGFEMorphologyElement.h:
        * svg/SVGFEOffsetElement.cpp:
        (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
        * svg/SVGFEOffsetElement.h:
        * svg/SVGFESpecularLightingElement.cpp:
        (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
        * svg/SVGFESpecularLightingElement.h:
        * svg/SVGFETileElement.cpp:
        (WebCore::SVGFETileElement::SVGFETileElement):
        * svg/SVGFETileElement.h:
        * svg/SVGFETurbulenceElement.cpp:
        (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
        * svg/SVGFETurbulenceElement.h:
        * svg/SVGFilterElement.cpp:
        (WebCore::SVGFilterElement::SVGFilterElement):
        * svg/SVGFilterElement.h:
        * svg/SVGFilterPrimitiveStandardAttributes.cpp:
        (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
        * svg/SVGFilterPrimitiveStandardAttributes.h:
        * svg/SVGFitToViewBox.cpp:
        * svg/SVGFitToViewBox.h:
        * svg/SVGFontElement.cpp:
        (WebCore::SVGFontElement::SVGFontElement):
        * svg/SVGFontElement.h:
        (WebCore::SVGFontElement::rendererIsNeeded):
        * svg/SVGForeignObjectElement.cpp:
        (WebCore::SVGForeignObjectElement::SVGForeignObjectElement):
        * svg/SVGForeignObjectElement.h:
        (WebCore::SVGForeignObjectElement::synchronizeRequiredFeatures):
        (WebCore::SVGForeignObjectElement::synchronizeRequiredExtensions):
        (WebCore::SVGForeignObjectElement::synchronizeSystemLanguage):
        * svg/SVGGElement.cpp:
        (WebCore::SVGGElement::SVGGElement):
        * svg/SVGGElement.h:
        (WebCore::SVGGElement::synchronizeRequiredFeatures):
        (WebCore::SVGGElement::synchronizeRequiredExtensions):
        (WebCore::SVGGElement::synchronizeSystemLanguage):
        * svg/SVGGlyphElement.cpp:
        * svg/SVGGlyphElement.h:
        * svg/SVGGradientElement.cpp:
        (WebCore::SVGGradientElement::SVGGradientElement):
        (WebCore::SVGGradientElement::svgAttributeChanged):
        * svg/SVGGradientElement.h:
        * svg/SVGImageElement.cpp:
        (WebCore::SVGImageElement::SVGImageElement):
        * svg/SVGImageElement.h:
        (WebCore::SVGImageElement::synchronizeRequiredFeatures):
        (WebCore::SVGImageElement::synchronizeRequiredExtensions):
        (WebCore::SVGImageElement::synchronizeSystemLanguage):
        * svg/SVGLineElement.cpp:
        (WebCore::SVGLineElement::SVGLineElement):
        * svg/SVGLineElement.h:
        (WebCore::SVGLineElement::synchronizeRequiredFeatures):
        (WebCore::SVGLineElement::synchronizeRequiredExtensions):
        (WebCore::SVGLineElement::synchronizeSystemLanguage):
        * svg/SVGLinearGradientElement.cpp:
        (WebCore::SVGLinearGradientElement::SVGLinearGradientElement):
        * svg/SVGLinearGradientElement.h:
        * svg/SVGMPathElement.cpp:
        (WebCore::SVGMPathElement::SVGMPathElement):
        * svg/SVGMPathElement.h:
        * svg/SVGMarkerElement.cpp:
        (WebCore::SVGMarkerElement::orientTypePropertyInfo):
        (WebCore::SVGMarkerElement::SVGMarkerElement):
        (WebCore::SVGMarkerElement::setOrientToAuto):
        (WebCore::SVGMarkerElement::setOrientToAngle):
        (WebCore::SVGMarkerElement::synchronizeOrientType):
        (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper):
        (WebCore::SVGMarkerElement::orientTypeAnimated):
        * svg/SVGMarkerElement.h:
        * svg/SVGMaskElement.cpp:
        (WebCore::SVGMaskElement::SVGMaskElement):
        * svg/SVGMaskElement.h:
        (WebCore::SVGMaskElement::synchronizeRequiredFeatures):
        (WebCore::SVGMaskElement::synchronizeRequiredExtensions):
        (WebCore::SVGMaskElement::synchronizeSystemLanguage):
        * svg/SVGMissingGlyphElement.cpp:
        * svg/SVGMissingGlyphElement.h:
        * svg/SVGPathElement.cpp:
        (WebCore::SVGPathElement::dPropertyInfo):
        (WebCore::SVGPathElement::SVGPathElement):
        (WebCore::SVGPathElement::svgAttributeChanged):
        (WebCore::SVGPathElement::lookupOrCreateDWrapper):
        (WebCore::SVGPathElement::synchronizeD):
        (WebCore::SVGPathElement::pathSegList):
        (WebCore::SVGPathElement::animatedPathSegList):
        * svg/SVGPathElement.h:
        (WebCore::SVGPathElement::pathByteStream):
        (WebCore::SVGPathElement::synchronizeRequiredFeatures):
        (WebCore::SVGPathElement::synchronizeRequiredExtensions):
        (WebCore::SVGPathElement::synchronizeSystemLanguage):
        * svg/SVGPathSegWithContext.h:
        (WebCore::SVGPathSegWithContext::animatedProperty):
        * svg/SVGPatternElement.cpp:
        (WebCore::SVGPatternElement::SVGPatternElement):
        * svg/SVGPatternElement.h:
        (WebCore::SVGPatternElement::synchronizeRequiredFeatures):
        (WebCore::SVGPatternElement::synchronizeRequiredExtensions):
        (WebCore::SVGPatternElement::synchronizeSystemLanguage):
        * svg/SVGPolyElement.cpp:
        (WebCore::SVGPolyElement::pointsPropertyInfo):
        (WebCore::SVGPolyElement::SVGPolyElement):
        (WebCore::SVGPolyElement::parseMappedAttribute):
        (WebCore::SVGPolyElement::synchronizePoints):
        (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
        (WebCore::SVGPolyElement::points):
        (WebCore::SVGPolyElement::animatedPoints):
        * svg/SVGPolyElement.h:
        (WebCore::SVGPolyElement::synchronizeRequiredFeatures):
        (WebCore::SVGPolyElement::synchronizeRequiredExtensions):
        (WebCore::SVGPolyElement::synchronizeSystemLanguage):
        * svg/SVGRadialGradientElement.cpp:
        (WebCore::SVGRadialGradientElement::SVGRadialGradientElement):
        * svg/SVGRadialGradientElement.h:
        * svg/SVGRectElement.cpp:
        (WebCore::SVGRectElement::SVGRectElement):
        * svg/SVGRectElement.h:
        (WebCore::SVGRectElement::synchronizeRequiredFeatures):
        (WebCore::SVGRectElement::synchronizeRequiredExtensions):
        (WebCore::SVGRectElement::synchronizeSystemLanguage):
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::SVGSVGElement):
        * svg/SVGSVGElement.h:
        (WebCore::SVGSVGElement::synchronizeRequiredFeatures):
        (WebCore::SVGSVGElement::synchronizeRequiredExtensions):
        (WebCore::SVGSVGElement::synchronizeSystemLanguage):
        * svg/SVGScriptElement.cpp:
        (WebCore::SVGScriptElement::SVGScriptElement):
        * svg/SVGScriptElement.h:
        * svg/SVGStopElement.cpp:
        (WebCore::SVGStopElement::SVGStopElement):
        * svg/SVGStopElement.h:
        * svg/SVGStyledElement.cpp:
        (WebCore::SVGStyledElement::SVGStyledElement):
        (WebCore::cssPropertyToTypeMap):
        (WebCore::SVGStyledElement::animatedPropertyTypeForAttribute):
        * svg/SVGStyledElement.h:
        * svg/SVGStyledTransformableElement.cpp:
        (WebCore::SVGStyledTransformableElement::SVGStyledTransformableElement):
        * svg/SVGStyledTransformableElement.h:
        * svg/SVGSwitchElement.cpp:
        (WebCore::SVGSwitchElement::SVGSwitchElement):
        * svg/SVGSwitchElement.h:
        (WebCore::SVGSwitchElement::synchronizeRequiredFeatures):
        (WebCore::SVGSwitchElement::synchronizeRequiredExtensions):
        (WebCore::SVGSwitchElement::synchronizeSystemLanguage):
        * svg/SVGSymbolElement.cpp:
        (WebCore::SVGSymbolElement::SVGSymbolElement):
        * svg/SVGSymbolElement.h:
        * svg/SVGTRefElement.cpp:
        (WebCore::SVGTRefElement::SVGTRefElement):
        * svg/SVGTRefElement.h:
        * svg/SVGTSpanElement.cpp:
        * svg/SVGTSpanElement.h:
        * svg/SVGTests.cpp:
        (WebCore::SVGTests::requiredFeaturesPropertyInfo):
        (WebCore::SVGTests::requiredExtensionsPropertyInfo):
        (WebCore::SVGTests::systemLanguagePropertyInfo):
        (WebCore::SVGTests::attributeToPropertyMap):
        (WebCore::SVGTests::synchronizeRequiredFeatures):
        (WebCore::SVGTests::synchronizeRequiredExtensions):
        (WebCore::SVGTests::synchronizeSystemLanguage):
        * svg/SVGTests.h:
        * svg/SVGTextContentElement.cpp:
        (WebCore::SVGTextContentElement::textLengthPropertyInfo):
        (WebCore::SVGTextContentElement::SVGTextContentElement):
        (WebCore::SVGTextContentElement::synchronizeTextLength):
        (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
        (WebCore::SVGTextContentElement::textLengthAnimated):
        * svg/SVGTextContentElement.h:
        (WebCore::SVGTextContentElement::synchronizeRequiredFeatures):
        (WebCore::SVGTextContentElement::synchronizeRequiredExtensions):
        (WebCore::SVGTextContentElement::synchronizeSystemLanguage):
        * svg/SVGTextElement.cpp:
        (WebCore::SVGTextElement::SVGTextElement):
        * svg/SVGTextElement.h:
        * svg/SVGTextPathElement.cpp:
        (WebCore::SVGTextPathElement::SVGTextPathElement):
        * svg/SVGTextPathElement.h:
        * svg/SVGTextPositioningElement.cpp:
        (WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
        * svg/SVGTextPositioningElement.h:
        * svg/SVGTitleElement.cpp:
        * svg/SVGTitleElement.h:
        (WebCore::SVGTitleElement::rendererIsNeeded):
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::SVGUseElement):
        * svg/SVGUseElement.h:
        (WebCore::SVGUseElement::synchronizeRequiredFeatures):
        (WebCore::SVGUseElement::synchronizeRequiredExtensions):
        (WebCore::SVGUseElement::synchronizeSystemLanguage):
        * svg/SVGViewElement.cpp:
        (WebCore::SVGViewElement::SVGViewElement):
        * svg/SVGViewElement.h:
        * svg/SVGViewSpec.cpp:
        (WebCore::SVGViewSpec::SVGViewSpec):
        * svg/SVGViewSpec.h:
        * svg/properties/SVGAnimatedProperty.h:
        (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper):
        (WebCore::SVGAnimatedProperty::lookupWrapper):
        * svg/properties/SVGAnimatedPropertyMacros.h:
        * svg/properties/SVGAnimatedPropertySynchronizer.h:
        * svg/properties/SVGAttributeToPropertyMap.cpp: Added.
        (WebCore::SVGAttributeToPropertyMap::addProperties):
        (WebCore::SVGAttributeToPropertyMap::addProperty):
        (WebCore::SVGAttributeToPropertyMap::animatedPropertiesForAttribute):
        (WebCore::SVGAttributeToPropertyMap::animatedPropertyTypeForAttribute):
        (WebCore::SVGAttributeToPropertyMap::synchronizeProperties):
        (WebCore::SVGAttributeToPropertyMap::synchronizeProperty):
        (WebCore::SVGAttributeToPropertyMap::animatedProperty):
        * svg/properties/SVGAttributeToPropertyMap.h: Added.
        (WebCore::SVGAttributeToPropertyMap::SVGAttributeToPropertyMap):
        (WebCore::SVGAttributeToPropertyMap::~SVGAttributeToPropertyMap):
        (WebCore::SVGAttributeToPropertyMap::isEmpty):
        * svg/properties/SVGPropertyInfo.h: Added.
        (WebCore::SVGPropertyInfo::SVGPropertyInfo):

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

171 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.pro
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/svg/SVGAElement.cpp
Source/WebCore/svg/SVGAElement.h
Source/WebCore/svg/SVGAltGlyphElement.cpp
Source/WebCore/svg/SVGAltGlyphElement.h
Source/WebCore/svg/SVGAnimateElement.cpp
Source/WebCore/svg/SVGAnimateElement.h
Source/WebCore/svg/SVGAnimateTransformElement.cpp
Source/WebCore/svg/SVGAnimateTransformElement.h
Source/WebCore/svg/SVGAnimatedAngle.h
Source/WebCore/svg/SVGAnimatedBoolean.h
Source/WebCore/svg/SVGAnimatedEnumeration.h
Source/WebCore/svg/SVGAnimatedInteger.h
Source/WebCore/svg/SVGAnimatedLength.h
Source/WebCore/svg/SVGAnimatedLengthList.h
Source/WebCore/svg/SVGAnimatedNumber.h
Source/WebCore/svg/SVGAnimatedNumberList.h
Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.h
Source/WebCore/svg/SVGAnimatedRect.h
Source/WebCore/svg/SVGAnimatedString.h
Source/WebCore/svg/SVGAnimatedTransformList.h
Source/WebCore/svg/SVGAnimatedType.cpp
Source/WebCore/svg/SVGAnimatedType.h
Source/WebCore/svg/SVGAnimatedTypeAnimator.h
Source/WebCore/svg/SVGAnimationElement.cpp
Source/WebCore/svg/SVGAnimationElement.h
Source/WebCore/svg/SVGAnimatorFactory.h
Source/WebCore/svg/SVGCircleElement.cpp
Source/WebCore/svg/SVGCircleElement.h
Source/WebCore/svg/SVGClipPathElement.cpp
Source/WebCore/svg/SVGClipPathElement.h
Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp
Source/WebCore/svg/SVGComponentTransferFunctionElement.h
Source/WebCore/svg/SVGCursorElement.cpp
Source/WebCore/svg/SVGCursorElement.h
Source/WebCore/svg/SVGDefsElement.cpp
Source/WebCore/svg/SVGDefsElement.h
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGElement.h
Source/WebCore/svg/SVGEllipseElement.cpp
Source/WebCore/svg/SVGEllipseElement.h
Source/WebCore/svg/SVGFEBlendElement.cpp
Source/WebCore/svg/SVGFEBlendElement.h
Source/WebCore/svg/SVGFEColorMatrixElement.cpp
Source/WebCore/svg/SVGFEColorMatrixElement.h
Source/WebCore/svg/SVGFEComponentTransferElement.cpp
Source/WebCore/svg/SVGFEComponentTransferElement.h
Source/WebCore/svg/SVGFECompositeElement.cpp
Source/WebCore/svg/SVGFECompositeElement.h
Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp
Source/WebCore/svg/SVGFEConvolveMatrixElement.h
Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
Source/WebCore/svg/SVGFEDiffuseLightingElement.h
Source/WebCore/svg/SVGFEDisplacementMapElement.cpp
Source/WebCore/svg/SVGFEDisplacementMapElement.h
Source/WebCore/svg/SVGFEDropShadowElement.cpp
Source/WebCore/svg/SVGFEDropShadowElement.h
Source/WebCore/svg/SVGFEFloodElement.cpp
Source/WebCore/svg/SVGFEFloodElement.h
Source/WebCore/svg/SVGFEGaussianBlurElement.cpp
Source/WebCore/svg/SVGFEGaussianBlurElement.h
Source/WebCore/svg/SVGFEImageElement.cpp
Source/WebCore/svg/SVGFEImageElement.h
Source/WebCore/svg/SVGFELightElement.cpp
Source/WebCore/svg/SVGFELightElement.h
Source/WebCore/svg/SVGFEMergeElement.cpp
Source/WebCore/svg/SVGFEMergeElement.h
Source/WebCore/svg/SVGFEMergeNodeElement.cpp
Source/WebCore/svg/SVGFEMergeNodeElement.h
Source/WebCore/svg/SVGFEMorphologyElement.cpp
Source/WebCore/svg/SVGFEMorphologyElement.h
Source/WebCore/svg/SVGFEOffsetElement.cpp
Source/WebCore/svg/SVGFEOffsetElement.h
Source/WebCore/svg/SVGFESpecularLightingElement.cpp
Source/WebCore/svg/SVGFESpecularLightingElement.h
Source/WebCore/svg/SVGFETileElement.cpp
Source/WebCore/svg/SVGFETileElement.h
Source/WebCore/svg/SVGFETurbulenceElement.cpp
Source/WebCore/svg/SVGFETurbulenceElement.h
Source/WebCore/svg/SVGFilterElement.cpp
Source/WebCore/svg/SVGFilterElement.h
Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp
Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
Source/WebCore/svg/SVGFitToViewBox.cpp
Source/WebCore/svg/SVGFitToViewBox.h
Source/WebCore/svg/SVGFontElement.cpp
Source/WebCore/svg/SVGFontElement.h
Source/WebCore/svg/SVGForeignObjectElement.cpp
Source/WebCore/svg/SVGForeignObjectElement.h
Source/WebCore/svg/SVGGElement.cpp
Source/WebCore/svg/SVGGElement.h
Source/WebCore/svg/SVGGlyphElement.cpp
Source/WebCore/svg/SVGGlyphElement.h
Source/WebCore/svg/SVGGradientElement.cpp
Source/WebCore/svg/SVGGradientElement.h
Source/WebCore/svg/SVGImageElement.cpp
Source/WebCore/svg/SVGImageElement.h
Source/WebCore/svg/SVGLineElement.cpp
Source/WebCore/svg/SVGLineElement.h
Source/WebCore/svg/SVGLinearGradientElement.cpp
Source/WebCore/svg/SVGLinearGradientElement.h
Source/WebCore/svg/SVGMPathElement.cpp
Source/WebCore/svg/SVGMPathElement.h
Source/WebCore/svg/SVGMarkerElement.cpp
Source/WebCore/svg/SVGMarkerElement.h
Source/WebCore/svg/SVGMaskElement.cpp
Source/WebCore/svg/SVGMaskElement.h
Source/WebCore/svg/SVGMissingGlyphElement.cpp
Source/WebCore/svg/SVGMissingGlyphElement.h
Source/WebCore/svg/SVGPathElement.cpp
Source/WebCore/svg/SVGPathElement.h
Source/WebCore/svg/SVGPathSegWithContext.h
Source/WebCore/svg/SVGPatternElement.cpp
Source/WebCore/svg/SVGPatternElement.h
Source/WebCore/svg/SVGPolyElement.cpp
Source/WebCore/svg/SVGPolyElement.h
Source/WebCore/svg/SVGRadialGradientElement.cpp
Source/WebCore/svg/SVGRadialGradientElement.h
Source/WebCore/svg/SVGRectElement.cpp
Source/WebCore/svg/SVGRectElement.h
Source/WebCore/svg/SVGSVGElement.cpp
Source/WebCore/svg/SVGSVGElement.h
Source/WebCore/svg/SVGScriptElement.cpp
Source/WebCore/svg/SVGScriptElement.h
Source/WebCore/svg/SVGStopElement.cpp
Source/WebCore/svg/SVGStopElement.h
Source/WebCore/svg/SVGStyledElement.cpp
Source/WebCore/svg/SVGStyledElement.h
Source/WebCore/svg/SVGStyledTransformableElement.cpp
Source/WebCore/svg/SVGStyledTransformableElement.h
Source/WebCore/svg/SVGSwitchElement.cpp
Source/WebCore/svg/SVGSwitchElement.h
Source/WebCore/svg/SVGSymbolElement.cpp
Source/WebCore/svg/SVGSymbolElement.h
Source/WebCore/svg/SVGTRefElement.cpp
Source/WebCore/svg/SVGTRefElement.h
Source/WebCore/svg/SVGTSpanElement.cpp
Source/WebCore/svg/SVGTSpanElement.h
Source/WebCore/svg/SVGTests.cpp
Source/WebCore/svg/SVGTests.h
Source/WebCore/svg/SVGTextContentElement.cpp
Source/WebCore/svg/SVGTextContentElement.h
Source/WebCore/svg/SVGTextElement.cpp
Source/WebCore/svg/SVGTextElement.h
Source/WebCore/svg/SVGTextPathElement.cpp
Source/WebCore/svg/SVGTextPathElement.h
Source/WebCore/svg/SVGTextPositioningElement.cpp
Source/WebCore/svg/SVGTextPositioningElement.h
Source/WebCore/svg/SVGTitleElement.cpp
Source/WebCore/svg/SVGTitleElement.h
Source/WebCore/svg/SVGUseElement.cpp
Source/WebCore/svg/SVGUseElement.h
Source/WebCore/svg/SVGViewElement.cpp
Source/WebCore/svg/SVGViewElement.h
Source/WebCore/svg/SVGViewSpec.cpp
Source/WebCore/svg/SVGViewSpec.h
Source/WebCore/svg/properties/SVGAnimatedProperty.h
Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h
Source/WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h
Source/WebCore/svg/properties/SVGAttributeToPropertyMap.cpp [new file with mode: 0644]
Source/WebCore/svg/properties/SVGAttributeToPropertyMap.h [new file with mode: 0644]
Source/WebCore/svg/properties/SVGPropertyInfo.h [new file with mode: 0644]

index d35a8e7..629982a 100644 (file)
@@ -1809,6 +1809,7 @@ IF (ENABLE_SVG)
         svg/graphics/filters/SVGFEImage.cpp
         svg/graphics/filters/SVGFilter.cpp
         svg/graphics/filters/SVGFilterBuilder.cpp
+        svg/properties/SVGAttributeToPropertyMap.cpp
         svg/properties/SVGPathSegListPropertyTearOff.cpp
     )
 
index 68cd3a9..bfde996 100644 (file)
@@ -1,3 +1,507 @@
+2011-07-09  Nikolas Zimmermann  <nzimmermann@rim.com>
+
+        Add a possibility to retrieve the associated SVGAnimatedProperty object for a certain XML attribute
+        https://bugs.webkit.org/show_bug.cgi?id=63797
+
+        Reviewed by Dirk Schulze.
+
+        In order to prepare animVal support we need a way to map a given SVG DOM attribute to a SVGAnimatedProperty.
+        eg. SVGNames::xAttr -> SVGRectElement::xAnimated(), etc. This will be needed to update the animVal of the
+        SVGAnimatedProperty, if an animation is running. It would required adding a new method to all SVG* classes
+        that define animated properties. Unfortunately we already have lots of repeated code in methods like
+        synchronizeProperty / fillAttributeToPropertyTypeMap. Look at SVGRectElement for example:
+
+        void SVGRectElement::synchronizeProperty(const QualifiedName& attrName)
+        {
+            if (attrName == anyQName()) {
+                synchronizeX();
+                synchronizeY();
+                 ...
+              }
+
+            if (attrName == SVGNames::xAttr) {
+                synchronizeX();
+                return;
+            }
+
+            if (attrName == SVGNames::yAttr) {
+                synchronizeY();
+                return;
+            }
+            ...
+        }
+
+        or
+
+        void SVGRectElement::fillAttributeToPropertyTypeMap()
+        {
+            AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
+        
+            SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
+            attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
+            attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
+            ...
+        }
+
+        These lookups are all performed dynamically. Each synchronizeProperty() call does a lot of comparisons.
+        fillAttributeToPropertyTypeMap() isn't that bad as the result is cached in a static HashMap per-SVGRectElement.
+        There's no reason to do these things dynamically!
+
+        Inspired by JSC, I'm adding a "static const SVGPropertyInfo s_fooPropertyInfo" object for each animated SVG property.
+        For example, for SVGRectElements SVGAnimatedLength x property we're storing:
+        - "AnimatedPropertyType type" (AnimatedLength -- note the enum was named AnimatedAttributeType, I renamed it to AnimatedPropertyType for clarity)
+        - "const QualifiedName& attributeName" (SVGNames::xAttr)
+        - "const AtomicString& propertyIdentifier" (SVGNames::xAttr.localName() -- only different if N-wrappers map to a single XML DOM attribute, eg. orientAttr)
+        - "SynchronizeProperty synchronizeProperty" (callback to SVGRectElement::synchronizeX)
+        - "LookupOrCreateWrapperForAnimatedProperty lookupOrCreateWrapperForAnimatedProperty" (callback to SVGRectElement::xAnimated)
+
+        Using this information, we can replace all the various synchronizeProperty/fillAttributeToPropertyMap implementations, with a single one in SVGElement.
+        All these are auto-generated, using the standard macros used to define/declare SVG animated properties. This required several changes to the macros.
+        Here's a summary:
+    
+        #1) In all headers, wrap DECLARE_ANIMATED_* calls, in BEGIN_DECLARE_ANIMATED_PROPERTIES(ClassName) / END_DECLARE_ANIMATED_PROPERTIES blocks.
+        
+            Sample change for SVGRectElement:
+            -    DECLARE_ANIMATED_LENGTH(X, x)
+            -    DECLARE_ANIMATED_LENGTH(Y, y)
+            -    ...
+
+            +    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGRectElement)
+            +        DECLARE_ANIMATED_LENGTH(X, x)
+            +        DECLARE_ANIMATED_LENGTH(Y, y)
+            +         ...
+            +    END_DECLARE_ANIMATED_PROPERTIES
+
+        #2) In all cpp files, add a new section wrapped in BEGIN_REGISTER_ANIMATED_PROPERTIES(ClassName / END_REGISTER_ANIMATED_PROPERTIES blocks:
+
+            Sample change for SVGRectElement:
+            +BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGRectElement)
+            +    REGISTER_LOCAL_ANIMATED_PROPERTY(x)
+            +    REGISTER_LOCAL_ANIMATED_PROPERTY(y)
+            +    ...
+            +    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
+            +    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+            +END_REGISTER_ANIMATED_PROPERTIES
+
+            This is the main piece of the logic that replaces the manual synchronizeProperty/fillAttributeToPropertyMap implementation. It expands to following:
+
+            SVGAttributeToPropertyMap& SVGRectElement::attributeToPropertyMap()
+            {
+                DEFINE_STATIC_LOCAL(SVGAttributeToPropertyMap, s_attributeToPropertyMap, ());
+            }
+
+            static void registerAnimatedPropertiesForSVGRectElement()
+            {
+                SVGAttributeToPropertyMap& map = SVGRectElement::attributeToPropertyMap();
+                if (!map.isEmpty())
+                    return;
+                map.addProperty(SVGRectElement::xPropertyInfo());
+                map.addProperty(SVGRectElement::yPropertyInfo());
+                ...
+                map.addProperties(SVGStyledTransformableElement::attributeToPropertyMap());
+                map.addProperties(SVGTests::attributeToPropertyMap());
+            }
+
+            A single-instance of SVGAttributeToPropertyMap is created for each SVG*Element. The constructor of SVGRectElement is supposed to call
+            registerAnimatedPropertiesForSVGRectElement(), which collects all properties of SVGRectElement and all its parent classes and stores them
+            in a Vector<const SVGPropertyInfo*>. This Vector is stored in a HashMap<QualifiedName, Vector<const SVGPropertyInfo*> > where the key
+            is the attribute name (eg. SVGNames::xAttr -> SVGRectElement::xPropertyInfo). This is only done _once_ per SVGRectElement.
+
+            SVGElement contains a "virtual SVGAttributeToPropertyMap& localAttributeToPropertyMap()" method, and SVGRectElement overrides it
+            and returns SVGRectElement::attributeToPropertyMap() (which is static!) -- this is hidden again in the macros, no need to write any code.
+
+            SVGAttributeToPropertyMap provides following API:
+            - bool synchronizeProperty(SVGElement* contextElement, const QualifiedName& attributeName)
+            - void synchronizeProperties(SVGElement* contextElement)
+            
+                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
+                contextElement->localAttributeToPropertyMap().synchronizeProperty(this, SVGNames::xAttr)
+                The SVGAttributeToPropertyMap will ask its HashMap for the Vector containing the properties for SVGNames::xAttr (in that case, just one xAnimated()).
+
+            - void animatedPropertyTypeForAttribute(const QualifiedName& attributeName, Vector<AnimatedPropertyType>& propertyTypes)
+
+                This method replaces the fillAttributeToPropertyMap implementations everywhere.
+        
+            - void animatedPropertiesForAttribute(SVGElement* contextElement, const QualifiedName& attributeName, Vector<RefPtr<SVGAnimatedProperty> >& properties);
+
+                This method is not used yet, but allows us to collect all SVGAnimatedProperties for a QualifiedName -- the initial goal for this patch.
+
+        #3) In all cpp files, add a call to "registerAnimatedPropertiesForClassName()" in the constructor. Forgetting this will result in a compile error.
+
+        Doesn't affect any tests.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (NativeToJSValue):
+        * bindings/scripts/CodeGeneratorObjC.pm:
+        (GenerateImplementation):
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (GenerateNormalAttrGetter):
+        * svg/SVGAElement.cpp:
+        (WebCore::SVGAElement::SVGAElement):
+        * svg/SVGAElement.h:
+        (WebCore::SVGAElement::synchronizeRequiredFeatures):
+        (WebCore::SVGAElement::synchronizeRequiredExtensions):
+        (WebCore::SVGAElement::synchronizeSystemLanguage):
+        * svg/SVGAltGlyphElement.cpp:
+        (WebCore::SVGAltGlyphElement::SVGAltGlyphElement):
+        * svg/SVGAltGlyphElement.h:
+        * svg/SVGAnimateElement.cpp:
+        (WebCore::SVGAnimateElement::SVGAnimateElement):
+        (WebCore::SVGAnimateElement::hasValidAttributeType):
+        (WebCore::SVGAnimateElement::determineAnimatedPropertyType):
+        (WebCore::SVGAnimateElement::determinePropertyValueTypes):
+        (WebCore::SVGAnimateElement::calculateAnimatedValue):
+        (WebCore::SVGAnimateElement::calculateFromAndToValues):
+        (WebCore::SVGAnimateElement::calculateFromAndByValues):
+        (WebCore::SVGAnimateElement::resetToBaseValue):
+        (WebCore::SVGAnimateElement::applyResultsToTarget):
+        (WebCore::SVGAnimateElement::calculateDistance):
+        (WebCore::SVGAnimateElement::ensureAnimator):
+        * svg/SVGAnimateElement.h:
+        * svg/SVGAnimateTransformElement.cpp:
+        (WebCore::SVGAnimateTransformElement::hasValidAttributeType):
+        (WebCore::SVGAnimateTransformElement::determineAnimatedPropertyType):
+        (WebCore::SVGAnimateTransformElement::resetToBaseValue):
+        (WebCore::SVGAnimateTransformElement::calculateAnimatedValue):
+        (WebCore::SVGAnimateTransformElement::applyResultsToTarget):
+        * svg/SVGAnimateTransformElement.h:
+        * svg/SVGAnimatedAngle.h:
+        * svg/SVGAnimatedBoolean.h:
+        * svg/SVGAnimatedEnumeration.h:
+        * svg/SVGAnimatedInteger.h:
+        * svg/SVGAnimatedLength.h:
+        * svg/SVGAnimatedLengthList.h:
+        * svg/SVGAnimatedNumber.h:
+        * svg/SVGAnimatedNumberList.h:
+        * svg/SVGAnimatedPreserveAspectRatio.h:
+        * svg/SVGAnimatedRect.h:
+        * svg/SVGAnimatedString.h:
+        * svg/SVGAnimatedTransformList.h:
+        * svg/SVGAnimatedType.cpp:
+        (WebCore::SVGAnimatedType::SVGAnimatedType):
+        * svg/SVGAnimatedType.h:
+        (WebCore::SVGAnimatedType::type):
+        * svg/SVGAnimatedTypeAnimator.h:
+        (WebCore::SVGAnimatedTypeAnimator::SVGAnimatedTypeAnimator):
+        * svg/SVGAnimationElement.cpp:
+        (WebCore::SVGAnimationElement::SVGAnimationElement):
+        (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
+        * svg/SVGAnimationElement.h:
+        (WebCore::SVGAnimationElement::synchronizeRequiredFeatures):
+        (WebCore::SVGAnimationElement::synchronizeRequiredExtensions):
+        (WebCore::SVGAnimationElement::synchronizeSystemLanguage):
+        * svg/SVGAnimatorFactory.h:
+        (WebCore::SVGAnimatorFactory::create):
+        * svg/SVGCircleElement.cpp:
+        (WebCore::SVGCircleElement::SVGCircleElement):
+        * svg/SVGCircleElement.h:
+        (WebCore::SVGCircleElement::synchronizeRequiredFeatures):
+        (WebCore::SVGCircleElement::synchronizeRequiredExtensions):
+        (WebCore::SVGCircleElement::synchronizeSystemLanguage):
+        * svg/SVGClipPathElement.cpp:
+        (WebCore::SVGClipPathElement::SVGClipPathElement):
+        * svg/SVGClipPathElement.h:
+        (WebCore::SVGClipPathElement::synchronizeRequiredFeatures):
+        (WebCore::SVGClipPathElement::synchronizeRequiredExtensions):
+        (WebCore::SVGClipPathElement::synchronizeSystemLanguage):
+        * svg/SVGComponentTransferFunctionElement.cpp:
+        (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
+        * svg/SVGComponentTransferFunctionElement.h:
+        * svg/SVGCursorElement.cpp:
+        (WebCore::SVGCursorElement::SVGCursorElement):
+        * svg/SVGCursorElement.h:
+        (WebCore::SVGCursorElement::synchronizeRequiredFeatures):
+        (WebCore::SVGCursorElement::synchronizeRequiredExtensions):
+        (WebCore::SVGCursorElement::synchronizeSystemLanguage):
+        * svg/SVGDefsElement.cpp:
+        (WebCore::SVGDefsElement::SVGDefsElement):
+        * svg/SVGDefsElement.h:
+        (WebCore::SVGDefsElement::synchronizeRequiredFeatures):
+        (WebCore::SVGDefsElement::synchronizeRequiredExtensions):
+        (WebCore::SVGDefsElement::synchronizeSystemLanguage):
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::animatedPropertyTypeForAttribute):
+        (WebCore::SVGElement::updateAnimatedSVGAttribute):
+        (WebCore::SVGElement::localAttributeToPropertyMap):
+        (WebCore::SVGElement::synchronizeRequiredFeatures):
+        (WebCore::SVGElement::synchronizeRequiredExtensions):
+        (WebCore::SVGElement::synchronizeSystemLanguage):
+        * svg/SVGElement.h:
+        (WebCore::SVGElement::svgAttributeChanged):
+        (WebCore::SVGElement::synchronizeRequiredFeatures):
+        (WebCore::SVGElement::synchronizeRequiredExtensions):
+        (WebCore::SVGElement::synchronizeSystemLanguage):
+        * svg/SVGEllipseElement.cpp:
+        (WebCore::SVGEllipseElement::SVGEllipseElement):
+        * svg/SVGEllipseElement.h:
+        (WebCore::SVGEllipseElement::synchronizeRequiredFeatures):
+        (WebCore::SVGEllipseElement::synchronizeRequiredExtensions):
+        (WebCore::SVGEllipseElement::synchronizeSystemLanguage):
+        * svg/SVGFEBlendElement.cpp:
+        (WebCore::SVGFEBlendElement::SVGFEBlendElement):
+        * svg/SVGFEBlendElement.h:
+        * svg/SVGFEColorMatrixElement.cpp:
+        (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
+        * svg/SVGFEColorMatrixElement.h:
+        * svg/SVGFEComponentTransferElement.cpp:
+        (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement):
+        * svg/SVGFEComponentTransferElement.h:
+        * svg/SVGFECompositeElement.cpp:
+        (WebCore::SVGFECompositeElement::SVGFECompositeElement):
+        * svg/SVGFECompositeElement.h:
+        * svg/SVGFEConvolveMatrixElement.cpp:
+        (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
+        * svg/SVGFEConvolveMatrixElement.h:
+        * svg/SVGFEDiffuseLightingElement.cpp:
+        (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
+        * svg/SVGFEDiffuseLightingElement.h:
+        * svg/SVGFEDisplacementMapElement.cpp:
+        (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
+        * svg/SVGFEDisplacementMapElement.h:
+        * svg/SVGFEDropShadowElement.cpp:
+        (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
+        * svg/SVGFEDropShadowElement.h:
+        * svg/SVGFEFloodElement.cpp:
+        * svg/SVGFEFloodElement.h:
+        * svg/SVGFEGaussianBlurElement.cpp:
+        (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
+        * svg/SVGFEGaussianBlurElement.h:
+        * svg/SVGFEImageElement.cpp:
+        (WebCore::SVGFEImageElement::SVGFEImageElement):
+        * svg/SVGFEImageElement.h:
+        * svg/SVGFELightElement.cpp:
+        (WebCore::SVGFELightElement::SVGFELightElement):
+        * svg/SVGFELightElement.h:
+        * svg/SVGFEMergeElement.cpp:
+        * svg/SVGFEMergeElement.h:
+        * svg/SVGFEMergeNodeElement.cpp:
+        (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement):
+        * svg/SVGFEMergeNodeElement.h:
+        * svg/SVGFEMorphologyElement.cpp:
+        (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
+        * svg/SVGFEMorphologyElement.h:
+        * svg/SVGFEOffsetElement.cpp:
+        (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
+        * svg/SVGFEOffsetElement.h:
+        * svg/SVGFESpecularLightingElement.cpp:
+        (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
+        * svg/SVGFESpecularLightingElement.h:
+        * svg/SVGFETileElement.cpp:
+        (WebCore::SVGFETileElement::SVGFETileElement):
+        * svg/SVGFETileElement.h:
+        * svg/SVGFETurbulenceElement.cpp:
+        (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
+        * svg/SVGFETurbulenceElement.h:
+        * svg/SVGFilterElement.cpp:
+        (WebCore::SVGFilterElement::SVGFilterElement):
+        * svg/SVGFilterElement.h:
+        * svg/SVGFilterPrimitiveStandardAttributes.cpp:
+        (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
+        * svg/SVGFilterPrimitiveStandardAttributes.h:
+        * svg/SVGFitToViewBox.cpp:
+        * svg/SVGFitToViewBox.h:
+        * svg/SVGFontElement.cpp:
+        (WebCore::SVGFontElement::SVGFontElement):
+        * svg/SVGFontElement.h:
+        (WebCore::SVGFontElement::rendererIsNeeded):
+        * svg/SVGForeignObjectElement.cpp:
+        (WebCore::SVGForeignObjectElement::SVGForeignObjectElement):
+        * svg/SVGForeignObjectElement.h:
+        (WebCore::SVGForeignObjectElement::synchronizeRequiredFeatures):
+        (WebCore::SVGForeignObjectElement::synchronizeRequiredExtensions):
+        (WebCore::SVGForeignObjectElement::synchronizeSystemLanguage):
+        * svg/SVGGElement.cpp:
+        (WebCore::SVGGElement::SVGGElement):
+        * svg/SVGGElement.h:
+        (WebCore::SVGGElement::synchronizeRequiredFeatures):
+        (WebCore::SVGGElement::synchronizeRequiredExtensions):
+        (WebCore::SVGGElement::synchronizeSystemLanguage):
+        * svg/SVGGlyphElement.cpp:
+        * svg/SVGGlyphElement.h:
+        * svg/SVGGradientElement.cpp:
+        (WebCore::SVGGradientElement::SVGGradientElement):
+        (WebCore::SVGGradientElement::svgAttributeChanged):
+        * svg/SVGGradientElement.h:
+        * svg/SVGImageElement.cpp:
+        (WebCore::SVGImageElement::SVGImageElement):
+        * svg/SVGImageElement.h:
+        (WebCore::SVGImageElement::synchronizeRequiredFeatures):
+        (WebCore::SVGImageElement::synchronizeRequiredExtensions):
+        (WebCore::SVGImageElement::synchronizeSystemLanguage):
+        * svg/SVGLineElement.cpp:
+        (WebCore::SVGLineElement::SVGLineElement):
+        * svg/SVGLineElement.h:
+        (WebCore::SVGLineElement::synchronizeRequiredFeatures):
+        (WebCore::SVGLineElement::synchronizeRequiredExtensions):
+        (WebCore::SVGLineElement::synchronizeSystemLanguage):
+        * svg/SVGLinearGradientElement.cpp:
+        (WebCore::SVGLinearGradientElement::SVGLinearGradientElement):
+        * svg/SVGLinearGradientElement.h:
+        * svg/SVGMPathElement.cpp:
+        (WebCore::SVGMPathElement::SVGMPathElement):
+        * svg/SVGMPathElement.h:
+        * svg/SVGMarkerElement.cpp:
+        (WebCore::SVGMarkerElement::orientTypePropertyInfo):
+        (WebCore::SVGMarkerElement::SVGMarkerElement):
+        (WebCore::SVGMarkerElement::setOrientToAuto):
+        (WebCore::SVGMarkerElement::setOrientToAngle):
+        (WebCore::SVGMarkerElement::synchronizeOrientType):
+        (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper):
+        (WebCore::SVGMarkerElement::orientTypeAnimated):
+        * svg/SVGMarkerElement.h:
+        * svg/SVGMaskElement.cpp:
+        (WebCore::SVGMaskElement::SVGMaskElement):
+        * svg/SVGMaskElement.h:
+        (WebCore::SVGMaskElement::synchronizeRequiredFeatures):
+        (WebCore::SVGMaskElement::synchronizeRequiredExtensions):
+        (WebCore::SVGMaskElement::synchronizeSystemLanguage):
+        * svg/SVGMissingGlyphElement.cpp:
+        * svg/SVGMissingGlyphElement.h:
+        * svg/SVGPathElement.cpp:
+        (WebCore::SVGPathElement::dPropertyInfo):
+        (WebCore::SVGPathElement::SVGPathElement):
+        (WebCore::SVGPathElement::svgAttributeChanged):
+        (WebCore::SVGPathElement::lookupOrCreateDWrapper):
+        (WebCore::SVGPathElement::synchronizeD):
+        (WebCore::SVGPathElement::pathSegList):
+        (WebCore::SVGPathElement::animatedPathSegList):
+        * svg/SVGPathElement.h:
+        (WebCore::SVGPathElement::pathByteStream):
+        (WebCore::SVGPathElement::synchronizeRequiredFeatures):
+        (WebCore::SVGPathElement::synchronizeRequiredExtensions):
+        (WebCore::SVGPathElement::synchronizeSystemLanguage):
+        * svg/SVGPathSegWithContext.h:
+        (WebCore::SVGPathSegWithContext::animatedProperty):
+        * svg/SVGPatternElement.cpp:
+        (WebCore::SVGPatternElement::SVGPatternElement):
+        * svg/SVGPatternElement.h:
+        (WebCore::SVGPatternElement::synchronizeRequiredFeatures):
+        (WebCore::SVGPatternElement::synchronizeRequiredExtensions):
+        (WebCore::SVGPatternElement::synchronizeSystemLanguage):
+        * svg/SVGPolyElement.cpp:
+        (WebCore::SVGPolyElement::pointsPropertyInfo):
+        (WebCore::SVGPolyElement::SVGPolyElement):
+        (WebCore::SVGPolyElement::parseMappedAttribute):
+        (WebCore::SVGPolyElement::synchronizePoints):
+        (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
+        (WebCore::SVGPolyElement::points):
+        (WebCore::SVGPolyElement::animatedPoints):
+        * svg/SVGPolyElement.h:
+        (WebCore::SVGPolyElement::synchronizeRequiredFeatures):
+        (WebCore::SVGPolyElement::synchronizeRequiredExtensions):
+        (WebCore::SVGPolyElement::synchronizeSystemLanguage):
+        * svg/SVGRadialGradientElement.cpp:
+        (WebCore::SVGRadialGradientElement::SVGRadialGradientElement):
+        * svg/SVGRadialGradientElement.h:
+        * svg/SVGRectElement.cpp:
+        (WebCore::SVGRectElement::SVGRectElement):
+        * svg/SVGRectElement.h:
+        (WebCore::SVGRectElement::synchronizeRequiredFeatures):
+        (WebCore::SVGRectElement::synchronizeRequiredExtensions):
+        (WebCore::SVGRectElement::synchronizeSystemLanguage):
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::SVGSVGElement):
+        * svg/SVGSVGElement.h:
+        (WebCore::SVGSVGElement::synchronizeRequiredFeatures):
+        (WebCore::SVGSVGElement::synchronizeRequiredExtensions):
+        (WebCore::SVGSVGElement::synchronizeSystemLanguage):
+        * svg/SVGScriptElement.cpp:
+        (WebCore::SVGScriptElement::SVGScriptElement):
+        * svg/SVGScriptElement.h:
+        * svg/SVGStopElement.cpp:
+        (WebCore::SVGStopElement::SVGStopElement):
+        * svg/SVGStopElement.h:
+        * svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::SVGStyledElement):
+        (WebCore::cssPropertyToTypeMap):
+        (WebCore::SVGStyledElement::animatedPropertyTypeForAttribute):
+        * svg/SVGStyledElement.h:
+        * svg/SVGStyledTransformableElement.cpp:
+        (WebCore::SVGStyledTransformableElement::SVGStyledTransformableElement):
+        * svg/SVGStyledTransformableElement.h:
+        * svg/SVGSwitchElement.cpp:
+        (WebCore::SVGSwitchElement::SVGSwitchElement):
+        * svg/SVGSwitchElement.h:
+        (WebCore::SVGSwitchElement::synchronizeRequiredFeatures):
+        (WebCore::SVGSwitchElement::synchronizeRequiredExtensions):
+        (WebCore::SVGSwitchElement::synchronizeSystemLanguage):
+        * svg/SVGSymbolElement.cpp:
+        (WebCore::SVGSymbolElement::SVGSymbolElement):
+        * svg/SVGSymbolElement.h:
+        * svg/SVGTRefElement.cpp:
+        (WebCore::SVGTRefElement::SVGTRefElement):
+        * svg/SVGTRefElement.h:
+        * svg/SVGTSpanElement.cpp:
+        * svg/SVGTSpanElement.h:
+        * svg/SVGTests.cpp:
+        (WebCore::SVGTests::requiredFeaturesPropertyInfo):
+        (WebCore::SVGTests::requiredExtensionsPropertyInfo):
+        (WebCore::SVGTests::systemLanguagePropertyInfo):
+        (WebCore::SVGTests::attributeToPropertyMap):
+        (WebCore::SVGTests::synchronizeRequiredFeatures):
+        (WebCore::SVGTests::synchronizeRequiredExtensions):
+        (WebCore::SVGTests::synchronizeSystemLanguage):
+        * svg/SVGTests.h:
+        * svg/SVGTextContentElement.cpp:
+        (WebCore::SVGTextContentElement::textLengthPropertyInfo):
+        (WebCore::SVGTextContentElement::SVGTextContentElement):
+        (WebCore::SVGTextContentElement::synchronizeTextLength):
+        (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
+        (WebCore::SVGTextContentElement::textLengthAnimated):
+        * svg/SVGTextContentElement.h:
+        (WebCore::SVGTextContentElement::synchronizeRequiredFeatures):
+        (WebCore::SVGTextContentElement::synchronizeRequiredExtensions):
+        (WebCore::SVGTextContentElement::synchronizeSystemLanguage):
+        * svg/SVGTextElement.cpp:
+        (WebCore::SVGTextElement::SVGTextElement):
+        * svg/SVGTextElement.h:
+        * svg/SVGTextPathElement.cpp:
+        (WebCore::SVGTextPathElement::SVGTextPathElement):
+        * svg/SVGTextPathElement.h:
+        * svg/SVGTextPositioningElement.cpp:
+        (WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
+        * svg/SVGTextPositioningElement.h:
+        * svg/SVGTitleElement.cpp:
+        * svg/SVGTitleElement.h:
+        (WebCore::SVGTitleElement::rendererIsNeeded):
+        * svg/SVGUseElement.cpp:
+        (WebCore::SVGUseElement::SVGUseElement):
+        * svg/SVGUseElement.h:
+        (WebCore::SVGUseElement::synchronizeRequiredFeatures):
+        (WebCore::SVGUseElement::synchronizeRequiredExtensions):
+        (WebCore::SVGUseElement::synchronizeSystemLanguage):
+        * svg/SVGViewElement.cpp:
+        (WebCore::SVGViewElement::SVGViewElement):
+        * svg/SVGViewElement.h:
+        * svg/SVGViewSpec.cpp:
+        (WebCore::SVGViewSpec::SVGViewSpec):
+        * svg/SVGViewSpec.h:
+        * svg/properties/SVGAnimatedProperty.h:
+        (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper):
+        (WebCore::SVGAnimatedProperty::lookupWrapper):
+        * svg/properties/SVGAnimatedPropertyMacros.h:
+        * svg/properties/SVGAnimatedPropertySynchronizer.h:
+        * svg/properties/SVGAttributeToPropertyMap.cpp: Added.
+        (WebCore::SVGAttributeToPropertyMap::addProperties):
+        (WebCore::SVGAttributeToPropertyMap::addProperty):
+        (WebCore::SVGAttributeToPropertyMap::animatedPropertiesForAttribute):
+        (WebCore::SVGAttributeToPropertyMap::animatedPropertyTypeForAttribute):
+        (WebCore::SVGAttributeToPropertyMap::synchronizeProperties):
+        (WebCore::SVGAttributeToPropertyMap::synchronizeProperty):
+        (WebCore::SVGAttributeToPropertyMap::animatedProperty):
+        * svg/properties/SVGAttributeToPropertyMap.h: Added.
+        (WebCore::SVGAttributeToPropertyMap::SVGAttributeToPropertyMap):
+        (WebCore::SVGAttributeToPropertyMap::~SVGAttributeToPropertyMap):
+        (WebCore::SVGAttributeToPropertyMap::isEmpty):
+        * svg/properties/SVGPropertyInfo.h: Added.
+        (WebCore::SVGPropertyInfo::SVGPropertyInfo):
+
 2011-07-09  Patrick Gansterer  <paroga@webkit.org>
 
         Unreviewed build fix after r90676.
index 3152960..64dea88 100644 (file)
@@ -3395,6 +3395,8 @@ webcore_sources += \
        Source/WebCore/svg/graphics/SVGImage.h \
        Source/WebCore/svg/LinearGradientAttributes.h \
        Source/WebCore/svg/PatternAttributes.h \
+       Source/WebCore/svg/properties/SVGAttributeToPropertyMap.cpp \
+       Source/WebCore/svg/properties/SVGAttributeToPropertyMap.h \
        Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h \
        Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h \
        Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h \
@@ -3410,6 +3412,7 @@ webcore_sources += \
        Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp \
        Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.h \
        Source/WebCore/svg/properties/SVGProperty.h \
+       Source/WebCore/svg/properties/SVGPropertyInfo.h \
        Source/WebCore/svg/properties/SVGPropertyTearOff.h \
        Source/WebCore/svg/properties/SVGPropertyTraits.h \
        Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h \
index 1d46101..4eb7c3f 100644 (file)
             'svg/SVGTransformList.h',
             'svg/animation/SMILTime.h',
             'svg/animation/SVGSMILElement.h',
+            'svg/properties/SVGAttributeToPropertyMap.h',
             'svg/properties/SVGAnimatedEnumerationPropertyTearOff.h',
             'svg/properties/SVGAnimatedListPropertyTearOff.h',
             'svg/properties/SVGAnimatedProperty.h',
             'svg/properties/SVGListPropertyTearOff.h',
             'svg/properties/SVGPathSegListPropertyTearOff.h',
             'svg/properties/SVGProperty.h',
+            'svg/properties/SVGPropertyInfo.h',
             'svg/properties/SVGPropertyTearOff.h',
             'svg/properties/SVGPropertyTraits.h',
             'svg/properties/SVGStaticListPropertyTearOff.h',
             'svg/graphics/filters/SVGFilter.h',
             'svg/graphics/filters/SVGFilterBuilder.cpp',
             'svg/graphics/filters/SVGFilterBuilder.h',
+            'svg/properties/SVGAttributeToPropertyMap.cpp',
             'svg/properties/SVGAnimatedPathSegListPropertyTearOff.h',
             'svg/properties/SVGPathSegListPropertyTearOff.cpp',
             'webaudio/AudioBasicProcessorNode.cpp',
index c9e6404..50b7d5b 100644 (file)
@@ -2300,6 +2300,7 @@ HEADERS += \
     svg/graphics/filters/SVGFilterBuilder.h \
     svg/graphics/filters/SVGFilter.h \
     svg/graphics/SVGImage.h \
+    svg/properties/SVGAttributeToPropertyMap.h \
     svg/properties/SVGAnimatedEnumerationPropertyTearOff.h \
     svg/properties/SVGAnimatedListPropertyTearOff.h \
     svg/properties/SVGAnimatedPathSegListPropertyTearOff.h \
@@ -2314,6 +2315,7 @@ HEADERS += \
     svg/properties/SVGListPropertyTearOff.h \
     svg/properties/SVGPathSegListPropertyTearOff.h \
     svg/properties/SVGProperty.h \
+    svg/properties/SVGPropertyInfo.h \
     svg/properties/SVGPropertyTearOff.h \
     svg/properties/SVGPropertyTraits.h \
     svg/properties/SVGStaticListPropertyTearOff.h \
@@ -3263,6 +3265,7 @@ contains(DEFINES, ENABLE_SVG=1) {
         svg/graphics/filters/SVGFilter.cpp \
         svg/graphics/filters/SVGFilterBuilder.cpp \
         svg/graphics/SVGImage.cpp \
+        svg/properties/SVGAttributeToPropertyMap.cpp \
         svg/properties/SVGPathSegListPropertyTearOff.cpp
 
     linux-g++*:CONFIG(debug, debug|release):isEqual(QT_ARCH,i386) {
index f881b48..b5c4d0d 100755 (executable)
                                Name="properties"
                                >
                                <File
+                                       RelativePath="..\svg\properties\SVGAttributeToPropertyMap.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\svg\properties\SVGAttributeToPropertyMap.h"
+                                       >
+                               </File>
+                               <File
                                        RelativePath="..\svg\properties\SVGAnimatedEnumerationPropertyTearOff.h"
                                        >
                                </File>
                                        >
                                </File>
                                <File
+                                       RelativePath="..\svg\properties\SVGPropertyInfo.h"
+                                       >
+                               </File>
+                               <File
                                        RelativePath="..\svg\properties\SVGPropertyTearOff.h"
                                        >
                                </File>
index 85d7a6b..586580d 100644 (file)
@@ -88,6 +88,7 @@
                081668DA125603D5006F25DE /* SVGTextLayoutEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 081668D8125603D5006F25DE /* SVGTextLayoutEngine.h */; };
                081AA8DA1111237E002AB06E /* SVGElementRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 081AA8D91111237E002AB06E /* SVGElementRareData.h */; };
                081CDFBF126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 081CDFBE126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               081DD49C13BA1A6000DC7627 /* SVGPropertyInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 081DD49B13BA1A6000DC7627 /* SVGPropertyInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
                081EBF3A0FD34F4100DA7559 /* SVGFilterBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 081EBF380FD34F4100DA7559 /* SVGFilterBuilder.cpp */; };
                081EBF3B0FD34F4100DA7559 /* SVGFilterBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 081EBF390FD34F4100DA7559 /* SVGFilterBuilder.h */; };
                0823D159127AD6AC000EBC95 /* SVGAnimatedInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */; settings = {ATTRIBUTES = (Private, ); }; };
                08F0BFC61255C53C00075185 /* SVGTextMetrics.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F0BFC11255C53C00075185 /* SVGTextMetrics.h */; };
                08F2F0091213E61700DCEC48 /* RenderImageResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08F2F0071213E61700DCEC48 /* RenderImageResource.cpp */; };
                08F2F00A1213E61700DCEC48 /* RenderImageResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F2F0081213E61700DCEC48 /* RenderImageResource.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               08FB17C113BC7E9100040086 /* SVGAttributeToPropertyMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08FB17C013BC7E9100040086 /* SVGAttributeToPropertyMap.cpp */; };
+               08FB3F8413BC754C0099FC18 /* SVGAttributeToPropertyMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 08FB3F8313BC754C0099FC18 /* SVGAttributeToPropertyMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
                08FE0BC5127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h in Headers */ = {isa = PBXBuildFile; fileRef = 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */; settings = {ATTRIBUTES = (Private, ); }; };
                08FF102012950F5A00F00276 /* SVGPathSegListPropertyTearOff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08FF101F12950F5900F00276 /* SVGPathSegListPropertyTearOff.cpp */; };
                0A4844990CA44CB200B7BD48 /* SoftLinking.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A4844980CA44CB200B7BD48 /* SoftLinking.h */; settings = {ATTRIBUTES = (Private, ); }; };
                081668D8125603D5006F25DE /* SVGTextLayoutEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutEngine.h; sourceTree = "<group>"; };
                081AA8D91111237E002AB06E /* SVGElementRareData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGElementRareData.h; sourceTree = "<group>"; };
                081CDFBE126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertySynchronizer.h; sourceTree = "<group>"; };
+               081DD49B13BA1A6000DC7627 /* SVGPropertyInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyInfo.h; sourceTree = "<group>"; };
                081EBF380FD34F4100DA7559 /* SVGFilterBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFilterBuilder.cpp; sourceTree = "<group>"; };
                081EBF390FD34F4100DA7559 /* SVGFilterBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFilterBuilder.h; sourceTree = "<group>"; };
                0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedInteger.h; sourceTree = "<group>"; };
                08F0BFC11255C53C00075185 /* SVGTextMetrics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextMetrics.h; sourceTree = "<group>"; };
                08F2F0071213E61700DCEC48 /* RenderImageResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderImageResource.cpp; sourceTree = "<group>"; };
                08F2F0081213E61700DCEC48 /* RenderImageResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderImageResource.h; sourceTree = "<group>"; };
+               08FB17C013BC7E9100040086 /* SVGAttributeToPropertyMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAttributeToPropertyMap.cpp; sourceTree = "<group>"; };
+               08FB3F8313BC754C0099FC18 /* SVGAttributeToPropertyMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAttributeToPropertyMap.h; sourceTree = "<group>"; };
                08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPreserveAspectRatio.h; sourceTree = "<group>"; };
                08FF101F12950F5900F00276 /* SVGPathSegListPropertyTearOff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegListPropertyTearOff.cpp; sourceTree = "<group>"; };
                0A4844980CA44CB200B7BD48 /* SoftLinking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoftLinking.h; sourceTree = "<group>"; };
                                088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */,
                                08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */,
                                085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */,
+                               08FB17C013BC7E9100040086 /* SVGAttributeToPropertyMap.cpp */,
+                               08FB3F8313BC754C0099FC18 /* SVGAttributeToPropertyMap.h */,
                                0810764312828556007C63BA /* SVGListProperty.h */,
                                088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */,
                                08FF101F12950F5900F00276 /* SVGPathSegListPropertyTearOff.cpp */,
                                084A0828128D7867002DB1F1 /* SVGPathSegListPropertyTearOff.h */,
                                088A0E01126EF1DB00978F7A /* SVGProperty.h */,
+                               081DD49B13BA1A6000DC7627 /* SVGPropertyInfo.h */,
                                088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */,
                                088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */,
                                0880F70D1282B46D00948505 /* SVGStaticListPropertyTearOff.h */,
                                0863951613B5FE5700BB344D /* SVGAnimatedPath.h in Headers */,
                                431A2F9C13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h in Headers */,
                                A5ABB78713B904BC00F197E3 /* LineBreakIteratorPoolICU.h in Headers */,
+                               081DD49C13BA1A6000DC7627 /* SVGPropertyInfo.h in Headers */,
+                               08FB3F8413BC754C0099FC18 /* SVGAttributeToPropertyMap.h in Headers */,
                                82889B4D13C62392009A6156 /* InspectorStyleTextEditor.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                                431A2FD713B7707A007791E4 /* SVGAnimatedLengthList.cpp in Sources */,
                                431A302113B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp in Sources */,
                                431A308813B8F978007791E4 /* SVGAnimatedBoolean.cpp in Sources */,
+                               08FB17C113BC7E9100040086 /* SVGAttributeToPropertyMap.cpp in Sources */,
                                43F6FD9613BCD0B100224052 /* SVGAnimatedInteger.cpp in Sources */,
                                82889B4C13C62392009A6156 /* InspectorStyleTextEditor.cpp in Sources */,
                                43D2597713C816F400608559 /* ImageBuffer.cpp in Sources */,
index dae1c32..cfc1f93 100644 (file)
@@ -2737,8 +2737,7 @@ sub NativeToJSValue
                 $value = "${tearOffType}::create(imp, $value, $updateMethod)";
             }
         } elsif ($tearOffType =~ /SVGStaticListPropertyTearOff/) {
-            my $extraImp = "GetOwnerElementForType<$implClassName, IsDerivedFromSVGElement<$implClassName>::value>::ownerElement(imp), ";
-            $value = "${tearOffType}::create($extraImp$value)";
+            $value = "${tearOffType}::create(imp, $value)";
         } elsif (not $tearOffType =~ /SVG(Point|PathSeg)List/) {
             $value = "${tearOffType}::create($value)";
         }
index a032a71..66b03c7 100644 (file)
@@ -1316,8 +1316,7 @@ sub GenerateImplementation
                         $getterContentHead = "kit(WTF::getPtr($getterContentHead";
                         $getterContentTail .= "))";
                     } elsif ($idlTypeWithNamespace =~ /SVGStaticListPropertyTearOff/) {
-                        my $extraImp = "WebCore::GetOwnerElementForType<$implClassNameWithNamespace, WebCore::IsDerivedFromSVGElement<$implClassNameWithNamespace>::value>::ownerElement(IMPL), ";
-                        $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($extraImp$getterContentHead";
+                        $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create(IMPL, $getterContentHead";
                         $getterContentTail .= ")))";
                     } else {
                         $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($getterContentHead";
index b5982b3..66f970c 100644 (file)
@@ -902,8 +902,7 @@ END
                 push(@implContentDecls, "    return toV8(WTF::getPtr(${tearOffType}::create(imp, $result, $updateMethod)));\n");
             }
         } elsif ($tearOffType =~ /SVGStaticListPropertyTearOff/) {
-            my $extraImp = "GetOwnerElementForType<$implClassName, IsDerivedFromSVGElement<$implClassName>::value>::ownerElement(imp), ";
-            push(@implContentDecls, "    return toV8(WTF::getPtr(${tearOffType}::create($extraImp$result)));\n");
+            push(@implContentDecls, "    return toV8(WTF::getPtr(${tearOffType}::create(imp, $result)));\n");
         } elsif ($tearOffType =~ /SVG(Point|PathSeg)List/) {
             push(@implContentDecls, "    return toV8(WTF::getPtr($result));\n");
         } else {
index c921074..09c6962 100644 (file)
@@ -53,10 +53,19 @@ DEFINE_ANIMATED_STRING(SVGAElement, SVGNames::targetAttr, SVGTarget, svgTarget)
 DEFINE_ANIMATED_STRING(SVGAElement, XLinkNames::hrefAttr, Href, href)
 DEFINE_ANIMATED_BOOLEAN(SVGAElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAElement)
+     REGISTER_LOCAL_ANIMATED_PROPERTY(svgTarget)
+     REGISTER_LOCAL_ANIMATED_PROPERTY(href)
+     REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+     REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
+     REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGAElement::SVGAElement(const QualifiedName& tagName, Document* document)
     : SVGStyledTransformableElement(tagName, document)
 {
     ASSERT(hasTagName(SVGNames::aTag));
+    registerAnimatedPropertiesForSVGAElement();
 }
 
 PassRefPtr<SVGAElement> SVGAElement::create(const QualifiedName& tagName, Document* document)
@@ -132,60 +141,6 @@ void SVGAElement::svgAttributeChanged(const QualifiedName& attrName)
     }
 }
 
-AttributeToPropertyTypeMap& SVGAElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGAElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::targetAttr, AnimatedString);
-    attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
-}
-
-void SVGAElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeSVGTarget();
-        synchronizeHref();
-        synchronizeExternalResourcesRequired();
-        SVGTests::synchronizeProperties(this, attrName);
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::targetAttr) {
-        synchronizeSVGTarget();
-        return;
-    }
-
-    if (SVGURIReference::isKnownAttribute(attrName)) {
-        synchronizeHref();
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGTests::isKnownAttribute(attrName)) {
-        SVGTests::synchronizeProperties(this, attrName);
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
 RenderObject* SVGAElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
     if (static_cast<SVGElement*>(parentNode())->isTextContent())
index 1f82d7e..fb64461 100644 (file)
@@ -51,10 +51,6 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
 
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
 
@@ -67,17 +63,18 @@ private:
 
     virtual bool childShouldCreateRenderer(Node*) const;
 
-    // Animated property declarations
-
-    // This declaration used to define a non-virtual "String& target() const" method, that clashes with "virtual String Element::target() const".
-    // That's why it has been renamed to "svgTarget", the CodeGenerators take care of calling svgTargetAnimated() instead of targetAnimated(), see CodeGenerator.pm.
-    DECLARE_ANIMATED_STRING(SVGTarget, svgTarget)
-
-    // SVGURIReference
-    DECLARE_ANIMATED_STRING(Href, href)
-
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAElement)
+        // This declaration used to define a non-virtual "String& target() const" method, that clashes with "virtual String Element::target() const".
+        // That's why it has been renamed to "svgTarget", the CodeGenerators take care of calling svgTargetAnimated() instead of targetAnimated(), see CodeGenerator.pm.
+        DECLARE_ANIMATED_STRING(SVGTarget, svgTarget)
+        DECLARE_ANIMATED_STRING(Href, href)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
+
+    // SVGTests
+    virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
+    virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
+    virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
 };
 
 } // namespace WebCore
index 6c8e4d0..1fb1cf9 100644 (file)
 
 namespace WebCore {
 
-// Animated property declarations
+// Animated property definitions
 DEFINE_ANIMATED_STRING(SVGAltGlyphElement, XLinkNames::hrefAttr, Href, href)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAltGlyphElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(href)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTextPositioningElement)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGAltGlyphElement::SVGAltGlyphElement(const QualifiedName& tagName, Document* document)
     : SVGTextPositioningElement(tagName, document)
 {
     ASSERT(hasTagName(SVGNames::altGlyphTag));
+    registerAnimatedPropertiesForSVGAltGlyphElement();
 }
 
 PassRefPtr<SVGAltGlyphElement> SVGAltGlyphElement::create(const QualifiedName& tagName, Document* document)
@@ -47,28 +53,6 @@ PassRefPtr<SVGAltGlyphElement> SVGAltGlyphElement::create(const QualifiedName& t
     return adoptRef(new SVGAltGlyphElement(tagName, document));
 }
 
-void SVGAltGlyphElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    SVGTextPositioningElement::synchronizeProperty(attrName);
-
-    if (attrName == anyQName() || SVGURIReference::isKnownAttribute(attrName))
-        synchronizeHref();
-}
-
-AttributeToPropertyTypeMap& SVGAltGlyphElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGAltGlyphElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGTextPositioningElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
-}
-
 void SVGAltGlyphElement::setGlyphRef(const AtomicString&, ExceptionCode& ec)
 {
     ec = NO_MODIFICATION_ALLOWED_ERR;
index 3f286b6..0c9ba39 100644 (file)
@@ -45,18 +45,12 @@ public:
 private:
     SVGAltGlyphElement(const QualifiedName&, Document*);
 
-    virtual void synchronizeProperty(const QualifiedName&);
-
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
-
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
     virtual bool childShouldCreateRenderer(Node*) const;
 
-    // Animated property declarations
-
-    // SVGURIReference
-    DECLARE_ANIMATED_STRING(Href, href)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAltGlyphElement)
+        DECLARE_ANIMATED_STRING(Href, href)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index b301a67..d1ce3f6 100644 (file)
@@ -40,7 +40,7 @@ namespace WebCore {
 
 SVGAnimateElement::SVGAnimateElement(const QualifiedName& tagName, Document* document)
     : SVGAnimationElement(tagName, document)
-    , m_animatedAttributeType(AnimatedString)
+    , m_animatedPropertyType(AnimatedString)
     , m_fromPropertyValueType(RegularPropertyValue)
     , m_toPropertyValueType(RegularPropertyValue)
 {
@@ -109,14 +109,19 @@ bool SVGAnimateElement::hasValidAttributeType() const
     if (!targetElement)
         return false;
     
-    return determineAnimatedAttributeType(targetElement) != AnimatedUnknown;
+    return determineAnimatedPropertyType(targetElement) != AnimatedUnknown;
 }
 
-AnimatedAttributeType SVGAnimateElement::determineAnimatedAttributeType(SVGElement* targetElement) const
+AnimatedPropertyType SVGAnimateElement::determineAnimatedPropertyType(SVGElement* targetElement) const
 {
     ASSERT(targetElement);
 
-    AnimatedAttributeType type = targetElement->animatedPropertyTypeForAttribute(attributeName());
+    Vector<AnimatedPropertyType> propertyTypes;
+    targetElement->animatedPropertyTypeForAttribute(attributeName(), propertyTypes);
+    if (propertyTypes.isEmpty())
+        return AnimatedUnknown;
+
+    AnimatedPropertyType type = propertyTypes[0];
     if (hasTagName(SVGNames::animateColorTag) && type != AnimatedColor)
         return AnimatedUnknown;
 
@@ -142,7 +147,7 @@ void SVGAnimateElement::determinePropertyValueTypes(const String& from, const St
     if (inheritsFromProperty(targetElement, attributeName(), to))
         m_toPropertyValueType = InheritValue;
 
-    if (m_animatedAttributeType != AnimatedColor)
+    if (m_animatedPropertyType != AnimatedColor)
         return;
     
     if (attributeValueIsCurrentColor(from))
@@ -155,16 +160,16 @@ void SVGAnimateElement::calculateAnimatedValue(float percentage, unsigned repeat
 {
     ASSERT(resultElement);
     ASSERT(percentage >= 0 && percentage <= 1);
-    ASSERT(m_animatedAttributeType != AnimatedEnumeration);
-    ASSERT(m_animatedAttributeType != AnimatedTransformList);
-    ASSERT(m_animatedAttributeType != AnimatedUnknown);
+    ASSERT(m_animatedPropertyType != AnimatedEnumeration);
+    ASSERT(m_animatedPropertyType != AnimatedTransformList);
+    ASSERT(m_animatedPropertyType != AnimatedUnknown);
     ASSERT(m_animator);
     ASSERT(m_fromType);
     ASSERT(m_toType);
 
     SVGAnimateElement* resultAnimationElement = static_cast<SVGAnimateElement*>(resultElement);
     ASSERT(resultAnimationElement->m_animatedType);
-    ASSERT(resultAnimationElement->m_animatedAttributeType == m_animatedAttributeType);
+    ASSERT(resultAnimationElement->m_animatedPropertyType == m_animatedPropertyType);
     ASSERT(resultAnimationElement->hasTagName(SVGNames::animateTag)
         || resultAnimationElement->hasTagName(SVGNames::animateColorTag) 
         || resultAnimationElement->hasTagName(SVGNames::setTag));
@@ -187,7 +192,7 @@ bool SVGAnimateElement::calculateFromAndToValues(const String& fromString, const
     if (!targetElement)
         return false;
 
-    m_animatedAttributeType = determineAnimatedAttributeType(targetElement);
+    m_animatedPropertyType = determineAnimatedPropertyType(targetElement);
 
     ensureAnimator()->calculateFromAndToValues(m_fromType, m_toType, fromString, toString);
     return true;
@@ -200,7 +205,7 @@ bool SVGAnimateElement::calculateFromAndByValues(const String& fromString, const
         return false;
 
     ASSERT(!hasTagName(SVGNames::setTag));
-    m_animatedAttributeType = determineAnimatedAttributeType(targetElement);
+    m_animatedPropertyType = determineAnimatedPropertyType(targetElement);
 
     ensureAnimator()->calculateFromAndByValues(m_fromType, m_toType, fromString, byString);
     return true;
@@ -210,7 +215,7 @@ void SVGAnimateElement::resetToBaseValue(const String& baseString)
 {
     SVGElement* targetElement = this->targetElement();
     ASSERT(targetElement);
-    m_animatedAttributeType = determineAnimatedAttributeType(targetElement);
+    m_animatedPropertyType = determineAnimatedPropertyType(targetElement);
 
     if (!m_animatedType)
         m_animatedType = ensureAnimator()->constructFromString(baseString);
@@ -220,9 +225,9 @@ void SVGAnimateElement::resetToBaseValue(const String& baseString)
     
 void SVGAnimateElement::applyResultsToTarget()
 {
-    ASSERT(m_animatedAttributeType != AnimatedEnumeration);
-    ASSERT(m_animatedAttributeType != AnimatedTransformList);
-    ASSERT(m_animatedAttributeType != AnimatedUnknown);
+    ASSERT(m_animatedPropertyType != AnimatedEnumeration);
+    ASSERT(m_animatedPropertyType != AnimatedTransformList);
+    ASSERT(m_animatedPropertyType != AnimatedUnknown);
     ASSERT(m_animatedType);
 
     setTargetAttributeAnimatedValue(m_animatedType->valueAsString());
@@ -234,7 +239,7 @@ float SVGAnimateElement::calculateDistance(const String& fromString, const Strin
     SVGElement* targetElement = this->targetElement();
     if (!targetElement)
         return -1;
-    m_animatedAttributeType = determineAnimatedAttributeType(targetElement);
+    m_animatedPropertyType = determineAnimatedPropertyType(targetElement);
     
     return ensureAnimator()->calculateDistance(fromString, toString);
 }
@@ -242,7 +247,7 @@ float SVGAnimateElement::calculateDistance(const String& fromString, const Strin
 SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator()
 {
     if (!m_animator)
-        m_animator = SVGAnimatorFactory::create(this, targetElement(), m_animatedAttributeType);
+        m_animator = SVGAnimatorFactory::create(this, targetElement(), m_animatedPropertyType);
     return m_animator.get();
 }
 
index 73e3bac..f524232 100644 (file)
@@ -49,7 +49,7 @@ public:
     static void adjustForCurrentColor(SVGElement* targetElement, Color&);
     void adjustForInheritance(SVGElement* targetElement, const QualifiedName&, String& value);
     
-    AnimatedAttributeType determineAnimatedAttributeType(SVGElement*) const;
+    AnimatedPropertyType determineAnimatedPropertyType(SVGElement*) const;
     void determinePropertyValueTypes(const String&, const String&);
     
     AnimatedPropertyValueType fromPropertyValueType() { return m_fromPropertyValueType; }
@@ -69,7 +69,7 @@ private:
     SVGAnimatedTypeAnimator* ensureAnimator();
     
     virtual bool hasValidAttributeType() const;
-    AnimatedAttributeType m_animatedAttributeType;
+    AnimatedPropertyType m_animatedPropertyType;
 
     AnimatedPropertyValueType m_fromPropertyValueType;
     AnimatedPropertyValueType m_toPropertyValueType;
index 2cdefca..946862a 100644 (file)
@@ -66,18 +66,21 @@ bool SVGAnimateTransformElement::hasValidAttributeType() const
     if (!targetElement)
         return false;
     
-    return determineAnimatedAttributeType(targetElement) == AnimatedTransformList;
+    return determineAnimatedPropertyType(targetElement) == AnimatedTransformList;
 }
 
-AnimatedAttributeType SVGAnimateTransformElement::determineAnimatedAttributeType(SVGElement* targetElement) const
+AnimatedPropertyType SVGAnimateTransformElement::determineAnimatedPropertyType(SVGElement* targetElement) const
 {
     ASSERT(targetElement);
     
     // Just transform lists can be animated with <animateTransform>
     // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties
-    if (targetElement->animatedPropertyTypeForAttribute(attributeName()) != AnimatedTransformList)
+    Vector<AnimatedPropertyType> propertyTypes;
+    targetElement->animatedPropertyTypeForAttribute(attributeName(), propertyTypes);
+    if (propertyTypes.isEmpty() || propertyTypes[0] != AnimatedTransformList)
         return AnimatedUnknown;
 
+    ASSERT(propertyTypes.size() == 1);
     return AnimatedTransformList;
 }
 
@@ -131,7 +134,7 @@ static SVGTransformList* transformListFor(SVGElement* element)
 void SVGAnimateTransformElement::resetToBaseValue(const String& baseValue)
 {
     SVGElement* targetElement = this->targetElement();
-    if (!targetElement || determineAnimatedAttributeType(targetElement) == AnimatedUnknown)
+    if (!targetElement || determineAnimatedPropertyType(targetElement) == AnimatedUnknown)
         return;
 
     // FIXME: This might not be correct for accumulated sum. Needs checking.
@@ -154,7 +157,7 @@ void SVGAnimateTransformElement::resetToBaseValue(const String& baseValue)
 void SVGAnimateTransformElement::calculateAnimatedValue(float percentage, unsigned repeat, SVGSMILElement*)
 {
     SVGElement* targetElement = this->targetElement();
-    if (!targetElement || determineAnimatedAttributeType(targetElement) == AnimatedUnknown)
+    if (!targetElement || determineAnimatedPropertyType(targetElement) == AnimatedUnknown)
         return;
     SVGTransformList* transformList = transformListFor(targetElement);
     ASSERT(transformList);
@@ -203,7 +206,7 @@ SVGTransform SVGAnimateTransformElement::parseTransformValue(const String& value
 void SVGAnimateTransformElement::applyResultsToTarget()
 {
     SVGElement* targetElement = this->targetElement();
-    if (!targetElement || determineAnimatedAttributeType(targetElement) == AnimatedUnknown)
+    if (!targetElement || determineAnimatedPropertyType(targetElement) == AnimatedUnknown)
         return;
 
     // We accumulate to the target element transform list so there is not much to do here.
index db10a1b..0e09065 100644 (file)
@@ -40,7 +40,7 @@ private:
     SVGAnimateTransformElement(const QualifiedName&, Document*);
     
     virtual bool hasValidAttributeType() const;
-    AnimatedAttributeType determineAnimatedAttributeType(SVGElement*) const;
+    AnimatedPropertyType determineAnimatedPropertyType(SVGElement*) const;
 
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
index 34e4560..5ca7450 100644 (file)
@@ -34,7 +34,7 @@ typedef SVGAnimatedPropertyTearOff<SVGAngle> SVGAnimatedAngle;
 DECLARE_ANIMATED_PROPERTY(SVGAnimatedAngle, SVGAngle, UpperProperty, LowerProperty)
 
 #define DEFINE_ANIMATED_ANGLE_MULTIPLE_WRAPPERS(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty) \
-DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, SVGAnimatedAngle, SVGAngle, UpperProperty, LowerProperty)
+DEFINE_ANIMATED_PROPERTY(AnimatedAngle, OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty)
 
 #if ENABLE(SVG_ANIMATION)
 class SVGAnimationElement;
index f1aad6b..462791c 100644 (file)
@@ -33,9 +33,8 @@ typedef SVGAnimatedStaticPropertyTearOff<bool> SVGAnimatedBoolean;
 DECLARE_ANIMATED_PROPERTY(SVGAnimatedBoolean, bool, UpperProperty, LowerProperty)
 
 #define DEFINE_ANIMATED_BOOLEAN(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
-DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedBoolean, bool, UpperProperty, LowerProperty)
+DEFINE_ANIMATED_PROPERTY(AnimatedBoolean, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
 
-    
 #if ENABLE(SVG_ANIMATION)
 class SVGAnimationElement;
 
index e00a151..0ad75ba 100644 (file)
@@ -33,10 +33,7 @@ typedef SVGAnimatedStaticPropertyTearOff<int> SVGAnimatedEnumeration;
 DECLARE_ANIMATED_PROPERTY(SVGAnimatedEnumerationPropertyTearOff<EnumType>, EnumType, UpperProperty, LowerProperty)
 
 #define DEFINE_ANIMATED_ENUMERATION(OwnerType, DOMAttribute, UpperProperty, LowerProperty, EnumType) \
-DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedEnumerationPropertyTearOff<EnumType>, EnumType, UpperProperty, LowerProperty)
-
-#define DEFINE_ANIMATED_ENUMERATION_MULTIPLE_WRAPPERS(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty, EnumType) \
-DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, SVGAnimatedEnumerationPropertyTearOff<EnumType>, EnumType, UpperProperty, LowerProperty)
+DEFINE_ANIMATED_PROPERTY(AnimatedEnumeration, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
 
 } // namespace WebCore
 
index 44133ed..9098ee6 100644 (file)
@@ -34,10 +34,11 @@ typedef SVGAnimatedStaticPropertyTearOff<long> SVGAnimatedInteger;
 DECLARE_ANIMATED_PROPERTY(SVGAnimatedInteger, long, UpperProperty, LowerProperty)
 
 #define DEFINE_ANIMATED_INTEGER(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
-DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedInteger, long, UpperProperty, LowerProperty)
+DEFINE_ANIMATED_PROPERTY(AnimatedInteger, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
 
+// FIXME: This currently animates as number-optional-number, instead of integer-optional-integer, which is missing.
 #define DEFINE_ANIMATED_INTEGER_MULTIPLE_WRAPPERS(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty) \
-DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, SVGAnimatedInteger, long, UpperProperty, LowerProperty)
+DEFINE_ANIMATED_PROPERTY(AnimatedNumberOptionalNumber, OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty)
 
 #if ENABLE(SVG_ANIMATION)
 class SVGAnimationElement;
index 26c0c05..949626c 100644 (file)
@@ -34,7 +34,7 @@ typedef SVGAnimatedPropertyTearOff<SVGLength> SVGAnimatedLength;
 DECLARE_ANIMATED_PROPERTY(SVGAnimatedLength, SVGLength, UpperProperty, LowerProperty)
 
 #define DEFINE_ANIMATED_LENGTH(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
-DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedLength, SVGLength, UpperProperty, LowerProperty)
+DEFINE_ANIMATED_PROPERTY(AnimatedLength, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
 
 #if ENABLE(SVG_ANIMATION)
 class SVGAnimationElement;
index 01cec8c..5c8a95f 100644 (file)
@@ -34,8 +34,8 @@ typedef SVGAnimatedListPropertyTearOff<SVGLengthList> SVGAnimatedLengthList;
 DECLARE_ANIMATED_LIST_PROPERTY(SVGAnimatedLengthList, SVGLengthList, UpperProperty, LowerProperty)
 
 #define DEFINE_ANIMATED_LENGTH_LIST(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
-DEFINE_ANIMATED_LIST_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedLengthList, SVGLengthList, UpperProperty, LowerProperty)
-    
+DEFINE_ANIMATED_PROPERTY(AnimatedLengthList, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
+
 #if ENABLE(SVG_ANIMATION)
 class SVGAnimationElement;
 
index e48bd08..f88928b 100644 (file)
@@ -34,10 +34,10 @@ typedef SVGAnimatedStaticPropertyTearOff<float> SVGAnimatedNumber;
 DECLARE_ANIMATED_PROPERTY(SVGAnimatedNumber, float, UpperProperty, LowerProperty)
 
 #define DEFINE_ANIMATED_NUMBER(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
-DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedNumber, float, UpperProperty, LowerProperty)
+DEFINE_ANIMATED_PROPERTY(AnimatedNumber, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
 
 #define DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty) \
-DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, SVGAnimatedNumber, float, UpperProperty, LowerProperty)
+DEFINE_ANIMATED_PROPERTY(AnimatedNumberOptionalNumber, OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty)
 
 #if ENABLE(SVG_ANIMATION)
 class SVGAnimationElement;
index d53ccd7..558cb0c 100644 (file)
@@ -34,8 +34,8 @@ typedef SVGAnimatedListPropertyTearOff<SVGNumberList> SVGAnimatedNumberList;
 DECLARE_ANIMATED_LIST_PROPERTY(SVGAnimatedNumberList, SVGNumberList, UpperProperty, LowerProperty)
 
 #define DEFINE_ANIMATED_NUMBER_LIST(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
-DEFINE_ANIMATED_LIST_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedNumberList, SVGNumberList, UpperProperty, LowerProperty)
-    
+DEFINE_ANIMATED_PROPERTY(AnimatedNumberList, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
+
 #if ENABLE(SVG_ANIMATION)
 class SVGAnimationElement;
 
index 109055e..be0bbd7 100644 (file)
@@ -34,9 +34,8 @@ typedef SVGAnimatedPropertyTearOff<SVGPreserveAspectRatio> SVGAnimatedPreserveAs
 DECLARE_ANIMATED_PROPERTY(SVGAnimatedPreserveAspectRatio, SVGPreserveAspectRatio, UpperProperty, LowerProperty)
 
 #define DEFINE_ANIMATED_PRESERVEASPECTRATIO(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
-DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedPreserveAspectRatio, SVGPreserveAspectRatio, UpperProperty, LowerProperty)
+DEFINE_ANIMATED_PROPERTY(AnimatedPreserveAspectRatio, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
 
-    
 #if ENABLE(SVG_ANIMATION)
 class SVGAnimationElement;
 
index dd44a79..7477983 100644 (file)
@@ -35,7 +35,7 @@ typedef SVGAnimatedPropertyTearOff<FloatRect> SVGAnimatedRect;
 DECLARE_ANIMATED_PROPERTY(SVGAnimatedRect, FloatRect, UpperProperty, LowerProperty)
 
 #define DEFINE_ANIMATED_RECT(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
-DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedRect, FloatRect, UpperProperty, LowerProperty)
+DEFINE_ANIMATED_PROPERTY(AnimatedRect, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
 
 #if ENABLE(SVG_ANIMATION)
 class SVGAnimationElement;
index a028974..ac4f0e0 100644 (file)
@@ -34,7 +34,7 @@ typedef SVGAnimatedStaticPropertyTearOff<String> SVGAnimatedString;
 DECLARE_ANIMATED_PROPERTY(SVGAnimatedString, String, UpperProperty, LowerProperty)
 
 #define DEFINE_ANIMATED_STRING(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
-DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedString, String, UpperProperty, LowerProperty)
+DEFINE_ANIMATED_PROPERTY(AnimatedString, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
 
 #if ENABLE(SVG_ANIMATION)
 class SVGAnimationElement;
index 8caee3c..bf8038e 100644 (file)
@@ -32,7 +32,7 @@ typedef SVGAnimatedTransformListPropertyTearOff SVGAnimatedTransformList;
 DECLARE_ANIMATED_LIST_PROPERTY(SVGAnimatedTransformList, SVGTransformList, UpperProperty, LowerProperty)
 
 #define DEFINE_ANIMATED_TRANSFORM_LIST(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
-DEFINE_ANIMATED_LIST_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedTransformList, SVGTransformList, UpperProperty, LowerProperty)
+DEFINE_ANIMATED_PROPERTY(AnimatedTransformList, OwnerType, DOMAttribute, DOMAttribute.localName(), UpperProperty, LowerProperty)
 
 } // namespace WebCore
 
index 2d40d97..ce72bc0 100644 (file)
@@ -37,7 +37,7 @@ using namespace std;
 
 namespace WebCore {
 
-SVGAnimatedType::SVGAnimatedType(AnimatedAttributeType type)
+SVGAnimatedType::SVGAnimatedType(AnimatedPropertyType type)
     : m_type(type)
 {
 }
index 2373c6a..43a6af6 100644 (file)
@@ -55,7 +55,7 @@ public:
     static PassOwnPtr<SVGAnimatedType> createRect(FloatRect*);
     static PassOwnPtr<SVGAnimatedType> createString(String*);
 
-    AnimatedAttributeType type() const { return m_type; }
+    AnimatedPropertyType type() const { return m_type; }
 
     SVGAngle& angle();
     bool& boolean();
@@ -79,9 +79,9 @@ public:
     void setPreserveAspectRatioBaseValue(const SVGPreserveAspectRatio&);
 
 private:
-    SVGAnimatedType(AnimatedAttributeType);
+    SVGAnimatedType(AnimatedPropertyType);
 
-    AnimatedAttributeType m_type;
+    AnimatedPropertyType m_type;
 
     union DataUnion {
         DataUnion()
index 666c8de..62640d6 100644 (file)
@@ -43,14 +43,14 @@ public:
     void setContextElement(SVGElement* contextElement) { m_contextElement = contextElement; }
     
 protected:
-    SVGAnimatedTypeAnimator(AnimatedAttributeType type, SVGAnimationElement* animationElement, SVGElement* contextElement)
+    SVGAnimatedTypeAnimator(AnimatedPropertyType type, SVGAnimationElement* animationElement, SVGElement* contextElement)
         : m_type(type)
         , m_animationElement(animationElement)
         , m_contextElement(contextElement)
     {
     }
 
-    AnimatedAttributeType m_type;
+    AnimatedPropertyType m_type;
     SVGAnimationElement* m_animationElement;
     SVGElement* m_contextElement;
 };
index 124a83b..03e69c4 100644 (file)
@@ -55,10 +55,16 @@ namespace WebCore {
 // Animated property definitions
 DEFINE_ANIMATED_BOOLEAN(SVGAnimationElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAnimationElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+END_REGISTER_ANIMATED_PROPERTIES
+
 SVGAnimationElement::SVGAnimationElement(const QualifiedName& tagName, Document* document)
     : SVGSMILElement(tagName, document)
     , m_animationValid(false)
 {
+    registerAnimatedPropertiesForSVGAnimationElement();
 }
 
 static void parseKeyTimes(const String& parse, Vector<float>& result, bool verifyOrder)
@@ -203,22 +209,6 @@ void SVGAnimationElement::attributeChanged(Attribute* attr, bool preserveDecls)
     SVGSMILElement::attributeChanged(attr, preserveDecls);
 }
 
-void SVGAnimationElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    SVGSMILElement::synchronizeProperty(attrName);
-
-    if (attrName == anyQName()) {
-        synchronizeExternalResourcesRequired();
-        SVGTests::synchronizeProperties(this, attrName);
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
-        synchronizeExternalResourcesRequired();
-    else if (SVGTests::isKnownAttribute(attrName))
-        SVGTests::synchronizeProperties(this, attrName);
-}
-
 float SVGAnimationElement::getStartTime() const
 {
     return narrowPrecisionToFloat(intervalBegin().value());
@@ -486,7 +476,7 @@ void SVGAnimationElement::currentValuesForValuesAnimation(float percent, float&
     CalcMode calcMode = this->calcMode();
     if (hasTagName(SVGNames::animateTag) || hasTagName(SVGNames::animateColorTag)) {
         const SVGAnimateElement* animateElement = static_cast<const SVGAnimateElement*>(this);
-        AnimatedAttributeType attributeType = animateElement->determineAnimatedAttributeType(targetElement());
+        AnimatedPropertyType attributeType = animateElement->determineAnimatedPropertyType(targetElement());
         // Fall back to discrete animations for Strings.
         if (attributeType == AnimatedBoolean
             || attributeType == AnimatedEnumeration
index dc4154a..64603ff 100644 (file)
@@ -108,7 +108,6 @@ protected:
 
 private:
     virtual void attributeChanged(Attribute*, bool preserveDecls);
-    virtual void synchronizeProperty(const QualifiedName&);
 
     virtual bool calculateFromAndToValues(const String& fromString, const String& toString) = 0;
     virtual bool calculateFromAndByValues(const String& fromString, const String& byString) = 0;
@@ -123,10 +122,14 @@ private:
     float calculatePercentForSpline(float percent, unsigned splineIndex) const;
     unsigned calculateKeyTimesIndex(float percent) const;
 
-    // Animated property declarations
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAnimationElement)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    // SVGTests
+    virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
+    virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
+    virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
 
     bool m_animationValid;
 
index d648cf9..d06df0e 100644 (file)
@@ -42,7 +42,7 @@ class SVGAnimationElement;
 
 class SVGAnimatorFactory {
 public:
-    static PassOwnPtr<SVGAnimatedTypeAnimator> create(SVGAnimationElement* animationElement, SVGElement* contextElement, AnimatedAttributeType attributeType)
+    static PassOwnPtr<SVGAnimatedTypeAnimator> create(SVGAnimationElement* animationElement, SVGElement* contextElement, AnimatedPropertyType attributeType)
     {
         ASSERT(animationElement);
         ASSERT(contextElement);
index 6665349..9411191 100644 (file)
@@ -39,6 +39,15 @@ DEFINE_ANIMATED_LENGTH(SVGCircleElement, SVGNames::cyAttr, Cy, cy)
 DEFINE_ANIMATED_LENGTH(SVGCircleElement, SVGNames::rAttr, R, r)
 DEFINE_ANIMATED_BOOLEAN(SVGCircleElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGCircleElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(cx)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(cy)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(r)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGCircleElement::SVGCircleElement(const QualifiedName& tagName, Document* document)
     : SVGStyledTransformableElement(tagName, document)
     , m_cx(LengthModeWidth)
@@ -46,6 +55,7 @@ inline SVGCircleElement::SVGCircleElement(const QualifiedName& tagName, Document
     , m_r(LengthModeOther)
 {
     ASSERT(hasTagName(SVGNames::circleTag));
+    registerAnimatedPropertiesForSVGCircleElement();
 }
 
 PassRefPtr<SVGCircleElement> SVGCircleElement::create(const QualifiedName& tagName, Document* document)
@@ -138,67 +148,6 @@ void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-void SVGCircleElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeCx();
-        synchronizeCy();
-        synchronizeR();
-        synchronizeExternalResourcesRequired();
-        SVGTests::synchronizeProperties(this, attrName);
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-   
-    if (!isSupportedAttribute(attrName)) {
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::cxAttr) {
-        synchronizeCx();
-        return;
-    }
-
-    if (attrName == SVGNames::cyAttr) {
-        synchronizeCy();
-        return;
-    }
-
-    if (attrName == SVGNames::rAttr) {
-        synchronizeR();
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGTests::isKnownAttribute(attrName)) {
-        SVGTests::synchronizeProperties(this, attrName);
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGCircleElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGCircleElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::cxAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::cyAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::rAttr, AnimatedLength);
-}
-
 void SVGCircleElement::toPathData(Path& path) const
 {
     ASSERT(path.isEmpty());
index 9c49e58..f9011fb 100644 (file)
@@ -47,22 +47,22 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
 
     virtual void toPathData(Path&) const;
 
     virtual bool selfHasRelativeLengths() const;
 
-    // Animated property declarations
-    DECLARE_ANIMATED_LENGTH(Cx, cx)
-    DECLARE_ANIMATED_LENGTH(Cy, cy)
-    DECLARE_ANIMATED_LENGTH(R, r)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGCircleElement)
+        DECLARE_ANIMATED_LENGTH(Cx, cx)
+        DECLARE_ANIMATED_LENGTH(Cy, cy)
+        DECLARE_ANIMATED_LENGTH(R, r)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    // SVGTests
+    virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
+    virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
+    virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
 };
 
 } // namespace WebCore
index 6397c05..d95a61e 100644 (file)
@@ -38,11 +38,19 @@ namespace WebCore {
 DEFINE_ANIMATED_ENUMERATION(SVGClipPathElement, SVGNames::clipPathUnitsAttr, ClipPathUnits, clipPathUnits, SVGUnitTypes::SVGUnitType)
 DEFINE_ANIMATED_BOOLEAN(SVGClipPathElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGClipPathElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(clipPathUnits)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGClipPathElement::SVGClipPathElement(const QualifiedName& tagName, Document* document)
     : SVGStyledTransformableElement(tagName, document)
     , m_clipPathUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
 {
     ASSERT(hasTagName(SVGNames::clipPathTag));
+    registerAnimatedPropertiesForSVGClipPathElement();
 }
 
 PassRefPtr<SVGClipPathElement> SVGClipPathElement::create(const QualifiedName& tagName, Document* document)
@@ -99,53 +107,6 @@ void SVGClipPathElement::svgAttributeChanged(const QualifiedName& attrName)
         object->setNeedsLayout(true);
 }
 
-void SVGClipPathElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeClipPathUnits();
-        synchronizeExternalResourcesRequired();
-        SVGTests::synchronizeProperties(this, attrName);
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::clipPathUnitsAttr) {
-        synchronizeClipPathUnits();
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGTests::isKnownAttribute(attrName)) {
-        SVGTests::synchronizeProperties(this, attrName);
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGClipPathElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGClipPathElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::clipPathUnitsAttr, AnimatedEnumeration);
-}
-
 void SVGClipPathElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
     SVGStyledTransformableElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
index 26a4595..fa3dc55 100644 (file)
@@ -50,18 +50,19 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
 
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
 
-    // Animated property declarations
-    DECLARE_ANIMATED_ENUMERATION(ClipPathUnits, clipPathUnits, SVGUnitTypes::SVGUnitType)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGClipPathElement)
+        DECLARE_ANIMATED_ENUMERATION(ClipPathUnits, clipPathUnits, SVGUnitTypes::SVGUnitType)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    // SVGTests
+    virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
+    virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
+    virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
 };
 
 }
index e616364..d3b486f 100644 (file)
@@ -39,6 +39,16 @@ DEFINE_ANIMATED_NUMBER(SVGComponentTransferFunctionElement, SVGNames::amplitudeA
 DEFINE_ANIMATED_NUMBER(SVGComponentTransferFunctionElement, SVGNames::exponentAttr, Exponent, exponent)
 DEFINE_ANIMATED_NUMBER(SVGComponentTransferFunctionElement, SVGNames::offsetAttr, Offset, offset)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGComponentTransferFunctionElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(type)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(tableValues)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(slope)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(intercept)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(amplitude)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(exponent)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(offset)
+END_REGISTER_ANIMATED_PROPERTIES
+
 SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(const QualifiedName& tagName, Document* document)
     : SVGElement(tagName, document)
     , m_type(FECOMPONENTTRANSFER_TYPE_IDENTITY)
@@ -46,6 +56,7 @@ SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(const Q
     , m_amplitude(1)
     , m_exponent(1)
 {
+    registerAnimatedPropertiesForSVGComponentTransferFunctionElement();
 }
 
 bool SVGComponentTransferFunctionElement::isSupportedAttribute(const QualifiedName& attrName)
@@ -114,81 +125,6 @@ void SVGComponentTransferFunctionElement::parseMappedAttribute(Attribute* attr)
     ASSERT_NOT_REACHED();
 }
 
-void SVGComponentTransferFunctionElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeType();
-        synchronizeTableValues();
-        synchronizeSlope();
-        synchronizeIntercept();
-        synchronizeAmplitude();
-        synchronizeExponent();
-        synchronizeOffset();
-        SVGElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::typeAttr) {
-        synchronizeType();
-        return;
-    }
-
-    if (attrName == SVGNames::tableValuesAttr) {
-        synchronizeTableValues();
-        return;
-    }
-
-    if (attrName == SVGNames::slopeAttr) {
-        synchronizeSlope();
-        return;
-    }
-
-    if (attrName == SVGNames::interceptAttr) {
-        synchronizeIntercept();
-        return;
-    }
-
-    if (attrName == SVGNames::amplitudeAttr) {
-        synchronizeAmplitude();
-        return;
-    }
-
-    if (attrName == SVGNames::exponentAttr) {
-        synchronizeExponent();
-        return;
-    }
-
-    if (attrName == SVGNames::offsetAttr) {
-        synchronizeOffset();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGComponentTransferFunctionElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGComponentTransferFunctionElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-    attributeToPropertyTypeMap.set(SVGNames::typeAttr, AnimatedEnumeration);
-    attributeToPropertyTypeMap.set(SVGNames::tableValuesAttr, AnimatedNumberList);
-    attributeToPropertyTypeMap.set(SVGNames::slopeAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::interceptAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::amplitudeAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::exponentAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::offsetAttr, AnimatedNumber);
-}
-
 ComponentTransferFunction SVGComponentTransferFunctionElement::transferFunction() const
 {
     ComponentTransferFunction func;
index 7ea6c6c..2101ff8 100644 (file)
@@ -80,19 +80,17 @@ protected:
     // FIXME: svgAttributeChanged missing.
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     
 private:
-    // Animated property declarations
-    DECLARE_ANIMATED_ENUMERATION(Type, type, ComponentTransferType)
-    DECLARE_ANIMATED_NUMBER_LIST(TableValues, tableValues)
-    DECLARE_ANIMATED_NUMBER(Slope, slope)
-    DECLARE_ANIMATED_NUMBER(Intercept, intercept)
-    DECLARE_ANIMATED_NUMBER(Amplitude, amplitude)
-    DECLARE_ANIMATED_NUMBER(Exponent, exponent)
-    DECLARE_ANIMATED_NUMBER(Offset, offset)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGComponentTransferFunctionElement)
+        DECLARE_ANIMATED_ENUMERATION(Type, type, ComponentTransferType)
+        DECLARE_ANIMATED_NUMBER_LIST(TableValues, tableValues)
+        DECLARE_ANIMATED_NUMBER(Slope, slope)
+        DECLARE_ANIMATED_NUMBER(Intercept, intercept)
+        DECLARE_ANIMATED_NUMBER(Amplitude, amplitude)
+        DECLARE_ANIMATED_NUMBER(Exponent, exponent)
+        DECLARE_ANIMATED_NUMBER(Offset, offset)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index 4e4b009..c083db4 100644 (file)
@@ -36,12 +36,21 @@ DEFINE_ANIMATED_LENGTH(SVGCursorElement, SVGNames::yAttr, Y, y)
 DEFINE_ANIMATED_STRING(SVGCursorElement, XLinkNames::hrefAttr, Href, href)
 DEFINE_ANIMATED_BOOLEAN(SVGCursorElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGCursorElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(x)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(y)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(href)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGCursorElement::SVGCursorElement(const QualifiedName& tagName, Document* document)
     : SVGElement(tagName, document)
     , m_x(LengthModeWidth)
     , m_y(LengthModeHeight)
 {
     ASSERT(hasTagName(SVGNames::cursorTag));
+    registerAnimatedPropertiesForSVGCursorElement();
 }
 
 PassRefPtr<SVGCursorElement> SVGCursorElement::create(const QualifiedName& tagName, Document* document)
@@ -96,20 +105,6 @@ void SVGCursorElement::parseMappedAttribute(Attribute* attr)
     ASSERT_NOT_REACHED();
 }
 
-AttributeToPropertyTypeMap& SVGCursorElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGCursorElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-    attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
-}
-
 void SVGCursorElement::addClient(SVGElement* element)
 {
     m_clients.add(element);
@@ -147,51 +142,6 @@ void SVGCursorElement::svgAttributeChanged(const QualifiedName& attrName)
         (*it)->setNeedsStyleRecalc();
 }
 
-void SVGCursorElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeX();
-        synchronizeY();
-        synchronizeExternalResourcesRequired();
-        synchronizeHref();
-        SVGTests::synchronizeProperties(this, attrName);
-        SVGElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::xAttr) {
-        synchronizeX();
-        return;
-    }
-
-    if (attrName == SVGNames::yAttr) {
-        synchronizeY();
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGURIReference::isKnownAttribute(attrName)) {
-        synchronizeHref();
-        return;
-    }
-
-    if (SVGTests::isKnownAttribute(attrName)) {
-        SVGTests::synchronizeProperties(this, attrName);
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
 void SVGCursorElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
 {
     SVGElement::addSubresourceAttributeURLs(urls);
index b9fb071..078936b 100644 (file)
@@ -53,21 +53,20 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
 
     virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
 
-    // Animated property declarations
-    DECLARE_ANIMATED_LENGTH(X, x)
-    DECLARE_ANIMATED_LENGTH(Y, y)
-
-    // SVGURIReference
-    DECLARE_ANIMATED_STRING(Href, href)
-
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGCursorElement)
+        DECLARE_ANIMATED_LENGTH(X, x)
+        DECLARE_ANIMATED_LENGTH(Y, y)
+        DECLARE_ANIMATED_STRING(Href, href)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
+
+    // SVGTests
+    virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
+    virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
+    virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
 
     HashSet<SVGElement*> m_clients;
 };
index 515f9d0..ddb46fc 100644 (file)
@@ -31,10 +31,17 @@ namespace WebCore {
 // Animated property definitions
 DEFINE_ANIMATED_BOOLEAN(SVGDefsElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGDefsElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGDefsElement::SVGDefsElement(const QualifiedName& tagName, Document* document)
     : SVGStyledTransformableElement(tagName, document)
 {
     ASSERT(hasTagName(SVGNames::defsTag));
+    registerAnimatedPropertiesForSVGDefsElement();
 }
 
 PassRefPtr<SVGDefsElement> SVGDefsElement::create(const QualifiedName& tagName, Document* document)
@@ -52,22 +59,6 @@ RenderObject* SVGDefsElement::createRenderer(RenderArena* arena, RenderStyle*)
     return new (arena) RenderSVGHiddenContainer(this);
 }
 
-void SVGDefsElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    SVGStyledTransformableElement::synchronizeProperty(attrName);
-
-    if (attrName == anyQName()) {
-        synchronizeExternalResourcesRequired();
-        SVGTests::synchronizeProperties(this, attrName);
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
-        synchronizeExternalResourcesRequired();
-    else if (SVGTests::isKnownAttribute(attrName))
-        SVGTests::synchronizeProperties(this, attrName);
-}
-
 }
 
 #endif // ENABLE(SVG)
index 70eca95..22cc0e9 100644 (file)
@@ -43,12 +43,15 @@ private:
     virtual bool isValid() const;
 
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-    virtual void synchronizeProperty(const QualifiedName&);
 
-    // Animated property declarations
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGDefsElement)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    // SVGTests
+    virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
+    virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
+    virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
 };
 
 } // namespace WebCore
index f873d86..ba47abb 100644 (file)
@@ -285,23 +285,9 @@ void SVGElement::parseMappedAttribute(Attribute* attr)
         StyledElement::parseMappedAttribute(attr);
 }
 
-AttributeToPropertyTypeMap& SVGElement::attributeToPropertyTypeMap()
+void SVGElement::animatedPropertyTypeForAttribute(const QualifiedName& attributeName, Vector<AnimatedPropertyType>& propertyTypes)
 {
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-AnimatedAttributeType SVGElement::animatedPropertyTypeForAttribute(const QualifiedName& attrName)
-{
-    AttributeToPropertyTypeMap& animatedAttributeMap = attributeToPropertyTypeMap();
-    if (animatedAttributeMap.isEmpty())
-        fillAttributeToPropertyTypeMap();
-    if (animatedAttributeMap.contains(attrName))
-        return animatedAttributeMap.get(attrName);
-    if (isStyled())
-        return static_cast<SVGStyledElement*>(this)->animatedPropertyTypeForCSSProperty(attrName);
-
-    return AnimatedUnknown;
+    localAttributeToPropertyMap().animatedPropertyTypeForAttribute(attributeName, propertyTypes);
 }
 
 bool SVGElement::haveLoadedRequiredResources()
@@ -392,13 +378,42 @@ void SVGElement::updateAnimatedSVGAttribute(const QualifiedName& name) const
 
     setIsSynchronizingSVGAttributes();
 
-    const_cast<SVGElement*>(this)->synchronizeProperty(name);
-    if (name == anyQName())
+    SVGElement* nonConstThis = const_cast<SVGElement*>(this);
+    if (name == anyQName()) {
+        nonConstThis->localAttributeToPropertyMap().synchronizeProperties(nonConstThis);
         setAreSVGAttributesValid();
+    } else
+        nonConstThis->localAttributeToPropertyMap().synchronizeProperty(nonConstThis, name);
 
     clearIsSynchronizingSVGAttributes();
 }
 
+SVGAttributeToPropertyMap& SVGElement::localAttributeToPropertyMap()
+{
+    ASSERT_NOT_REACHED();
+
+    DEFINE_STATIC_LOCAL(SVGAttributeToPropertyMap, dummyMap, ());
+    return dummyMap;
+}
+
+void SVGElement::synchronizeRequiredFeatures(void* contextElement)
+{
+    ASSERT(contextElement);
+    static_cast<SVGElement*>(contextElement)->synchronizeRequiredFeatures();
+}
+
+void SVGElement::synchronizeRequiredExtensions(void* contextElement)
+{
+    ASSERT(contextElement);
+    static_cast<SVGElement*>(contextElement)->synchronizeRequiredExtensions();
+}
+
+void SVGElement::synchronizeSystemLanguage(void* contextElement)
+{
+    ASSERT(contextElement);
+    static_cast<SVGElement*>(contextElement)->synchronizeSystemLanguage();
+}
+
 }
 
 #endif // ENABLE(SVG)
index 7ab5fd2..2f9c9f1 100644 (file)
 
 #if ENABLE(SVG)
 #include "SVGLocatable.h"
+#include "SVGPropertyInfo.h"
 #include "StyledElement.h"
 #include <wtf/HashMap.h>
 
 namespace WebCore {
 
-enum AnimatedAttributeType {
-    AnimatedAngle,
-    AnimatedBoolean,
-    AnimatedColor,
-    AnimatedEnumeration,
-    AnimatedInteger,
-    AnimatedLength,
-    AnimatedLengthList,
-    AnimatedNumber,
-    AnimatedNumberList,
-    AnimatedNumberOptionalNumber,
-    AnimatedPath,
-    AnimatedPoints,
-    AnimatedPreserveAspectRatio,
-    AnimatedRect,
-    AnimatedString,
-    AnimatedTransformList,
-    AnimatedUnknown
-};
-
 enum SVGParsingError {
     NoError,
     ParsingAttributeFailedError,
     NegativeValueForbiddenError
 };
 
-typedef HashMap<QualifiedName, AnimatedAttributeType> AttributeToPropertyTypeMap;
-
+class AffineTransform;
 class CSSCursorImageValue;
 class Document;
+class SVGAttributeToPropertyMap;
 class SVGCursorElement;
 class SVGDocumentExtensions;
 class SVGElementInstance;
 class SVGElementRareData;
 class SVGSVGElement;
-class AffineTransform;
 
 class SVGElement : public StyledElement {
 public:
@@ -91,12 +71,8 @@ public:
     virtual bool isValid() const { return true; }
 
     virtual void svgAttributeChanged(const QualifiedName&) { }
-    virtual void synchronizeProperty(const QualifiedName&) { }
 
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
-    AnimatedAttributeType animatedPropertyTypeForAttribute(const QualifiedName&);
-
-    virtual void fillAttributeToPropertyTypeMap() { }
+    virtual void animatedPropertyTypeForAttribute(const QualifiedName&, Vector<AnimatedPropertyType>&);
 
     void sendSVGLoadEventIfPossible(bool sendParentLoadEvents = false);
 
@@ -115,6 +91,16 @@ public:
 
     virtual void updateAnimatedSVGAttribute(const QualifiedName&) const;
 
+    static void synchronizeRequiredFeatures(void* contextElement);
+    static void synchronizeRequiredExtensions(void* contextElement);
+    static void synchronizeSystemLanguage(void* contextElement);
+
+    virtual void synchronizeRequiredFeatures() { }
+    virtual void synchronizeRequiredExtensions() { }
+    virtual void synchronizeSystemLanguage() { }
+
+    virtual SVGAttributeToPropertyMap& localAttributeToPropertyMap();
+
 protected:
     SVGElement(const QualifiedName&, Document*);
 
index a15f049..2cee32d 100644 (file)
@@ -40,6 +40,16 @@ DEFINE_ANIMATED_LENGTH(SVGEllipseElement, SVGNames::rxAttr, Rx, rx)
 DEFINE_ANIMATED_LENGTH(SVGEllipseElement, SVGNames::ryAttr, Ry, ry)
 DEFINE_ANIMATED_BOOLEAN(SVGEllipseElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGEllipseElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(cx)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(cy)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(rx)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(ry)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGEllipseElement::SVGEllipseElement(const QualifiedName& tagName, Document* document)
     : SVGStyledTransformableElement(tagName, document)
     , m_cx(LengthModeWidth)
@@ -48,6 +58,7 @@ inline SVGEllipseElement::SVGEllipseElement(const QualifiedName& tagName, Docume
     , m_ry(LengthModeHeight)
 {
     ASSERT(hasTagName(SVGNames::ellipseTag));
+    registerAnimatedPropertiesForSVGEllipseElement();
 }    
 
 PassRefPtr<SVGEllipseElement> SVGEllipseElement::create(const QualifiedName& tagName, Document* document)
@@ -149,74 +160,6 @@ void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-void SVGEllipseElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeCx();
-        synchronizeCy();
-        synchronizeRx();
-        synchronizeRy();
-        synchronizeExternalResourcesRequired();
-        SVGTests::synchronizeProperties(this, attrName);
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::cxAttr) {
-        synchronizeCx();
-        return;
-    }
-
-    if (attrName == SVGNames::cyAttr) {
-        synchronizeCy();
-        return;
-    }
-
-    if (attrName == SVGNames::rxAttr) {
-        synchronizeRx();
-        return;
-    }
-
-    if (attrName == SVGNames::ryAttr) {
-        synchronizeRy();
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGTests::isKnownAttribute(attrName)) {
-        SVGTests::synchronizeProperties(this, attrName);
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGEllipseElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGEllipseElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);    
-    attributeToPropertyTypeMap.set(SVGNames::cxAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::cyAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::rxAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::ryAttr, AnimatedLength);
-}
-
 void SVGEllipseElement::toPathData(Path& path) const
 {
     ASSERT(path.isEmpty());
index 32ae127..e775177 100644 (file)
@@ -47,22 +47,23 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
 
     virtual void toPathData(Path&) const;
 
     virtual bool selfHasRelativeLengths() const;
 
-    // Animated property declarations
-    DECLARE_ANIMATED_LENGTH(Cx, cx)
-    DECLARE_ANIMATED_LENGTH(Cy, cy)
-    DECLARE_ANIMATED_LENGTH(Rx, rx)
-    DECLARE_ANIMATED_LENGTH(Ry, ry)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGEllipseElement)
+        DECLARE_ANIMATED_LENGTH(Cx, cx)
+        DECLARE_ANIMATED_LENGTH(Cy, cy)
+        DECLARE_ANIMATED_LENGTH(Rx, rx)
+        DECLARE_ANIMATED_LENGTH(Ry, ry)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    // SVGTests
+    virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
+    virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
+    virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
 };
 
 } // namespace WebCore
index 9234dbb..d512df1 100644 (file)
@@ -36,11 +36,19 @@ DEFINE_ANIMATED_STRING(SVGFEBlendElement, SVGNames::inAttr, In1, in1)
 DEFINE_ANIMATED_STRING(SVGFEBlendElement, SVGNames::in2Attr, In2, in2)
 DEFINE_ANIMATED_ENUMERATION(SVGFEBlendElement, SVGNames::modeAttr, Mode, mode, BlendModeType)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEBlendElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in2)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(mode)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFEBlendElement::SVGFEBlendElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
     , m_mode(FEBLEND_MODE_NORMAL)
 {
     ASSERT(hasTagName(SVGNames::feBlendTag));
+    registerAnimatedPropertiesForSVGFEBlendElement();
 }
 
 PassRefPtr<SVGFEBlendElement> SVGFEBlendElement::create(const QualifiedName& tagName, Document* document)
@@ -119,55 +127,6 @@ void SVGFEBlendElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-void SVGFEBlendElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeMode();
-        synchronizeIn1();
-        synchronizeIn2();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::modeAttr) {
-        synchronizeMode();
-        return;
-    }
-
-    if (attrName == SVGNames::inAttr) {
-        synchronizeIn1();
-        return;
-    }
-
-    if (attrName == SVGNames::in2Attr) {
-        synchronizeIn2();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFEBlendElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFEBlendElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);    
-    attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
-    attributeToPropertyTypeMap.set(SVGNames::in2Attr, AnimatedString);
-    attributeToPropertyTypeMap.set(SVGNames::modeAttr, AnimatedEnumeration);
-}
-
 PassRefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
index ff8288e..d50c73b 100644 (file)
@@ -80,15 +80,13 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
-    // Animated property declarations
-    DECLARE_ANIMATED_STRING(In1, in1)
-    DECLARE_ANIMATED_STRING(In2, in2)
-    DECLARE_ANIMATED_ENUMERATION(Mode, mode, BlendModeType)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEBlendElement)
+        DECLARE_ANIMATED_STRING(In1, in1)
+        DECLARE_ANIMATED_STRING(In2, in2)
+        DECLARE_ANIMATED_ENUMERATION(Mode, mode, BlendModeType)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index c3cd8cb..7b6529c 100644 (file)
@@ -36,11 +36,19 @@ DEFINE_ANIMATED_STRING(SVGFEColorMatrixElement, SVGNames::inAttr, In1, in1)
 DEFINE_ANIMATED_ENUMERATION(SVGFEColorMatrixElement, SVGNames::typeAttr, Type, type, ColorMatrixType)
 DEFINE_ANIMATED_NUMBER_LIST(SVGFEColorMatrixElement, SVGNames::valuesAttr, Values, values)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEColorMatrixElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(type)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(values)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFEColorMatrixElement::SVGFEColorMatrixElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
     , m_type(FECOLORMATRIX_TYPE_UNKNOWN)
 {
     ASSERT(hasTagName(SVGNames::feColorMatrixTag));
+    registerAnimatedPropertiesForSVGFEColorMatrixElement();
 }
 
 PassRefPtr<SVGFEColorMatrixElement> SVGFEColorMatrixElement::create(const QualifiedName& tagName, Document* document)
@@ -124,55 +132,6 @@ void SVGFEColorMatrixElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-void SVGFEColorMatrixElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeType();
-        synchronizeIn1();
-        synchronizeValues();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::typeAttr) {
-        synchronizeType();
-        return;
-    }
-
-    if (attrName == SVGNames::inAttr) {
-        synchronizeIn1();
-        return;
-    }
-
-    if (attrName == SVGNames::valuesAttr) {
-        synchronizeValues();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFEColorMatrixElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFEColorMatrixElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
-    attributeToPropertyTypeMap.set(SVGNames::typeAttr, AnimatedEnumeration);
-    attributeToPropertyTypeMap.set(SVGNames::valuesAttr, AnimatedNumberList);
-}
-
 PassRefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
index 1cedd34..09b4db0 100644 (file)
@@ -77,15 +77,13 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
-    // Animated property declarations
-    DECLARE_ANIMATED_STRING(In1, in1)
-    DECLARE_ANIMATED_ENUMERATION(Type, type, ColorMatrixType)
-    DECLARE_ANIMATED_NUMBER_LIST(Values, values)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEColorMatrixElement)
+        DECLARE_ANIMATED_STRING(In1, in1)
+        DECLARE_ANIMATED_ENUMERATION(Type, type, ColorMatrixType)
+        DECLARE_ANIMATED_NUMBER_LIST(Values, values)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index 1885caa..317111f 100644 (file)
 
 namespace WebCore {
 
-// Animated property declarations
+// Animated property definitions
 DEFINE_ANIMATED_STRING(SVGFEComponentTransferElement, SVGNames::inAttr, In1, in1)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEComponentTransferElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFEComponentTransferElement::SVGFEComponentTransferElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
 {
     ASSERT(hasTagName(SVGNames::feComponentTransferTag));
+    registerAnimatedPropertiesForSVGFEComponentTransferElement();
 }
 
 PassRefPtr<SVGFEComponentTransferElement> SVGFEComponentTransferElement::create(const QualifiedName& tagName, Document* document)
@@ -72,41 +78,6 @@ void SVGFEComponentTransferElement::parseMappedAttribute(Attribute* attr)
     ASSERT_NOT_REACHED();
 }
 
-void SVGFEComponentTransferElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeIn1();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::inAttr) {
-        synchronizeIn1();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFEComponentTransferElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFEComponentTransferElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
-}
-
 PassRefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
index 1b77ae5..f88735c 100644 (file)
@@ -37,13 +37,11 @@ private:
     // FIXME: svgAttributeChanged missing.
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
-    // Animated property declarations
-    DECLARE_ANIMATED_STRING(In1, in1)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEComponentTransferElement)
+        DECLARE_ANIMATED_STRING(In1, in1)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index 07dbbe5..a143bae 100644 (file)
@@ -40,11 +40,23 @@ DEFINE_ANIMATED_NUMBER(SVGFECompositeElement, SVGNames::k2Attr, K2, k2)
 DEFINE_ANIMATED_NUMBER(SVGFECompositeElement, SVGNames::k3Attr, K3, k3)
 DEFINE_ANIMATED_NUMBER(SVGFECompositeElement, SVGNames::k4Attr, K4, k4)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFECompositeElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in2)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(_operator)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(k1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(k2)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(k3)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(k4)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFECompositeElement::SVGFECompositeElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
     , m__operator(FECOMPOSITE_OPERATOR_OVER)
 {
     ASSERT(hasTagName(SVGNames::feCompositeTag));
+    registerAnimatedPropertiesForSVGFECompositeElement();
 }
 
 PassRefPtr<SVGFECompositeElement> SVGFECompositeElement::create(const QualifiedName& tagName, Document* document)
@@ -160,83 +172,6 @@ void SVGFECompositeElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-void SVGFECompositeElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronize_operator();
-        synchronizeIn1();
-        synchronizeIn2();
-        synchronizeK1();
-        synchronizeK2();
-        synchronizeK3();
-        synchronizeK4();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::operatorAttr) {
-        synchronize_operator();
-        return;
-    }
-
-    if (attrName == SVGNames::inAttr) {
-        synchronizeIn1();
-        return;
-    }
-
-    if (attrName == SVGNames::in2Attr) {
-        synchronizeIn2();
-        return;
-    }
-
-    if (attrName == SVGNames::k1Attr) {
-        synchronizeK1();
-        return;
-    }
-
-    if (attrName == SVGNames::k2Attr) {
-        synchronizeK2();
-        return;
-    }
-
-    if (attrName == SVGNames::k3Attr) {
-        synchronizeK3();
-        return;
-    }
-
-    if (attrName == SVGNames::k4Attr) {
-        synchronizeK4();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFECompositeElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFECompositeElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);    
-    attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
-    attributeToPropertyTypeMap.set(SVGNames::in2Attr, AnimatedString);
-    attributeToPropertyTypeMap.set(SVGNames::operatorAttr, AnimatedEnumeration);
-    attributeToPropertyTypeMap.set(SVGNames::k1Attr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::k2Attr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::k3Attr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::k4Attr, AnimatedNumber);
-}
-
 PassRefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
index fe8977f..4105315 100644 (file)
@@ -85,19 +85,17 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
-    // Animated property declarations
-    DECLARE_ANIMATED_STRING(In1, in1)
-    DECLARE_ANIMATED_STRING(In2, in2)
-    DECLARE_ANIMATED_ENUMERATION(_operator, _operator, CompositeOperationType)
-    DECLARE_ANIMATED_NUMBER(K1, k1)
-    DECLARE_ANIMATED_NUMBER(K2, k2)
-    DECLARE_ANIMATED_NUMBER(K3, k3)
-    DECLARE_ANIMATED_NUMBER(K4, k4)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFECompositeElement)
+        DECLARE_ANIMATED_STRING(In1, in1)
+        DECLARE_ANIMATED_STRING(In2, in2)
+        DECLARE_ANIMATED_ENUMERATION(_operator, _operator, CompositeOperationType)
+        DECLARE_ANIMATED_NUMBER(K1, k1)
+        DECLARE_ANIMATED_NUMBER(K2, k2)
+        DECLARE_ANIMATED_NUMBER(K3, k3)
+        DECLARE_ANIMATED_NUMBER(K4, k4)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index b5597be..9ecf1a6 100644 (file)
@@ -48,11 +48,28 @@ DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEConvolveMatrixElement, SVGNames::k
 DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), KernelUnitLengthY, kernelUnitLengthY)
 DEFINE_ANIMATED_BOOLEAN(SVGFEConvolveMatrixElement, SVGNames::preserveAlphaAttr, PreserveAlpha, preserveAlpha)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEConvolveMatrixElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(orderX)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(orderY)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(kernelMatrix)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(divisor)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(bias)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(targetX)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(targetY)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(edgeMode)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthX)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthY)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAlpha)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
     , m_edgeMode(EDGEMODE_DUPLICATE)
 {
     ASSERT(hasTagName(SVGNames::feConvolveMatrixTag));
+    registerAnimatedPropertiesForSVGFEConvolveMatrixElement();
 }
 
 PassRefPtr<SVGFEConvolveMatrixElement> SVGFEConvolveMatrixElement::create(const QualifiedName& tagName, Document* document)
@@ -245,88 +262,6 @@ void SVGFEConvolveMatrixElement::svgAttributeChanged(const QualifiedName& attrNa
     ASSERT_NOT_REACHED();
 }
 
-void SVGFEConvolveMatrixElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeEdgeMode();
-        synchronizeDivisor();
-        synchronizeBias();
-        synchronizeTargetX();
-        synchronizeTargetY();
-        synchronizeKernelUnitLengthX();
-        synchronizeKernelUnitLengthY();
-        synchronizePreserveAlpha();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::edgeModeAttr) {
-        synchronizeEdgeMode();
-        return;
-    }
-
-    if (attrName == SVGNames::divisorAttr) {
-        synchronizeDivisor();
-        return;
-    }
-
-    if (attrName == SVGNames::biasAttr) {
-        synchronizeBias();
-        return;
-    }
-
-    if (attrName == SVGNames::targetXAttr) {
-        synchronizeTargetX();
-        return;
-    }
-
-    if (attrName == SVGNames::targetYAttr) {
-        synchronizeTargetY();
-        return;
-    }
-
-    if (attrName == SVGNames::kernelUnitLengthAttr) {
-        synchronizeKernelUnitLengthX();
-        synchronizeKernelUnitLengthY();
-        return;
-    }
-
-    if (attrName == SVGNames::preserveAlphaAttr) {
-        synchronizePreserveAlpha();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFEConvolveMatrixElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFEConvolveMatrixElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
-    attributeToPropertyTypeMap.set(SVGNames::orderAttr, AnimatedNumberOptionalNumber);
-    attributeToPropertyTypeMap.set(SVGNames::kernelMatrixAttr, AnimatedNumberList);
-    attributeToPropertyTypeMap.set(SVGNames::divisorAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::biasAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::targetXAttr, AnimatedInteger);
-    attributeToPropertyTypeMap.set(SVGNames::targetYAttr, AnimatedInteger);
-    attributeToPropertyTypeMap.set(SVGNames::operatorAttr, AnimatedEnumeration);
-    attributeToPropertyTypeMap.set(SVGNames::kernelUnitLengthAttr, AnimatedNumberOptionalNumber);
-    attributeToPropertyTypeMap.set(SVGNames::preserveAlphaAttr, AnimatedBoolean);
-}
-
 PassRefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
index a6120c1..171aaf0 100644 (file)
@@ -78,9 +78,6 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     static const AtomicString& orderXIdentifier();
@@ -88,19 +85,20 @@ private:
     static const AtomicString& kernelUnitLengthXIdentifier();
     static const AtomicString& kernelUnitLengthYIdentifier();
 
-    // Animated property declarations
-    DECLARE_ANIMATED_STRING(In1, in1)
-    DECLARE_ANIMATED_INTEGER(OrderX, orderX)
-    DECLARE_ANIMATED_INTEGER(OrderY, orderY)
-    DECLARE_ANIMATED_NUMBER_LIST(KernelMatrix, kernelMatrix)
-    DECLARE_ANIMATED_NUMBER(Divisor, divisor)
-    DECLARE_ANIMATED_NUMBER(Bias, bias)
-    DECLARE_ANIMATED_INTEGER(TargetX, targetX)
-    DECLARE_ANIMATED_INTEGER(TargetY, targetY)
-    DECLARE_ANIMATED_ENUMERATION(EdgeMode, edgeMode, EdgeModeType)
-    DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
-    DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
-    DECLARE_ANIMATED_BOOLEAN(PreserveAlpha, preserveAlpha)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEConvolveMatrixElement)
+        DECLARE_ANIMATED_STRING(In1, in1)
+        DECLARE_ANIMATED_INTEGER(OrderX, orderX)
+        DECLARE_ANIMATED_INTEGER(OrderY, orderY)
+        DECLARE_ANIMATED_NUMBER_LIST(KernelMatrix, kernelMatrix)
+        DECLARE_ANIMATED_NUMBER(Divisor, divisor)
+        DECLARE_ANIMATED_NUMBER(Bias, bias)
+        DECLARE_ANIMATED_INTEGER(TargetX, targetX)
+        DECLARE_ANIMATED_INTEGER(TargetY, targetY)
+        DECLARE_ANIMATED_ENUMERATION(EdgeMode, edgeMode, EdgeModeType)
+        DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
+        DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
+        DECLARE_ANIMATED_BOOLEAN(PreserveAlpha, preserveAlpha)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index 80b7798..539c3af 100644 (file)
@@ -42,12 +42,22 @@ DEFINE_ANIMATED_NUMBER(SVGFEDiffuseLightingElement, SVGNames::surfaceScaleAttr,
 DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), KernelUnitLengthX, kernelUnitLengthX)
 DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), KernelUnitLengthY, kernelUnitLengthY)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEDiffuseLightingElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(diffuseConstant)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(surfaceScale)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthX)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthY)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
     , m_diffuseConstant(1)
     , m_surfaceScale(1)
 {
     ASSERT(hasTagName(SVGNames::feDiffuseLightingTag));
+    registerAnimatedPropertiesForSVGFEDiffuseLightingElement();
 }
 
 PassRefPtr<SVGFEDiffuseLightingElement> SVGFEDiffuseLightingElement::create(const QualifiedName& tagName, Document* document)
@@ -194,67 +204,6 @@ void SVGFEDiffuseLightingElement::lightElementAttributeChanged(const SVGFELightE
     primitiveAttributeChanged(attrName);
 }
 
-void SVGFEDiffuseLightingElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeIn1();
-        synchronizeSurfaceScale();
-        synchronizeDiffuseConstant();
-        synchronizeKernelUnitLengthX();
-        synchronizeKernelUnitLengthY();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::lighting_colorAttr)
-        return;
-
-    if (attrName == SVGNames::inAttr) {
-        synchronizeIn1();
-        return;
-    }
-
-    if (attrName == SVGNames::surfaceScaleAttr) {
-        synchronizeSurfaceScale();
-        return;
-    }
-
-    if (attrName == SVGNames::diffuseConstantAttr) {
-        synchronizeDiffuseConstant();
-        return;
-    }
-
-    if (attrName == SVGNames::kernelUnitLengthAttr) {
-        synchronizeKernelUnitLengthX();
-        synchronizeKernelUnitLengthY();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFEDiffuseLightingElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFEDiffuseLightingElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);    
-    attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
-    attributeToPropertyTypeMap.set(SVGNames::diffuseConstantAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::surfaceScaleAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::kernelUnitLengthAttr, AnimatedNumberOptionalNumber);
-}
-
 PassRefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
index b4ab426..c0397ef 100644 (file)
@@ -43,20 +43,18 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     static const AtomicString& kernelUnitLengthXIdentifier();
     static const AtomicString& kernelUnitLengthYIdentifier();
 
-    // Animated property declarations
-    DECLARE_ANIMATED_STRING(In1, in1)
-    DECLARE_ANIMATED_NUMBER(DiffuseConstant, diffuseConstant)
-    DECLARE_ANIMATED_NUMBER(SurfaceScale, surfaceScale)
-    DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
-    DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEDiffuseLightingElement)
+        DECLARE_ANIMATED_STRING(In1, in1)
+        DECLARE_ANIMATED_NUMBER(DiffuseConstant, diffuseConstant)
+        DECLARE_ANIMATED_NUMBER(SurfaceScale, surfaceScale)
+        DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
+        DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index c0966ee..f7fffc9 100644 (file)
@@ -37,12 +37,22 @@ DEFINE_ANIMATED_ENUMERATION(SVGFEDisplacementMapElement, SVGNames::xChannelSelec
 DEFINE_ANIMATED_ENUMERATION(SVGFEDisplacementMapElement, SVGNames::yChannelSelectorAttr, YChannelSelector, yChannelSelector, ChannelSelectorType)
 DEFINE_ANIMATED_NUMBER(SVGFEDisplacementMapElement, SVGNames::scaleAttr, Scale, scale)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEDisplacementMapElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in2)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(xChannelSelector)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(yChannelSelector)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(scale)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
     , m_xChannelSelector(CHANNEL_A)
     , m_yChannelSelector(CHANNEL_A)
 {
     ASSERT(hasTagName(SVGNames::feDisplacementMapTag));
+    registerAnimatedPropertiesForSVGFEDisplacementMapElement();
 }
 
 PassRefPtr<SVGFEDisplacementMapElement> SVGFEDisplacementMapElement::create(const QualifiedName& tagName, Document* document)
@@ -139,69 +149,6 @@ void SVGFEDisplacementMapElement::svgAttributeChanged(const QualifiedName& attrN
     ASSERT_NOT_REACHED();
 }
 
-void SVGFEDisplacementMapElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeXChannelSelector();
-        synchronizeYChannelSelector();
-        synchronizeIn1();
-        synchronizeIn2();
-        synchronizeScale();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::xChannelSelectorAttr) {
-        synchronizeXChannelSelector();
-        return;
-    }
-
-    if (attrName == SVGNames::yChannelSelectorAttr) {
-        synchronizeYChannelSelector();
-        return;
-    }
-
-    if (attrName == SVGNames::inAttr) {
-        synchronizeIn1();
-        return;
-    }
-
-    if (attrName == SVGNames::in2Attr) {
-        synchronizeIn2();
-        return;
-    }
-
-    if (attrName == SVGNames::scaleAttr) {
-        synchronizeScale();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFEDisplacementMapElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFEDisplacementMapElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
-    attributeToPropertyTypeMap.set(SVGNames::in2Attr, AnimatedString);
-    attributeToPropertyTypeMap.set(SVGNames::xChannelSelectorAttr, AnimatedEnumeration);
-    attributeToPropertyTypeMap.set(SVGNames::yChannelSelectorAttr, AnimatedEnumeration);
-    attributeToPropertyTypeMap.set(SVGNames::scaleAttr, AnimatedNumber);
-}
-
 PassRefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
index 20bb662..17e563d 100644 (file)
@@ -78,17 +78,15 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
-    // Animated property declarations
-    DECLARE_ANIMATED_STRING(In1, in1)
-    DECLARE_ANIMATED_STRING(In2, in2)
-    DECLARE_ANIMATED_ENUMERATION(XChannelSelector, xChannelSelector, ChannelSelectorType)
-    DECLARE_ANIMATED_ENUMERATION(YChannelSelector, yChannelSelector, ChannelSelectorType)
-    DECLARE_ANIMATED_NUMBER(Scale, scale)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEDisplacementMapElement)
+        DECLARE_ANIMATED_STRING(In1, in1)
+        DECLARE_ANIMATED_STRING(In2, in2)
+        DECLARE_ANIMATED_ENUMERATION(XChannelSelector, xChannelSelector, ChannelSelectorType)
+        DECLARE_ANIMATED_ENUMERATION(YChannelSelector, yChannelSelector, ChannelSelectorType)
+        DECLARE_ANIMATED_NUMBER(Scale, scale)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index 323ef9a..6f390e3 100644 (file)
@@ -39,6 +39,15 @@ DEFINE_ANIMATED_NUMBER(SVGFEDropShadowElement, SVGNames::dyAttr, Dy, dy)
 DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEDropShadowElement, SVGNames::stdDeviationAttr, stdDeviationXIdentifier(), StdDeviationX, stdDeviationX)
 DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEDropShadowElement, SVGNames::stdDeviationAttr, stdDeviationYIdentifier(), StdDeviationY, stdDeviationY)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEDropShadowElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(dx)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(dy)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(stdDeviationX)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(stdDeviationY)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFEDropShadowElement::SVGFEDropShadowElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
     , m_dx(2)
@@ -47,6 +56,7 @@ inline SVGFEDropShadowElement::SVGFEDropShadowElement(const QualifiedName& tagNa
     , m_stdDeviationY(2)
 {
     ASSERT(hasTagName(SVGNames::feDropShadowTag));
+    registerAnimatedPropertiesForSVGFEDropShadowElement();
 }
 
 PassRefPtr<SVGFEDropShadowElement> SVGFEDropShadowElement::create(const QualifiedName& tagName, Document* document)
@@ -140,47 +150,6 @@ void SVGFEDropShadowElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-void SVGFEDropShadowElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeStdDeviationX();
-        synchronizeStdDeviationY();
-        synchronizeDx();
-        synchronizeDy();
-        synchronizeIn1();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::stdDeviationAttr) {
-        synchronizeStdDeviationX();
-        synchronizeStdDeviationY();
-        return;
-    }
-
-    if (attrName == SVGNames::inAttr) {
-        synchronizeIn1();
-        return;
-    }
-
-    if (attrName == SVGNames::dxAttr) {
-        synchronizeDx();
-        return;
-    }
-
-    if (attrName == SVGNames::dyAttr) {
-        synchronizeDy();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
 PassRefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     RenderObject* renderer = this->renderer();
index 3aeb782..50723a5 100644 (file)
@@ -39,18 +39,18 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
     
     static const AtomicString& stdDeviationXIdentifier();
     static const AtomicString& stdDeviationYIdentifier();
     
-    // Animated property declarations
-    DECLARE_ANIMATED_STRING(In1, in1)
-    DECLARE_ANIMATED_NUMBER(Dx, dx)
-    DECLARE_ANIMATED_NUMBER(Dy, dy)
-    DECLARE_ANIMATED_NUMBER(StdDeviationX, stdDeviationX)
-    DECLARE_ANIMATED_NUMBER(StdDeviationY, stdDeviationY)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEDropShadowElement)
+        DECLARE_ANIMATED_STRING(In1, in1)
+        DECLARE_ANIMATED_NUMBER(Dx, dx)
+        DECLARE_ANIMATED_NUMBER(Dy, dy)
+        DECLARE_ANIMATED_NUMBER(StdDeviationX, stdDeviationX)
+        DECLARE_ANIMATED_NUMBER(StdDeviationY, stdDeviationY)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
     
 } // namespace WebCore
index 76756fb..2287a0b 100644 (file)
@@ -74,19 +74,6 @@ PassRefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter* fil
     return FEFlood::create(filter, color, opacity);
 }
 
-AttributeToPropertyTypeMap& SVGFEFloodElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFEFloodElement::fillAttributeToPropertyTypeMap()
-{
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap());
-}
-
 }
 
 #endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-// vim:ts=4:noet
index e98e7b3..5d68d8a 100644 (file)
@@ -34,8 +34,6 @@ public:
 private:
     SVGFEFloodElement(const QualifiedName&, Document*);
 
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName);
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 };
index 96b7b2e..68d5ded 100644 (file)
@@ -37,10 +37,18 @@ DEFINE_ANIMATED_STRING(SVGFEGaussianBlurElement, SVGNames::inAttr, In1, in1)
 DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, stdDeviationXIdentifier(), StdDeviationX, stdDeviationX)
 DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, stdDeviationYIdentifier(), StdDeviationY, stdDeviationY)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEGaussianBlurElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(stdDeviationX)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(stdDeviationY)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
 {
     ASSERT(hasTagName(SVGNames::feGaussianBlurTag));
+    registerAnimatedPropertiesForSVGFEGaussianBlurElement();
 }
 
 PassRefPtr<SVGFEGaussianBlurElement> SVGFEGaussianBlurElement::create(const QualifiedName& tagName, Document* document)
@@ -119,50 +127,6 @@ void SVGFEGaussianBlurElement::svgAttributeChanged(const QualifiedName& attrName
     ASSERT_NOT_REACHED();
 }
 
-void SVGFEGaussianBlurElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeStdDeviationX();
-        synchronizeStdDeviationY();
-        synchronizeIn1();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::stdDeviationAttr) {
-        synchronizeStdDeviationX();
-        synchronizeStdDeviationY();
-        return;
-    }
-
-    if (attrName == SVGNames::inAttr) {
-        synchronizeIn1();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFEGaussianBlurElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFEGaussianBlurElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
-    attributeToPropertyTypeMap.set(SVGNames::stdDeviationAttr, AnimatedNumberOptionalNumber);
-}
-
 PassRefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
index 7b13488..cfc283c 100644 (file)
@@ -40,18 +40,16 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     static const AtomicString& stdDeviationXIdentifier();
     static const AtomicString& stdDeviationYIdentifier();
 
-    // Animated property declarations
-    DECLARE_ANIMATED_STRING(In1, in1)
-    DECLARE_ANIMATED_NUMBER(StdDeviationX, stdDeviationX)
-    DECLARE_ANIMATED_NUMBER(StdDeviationY, stdDeviationY)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEGaussianBlurElement)
+        DECLARE_ANIMATED_STRING(In1, in1)
+        DECLARE_ANIMATED_NUMBER(StdDeviationX, stdDeviationX)
+        DECLARE_ANIMATED_NUMBER(StdDeviationY, stdDeviationY)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index 39dbbdb..467e926 100644 (file)
@@ -44,10 +44,18 @@ DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGFEImageElement, SVGNames::preserveAspectR
 DEFINE_ANIMATED_STRING(SVGFEImageElement, XLinkNames::hrefAttr, Href, href)
 DEFINE_ANIMATED_BOOLEAN(SVGFEImageElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEImageElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(href)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFEImageElement::SVGFEImageElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
 {
     ASSERT(hasTagName(SVGNames::feImageTag));
+    registerAnimatedPropertiesForSVGFEImageElement();
 }
 
 PassRefPtr<SVGFEImageElement> SVGFEImageElement::create(const QualifiedName& tagName, Document* document)
@@ -138,54 +146,6 @@ void SVGFEImageElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-void SVGFEImageElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizePreserveAspectRatio();
-        synchronizeHref();
-        synchronizeExternalResourcesRequired();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }   
-
-    if (attrName == SVGNames::preserveAspectRatioAttr) {
-        synchronizePreserveAspectRatio();
-        return;
-    }
-
-    if (SVGURIReference::isKnownAttribute(attrName)) {
-        synchronizeHref();
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFEImageElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFEImageElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::preserveAspectRatioAttr, AnimatedPreserveAspectRatio);
-    attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
-}
-
 void SVGFEImageElement::notifyFinished(CachedResource*)
 {
     if (!inDocument())
index b6b9a37..489df2f 100644 (file)
@@ -51,9 +51,6 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual void notifyFinished(CachedResource*);
 
     virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
@@ -61,14 +58,11 @@ private:
 
     void requestImageResource();
 
-    // Animated property declarations
-    DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
-
-    // SVGURIReference
-    DECLARE_ANIMATED_STRING(Href, href)
-
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEImageElement)
+        DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
+        DECLARE_ANIMATED_STRING(Href, href)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 
     CachedResourceHandle<CachedImage> m_cachedImage;
     OwnPtr<ImageBuffer> m_targetImage;
index 7b0772c..300ffd3 100644 (file)
@@ -48,10 +48,24 @@ DEFINE_ANIMATED_NUMBER(SVGFELightElement, SVGNames::pointsAtZAttr, PointsAtZ, po
 DEFINE_ANIMATED_NUMBER(SVGFELightElement, SVGNames::specularExponentAttr, SpecularExponent, specularExponent)
 DEFINE_ANIMATED_NUMBER(SVGFELightElement, SVGNames::limitingConeAngleAttr, LimitingConeAngle, limitingConeAngle)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFELightElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(azimuth)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(elevation)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(x)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(y)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(z)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(pointsAtX)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(pointsAtY)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(pointsAtZ)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(specularExponent)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(limitingConeAngle)
+END_REGISTER_ANIMATED_PROPERTIES
+
 SVGFELightElement::SVGFELightElement(const QualifiedName& tagName, Document* document)
     : SVGElement(tagName, document)
     , m_specularExponent(1)
 {
+    registerAnimatedPropertiesForSVGFELightElement();
 }
 
 SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement* svgElement)
@@ -194,102 +208,6 @@ void SVGFELightElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-void SVGFELightElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeAzimuth();
-        synchronizeElevation();
-        synchronizeX();
-        synchronizeY();
-        synchronizeZ();
-        synchronizePointsAtX();
-        synchronizePointsAtY();
-        synchronizePointsAtZ();
-        synchronizeSpecularExponent();
-        synchronizeLimitingConeAngle();
-        SVGElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGElement::synchronizeProperty(attrName);
-        return;
-    }
-    
-    if (attrName == SVGNames::azimuthAttr) {
-        synchronizeAzimuth();
-        return;
-    }
-
-    if (attrName == SVGNames::elevationAttr) {
-        synchronizeElevation();
-        return;
-    }
-
-    if (attrName == SVGNames::xAttr) {
-        synchronizeX();
-        return;
-    }
-
-    if (attrName == SVGNames::yAttr) {
-        synchronizeY();
-        return;
-    }
-
-    if (attrName == SVGNames::zAttr) {
-        synchronizeZ();
-        return;
-    }
-
-    if (attrName == SVGNames::pointsAtXAttr) {
-        synchronizePointsAtX();
-        return;
-    }
-
-    if (attrName == SVGNames::pointsAtYAttr) {
-        synchronizePointsAtY();
-        return;
-    }
-
-    if (attrName == SVGNames::pointsAtZAttr) {
-        synchronizePointsAtZ();
-        return;
-    }
-
-    if (attrName == SVGNames::specularExponentAttr) {
-        synchronizeSpecularExponent();
-        return;
-    }
-
-    if (attrName == SVGNames::limitingConeAngleAttr) {
-        synchronizeLimitingConeAngle();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFELightElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFELightElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-    attributeToPropertyTypeMap.set(SVGNames::azimuthAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::elevationAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::zAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::pointsAtXAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::pointsAtYAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::pointsAtZAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::specularExponentAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::limitingConeAngleAttr, AnimatedNumber);
-}
-
 void SVGFELightElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
     SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
index f6814b3..1a81f5d 100644 (file)
@@ -42,22 +42,20 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
 
-    // Animated property declarations
-    DECLARE_ANIMATED_NUMBER(Azimuth, azimuth)
-    DECLARE_ANIMATED_NUMBER(Elevation, elevation)
-    DECLARE_ANIMATED_NUMBER(X, x)
-    DECLARE_ANIMATED_NUMBER(Y, y)
-    DECLARE_ANIMATED_NUMBER(Z, z)
-    DECLARE_ANIMATED_NUMBER(PointsAtX, pointsAtX)
-    DECLARE_ANIMATED_NUMBER(PointsAtY, pointsAtY)
-    DECLARE_ANIMATED_NUMBER(PointsAtZ, pointsAtZ)
-    DECLARE_ANIMATED_NUMBER(SpecularExponent, specularExponent)
-    DECLARE_ANIMATED_NUMBER(LimitingConeAngle, limitingConeAngle)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFELightElement)
+        DECLARE_ANIMATED_NUMBER(Azimuth, azimuth)
+        DECLARE_ANIMATED_NUMBER(Elevation, elevation)
+        DECLARE_ANIMATED_NUMBER(X, x)
+        DECLARE_ANIMATED_NUMBER(Y, y)
+        DECLARE_ANIMATED_NUMBER(Z, z)
+        DECLARE_ANIMATED_NUMBER(PointsAtX, pointsAtX)
+        DECLARE_ANIMATED_NUMBER(PointsAtY, pointsAtY)
+        DECLARE_ANIMATED_NUMBER(PointsAtZ, pointsAtZ)
+        DECLARE_ANIMATED_NUMBER(SpecularExponent, specularExponent)
+        DECLARE_ANIMATED_NUMBER(LimitingConeAngle, limitingConeAngle)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index c7b8cac..9da262b 100644 (file)
@@ -60,19 +60,6 @@ PassRefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilde
     return effect.release();
 }
 
-AttributeToPropertyTypeMap& SVGFEMergeElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFEMergeElement::fillAttributeToPropertyTypeMap()
-{
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap());
-}
-
 }
 
 #endif // ENABLE(SVG)
-
-// vim:ts=4:noet
index 8241ea8..2495a56 100644 (file)
@@ -34,8 +34,6 @@ public:
 private:
     SVGFEMergeElement(const QualifiedName&, Document*);
 
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 };
 
index b4789cd..a7606b7 100644 (file)
@@ -35,10 +35,15 @@ namespace WebCore {
 // Animated property definitions
 DEFINE_ANIMATED_STRING(SVGFEMergeNodeElement, SVGNames::inAttr, In1, in1)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEMergeNodeElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFEMergeNodeElement::SVGFEMergeNodeElement(const QualifiedName& tagName, Document* document)
     : SVGElement(tagName, document)
 {
     ASSERT(hasTagName(SVGNames::feMergeNodeTag));
+    registerAnimatedPropertiesForSVGFEMergeNodeElement();
 }
 
 PassRefPtr<SVGFEMergeNodeElement> SVGFEMergeNodeElement::create(const QualifiedName& tagName, Document* document)
@@ -94,38 +99,6 @@ void SVGFEMergeNodeElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-AttributeToPropertyTypeMap& SVGFEMergeNodeElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFEMergeNodeElement::fillAttributeToPropertyTypeMap()
-{
-    attributeToPropertyTypeMap().set(SVGNames::inAttr, AnimatedString);
-}
-
-void SVGFEMergeNodeElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeIn1();
-        SVGElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGElement::synchronizeProperty(attrName);
-        return;
-    }   
-
-    if (attrName == SVGNames::inAttr) {
-        synchronizeIn1();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
 }
 
 #endif // ENABLE(SVG)
index 7e64237..dcd82a5 100644 (file)
@@ -37,12 +37,10 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
 
-    // Animated property declarations
-    DECLARE_ANIMATED_STRING(In1, in1)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEMergeNodeElement)
+        DECLARE_ANIMATED_STRING(In1, in1)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index 7395678..31ec4b4 100644 (file)
@@ -37,11 +37,20 @@ DEFINE_ANIMATED_ENUMERATION(SVGFEMorphologyElement, SVGNames::operatorAttr, _ope
 DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, radiusXIdentifier(), RadiusX, radiusX)
 DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, radiusYIdentifier(), RadiusY, radiusY)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEMorphologyElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(_operator)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(radiusX)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(radiusY)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFEMorphologyElement::SVGFEMorphologyElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
     , m__operator(FEMORPHOLOGY_OPERATOR_ERODE)
 {
     ASSERT(hasTagName(SVGNames::feMorphologyTag));
+    registerAnimatedPropertiesForSVGFEMorphologyElement();
 }
 
 PassRefPtr<SVGFEMorphologyElement> SVGFEMorphologyElement::create(const QualifiedName& tagName, Document* document)
@@ -145,57 +154,6 @@ void SVGFEMorphologyElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-void SVGFEMorphologyElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronize_operator();
-        synchronizeIn1();
-        synchronizeRadiusX();
-        synchronizeRadiusY();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::operatorAttr) {
-        synchronize_operator();
-        return;
-    }
-
-    if (attrName == SVGNames::inAttr) {
-        synchronizeIn1();
-        return;
-    }
-
-    if (attrName == SVGNames::radiusAttr) {
-        synchronizeRadiusX();
-        synchronizeRadiusY();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFEMorphologyElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFEMorphologyElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
-    attributeToPropertyTypeMap.set(SVGNames::operatorAttr, AnimatedEnumeration);
-    attributeToPropertyTypeMap.set(SVGNames::radiusAttr, AnimatedNumberOptionalNumber);
-}
-
 PassRefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
index 94b4a0c..36008a5 100644 (file)
@@ -70,19 +70,17 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     static const AtomicString& radiusXIdentifier();
     static const AtomicString& radiusYIdentifier();
 
-    // Animated property declarations
-    DECLARE_ANIMATED_STRING(In1, in1)
-    DECLARE_ANIMATED_ENUMERATION(_operator, _operator, MorphologyOperatorType)
-    DECLARE_ANIMATED_NUMBER(RadiusX, radiusX)
-    DECLARE_ANIMATED_NUMBER(RadiusY, radiusY)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEMorphologyElement)
+        DECLARE_ANIMATED_STRING(In1, in1)
+        DECLARE_ANIMATED_ENUMERATION(_operator, _operator, MorphologyOperatorType)
+        DECLARE_ANIMATED_NUMBER(RadiusX, radiusX)
+        DECLARE_ANIMATED_NUMBER(RadiusY, radiusY)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index 1071f76..313e4d6 100644 (file)
@@ -36,10 +36,18 @@ DEFINE_ANIMATED_STRING(SVGFEOffsetElement, SVGNames::inAttr, In1, in1)
 DEFINE_ANIMATED_NUMBER(SVGFEOffsetElement, SVGNames::dxAttr, Dx, dx)
 DEFINE_ANIMATED_NUMBER(SVGFEOffsetElement, SVGNames::dyAttr, Dy, dy)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEOffsetElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(dx)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(dy)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFEOffsetElement::SVGFEOffsetElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
 {
     ASSERT(hasTagName(SVGNames::feOffsetTag));
+    registerAnimatedPropertiesForSVGFEOffsetElement();
 }
 
 PassRefPtr<SVGFEOffsetElement> SVGFEOffsetElement::create(const QualifiedName& tagName, Document* document)
@@ -101,55 +109,6 @@ void SVGFEOffsetElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-void SVGFEOffsetElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeDx();
-        synchronizeDy();
-        synchronizeIn1();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::dxAttr) {
-        synchronizeDx();
-        return;
-    }
-
-    if (attrName == SVGNames::dyAttr) {
-        synchronizeDy();
-        return;
-    }
-
-    if (attrName == SVGNames::inAttr) {
-        synchronizeIn1();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFEOffsetElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFEOffsetElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
-    attributeToPropertyTypeMap.set(SVGNames::dxAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::dyAttr, AnimatedNumber);
-}
-
 PassRefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
index f59eeb5..b42c571 100644 (file)
@@ -38,15 +38,13 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
-    // Animated property declarations
-    DECLARE_ANIMATED_STRING(In1, in1)
-    DECLARE_ANIMATED_NUMBER(Dx, dx)
-    DECLARE_ANIMATED_NUMBER(Dy, dy)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEOffsetElement)
+        DECLARE_ANIMATED_STRING(In1, in1)
+        DECLARE_ANIMATED_NUMBER(Dx, dx)
+        DECLARE_ANIMATED_NUMBER(Dy, dy)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index 0fcb735..530f566 100644 (file)
@@ -44,6 +44,16 @@ DEFINE_ANIMATED_NUMBER(SVGFESpecularLightingElement, SVGNames::surfaceScaleAttr,
 DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), KernelUnitLengthX, kernelUnitLengthX)
 DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), KernelUnitLengthY, kernelUnitLengthY)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFESpecularLightingElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(specularConstant)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(specularExponent)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(surfaceScale)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthX)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(kernelUnitLengthY)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFESpecularLightingElement::SVGFESpecularLightingElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
     , m_specularConstant(1)
@@ -51,6 +61,7 @@ inline SVGFESpecularLightingElement::SVGFESpecularLightingElement(const Qualifie
     , m_surfaceScale(1)
 {
     ASSERT(hasTagName(SVGNames::feSpecularLightingTag));
+    registerAnimatedPropertiesForSVGFESpecularLightingElement();
 }
 
 PassRefPtr<SVGFESpecularLightingElement> SVGFESpecularLightingElement::create(const QualifiedName& tagName, Document* document)
@@ -204,71 +215,6 @@ void SVGFESpecularLightingElement::lightElementAttributeChanged(const SVGFELight
     primitiveAttributeChanged(attrName);
 }
 
-void SVGFESpecularLightingElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeIn1();
-        synchronizeSurfaceScale();
-        synchronizeSpecularConstant();
-        synchronizeSpecularExponent();
-        synchronizeKernelUnitLengthX();
-        synchronizeKernelUnitLengthY();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::inAttr) {
-        synchronizeIn1();
-        return;
-    }
-
-    if (attrName == SVGNames::surfaceScaleAttr) {
-        synchronizeSurfaceScale();
-        return;
-    }
-
-    if (attrName == SVGNames::specularConstantAttr) {
-        synchronizeSpecularConstant();
-        return;
-    }
-
-    if (attrName == SVGNames::specularExponentAttr) {
-        synchronizeSpecularExponent();
-        return;
-    }
-
-    if (attrName == SVGNames::kernelUnitLengthAttr) {
-        synchronizeKernelUnitLengthX();
-        synchronizeKernelUnitLengthY();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFESpecularLightingElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFESpecularLightingElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
-    attributeToPropertyTypeMap.set(SVGNames::specularConstantAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::specularExponentAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::surfaceScaleAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::kernelUnitLengthAttr, AnimatedNumberOptionalNumber);
-}
-
 PassRefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
index d43e479..632e7cf 100644 (file)
@@ -42,21 +42,19 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     static const AtomicString& kernelUnitLengthXIdentifier();
     static const AtomicString& kernelUnitLengthYIdentifier();
 
-    // Animated property declarations
-    DECLARE_ANIMATED_STRING(In1, in1)
-    DECLARE_ANIMATED_NUMBER(SpecularConstant, specularConstant)
-    DECLARE_ANIMATED_NUMBER(SpecularExponent, specularExponent)
-    DECLARE_ANIMATED_NUMBER(SurfaceScale, surfaceScale)
-    DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
-    DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFESpecularLightingElement)
+        DECLARE_ANIMATED_STRING(In1, in1)
+        DECLARE_ANIMATED_NUMBER(SpecularConstant, specularConstant)
+        DECLARE_ANIMATED_NUMBER(SpecularExponent, specularExponent)
+        DECLARE_ANIMATED_NUMBER(SurfaceScale, surfaceScale)
+        DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
+        DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index e2215f5..e4d2a7e 100644 (file)
@@ -35,10 +35,16 @@ namespace WebCore {
 // Animated property definitions
 DEFINE_ANIMATED_STRING(SVGFETileElement, SVGNames::inAttr, In1, in1)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFETileElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFETileElement::SVGFETileElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
 {
     ASSERT(hasTagName(SVGNames::feTileTag));
+    registerAnimatedPropertiesForSVGFETileElement();
 }
 
 PassRefPtr<SVGFETileElement> SVGFETileElement::create(const QualifiedName& tagName, Document* document)
@@ -86,41 +92,6 @@ void SVGFETileElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-void SVGFETileElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeIn1();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-    
-    if (attrName == SVGNames::inAttr) {
-        synchronizeIn1();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFETileElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFETileElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::inAttr, AnimatedString);
-}
-
 PassRefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
index d6a9972..f479f10 100644 (file)
@@ -37,13 +37,11 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
-    // Animated property declarations
-    DECLARE_ANIMATED_STRING(In1, in1)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFETileElement)
+        DECLARE_ANIMATED_STRING(In1, in1)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index 843b7d7..721a7f6 100644 (file)
@@ -38,6 +38,16 @@ DEFINE_ANIMATED_NUMBER(SVGFETurbulenceElement, SVGNames::seedAttr, Seed, seed)
 DEFINE_ANIMATED_ENUMERATION(SVGFETurbulenceElement, SVGNames::stitchTilesAttr, StitchTiles, stitchTiles, SVGStitchOptions)
 DEFINE_ANIMATED_ENUMERATION(SVGFETurbulenceElement, SVGNames::typeAttr, Type, type, TurbulenceType)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFETurbulenceElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(baseFrequencyX)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(baseFrequencyY)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(numOctaves)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(seed)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(stitchTiles)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(type)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagName, Document* document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
     , m_numOctaves(1)
@@ -45,6 +55,7 @@ inline SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagNa
     , m_type(FETURBULENCE_TYPE_TURBULENCE)
 {
     ASSERT(hasTagName(SVGNames::feTurbulenceTag));
+    registerAnimatedPropertiesForSVGFETurbulenceElement();
 }
 
 PassRefPtr<SVGFETurbulenceElement> SVGFETurbulenceElement::create(const QualifiedName& tagName, Document* document)
@@ -160,71 +171,6 @@ void SVGFETurbulenceElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-void SVGFETurbulenceElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeType();
-        synchronizeStitchTiles();
-        synchronizeBaseFrequencyX();
-        synchronizeBaseFrequencyY();
-        synchronizeSeed();
-        synchronizeNumOctaves();
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::typeAttr) {
-        synchronizeType();
-        return;
-    }
-
-    if (attrName == SVGNames::stitchTilesAttr) {
-        synchronizeStitchTiles();
-        return;
-    }
-
-    if (attrName == SVGNames::baseFrequencyAttr) {
-        synchronizeBaseFrequencyX();
-        synchronizeBaseFrequencyY();
-        return;
-    }
-
-    if (attrName == SVGNames::seedAttr) {
-        synchronizeSeed();
-        return;
-    }
-
-    if (attrName == SVGNames::numOctavesAttr) {
-        synchronizeNumOctaves();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFETurbulenceElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFETurbulenceElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::baseFrequencyAttr, AnimatedNumberOptionalNumber);
-    attributeToPropertyTypeMap.set(SVGNames::numOctavesAttr, AnimatedInteger);
-    attributeToPropertyTypeMap.set(SVGNames::seedAttr, AnimatedNumber);
-    attributeToPropertyTypeMap.set(SVGNames::stitchTilesAttr, AnimatedEnumeration);
-    attributeToPropertyTypeMap.set(SVGNames::typeAttr, AnimatedEnumeration);
-}
-
 PassRefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter* filter)
 {
     if (baseFrequencyX() < 0 || baseFrequencyY() < 0)
index ac044ba..9c4804f 100644 (file)
@@ -105,21 +105,19 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     static const AtomicString& baseFrequencyXIdentifier();
     static const AtomicString& baseFrequencyYIdentifier();
 
-    // Animated property declarations
-    DECLARE_ANIMATED_NUMBER(BaseFrequencyX, baseFrequencyX)
-    DECLARE_ANIMATED_NUMBER(BaseFrequencyY, baseFrequencyY)
-    DECLARE_ANIMATED_INTEGER(NumOctaves, numOctaves)
-    DECLARE_ANIMATED_NUMBER(Seed, seed)
-    DECLARE_ANIMATED_ENUMERATION(StitchTiles, stitchTiles, SVGStitchOptions)
-    DECLARE_ANIMATED_ENUMERATION(Type, type, TurbulenceType)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFETurbulenceElement)
+        DECLARE_ANIMATED_NUMBER(BaseFrequencyX, baseFrequencyX)
+        DECLARE_ANIMATED_NUMBER(BaseFrequencyY, baseFrequencyY)
+        DECLARE_ANIMATED_INTEGER(NumOctaves, numOctaves)
+        DECLARE_ANIMATED_NUMBER(Seed, seed)
+        DECLARE_ANIMATED_ENUMERATION(StitchTiles, stitchTiles, SVGStitchOptions)
+        DECLARE_ANIMATED_ENUMERATION(Type, type, TurbulenceType)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index 169778b..9716002 100644 (file)
@@ -48,11 +48,21 @@ DEFINE_ANIMATED_INTEGER_MULTIPLE_WRAPPERS(SVGFilterElement, SVGNames::filterResA
 DEFINE_ANIMATED_STRING(SVGFilterElement, XLinkNames::hrefAttr, Href, href)
 DEFINE_ANIMATED_BOOLEAN(SVGFilterElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFilterElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(filterUnits)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(primitiveUnits)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(x)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(y)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(width)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(height)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(filterResX)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(filterResY)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(href)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFilterElement::SVGFilterElement(const QualifiedName& tagName, Document* document)
     : SVGStyledElement(tagName, document)
-    , SVGURIReference()
-    , SVGLangSpace()
-    , SVGExternalResourcesRequired()
     , m_filterUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
     , m_primitiveUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
     , m_x(LengthModeWidth, "-10%")
@@ -63,6 +73,7 @@ inline SVGFilterElement::SVGFilterElement(const QualifiedName& tagName, Document
     // Spec: If the x/y attribute is not specified, the effect is as if a value of "-10%" were specified.
     // Spec: If the width/height attribute is not specified, the effect is as if a value of "120%" were specified.
     ASSERT(hasTagName(SVGNames::filterTag));
+    registerAnimatedPropertiesForSVGFilterElement();
 }
 
 PassRefPtr<SVGFilterElement> SVGFilterElement::create(const QualifiedName& tagName, Document* document)
@@ -189,98 +200,6 @@ void SVGFilterElement::svgAttributeChanged(const QualifiedName& attrName)
         object->setNeedsLayout(true);
 }
 
-void SVGFilterElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeX();
-        synchronizeY();
-        synchronizeWidth();
-        synchronizeHeight();
-        synchronizeFilterUnits();
-        synchronizePrimitiveUnits();
-        synchronizeFilterResX();
-        synchronizeFilterResY();
-        synchronizeExternalResourcesRequired();
-        synchronizeHref();
-        SVGStyledElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGStyledElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::xAttr) {
-        synchronizeX();
-        return;
-    }
-
-    if (attrName == SVGNames::yAttr) {
-        synchronizeY();
-        return;
-    }
-
-    if (attrName == SVGNames::widthAttr) {
-        synchronizeWidth();
-        return;
-    }
-
-    if (attrName == SVGNames::heightAttr) {
-        synchronizeHeight();
-        return;
-    }
-
-    if (attrName == SVGNames::filterUnitsAttr) {
-        synchronizeFilterUnits();
-        return;
-    }
-
-    if (attrName == SVGNames::primitiveUnitsAttr) {
-        synchronizePrimitiveUnits();
-        return;
-    }
-
-    if (attrName == SVGNames::filterResAttr) {
-        synchronizeFilterResX();
-        synchronizeFilterResY();
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGURIReference::isKnownAttribute(attrName)) {
-        synchronizeHref();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGFilterElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFilterElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::filterUnitsAttr, AnimatedEnumeration);
-    attributeToPropertyTypeMap.set(SVGNames::primitiveUnitsAttr, AnimatedEnumeration);
-    attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::widthAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::heightAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::filterResAttr, AnimatedNumberOptionalNumber);
-    attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
-}
-
 void SVGFilterElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
     SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
index 6b3ef44..4d2cc1f 100644 (file)
@@ -54,9 +54,6 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
 
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
@@ -66,21 +63,18 @@ private:
     static const AtomicString& filterResXIdentifier();
     static const AtomicString& filterResYIdentifier();
 
-    // Animated property declarations
-    DECLARE_ANIMATED_ENUMERATION(FilterUnits, filterUnits, SVGUnitTypes::SVGUnitType)
-    DECLARE_ANIMATED_ENUMERATION(PrimitiveUnits, primitiveUnits, SVGUnitTypes::SVGUnitType)
-    DECLARE_ANIMATED_LENGTH(X, x)
-    DECLARE_ANIMATED_LENGTH(Y, y)
-    DECLARE_ANIMATED_LENGTH(Width, width)
-    DECLARE_ANIMATED_LENGTH(Height, height)
-    DECLARE_ANIMATED_INTEGER(FilterResX, filterResX)
-    DECLARE_ANIMATED_INTEGER(FilterResY, filterResY)
-
-    // SVGURIReference
-    DECLARE_ANIMATED_STRING(Href, href)
-
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFilterElement)
+        DECLARE_ANIMATED_ENUMERATION(FilterUnits, filterUnits, SVGUnitTypes::SVGUnitType)
+        DECLARE_ANIMATED_ENUMERATION(PrimitiveUnits, primitiveUnits, SVGUnitTypes::SVGUnitType)
+        DECLARE_ANIMATED_LENGTH(X, x)
+        DECLARE_ANIMATED_LENGTH(Y, y)
+        DECLARE_ANIMATED_LENGTH(Width, width)
+        DECLARE_ANIMATED_LENGTH(Height, height)
+        DECLARE_ANIMATED_INTEGER(FilterResX, filterResX)
+        DECLARE_ANIMATED_INTEGER(FilterResY, filterResY)
+        DECLARE_ANIMATED_STRING(Href, href)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 }
index 3f1635b..f4e4387 100644 (file)
@@ -43,6 +43,15 @@ DEFINE_ANIMATED_LENGTH(SVGFilterPrimitiveStandardAttributes, SVGNames::widthAttr
 DEFINE_ANIMATED_LENGTH(SVGFilterPrimitiveStandardAttributes, SVGNames::heightAttr, Height, height)
 DEFINE_ANIMATED_STRING(SVGFilterPrimitiveStandardAttributes, SVGNames::resultAttr, Result, result)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(x)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(y)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(width)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(height)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(result)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
+END_REGISTER_ANIMATED_PROPERTIES
+
 SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const QualifiedName& tagName, Document* document)
     : SVGStyledElement(tagName, document)
     , m_x(LengthModeWidth, "0%")
@@ -52,6 +61,7 @@ SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const
 {
     // Spec: If the x/y attribute is not specified, the effect is as if a value of "0%" were specified.
     // Spec: If the width/height attribute is not specified, the effect is as if a value of "100%" were specified.
+    registerAnimatedPropertiesForSVGFilterPrimitiveStandardAttributes();
 }
 
 bool SVGFilterPrimitiveStandardAttributes::isSupportedAttribute(const QualifiedName& attrName)
@@ -121,51 +131,6 @@ void SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(const QualifiedNa
     invalidate();
 }
 
-void SVGFilterPrimitiveStandardAttributes::synchronizeProperty(const QualifiedName& attrName)
-{    
-    if (attrName == anyQName()) {
-        synchronizeX();
-        synchronizeY();
-        synchronizeWidth();
-        synchronizeHeight();
-        synchronizeResult();
-        SVGStyledElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGStyledElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::xAttr) {
-        synchronizeX();
-        return;
-    }
-
-    if (attrName == SVGNames::yAttr) {
-        synchronizeY();
-        return;
-    }
-
-    if (attrName == SVGNames::widthAttr) {
-        synchronizeWidth();
-        return;
-    }
-
-    if (attrName == SVGNames::heightAttr) {
-        synchronizeHeight();
-        return;
-    }
-
-    if (attrName == SVGNames::resultAttr) {
-        synchronizeResult();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
 void SVGFilterPrimitiveStandardAttributes::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
     SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
@@ -204,17 +169,6 @@ void SVGFilterPrimitiveStandardAttributes::setStandardAttributes(bool primitiveB
     filterEffect->setEffectBoundaries(effectBBox);
 }
 
-void SVGFilterPrimitiveStandardAttributes::fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap& attributeToPropertyTypeMap)
-{
-    SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    
-    attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::widthAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::heightAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::resultAttr, AnimatedString);
-}
-
 RenderObject* SVGFilterPrimitiveStandardAttributes::createRenderer(RenderArena* arena, RenderStyle*)
 {
     return new (arena) RenderSVGResourceFilterPrimitive(this);
index 4fa8aac..a731641 100644 (file)
@@ -51,8 +51,6 @@ protected:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    void fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap&);
     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
 
     inline void invalidate()
@@ -73,12 +71,13 @@ private:
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
     virtual bool rendererIsNeeded(const NodeRenderingContext&);
 
-    // Animated property declarations
-    DECLARE_ANIMATED_LENGTH(X, x)
-    DECLARE_ANIMATED_LENGTH(Y, y)
-    DECLARE_ANIMATED_LENGTH(Width, width)
-    DECLARE_ANIMATED_LENGTH(Height, height)
-    DECLARE_ANIMATED_STRING(Result, result)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
+        DECLARE_ANIMATED_LENGTH(X, x)
+        DECLARE_ANIMATED_LENGTH(Y, y)
+        DECLARE_ANIMATED_LENGTH(Width, width)
+        DECLARE_ANIMATED_LENGTH(Height, height)
+        DECLARE_ANIMATED_STRING(Result, result)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index 4303c26..8f50163 100644 (file)
@@ -104,20 +104,6 @@ bool SVGFitToViewBox::parseMappedAttribute(Document* document, Attribute* attr)
     return false;
 }
 
-void SVGFitToViewBox::synchronizeProperties(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeViewBox();
-        synchronizePreserveAspectRatio();
-        return;
-    }
-
-    if (attrName == SVGNames::viewBoxAttr)
-        synchronizeViewBox();
-    else if (attrName == SVGNames::preserveAspectRatioAttr)
-        synchronizePreserveAspectRatio();
-}
-
 bool SVGFitToViewBox::isKnownAttribute(const QualifiedName& attrName)
 {
     return attrName == SVGNames::viewBoxAttr || attrName == SVGNames::preserveAspectRatioAttr;
index 1d3de3f..3c8cebc 100644 (file)
@@ -43,14 +43,10 @@ public:
     bool parseMappedAttribute(Document*, Attribute*);
     bool isKnownAttribute(const QualifiedName&);
     void addSupportedAttributes(HashSet<QualifiedName>&);
-    void synchronizeProperties(const QualifiedName&);
 
     virtual void setViewBoxBaseValue(const FloatRect&) = 0;
     virtual void setPreserveAspectRatioBaseValue(const SVGPreserveAspectRatio&) = 0;
 
-    virtual void synchronizeViewBox() = 0;
-    virtual void synchronizePreserveAspectRatio() = 0;
-
 private:
     bool parseViewBox(Document*, const String&, FloatRect&);
 };
index 0c1cf30..94e5b81 100644 (file)
 
 namespace WebCore {
 
-// Animated property declarations
+// Animated property definitions
 DEFINE_ANIMATED_BOOLEAN(SVGFontElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFontElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGFontElement::SVGFontElement(const QualifiedName& tagName, Document* document)
     : SVGStyledElement(tagName, document) 
     , m_missingGlyph(0)
     , m_isGlyphCacheValid(false)
 {
     ASSERT(hasTagName(SVGNames::fontTag));
+    registerAnimatedPropertiesForSVGFontElement();
 }
 
 PassRefPtr<SVGFontElement> SVGFontElement::create(const QualifiedName& tagName, Document* document)
@@ -52,14 +58,6 @@ PassRefPtr<SVGFontElement> SVGFontElement::create(const QualifiedName& tagName,
     return adoptRef(new SVGFontElement(tagName, document));
 }
 
-void SVGFontElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    SVGStyledElement::synchronizeProperty(attrName);
-
-    if (attrName == anyQName() || SVGExternalResourcesRequired::isKnownAttribute(attrName))
-        synchronizeExternalResourcesRequired();
-}
-
 void SVGFontElement::invalidateGlyphCache()
 {
     if (m_isGlyphCacheValid) {
@@ -259,17 +257,6 @@ Glyph SVGFontElement::missingGlyph()
     return m_missingGlyph;
 }
 
-AttributeToPropertyTypeMap& SVGFontElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGFontElement::fillAttributeToPropertyTypeMap()
-{
-    SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap());
-}
-
 }
 
 #endif // ENABLE(SVG_FONTS)
index d44faa9..849179e 100644 (file)
@@ -73,18 +73,14 @@ public:
 private:
     SVGFontElement(const QualifiedName&, Document*);
 
-    virtual void synchronizeProperty(const QualifiedName&);
     virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }  
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
 
     void ensureGlyphCache();
     void registerLigaturesInGlyphCache(Vector<String>&);
 
-    // Animated property declarations
-
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFontElement)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 
     KerningPairVector m_horizontalKerningPairs;
     KerningPairVector m_verticalKerningPairs;
index 10370e3..4ce6d97 100644 (file)
@@ -42,6 +42,17 @@ DEFINE_ANIMATED_LENGTH(SVGForeignObjectElement, SVGNames::heightAttr, Height, he
 DEFINE_ANIMATED_STRING(SVGForeignObjectElement, XLinkNames::hrefAttr, Href, href)
 DEFINE_ANIMATED_BOOLEAN(SVGForeignObjectElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGForeignObjectElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(x)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(y)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(width)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(height)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(href)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGForeignObjectElement::SVGForeignObjectElement(const QualifiedName& tagName, Document* document)
     : SVGStyledTransformableElement(tagName, document)
     , m_x(LengthModeWidth)
@@ -50,6 +61,7 @@ inline SVGForeignObjectElement::SVGForeignObjectElement(const QualifiedName& tag
     , m_height(LengthModeHeight)
 {
     ASSERT(hasTagName(SVGNames::foreignObjectTag));
+    registerAnimatedPropertiesForSVGForeignObjectElement();
 }
 
 PassRefPtr<SVGForeignObjectElement> SVGForeignObjectElement::create(const QualifiedName& tagName, Document* document)
@@ -134,76 +146,6 @@ void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName)
         RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
 }
 
-void SVGForeignObjectElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeX();
-        synchronizeY();
-        synchronizeWidth();
-        synchronizeHeight();
-        synchronizeExternalResourcesRequired();
-        synchronizeHref();
-        SVGTests::synchronizeProperties(this, attrName);
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::xAttr) {
-        synchronizeX();
-        return;
-    }
-
-    if (attrName == SVGNames::yAttr) {
-        synchronizeY();
-        return;
-    }
-
-    if (attrName == SVGNames::widthAttr) {
-        synchronizeWidth();
-        return;
-    }
-
-    if (attrName == SVGNames::heightAttr) {
-        synchronizeHeight();
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGTests::isKnownAttribute(attrName)) {
-        SVGTests::synchronizeProperties(this, attrName);
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGForeignObjectElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGForeignObjectElement::fillAttributeToPropertyTypeMap()
-{    
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::widthAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::heightAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
-}
-
 RenderObject* SVGForeignObjectElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
     return new (arena) RenderSVGForeignObject(this);
index 6695cf4..6eaa82d 100644 (file)
@@ -45,26 +45,25 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
 
     virtual bool childShouldCreateRenderer(Node*) const;
     virtual RenderObject* createRenderer(RenderArena* arena, RenderStyle* style);
 
     virtual bool selfHasRelativeLengths() const;
 
-    // Animated property declarations
-    DECLARE_ANIMATED_LENGTH(X, x)
-    DECLARE_ANIMATED_LENGTH(Y, y)
-    DECLARE_ANIMATED_LENGTH(Width, width)
-    DECLARE_ANIMATED_LENGTH(Height, height)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGForeignObjectElement)
+        DECLARE_ANIMATED_LENGTH(X, x)
+        DECLARE_ANIMATED_LENGTH(Y, y)
+        DECLARE_ANIMATED_LENGTH(Width, width)
+        DECLARE_ANIMATED_LENGTH(Height, height)
+        DECLARE_ANIMATED_STRING(Href, href)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 
-    // SVGURIReference
-    DECLARE_ANIMATED_STRING(Href, href)
-
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    // SVGTests
+    virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
+    virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
+    virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
 };
 
 } // namespace WebCore
index 0c7b03c..f272cc4 100644 (file)
 
 namespace WebCore {
 
-// Animated property declarations
+// Animated property definitions
 DEFINE_ANIMATED_BOOLEAN(SVGGElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGGElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+END_REGISTER_ANIMATED_PROPERTIES
+
 SVGGElement::SVGGElement(const QualifiedName& tagName, Document* document)
     : SVGStyledTransformableElement(tagName, document)
 {
     ASSERT(hasTagName(SVGNames::gTag));
+    registerAnimatedPropertiesForSVGGElement();
 }
 
 PassRefPtr<SVGGElement> SVGGElement::create(const QualifiedName& tagName, Document* document)
@@ -89,44 +96,6 @@ void SVGGElement::svgAttributeChanged(const QualifiedName& attrName)
         RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
 }
 
-void SVGGElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeExternalResourcesRequired();
-        SVGTests::synchronizeProperties(this, attrName);
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGTests::isKnownAttribute(attrName)) {
-        SVGTests::synchronizeProperties(this, attrName);
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGGElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGGElement::fillAttributeToPropertyTypeMap()
-{
-    SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap());
-}
-
 RenderObject* SVGGElement::createRenderer(RenderArena* arena, RenderStyle* style)
 {
     // SVG 1.1 testsuite explicitely uses constructs like <g display="none"><linearGradient>
index 0523936..21c04db 100644 (file)
@@ -51,16 +51,17 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
 
     virtual bool rendererIsNeeded(const NodeRenderingContext&);
 
-    // Animated property declarations
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGGElement)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    // SVGTests
+    virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
+    virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
+    virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
 };
 
 } // namespace WebCore
index 1c79e62..09000bb 100644 (file)
@@ -129,20 +129,6 @@ static inline float parseSVGGlyphAttribute(const SVGElement* element, const WebC
     return value.toFloat();
 }
 
-AttributeToPropertyTypeMap& SVGGlyphElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGGlyphElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::dAttr, AnimatedPath);
-}
-
 SVGGlyph SVGGlyphElement::buildGenericGlyphIdentifier(const SVGElement* element)
 {
     SVGGlyph identifier;
index 5ad089a..60be413 100644 (file)
@@ -46,9 +46,8 @@ public:
 private:
     SVGGlyphElement(const QualifiedName&, Document*);
 
+    // FIXME: svgAttributeChanged missing.
     virtual void parseMappedAttribute(Attribute*);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
 
     virtual void insertedIntoDocument();
     virtual void removedFromDocument();
index 2dc3178..985dd72 100644 (file)
@@ -45,11 +45,21 @@ DEFINE_ANIMATED_TRANSFORM_LIST(SVGGradientElement, SVGNames::gradientTransformAt
 DEFINE_ANIMATED_STRING(SVGGradientElement, XLinkNames::hrefAttr, Href, href)
 DEFINE_ANIMATED_BOOLEAN(SVGGradientElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGGradientElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(spreadMethod)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(gradientUnits)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(gradientTransform)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(href)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
+END_REGISTER_ANIMATED_PROPERTIES
 SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, Document* document)
     : SVGStyledElement(tagName, document)
     , m_spreadMethod(SVGSpreadMethodPad)
     , m_gradientUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
 {
+    registerAnimatedPropertiesForSVGGradientElement();
 }
 
 bool SVGGradientElement::isSupportedAttribute(const QualifiedName& attrName)
@@ -116,61 +126,6 @@ void SVGGradientElement::svgAttributeChanged(const QualifiedName& attrName)
     if (RenderObject* object = renderer())
         object->setNeedsLayout(true);
 }
-
-void SVGGradientElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeGradientUnits();
-        synchronizeGradientTransform();
-        synchronizeSpreadMethod();
-        synchronizeExternalResourcesRequired();
-        synchronizeHref();
-        SVGStyledElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGStyledElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::gradientUnitsAttr) {
-        synchronizeGradientUnits();
-        return;
-    }
-
-    if (attrName == SVGNames::gradientTransformAttr) {
-        synchronizeGradientTransform();
-        return;
-    }
-
-    if (attrName == SVGNames::spreadMethodAttr) {
-        synchronizeSpreadMethod();
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGURIReference::isKnownAttribute(attrName)) {
-        synchronizeHref();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-void SVGGradientElement::fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap& attributeToPropertyTypeMap)
-{
-    SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-
-    attributeToPropertyTypeMap.set(SVGNames::spreadMethodAttr, AnimatedEnumeration);
-    attributeToPropertyTypeMap.set(SVGNames::gradientUnitsAttr, AnimatedEnumeration);
-    attributeToPropertyTypeMap.set(SVGNames::gradientTransformAttr, AnimatedTransformList);
-    attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
-}
     
 void SVGGradientElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
index f412635..1150959 100644 (file)
@@ -73,7 +73,6 @@ struct SVGPropertyTraits<SVGSpreadMethodType> {
     }
 };
 
-
 class SVGGradientElement : public SVGStyledElement,
                            public SVGURIReference,
                            public SVGExternalResourcesRequired {
@@ -93,24 +92,19 @@ protected:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    void fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap&);
 
 private:
     virtual bool needsPendingResourceHandling() const { return false; }
 
     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
 
-    // Animated property declarations
-    DECLARE_ANIMATED_ENUMERATION(SpreadMethod, spreadMethod, SVGSpreadMethodType)
-    DECLARE_ANIMATED_ENUMERATION(GradientUnits, gradientUnits, SVGUnitTypes::SVGUnitType)
-    DECLARE_ANIMATED_TRANSFORM_LIST(GradientTransform, gradientTransform)
-
-    // SVGURIReference
-    DECLARE_ANIMATED_STRING(Href, href)
-
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGGradientElement)
+        DECLARE_ANIMATED_ENUMERATION(SpreadMethod, spreadMethod, SVGSpreadMethodType)
+        DECLARE_ANIMATED_ENUMERATION(GradientUnits, gradientUnits, SVGUnitTypes::SVGUnitType)
+        DECLARE_ANIMATED_TRANSFORM_LIST(GradientTransform, gradientTransform)
+        DECLARE_ANIMATED_STRING(Href, href)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index c208157..96866d7 100644 (file)
@@ -45,6 +45,18 @@ DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGImageElement, SVGNames::preserveAspectRat
 DEFINE_ANIMATED_STRING(SVGImageElement, XLinkNames::hrefAttr, Href, href)
 DEFINE_ANIMATED_BOOLEAN(SVGImageElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGImageElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(x)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(y)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(width)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(height)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(href)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGImageElement::SVGImageElement(const QualifiedName& tagName, Document* document)
     : SVGStyledTransformableElement(tagName, document)
     , m_x(LengthModeWidth)
@@ -54,6 +66,7 @@ inline SVGImageElement::SVGImageElement(const QualifiedName& tagName, Document*
     , m_imageLoader(this)
 {
     ASSERT(hasTagName(SVGNames::imageTag));
+    registerAnimatedPropertiesForSVGImageElement();
 }
 
 PassRefPtr<SVGImageElement> SVGImageElement::create(const QualifiedName& tagName, Document* document)
@@ -173,88 +186,6 @@ void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-void SVGImageElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeX();
-        synchronizeY();
-        synchronizeWidth();
-        synchronizeHeight();
-        synchronizePreserveAspectRatio();
-        synchronizeExternalResourcesRequired();
-        synchronizeHref();
-        SVGTests::synchronizeProperties(this, attrName);
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::xAttr) {
-        synchronizeX();
-        return;
-    }
-
-    if (attrName == SVGNames::yAttr) {
-        synchronizeY();
-        return;
-    }
-
-    if (attrName == SVGNames::widthAttr) {
-        synchronizeWidth();
-        return;
-    }
-
-    if (attrName == SVGNames::heightAttr) {
-        synchronizeHeight();
-        return;
-    }
-
-    if (attrName == SVGNames::preserveAspectRatioAttr) {
-        synchronizePreserveAspectRatio();
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGURIReference::isKnownAttribute(attrName)) {
-        synchronizeHref();
-        return;
-    }
-
-    if (SVGTests::isKnownAttribute(attrName)) {
-        SVGTests::synchronizeProperties(this, attrName);
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGImageElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGImageElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::widthAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::heightAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::preserveAspectRatioAttr, AnimatedPreserveAspectRatio);
-    attributeToPropertyTypeMap.set(XLinkNames::hrefAttr, AnimatedString);
-}
-
 bool SVGImageElement::selfHasRelativeLengths() const
 {
     return x().isRelative()
index 86700d1..f97e1d9 100644 (file)
@@ -51,9 +51,6 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
 
     virtual void attach();
     virtual void insertedIntoDocument();
@@ -68,18 +65,20 @@ private:
     virtual bool selfHasRelativeLengths() const;
     virtual void willMoveToNewOwnerDocument();
 
-    // Animated property declarations
-    DECLARE_ANIMATED_LENGTH(X, x)
-    DECLARE_ANIMATED_LENGTH(Y, y)
-    DECLARE_ANIMATED_LENGTH(Width, width)
-    DECLARE_ANIMATED_LENGTH(Height, height)
-    DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
-
-    // SVGURIReference
-    DECLARE_ANIMATED_STRING(Href, href)
-
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGImageElement)
+        DECLARE_ANIMATED_LENGTH(X, x)
+        DECLARE_ANIMATED_LENGTH(Y, y)
+        DECLARE_ANIMATED_LENGTH(Width, width)
+        DECLARE_ANIMATED_LENGTH(Height, height)
+        DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
+        DECLARE_ANIMATED_STRING(Href, href)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
+
+    // SVGTests
+    virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
+    virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
+    virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
 
     SVGImageLoader m_imageLoader;
 };
index 8428417..5707db6 100644 (file)
@@ -40,6 +40,16 @@ DEFINE_ANIMATED_LENGTH(SVGLineElement, SVGNames::x2Attr, X2, x2)
 DEFINE_ANIMATED_LENGTH(SVGLineElement, SVGNames::y2Attr, Y2, y2)
 DEFINE_ANIMATED_BOOLEAN(SVGLineElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGLineElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(x1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(y1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(x2)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(y2)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGLineElement::SVGLineElement(const QualifiedName& tagName, Document* document)
     : SVGStyledTransformableElement(tagName, document)
     , m_x1(LengthModeWidth)
@@ -48,6 +58,7 @@ inline SVGLineElement::SVGLineElement(const QualifiedName& tagName, Document* do
     , m_y2(LengthModeHeight)
 {
     ASSERT(hasTagName(SVGNames::lineTag));
+    registerAnimatedPropertiesForSVGLineElement();
 }
 
 PassRefPtr<SVGLineElement> SVGLineElement::create(const QualifiedName& tagName, Document* document)
@@ -145,74 +156,6 @@ void SVGLineElement::svgAttributeChanged(const QualifiedName& attrName)
     ASSERT_NOT_REACHED();
 }
 
-void SVGLineElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeX1();
-        synchronizeY1();
-        synchronizeX2();
-        synchronizeY2();
-        synchronizeExternalResourcesRequired();
-        SVGTests::synchronizeProperties(this, attrName);
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::x1Attr) {
-        synchronizeX1();
-        return;
-    }
-
-    if (attrName == SVGNames::y1Attr) {
-        synchronizeY1();
-        return;
-    }
-
-    if (attrName == SVGNames::x2Attr) {
-        synchronizeX2();
-        return;
-    }
-
-    if (attrName == SVGNames::y2Attr) {
-        synchronizeY2();
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGTests::isKnownAttribute(attrName)) {
-        SVGTests::synchronizeProperties(this, attrName);
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGLineElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGLineElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::x1Attr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::y1Attr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::x2Attr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::y2Attr, AnimatedLength);
-}
-
 void SVGLineElement::toPathData(Path& path) const
 {
     ASSERT(path.isEmpty());
index 2ea625e..559b456 100644 (file)
@@ -47,9 +47,6 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
 
     virtual void toPathData(Path&) const;
 
@@ -57,14 +54,18 @@ private:
 
     virtual bool selfHasRelativeLengths() const;
 
-    // Animated property declarations
-    DECLARE_ANIMATED_LENGTH(X1, x1)
-    DECLARE_ANIMATED_LENGTH(Y1, y1)
-    DECLARE_ANIMATED_LENGTH(X2, x2)
-    DECLARE_ANIMATED_LENGTH(Y2, y2)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGLineElement)
+        DECLARE_ANIMATED_LENGTH(X1, x1)
+        DECLARE_ANIMATED_LENGTH(Y1, y1)
+        DECLARE_ANIMATED_LENGTH(X2, x2)
+        DECLARE_ANIMATED_LENGTH(Y2, y2)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    // SVGTests
+    virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
+    virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
+    virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
 };
 
 } // namespace WebCore
index 6d7619d..1185923 100644 (file)
@@ -46,6 +46,14 @@ DEFINE_ANIMATED_LENGTH(SVGLinearGradientElement, SVGNames::y1Attr, Y1, y1)
 DEFINE_ANIMATED_LENGTH(SVGLinearGradientElement, SVGNames::x2Attr, X2, x2)
 DEFINE_ANIMATED_LENGTH(SVGLinearGradientElement, SVGNames::y2Attr, Y2, y2)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGLinearGradientElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(x1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(y1)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(x2)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(y2)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGradientElement)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGLinearGradientElement::SVGLinearGradientElement(const QualifiedName& tagName, Document* document)
     : SVGGradientElement(tagName, document)
     , m_x1(LengthModeWidth)
@@ -55,6 +63,7 @@ inline SVGLinearGradientElement::SVGLinearGradientElement(const QualifiedName& t
 {
     // Spec: If the x2 attribute is not specified, the effect is as if a value of "100%" were specified.
     ASSERT(hasTagName(SVGNames::linearGradientTag));
+    registerAnimatedPropertiesForSVGLinearGradientElement();
 }
 
 PassRefPtr<SVGLinearGradientElement> SVGLinearGradientElement::create(const QualifiedName& tagName, Document* document)
@@ -119,62 +128,6 @@ void SVGLinearGradientElement::svgAttributeChanged(const QualifiedName& attrName
         object->setNeedsLayout(true);
 }
 
-void SVGLinearGradientElement::synchronizeProperty(const QualifiedName& attrName)
-{    
-    if (attrName == anyQName()) {
-        synchronizeX1();
-        synchronizeY1();
-        synchronizeX2();
-        synchronizeY2();
-        SVGGradientElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGGradientElement::synchronizeProperty(attrName);
-        return;
-    }   
-
-    if (attrName == SVGNames::x1Attr) {
-        synchronizeX1();
-        return;
-    }
-
-    if (attrName == SVGNames::y1Attr) {
-        synchronizeY1();
-        return;
-    }
-
-    if (attrName == SVGNames::x2Attr) {
-        synchronizeX2();
-        return;
-    }
-
-    if (attrName == SVGNames::y2Attr) {
-        synchronizeY2();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGLinearGradientElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGLinearGradientElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGGradientElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::x1Attr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::y1Attr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::x2Attr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::y2Attr, AnimatedLength);
-}
-
 RenderObject* SVGLinearGradientElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
     return new (arena) RenderSVGResourceLinearGradient(this);
index 108360e..7418cb4 100644 (file)
@@ -42,19 +42,17 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
 
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
 
     virtual bool selfHasRelativeLengths() const;
 
-    // Animated property declarations
-    DECLARE_ANIMATED_LENGTH(X1, x1)
-    DECLARE_ANIMATED_LENGTH(Y1, y1)
-    DECLARE_ANIMATED_LENGTH(X2, x2)
-    DECLARE_ANIMATED_LENGTH(Y2, y2)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGLinearGradientElement)
+        DECLARE_ANIMATED_LENGTH(X1, x1)
+        DECLARE_ANIMATED_LENGTH(Y1, y1)
+        DECLARE_ANIMATED_LENGTH(X2, x2)
+        DECLARE_ANIMATED_LENGTH(Y2, y2)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index 995759d..e92c9b7 100644 (file)
@@ -32,10 +32,16 @@ namespace WebCore {
 DEFINE_ANIMATED_STRING(SVGMPathElement, XLinkNames::hrefAttr, Href, href)
 DEFINE_ANIMATED_BOOLEAN(SVGMPathElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGMPathElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(href)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGMPathElement::SVGMPathElement(const QualifiedName& tagName, Document* document)
     : SVGElement(tagName, document)
 {
     ASSERT(hasTagName(SVGNames::mpathTag));
+    registerAnimatedPropertiesForSVGMPathElement();
 }
 
 PassRefPtr<SVGMPathElement> SVGMPathElement::create(const QualifiedName& tagName, Document* document)
@@ -68,41 +74,6 @@ void SVGMPathElement::parseMappedAttribute(Attribute* attr)
     ASSERT_NOT_REACHED();
 }
 
-void SVGMPathElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeExternalResourcesRequired();
-        synchronizeHref();
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName))
-        return;
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGURIReference::isKnownAttribute(attrName)) {
-        synchronizeHref();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGMPathElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGMPathElement::fillAttributeToPropertyTypeMap()
-{
-    attributeToPropertyTypeMap().set(XLinkNames::hrefAttr, AnimatedString);
-}
-
 SVGPathElement* SVGMPathElement::pathElement()
 {
     Element* target = treeScope()->getElementById(getTarget(href()));
index 5fada0e..eb5fc0c 100644 (file)
@@ -44,17 +44,11 @@ private:
     // FIXME: svgAttributeChanged missing.
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
 
-    // Animated property declarations
-
-    // SVGURIReference
-    DECLARE_ANIMATED_STRING(Href, href)
-
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGMPathElement)
+        DECLARE_ANIMATED_STRING(Href, href)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 };
 
 } // namespace WebCore
index 7b9179a..52bab8e 100644 (file)
 #include "SVGSVGElement.h"
 
 namespace WebCore {
+// Define custom animated property 'orientType'.
+const SVGPropertyInfo* SVGMarkerElement::orientTypePropertyInfo()
+{
+    static const SVGPropertyInfo* s_propertyInfo = 0;
+    if (!s_propertyInfo) {
+        s_propertyInfo = new SVGPropertyInfo(AnimatedEnumeration,
+                                             SVGNames::orientAttr,
+                                             orientTypeIdentifier(),
+                                             &SVGMarkerElement::synchronizeOrientType,
+                                             &SVGMarkerElement::lookupOrCreateOrientTypeWrapper);
+    }
+    return s_propertyInfo;
+}
 
 // Animated property definitions
 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::refXAttr, RefX, refX)
@@ -44,6 +58,20 @@ DEFINE_ANIMATED_BOOLEAN(SVGMarkerElement, SVGNames::externalResourcesRequiredAtt
 DEFINE_ANIMATED_RECT(SVGMarkerElement, SVGNames::viewBoxAttr, ViewBox, viewBox)
 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGMarkerElement, SVGNames::preserveAspectRatioAttr, PreserveAspectRatio, preserveAspectRatio)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGMarkerElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(refX)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(refY)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(markerWidth)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(markerHeight)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(markerUnits)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(orientAngle)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(orientType)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document* document)
     : SVGStyledElement(tagName, document)
     , m_refX(LengthModeWidth)
@@ -55,6 +83,7 @@ inline SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document
 {
     // Spec: If the markerWidth/markerHeight attribute is not specified, the effect is as if a value of "3" were specified.
     ASSERT(hasTagName(SVGNames::markerTag));
+    registerAnimatedPropertiesForSVGMarkerElement();
 }
 
 PassRefPtr<SVGMarkerElement> SVGMarkerElement::create(const QualifiedName& tagName, Document* document)
@@ -170,91 +199,6 @@ void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName)
         object->setNeedsLayout(true);
 }
 
-void SVGMarkerElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeMarkerUnits();
-        synchronizeRefX();
-        synchronizeRefY();
-        synchronizeMarkerWidth();
-        synchronizeMarkerHeight();
-        synchronizeOrientAngle();
-        synchronizeOrientType();
-        synchronizeExternalResourcesRequired();
-        SVGFitToViewBox::synchronizeProperties(attrName);
-        SVGStyledElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGStyledElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::markerUnitsAttr) {
-        synchronizeMarkerUnits();
-        return;
-    }
-
-    if (attrName == SVGNames::refXAttr) {
-        synchronizeRefX();
-        return;
-    }
-
-    if (attrName == SVGNames::refYAttr) {
-        synchronizeRefY();
-        return;
-    }
-
-    if (attrName == SVGNames::markerWidthAttr) {
-        synchronizeMarkerWidth();
-        return;
-    }
-
-    if (attrName == SVGNames::markerHeightAttr) {
-        synchronizeMarkerHeight();
-        return;
-    }
-
-    if (attrName == SVGNames::orientAttr) {
-        synchronizeOrientAngle();
-        synchronizeOrientType();
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGFitToViewBox::isKnownAttribute(attrName)) {
-        SVGFitToViewBox::synchronizeProperties(attrName);
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGMarkerElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGMarkerElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::refXAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::refYAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::markerWidthAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::markerHeightAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::markerUnitsAttr, AnimatedEnumeration);
-    attributeToPropertyTypeMap.set(SVGNames::orientAttr, AnimatedAngle);
-    attributeToPropertyTypeMap.set(SVGNames::viewBoxAttr, AnimatedRect);
-}
-
 void SVGMarkerElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
     SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
@@ -270,9 +214,12 @@ void SVGMarkerElement::setOrientToAuto()
 {
     setOrientTypeBaseValue(SVGMarkerOrientAuto);
     setOrientAngleBaseValue(SVGAngle());
-
-    if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+    // Mark orientAttr dirty - the next XML DOM access of that attribute kicks in synchronization.
+    m_orientAngle.shouldSynchronize = true;
+    m_orientType.shouldSynchronize = true;
+    invalidateSVGAttributes();
+    svgAttributeChanged(orientAnglePropertyInfo()->attributeName);
 }
 
 void SVGMarkerElement::setOrientToAngle(const SVGAngle& angle)
@@ -280,8 +227,11 @@ void SVGMarkerElement::setOrientToAngle(const SVGAngle& angle)
     setOrientTypeBaseValue(SVGMarkerOrientAngle);
     setOrientAngleBaseValue(angle);
 
-    if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+    // Mark orientAttr dirty - the next XML DOM access of that attribute kicks in synchronization.
+    m_orientAngle.shouldSynchronize = true;
+    m_orientType.shouldSynchronize = true;
+    invalidateSVGAttributes();
+    svgAttributeChanged(orientAnglePropertyInfo()->attributeName);
 }
 
 RenderObject* SVGMarkerElement::createRenderer(RenderArena* arena, RenderStyle*)
@@ -297,24 +247,33 @@ bool SVGMarkerElement::selfHasRelativeLengths() const
         || markerHeight().isRelative();
 }
 
-void SVGMarkerElement::synchronizeOrientType()
+void SVGMarkerElement::synchronizeOrientType(void* contextElement)
 {
-    if (!m_orientType.shouldSynchronize)
+    ASSERT(contextElement);
+    SVGMarkerElement* ownerType = static_cast<SVGMarkerElement*>(contextElement);
+    if (!ownerType->m_orientType.shouldSynchronize)
         return;
-    
-    AtomicString value;
-    if (m_orientType.value == SVGMarkerOrientAuto)
-        value = "auto";
-    else if (m_orientType.value == SVGMarkerOrientAngle)
-        value = orientAngle().valueAsString();
 
-    SVGAnimatedPropertySynchronizer<true>::synchronize(this, SVGNames::orientAttr, value);
+    // If orient is not auto, the previous call to synchronizeOrientAngle already set the orientAttr to the right angle.
+    if (ownerType->m_orientType.value != SVGMarkerOrientAuto)
+        return;
+
+    DEFINE_STATIC_LOCAL(AtomicString, autoString, ("auto"));
+    SVGAnimatedPropertySynchronizer<true>::synchronize(ownerType, orientTypePropertyInfo()->attributeName, autoString);
 }
 
+PassRefPtr<SVGAnimatedProperty> SVGMarkerElement::lookupOrCreateOrientTypeWrapper(void* contextElement)
+{
+    ASSERT(contextElement);
+    SVGMarkerElement* ownerType = static_cast<SVGMarkerElement*>(contextElement);
+    return SVGAnimatedProperty::lookupOrCreateWrapper<SVGMarkerElement, SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType>, SVGMarkerOrientType, true>
+           (ownerType, orientTypePropertyInfo(), ownerType->m_orientType.value);
+}
+  
 PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > SVGMarkerElement::orientTypeAnimated()
 {
     m_orientType.shouldSynchronize = true;
-    return SVGAnimatedProperty::lookupOrCreateWrapper<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType>, SVGMarkerOrientType>(this, SVGNames::orientAttr, orientTypeIdentifier(), m_orientType.value);
+    return static_pointer_cast<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> >(lookupOrCreateOrientTypeWrapper(this));
 }
 
 }
index 028b05e..054cb87 100644 (file)
@@ -120,6 +120,8 @@ public:
     void setOrientToAuto();
     void setOrientToAngle(const SVGAngle&);
 
+    static const SVGPropertyInfo* orientTypePropertyInfo();
+
 private:
     SVGMarkerElement(const QualifiedName&, Document*);
 
@@ -128,9 +130,6 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
 
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
@@ -138,33 +137,33 @@ private:
 
     virtual bool selfHasRelativeLengths() const;
 
+    void synchronizeOrientType();
+
     static const AtomicString& orientTypeIdentifier();
     static const AtomicString& orientAngleIdentifier();
-
-    // Animated property declarations
-    DECLARE_ANIMATED_LENGTH(RefX, refX)
-    DECLARE_ANIMATED_LENGTH(RefY, refY)
-    DECLARE_ANIMATED_LENGTH(MarkerWidth, markerWidth)
-    DECLARE_ANIMATED_LENGTH(MarkerHeight, markerHeight)
-    DECLARE_ANIMATED_ENUMERATION(MarkerUnits, markerUnits, SVGMarkerUnitsType)
-    DECLARE_ANIMATED_ANGLE(OrientAngle, orientAngle)
-
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
-
-    // SVGFitToViewBox
-    DECLARE_ANIMATED_RECT(ViewBox, viewBox)
-    DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
-
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGMarkerElement)
+        DECLARE_ANIMATED_LENGTH(RefX, refX)
+        DECLARE_ANIMATED_LENGTH(RefY, refY)
+        DECLARE_ANIMATED_LENGTH(MarkerWidth, markerWidth)
+        DECLARE_ANIMATED_LENGTH(MarkerHeight, markerHeight)
+        DECLARE_ANIMATED_ENUMERATION(MarkerUnits, markerUnits, SVGMarkerUnitsType)
+        DECLARE_ANIMATED_ANGLE(OrientAngle, orientAngle)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+        DECLARE_ANIMATED_RECT(ViewBox, viewBox)
+        DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
+    END_DECLARE_ANIMATED_PROPERTIES
+  
 public:
-    // Custom animated property: orientType
+    // Custom 'orientType' property.
+    static void synchronizeOrientType(void* contextElement);
+    static PassRefPtr<SVGAnimatedProperty> lookupOrCreateOrientTypeWrapper(void* contextElement);
     SVGMarkerOrientType& orientType() const { return m_orientType.value; }
     SVGMarkerOrientType& orientTypeBaseValue() const { return m_orientType.value; }
     void setOrientTypeBaseValue(const SVGMarkerOrientType& type) { m_orientType.value = type; }
     PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > orientTypeAnimated();
 
 private:
-    void synchronizeOrientType();
     mutable SVGSynchronizableAnimatedProperty<SVGMarkerOrientType> m_orientType;
 };
 
index bcde099..5cc19e1 100644 (file)
@@ -45,6 +45,18 @@ DEFINE_ANIMATED_LENGTH(SVGMaskElement, SVGNames::widthAttr, Width, width)
 DEFINE_ANIMATED_LENGTH(SVGMaskElement, SVGNames::heightAttr, Height, height)
 DEFINE_ANIMATED_BOOLEAN(SVGMaskElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGMaskElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(maskUnits)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(maskContentUnits)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(x)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(y)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(width)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(height)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledLocatableElement)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document* document)
     : SVGStyledLocatableElement(tagName, document)
     , m_maskUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
@@ -57,6 +69,7 @@ inline SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document* do
     // Spec: If the x/y attribute is not specified, the effect is as if a value of "-10%" were specified.
     // Spec: If the width/height attribute is not specified, the effect is as if a value of "120%" were specified.
     ASSERT(hasTagName(SVGNames::maskTag));
+    registerAnimatedPropertiesForSVGMaskElement();
 }
 
 PassRefPtr<SVGMaskElement> SVGMaskElement::create(const QualifiedName& tagName, Document* document)
@@ -151,88 +164,6 @@ void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName)
         object->setNeedsLayout(true);
 }
 
-void SVGMaskElement::synchronizeProperty(const QualifiedName& attrName)
-{
-    if (attrName == anyQName()) {
-        synchronizeMaskUnits();
-        synchronizeMaskContentUnits();
-        synchronizeX();
-        synchronizeY();
-        synchronizeWidth();
-        synchronizeHeight();
-        synchronizeExternalResourcesRequired();
-        SVGTests::synchronizeProperties(this, attrName);
-        SVGStyledElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (!isSupportedAttribute(attrName)) {
-        SVGStyledElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::maskUnitsAttr) {
-        synchronizeMaskUnits();
-        return;
-    }
-
-    if (attrName == SVGNames::maskContentUnitsAttr) {
-        synchronizeMaskContentUnits();
-        return;
-    }
-
-    if (attrName == SVGNames::xAttr) {
-        synchronizeX();
-        return;
-    }
-
-    if (attrName == SVGNames::yAttr) {
-        synchronizeY();
-        return;
-    }
-
-    if (attrName == SVGNames::widthAttr) {
-        synchronizeWidth();
-        return;
-    }
-
-    if (attrName == SVGNames::heightAttr) {
-        synchronizeHeight();
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGTests::isKnownAttribute(attrName)) {
-        SVGTests::synchronizeProperties(this, attrName);
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-AttributeToPropertyTypeMap& SVGMaskElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGMaskElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGStyledLocatableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::xAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::yAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::widthAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::heightAttr, AnimatedLength);
-    attributeToPropertyTypeMap.set(SVGNames::maskUnitsAttr, AnimatedEnumeration);
-    attributeToPropertyTypeMap.set(SVGNames::maskContentUnitsAttr, AnimatedEnumeration);
-}
-
 void SVGMaskElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
     SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
index faa1025..0c9110b 100644 (file)
@@ -50,25 +50,26 @@ private:
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
 
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
 
     virtual bool selfHasRelativeLengths() const;
 
-    // Animated property declarations
-    DECLARE_ANIMATED_ENUMERATION(MaskUnits, maskUnits, SVGUnitTypes::SVGUnitType)
-    DECLARE_ANIMATED_ENUMERATION(MaskContentUnits, maskContentUnits, SVGUnitTypes::SVGUnitType)
-    DECLARE_ANIMATED_LENGTH(X, x)
-    DECLARE_ANIMATED_LENGTH(Y, y)
-    DECLARE_ANIMATED_LENGTH(Width, width)
-    DECLARE_ANIMATED_LENGTH(Height, height)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGMaskElement)
+        DECLARE_ANIMATED_ENUMERATION(MaskUnits, maskUnits, SVGUnitTypes::SVGUnitType)
+        DECLARE_ANIMATED_ENUMERATION(MaskContentUnits, maskContentUnits, SVGUnitTypes::SVGUnitType)
+        DECLARE_ANIMATED_LENGTH(X, x)
+        DECLARE_ANIMATED_LENGTH(Y, y)
+        DECLARE_ANIMATED_LENGTH(Width, width)
+        DECLARE_ANIMATED_LENGTH(Height, height)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    // SVGTests
+    virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
+    virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
+    virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
 };
 
 }
index 580c6ef..5c98015 100644 (file)
@@ -36,17 +36,6 @@ PassRefPtr<SVGMissingGlyphElement> SVGMissingGlyphElement::create(const Qualifie
     return adoptRef(new SVGMissingGlyphElement(tagName, document));
 }
 
-AttributeToPropertyTypeMap& SVGMissingGlyphElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGMissingGlyphElement::fillAttributeToPropertyTypeMap()
-{
-    SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap());
-}
-
 }
 
 #endif // ENABLE(SVG_FONTS)
index f2a176e..d726c0d 100644 (file)
@@ -32,9 +32,6 @@ public:
 private:
     SVGMissingGlyphElement(const QualifiedName&, Document*);
 
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
-
     virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }
 };
 
@@ -42,5 +39,3 @@ private:
 
 #endif // ENABLE(SVG_FONTS)
 #endif
-
-// vim:ts=4:noet
index 2a37af1..222bfbf 100644 (file)
 
 namespace WebCore {
 
+// Define custom animated property 'd'.
+const SVGPropertyInfo* SVGPathElement::dPropertyInfo()
+{
+    static const SVGPropertyInfo* s_propertyInfo = 0;
+    if (!s_propertyInfo) {
+        s_propertyInfo = new SVGPropertyInfo(AnimatedPath,
+                                             SVGNames::dAttr,
+                                             SVGNames::dAttr.localName(),
+                                             &SVGPathElement::synchronizeD,
+                                             &SVGPathElement::lookupOrCreateDWrapper);
+    }
+    return s_propertyInfo;
+}
+
 // Animated property definitions
 DEFINE_ANIMATED_NUMBER(SVGPathElement, SVGNames::pathLengthAttr, PathLength, pathLength)
 DEFINE_ANIMATED_BOOLEAN(SVGPathElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPathElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(d)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(pathLength)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGPathElement::SVGPathElement(const QualifiedName& tagName, Document* document)
     : SVGStyledTransformableElement(tagName, document)
     , m_pathByteStream(SVGPathByteStream::create())
     , m_pathSegList(PathSegUnalteredRole)
 {
     ASSERT(hasTagName(SVGNames::pathTag));
+    registerAnimatedPropertiesForSVGPathElement();
 }
 
 PassRefPtr<SVGPathElement> SVGPathElement::create(const QualifiedName& tagName, Document* document)
@@ -238,7 +261,7 @@ void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName)
     RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
 
     if (attrName == SVGNames::dAttr) {
-        if (m_animatablePathSegList) {
+        if (SVGAnimatedProperty::lookupWrapper<SVGAnimatedPathSegListPropertyTearOff>(this, dPropertyInfo())) {
             SVGPathSegList newList(PathSegUnalteredRole);
             SVGPathParserFactory* factory = SVGPathParserFactory::self();
             factory->buildSVGPathSegListFromByteStream(m_pathByteStream.get(), this, newList, UnalteredParsing);
@@ -253,80 +276,32 @@ void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName)
         RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
 }
 
-void SVGPathElement::synchronizeProperty(const QualifiedName& attrName)
+PassRefPtr<SVGAnimatedProperty> SVGPathElement::lookupOrCreateDWrapper(void* contextElement)
 {
-    if (attrName == anyQName()) {
-        synchronizeD();
-        synchronizePathLength();
-        synchronizeExternalResourcesRequired();
-        SVGTests::synchronizeProperties(this, attrName);
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
+    ASSERT(contextElement);
+    SVGPathElement* ownerType = static_cast<SVGPathElement*>(contextElement);
 
-    if (!isSupportedAttribute(attrName)) {
-        SVGStyledTransformableElement::synchronizeProperty(attrName);
-        return;
-    }
-
-    if (attrName == SVGNames::dAttr) {
-        synchronizeD();
-        return;
-    }
-
-    if (attrName == SVGNames::pathLengthAttr) {
-        synchronizePathLength();
-        return;
-    }
-
-    if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        synchronizeExternalResourcesRequired();
-        return;
-    }
-
-    if (SVGTests::isKnownAttribute(attrName)) {
-        SVGTests::synchronizeProperties(this, attrName);
-        return;
-    }
+    SVGPathParserFactory* factory = SVGPathParserFactory::self();
+    factory->buildSVGPathSegListFromByteStream(ownerType->m_pathByteStream.get(), ownerType, ownerType->m_pathSegList.value, UnalteredParsing);
 
-    ASSERT_NOT_REACHED();
+    return SVGAnimatedProperty::lookupOrCreateWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff, SVGPathSegList, true>
+           (ownerType, dPropertyInfo(), ownerType->m_pathSegList.value);
 }
 
-void SVGPathElement::synchronizeD()
+void SVGPathElement::synchronizeD(void* contextElement)
 {
-    if (!m_pathSegList.shouldSynchronize)
+    ASSERT(contextElement);
+    SVGPathElement* ownerType = static_cast<SVGPathElement*>(contextElement);
+    if (!ownerType->m_pathSegList.shouldSynchronize)
         return;
-
-    SVGAnimatedPropertySynchronizer<true>::synchronize(this, SVGNames::dAttr, m_pathSegList.value.valueAsString());
-}
-
-AttributeToPropertyTypeMap& SVGPathElement::attributeToPropertyTypeMap()
-{
-    DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
-    return s_attributeToPropertyTypeMap;
-}
-
-void SVGPathElement::fillAttributeToPropertyTypeMap()
-{
-    AttributeToPropertyTypeMap& attributeToPropertyTypeMap = this->attributeToPropertyTypeMap();
-
-    SVGStyledTransformableElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap);
-    attributeToPropertyTypeMap.set(SVGNames::dAttr, AnimatedPath);
-    attributeToPropertyTypeMap.set(SVGNames::pathLengthAttr, AnimatedNumber);
+    SVGAnimatedPropertySynchronizer<true>::synchronize(ownerType, dPropertyInfo()->attributeName, ownerType->m_pathSegList.value.valueAsString());
 }
 
 SVGPathSegListPropertyTearOff* SVGPathElement::pathSegList()
 {
-    if (!m_animatablePathSegList) {
-        m_pathSegList.shouldSynchronize = true;
-
-        SVGPathParserFactory* factory = SVGPathParserFactory::self();
-        factory->buildSVGPathSegListFromByteStream(m_pathByteStream.get(), this, m_pathSegList.value, UnalteredParsing);
-
-        m_animatablePathSegList = SVGAnimatedProperty::lookupOrCreateWrapper<SVGAnimatedPathSegListPropertyTearOff, SVGPathSegList>
-                                 (this, SVGNames::dAttr, SVGNames::dAttr.localName(), m_pathSegList.value);
-    }
-
+    m_pathSegList.shouldSynchronize = true;
+    if (!m_animatablePathSegList)
+        m_animatablePathSegList = static_pointer_cast<SVGAnimatedPathSegListPropertyTearOff>(lookupOrCreateDWrapper(this));
     return static_cast<SVGPathSegListPropertyTearOff*>(m_animatablePathSegList->baseVal(PathSegUnalteredRole));
 }
 
@@ -338,16 +313,9 @@ SVGPathSegListPropertyTearOff* SVGPathElement::normalizedPathSegList()
 
 SVGPathSegListPropertyTearOff* SVGPathElement::animatedPathSegList()
 {
-    if (!m_animatablePathSegList) {
-        m_pathSegList.shouldSynchronize = true;
-
-        SVGPathParserFactory* factory = SVGPathParserFactory::self();
-        factory->buildSVGPathSegListFromByteStream(m_pathByteStream.get(), this, m_pathSegList.value, UnalteredParsing);
-
-        m_animatablePathSegList = SVGAnimatedProperty::lookupOrCreateWrapper<SVGAnimatedPathSegListPropertyTearOff, SVGPathSegList>
-                                 (this, SVGNames::dAttr, SVGNames::dAttr.localName(), m_pathSegList.value);
-    }
-
+    m_pathSegList.shouldSynchronize = true;
+    if (!m_animatablePathSegList)
+        m_animatablePathSegList = static_pointer_cast<SVGAnimatedPathSegListPropertyTearOff>(lookupOrCreateDWrapper(this));
     return static_cast<SVGPathSegListPropertyTearOff*>(m_animatablePathSegList->animVal(PathSegUnalteredRole));
 }
 
index f6b0f35..1d37d0e 100644 (file)
@@ -91,11 +91,12 @@ public:
     SVGPathSegListPropertyTearOff* animatedNormalizedPathSegList();
 
     SVGPathByteStream* pathByteStream() const { return m_pathByteStream.get(); }
-    SVGAnimatedProperty* animatablePathSegList() const { return m_animatablePathSegList.get(); }
 
     virtual void toPathData(Path&) const;
     void pathSegListChanged(SVGPathSegRole);
 
+    static const SVGPropertyInfo* dPropertyInfo();
+
 private:
     SVGPathElement(const QualifiedName&, Document*);
 
@@ -104,21 +105,24 @@ private:
 
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseMappedAttribute(Attribute*);
-    virtual void synchronizeProperty(const QualifiedName&);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void fillAttributeToPropertyTypeMap();
-    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     virtual bool supportsMarkers() const { return true; }
 
-    // Animated property declarations
-    DECLARE_ANIMATED_NUMBER(PathLength, pathLength)
+    // Custom 'd' property
+    static void synchronizeD(void* contextElement);
+    static PassRefPtr<SVGAnimatedProperty> lookupOrCreateDWrapper(void* contextElement);
 
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPathElement)
+        DECLARE_ANIMATED_NUMBER(PathLength, pathLength)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    END_DECLARE_ANIMATED_PROPERTIES
 
-    void synchronizeD();
+    // SVGTests
+    virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
+    virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
+    virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
 
-protected:
+private:
     OwnPtr<SVGPathByteStream> m_pathByteStream;
     mutable SVGSynchronizableAnimatedProperty<SVGPathSegList> m_pathSegList;
     RefPtr<SVGAnimatedPathSegListPropertyTearOff> m_animatablePathSegList;
index 97d8df1..421ca64 100644 (file)
@@ -39,7 +39,7 @@ public:
         case PathSegUndefinedRole:
             return 0;
         case PathSegUnalteredRole:
-            return m_element->animatablePathSegList();
+            return SVGAnimatedProperty::lookupWrapper<SVGAnimatedPathSegListPropertyTearOff>(m_element.get(), SVGPathElement::dPropertyInfo());
         case PathSegNormalizedRole:
             // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists!
             return 0;
index a58b30f..6707256 100644 (file)
@@ -55,6 +55,22 @@ DEFINE_ANIMATED_BOOLEAN(SVGPatternElement, SVGNames::externalResourcesRequiredAt
 DEFINE_ANIMATED_RECT(SVGPatternElement, SVGNames::viewBoxAttr, ViewBox, viewBox)
 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGPatternElement, SVGNames::preserveAspectRatioAttr, PreserveAspectRatio, preserveAspectRatio) 
 
+BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPatternElement)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(x)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(y)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(width)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(height)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(patternUnits)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(patternContentUnits)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(patternTransform)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(href)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox)
+    REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) 
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
+    REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+END_REGISTER_ANIMATED_PROPERTIES
+
 inline SVGPatternElement::SVGPatternElement(const QualifiedName& tagName, Document* document)
     : SVGStyledElement(tagName, document)
     , m_x(LengthModeWidth)
@@ -65,6 +81,7 @@ inline SVGPatternElement::SVGPatternElement(const QualifiedName& tagName, Docume
     , m_patternContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
 {
     ASSERT(hasTagName(SVGNames::patternTag));
+    registerAnimatedPropertiesForSVGPatternElement();
 }
 
 PassRefPtr<SVGPatt