Changeset 49745 in webkit


Ignore:
Timestamp:
Oct 17, 2009 3:52:54 PM (15 years ago)
Author:
Nikolas Zimmermann
Message:

2009-10-17 Nikolas Zimmermann <nzimmermann@rim.com>

Reviewed by George Staikos.

Cleanup SVGElement code, preparing for animVal support
https://bugs.webkit.org/show_bug.cgi?id=30466

Add new SynchronizablePropertyController and move the code for SVG property <-> XML attribute synchronization
from SVGElement. This is a further preparation for animVal support, where SynchronizablePropertyController will
be used to control the start/end state of an animated property.

We're currently tracking animated properties that need synchronization, generalize this concept and use
it to track their creation (bound to certain SVG*Element classes) as well as a flag determing the need
of synchronization (no SVG DOM object wrappers, no synchronization needed).

No change in functionality, thus no tests.

  • GNUmakefile.am: Add 'SynchronizablePropertyController.cpp/h' to build
  • WebCore.gypi: Ditto.
  • WebCore.pro: Ditto.
  • WebCore.vcproj/WebCore.vcproj: Ditto.
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • svg/SVGAllInOne.cpp: Ditto.
  • svg/SVGAnimatedProperty.h: Add registerProperty() function (WebCore::::SVGAnimatedProperty): Call registerProperty() function (WebCore::::registerProperty): Add new registerProperty() function, announcing new properties to SynchronizablePropertyController.
  • svg/SVGAnimatedTemplate.h: Use propertyController() method, to access the new functions moved from SVGElement. (WebCore::lookupOrCreateWrapper):
  • svg/SVGElement.cpp: Adapt to code moving to SynchronizablePropertyController. (WebCore::SVGElement::updateAnimatedSVGAttribute):
  • svg/SVGElement.h: Move handling SVG property synchronization to SynchronizablePropertyController. (WebCore::SVGElement::propertyController): Expose reference to SynchronizablePropertyController object.
  • svg/SVGViewSpec.cpp: Reorder initialization order of contextElement, leading to possible crashes. (WebCore::SVGViewSpec::SVGViewSpec): (WebCore::SVGViewSpec::viewTarget):
  • svg/SVGViewSpec.h: Ditto. (WebCore::SVGViewSpec::contextElement):
  • svg/SynchronizablePropertyController.cpp: Added. (WebCore::SynchronizablePropertyController::SynchronizablePropertyController): (WebCore::SynchronizablePropertyController::registerProperty): (WebCore::SynchronizablePropertyController::setPropertyNeedsSynchronization): (WebCore::SynchronizablePropertyController::synchronizeProperty): (WebCore::SynchronizablePropertyController::synchronizeAllProperties): (WebCore::SynchronizablePropertyController::startAnimation): (WebCore::SynchronizablePropertyController::stopAnimation):
  • svg/SynchronizablePropertyController.h: Added. (WebCore::SynchronizableProperty::SynchronizableProperty): (WebCore::SynchronizableProperty::isHashTableDeletedValue): (WebCore::SynchronizableProperty::operator==): (WebCore::SynchronizablePropertyHash::hash): (WebCore::SynchronizablePropertyHash::equal): (WebCore::SynchronizablePropertyHashTraits::constructDeletedValue): (WebCore::SynchronizablePropertyHashTraits::isDeletedValue):
Location:
trunk/WebCore
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r49743 r49745  
     12009-10-17  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by George Staikos.
     4
     5        Cleanup SVGElement code, preparing for animVal support
     6        https://bugs.webkit.org/show_bug.cgi?id=30466
     7
     8        Add new SynchronizablePropertyController and move the code for SVG property <-> XML attribute synchronization
     9        from SVGElement. This is a further preparation for animVal support, where SynchronizablePropertyController will
     10        be used to control the start/end state of an animated property.
     11
     12        We're currently tracking animated properties that need synchronization, generalize this concept and use
     13        it to track their creation (bound to certain SVG*Element classes) as well as a flag determing the need
     14        of synchronization (no SVG DOM object wrappers, no synchronization needed).
     15
     16        No change in functionality, thus no tests.
     17
     18        * GNUmakefile.am: Add 'SynchronizablePropertyController.cpp/h' to build
     19        * WebCore.gypi: Ditto.
     20        * WebCore.pro: Ditto.
     21        * WebCore.vcproj/WebCore.vcproj: Ditto.
     22        * WebCore.xcodeproj/project.pbxproj: Ditto.
     23        * svg/SVGAllInOne.cpp: Ditto.
     24        * svg/SVGAnimatedProperty.h: Add registerProperty() function
     25        (WebCore::::SVGAnimatedProperty): Call registerProperty() function 
     26        (WebCore::::registerProperty): Add new registerProperty() function, announcing new properties to SynchronizablePropertyController.
     27        * svg/SVGAnimatedTemplate.h: Use propertyController() method, to access the new functions moved from SVGElement.
     28        (WebCore::lookupOrCreateWrapper):
     29        * svg/SVGElement.cpp: Adapt to code moving to SynchronizablePropertyController.
     30        (WebCore::SVGElement::updateAnimatedSVGAttribute):
     31        * svg/SVGElement.h: Move handling SVG property synchronization to SynchronizablePropertyController.
     32        (WebCore::SVGElement::propertyController): Expose reference to SynchronizablePropertyController object.
     33        * svg/SVGViewSpec.cpp: Reorder initialization order of contextElement, leading to possible crashes.
     34        (WebCore::SVGViewSpec::SVGViewSpec):
     35        (WebCore::SVGViewSpec::viewTarget):
     36        * svg/SVGViewSpec.h: Ditto.
     37        (WebCore::SVGViewSpec::contextElement):
     38        * svg/SynchronizablePropertyController.cpp: Added.
     39        (WebCore::SynchronizablePropertyController::SynchronizablePropertyController):
     40        (WebCore::SynchronizablePropertyController::registerProperty):
     41        (WebCore::SynchronizablePropertyController::setPropertyNeedsSynchronization):
     42        (WebCore::SynchronizablePropertyController::synchronizeProperty):
     43        (WebCore::SynchronizablePropertyController::synchronizeAllProperties):
     44        (WebCore::SynchronizablePropertyController::startAnimation):
     45        (WebCore::SynchronizablePropertyController::stopAnimation):
     46        * svg/SynchronizablePropertyController.h: Added.
     47        (WebCore::SynchronizableProperty::SynchronizableProperty):
     48        (WebCore::SynchronizableProperty::isHashTableDeletedValue):
     49        (WebCore::SynchronizableProperty::operator==):
     50        (WebCore::SynchronizablePropertyHash::hash):
     51        (WebCore::SynchronizablePropertyHash::equal):
     52        (WebCore::SynchronizablePropertyHashTraits::constructDeletedValue):
     53        (WebCore::SynchronizablePropertyHashTraits::isDeletedValue):
     54
    1552009-10-17  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
    256
  • trunk/WebCore/GNUmakefile.am

    r49739 r49745  
    31553155        WebCore/svg/SVGZoomEvent.cpp \
    31563156        WebCore/svg/SVGZoomEvent.h \
     3157        WebCore/svg/SynchronizablePropertyController.cpp \
     3158        WebCore/svg/SynchronizablePropertyController.h \
    31573159        WebCore/svg/SynchronizableTypeWrapper.h \
    31583160        WebCore/svg/animation/SMILTime.cpp \
  • trunk/WebCore/WebCore.gypi

    r49723 r49745  
    34803480            'svg/SVGZoomEvent.cpp',
    34813481            'svg/SVGZoomEvent.h',
     3482            'svg/SynchronizablePropertyController.cpp',
     3483            'svg/SynchronizablePropertyController.h',
    34823484            'svg/SynchronizableTypeWrapper.h',
    34833485            'websockets/WebSocket.cpp',
  • trunk/WebCore/WebCore.pro

    r49738 r49745  
    22542254    svg/SVGZoomAndPan.h \
    22552255    svg/SVGZoomEvent.h \
     2256    svg/SynchronizablePropertyController.h \
    22562257    wml/WMLAccessElement.h \
    22572258    wml/WMLAElement.h \
     
    30093010        svg/SVGViewSpec.cpp \
    30103011        svg/SVGZoomAndPan.cpp \
     3012        svg/SynchronizablePropertyController.cpp \
    30113013        svg/animation/SMILTime.cpp \
    30123014        svg/animation/SMILTimeContainer.cpp \
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r49723 r49745  
    3427134271                                >
    3427234272                        </File>
     34273                        <File
     34274                                RelativePath="..\svg\SynchronizablePropertyController.h"
     34275                                >
     34276                        </File>
    3427334277                        <Filter
    3427434278                                Name="animation"
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r49723 r49745  
    9191                08744BAA0EDB7D86004C9E63 /* WMLOnEventElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08744BA90EDB7D86004C9E63 /* WMLOnEventElement.cpp */; };
    9292                08744BAE0EDB7D92004C9E63 /* WMLOnEventElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08744BAD0EDB7D92004C9E63 /* WMLOnEventElement.h */; };
     93                0878B1FD10874E3F00A55097 /* SVGAnimatedProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 0878B1F910874E3F00A55097 /* SVGAnimatedProperty.h */; };
     94                0878B1FE10874E3F00A55097 /* SynchronizablePropertyController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0878B1FA10874E3F00A55097 /* SynchronizablePropertyController.cpp */; };
     95                0878B1FF10874E3F00A55097 /* SynchronizablePropertyController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0878B1FB10874E3F00A55097 /* SynchronizablePropertyController.h */; };
     96                0878B20010874E3F00A55097 /* SynchronizableTypeWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 0878B1FC10874E3F00A55097 /* SynchronizableTypeWrapper.h */; };
    9397                087FFA0F0EFF3ED3009DBD88 /* WMLInsertedLegendElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 087FFA0D0EFF3ED3009DBD88 /* WMLInsertedLegendElement.cpp */; };
    9498                087FFA100EFF3ED3009DBD88 /* WMLInsertedLegendElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 087FFA0E0EFF3ED3009DBD88 /* WMLInsertedLegendElement.h */; };
     
    52515255                08744BA90EDB7D86004C9E63 /* WMLOnEventElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLOnEventElement.cpp; sourceTree = "<group>"; };
    52525256                08744BAD0EDB7D92004C9E63 /* WMLOnEventElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLOnEventElement.h; sourceTree = "<group>"; };
     5257                0878B1F910874E3F00A55097 /* SVGAnimatedProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedProperty.h; sourceTree = "<group>"; };
     5258                0878B1FA10874E3F00A55097 /* SynchronizablePropertyController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SynchronizablePropertyController.cpp; sourceTree = "<group>"; };
     5259                0878B1FB10874E3F00A55097 /* SynchronizablePropertyController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SynchronizablePropertyController.h; sourceTree = "<group>"; };
     5260                0878B1FC10874E3F00A55097 /* SynchronizableTypeWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SynchronizableTypeWrapper.h; sourceTree = "<group>"; };
    52535261                087FFA0D0EFF3ED3009DBD88 /* WMLInsertedLegendElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLInsertedLegendElement.cpp; sourceTree = "<group>"; };
    52545262                087FFA0E0EFF3ED3009DBD88 /* WMLInsertedLegendElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLInsertedLegendElement.h; sourceTree = "<group>"; };
     
    1348513493                                B22277F30D00BF1F0071B782 /* SVGAnimatedPoints.idl */,
    1348613494                                B22277F40D00BF1F0071B782 /* SVGAnimatedPreserveAspectRatio.idl */,
     13495                                0878B1F910874E3F00A55097 /* SVGAnimatedProperty.h */,
    1348713496                                B22277F50D00BF1F0071B782 /* SVGAnimatedRect.idl */,
    1348813497                                B22277F60D00BF1F0071B782 /* SVGAnimatedString.idl */,
     
    1387313882                                B2E4EC950D00C22B00432643 /* SVGZoomEvent.h */,
    1387413883                                B2E4EC960D00C22B00432643 /* SVGZoomEvent.idl */,
     13884                                0878B1FA10874E3F00A55097 /* SynchronizablePropertyController.cpp */,
     13885                                0878B1FB10874E3F00A55097 /* SynchronizablePropertyController.h */,
     13886                                0878B1FC10874E3F00A55097 /* SynchronizableTypeWrapper.h */,
    1387513887                                B28C6A260D00C44800334AA4 /* xlinkattrs.in */,
    1387613888                        );
     
    1768817700                                B22279850D00BF220071B782 /* SVGAnimatedPathData.h in Headers */,
    1768917701                                B22279880D00BF220071B782 /* SVGAnimatedPoints.h in Headers */,
     17702                                0878B1FD10874E3F00A55097 /* SVGAnimatedProperty.h in Headers */,
    1769017703                                B222798D0D00BF220071B782 /* SVGAnimatedTemplate.h in Headers */,
    1769117704                                B22279900D00BF220071B782 /* SVGAnimateElement.h in Headers */,
     
    1786117874                                B2227AF60D00BF220071B782 /* SVGZoomAndPan.h in Headers */,
    1786217875                                B2E4EC980D00C22B00432643 /* SVGZoomEvent.h in Headers */,
     17876                                0878B1FF10874E3F00A55097 /* SynchronizablePropertyController.h in Headers */,
     17877                                0878B20010874E3F00A55097 /* SynchronizableTypeWrapper.h in Headers */,
    1786317878                                93E62D9B0985F41600E1B5E3 /* SystemTime.h in Headers */,
    1786417879                                A8CFF0510A154F09000A4234 /* TableLayout.h in Headers */,
     
    2002420039                                B2227AF50D00BF220071B782 /* SVGZoomAndPan.cpp in Sources */,
    2002520040                                B2E4EC970D00C22B00432643 /* SVGZoomEvent.cpp in Sources */,
     20041                                0878B1FE10874E3F00A55097 /* SynchronizablePropertyController.cpp in Sources */,
    2002620042                                6582A16309999D6D00BEEB6D /* SystemTimeMac.cpp in Sources */,
    2002720043                                BCE3BEC20D222B1D007E06E4 /* TagNodeList.cpp in Sources */,
  • trunk/WebCore/svg/SVGAllInOne.cpp

    r49400 r49745  
    151151#include "SVGZoomAndPan.cpp"
    152152#include "SVGZoomEvent.cpp"
     153#include "SynchronizablePropertyController.cpp"
  • trunk/WebCore/svg/SVGAnimatedProperty.h

    r49602 r49745  
    7272        virtual ~SVGAnimatedPropertyBase() { }
    7373        virtual void synchronize() const = 0;
     74        virtual void startAnimation() const = 0;
     75        virtual void stopAnimation() = 0;
    7476    };
    7577
     
    126128        PassRefPtr<TearOff> animatedTearOff() const;
    127129
     130        void registerProperty();
    128131        virtual void synchronize() const;
    129132
     
    142145
    143146        mutable SynchronizableTypeWrapper<StorableType> m_value;
     147
     148#ifndef NDEBUG
     149        bool m_registered;
     150#endif
    144151    };
    145152
     
    188195        , m_attributeIdentifier(attributeName.localName())
    189196        , m_value()
    190     {
    191         ASSERT(m_ownerType);
     197#ifndef NDEBUG
     198        , m_registered(false)
     199#endif
     200    {
     201        ASSERT(m_ownerType);
     202        registerProperty();
    192203    }
    193204
     
    200211        , m_attributeIdentifier(attributeIdentifier)
    201212        , m_value()
    202     {
    203         ASSERT(m_ownerType);
     213#ifndef NDEBUG
     214        , m_registered(false)
     215#endif
     216    {
     217        ASSERT(m_ownerType);
     218        registerProperty();
    204219    }
    205220
     
    213228        , m_attributeIdentifier(attributeName.localName())
    214229        , m_value(arg1)
    215     {
    216         ASSERT(m_ownerType);
     230#ifndef NDEBUG
     231        , m_registered(false)
     232#endif
     233    {
     234        ASSERT(m_ownerType);
     235        registerProperty();
    217236    }
    218237
     
    227246        , m_attributeIdentifier(attributeIdentifier)
    228247        , m_value(arg1)
    229     {
    230         ASSERT(m_ownerType);
     248#ifndef NDEBUG
     249        , m_registered(false)
     250#endif
     251    {
     252        ASSERT(m_ownerType);
     253        registerProperty();
    231254    }
    232255
     
    241264        , m_attributeIdentifier(attributeName.localName())
    242265        , m_value(arg1, arg2)
    243     {
    244         ASSERT(m_ownerType);
     266#ifndef NDEBUG
     267        , m_registered(false)
     268#endif
     269    {
     270        ASSERT(m_ownerType);
     271        registerProperty();
    245272    }
    246273
     
    256283        , m_attributeIdentifier(attributeIdentifier)
    257284        , m_value(arg1, arg2)
    258     {
    259         ASSERT(m_ownerType);
     285#ifndef NDEBUG
     286        , m_registered(false)
     287#endif
     288    {
     289        ASSERT(m_ownerType);
     290        registerProperty();
    260291    }
    261292
     
    271302        , m_attributeIdentifier(attributeName.localName())
    272303        , m_value(arg1, arg2, arg3)
    273     {
    274         ASSERT(m_ownerType);
     304#ifndef NDEBUG
     305        , m_registered(false)
     306#endif
     307    {
     308        ASSERT(m_ownerType);
     309        registerProperty();
    275310    }
    276311
     
    287322        , m_attributeIdentifier(attributeIdentifier)
    288323        , m_value(arg1, arg2, arg3)
    289     {
    290         ASSERT(m_ownerType);
     324#ifndef NDEBUG
     325        , m_registered(false)
     326#endif
     327    {
     328        ASSERT(m_ownerType);
     329        registerProperty();
    291330    }
    292331
     
    295334    SVGAnimatedProperty<OwnerTypeArg, AnimatedTypeArg, TagName, PropertyName>::value() const
    296335    {
     336        ASSERT(m_registered);
    297337        return m_value;
    298338    }
     
    301341    void SVGAnimatedProperty<OwnerTypeArg, AnimatedTypeArg, TagName, PropertyName>::setValue(typename SVGAnimatedProperty::DecoratedType newValue)
    302342    {
     343        ASSERT(m_registered);
    303344        m_value = newValue;
    304345        ownerElement()->setSynchronizedSVGAttributes(false);
     
    309350    SVGAnimatedProperty<OwnerTypeArg, AnimatedTypeArg, TagName, PropertyName>::baseValue() const
    310351    {
     352        ASSERT(m_registered);
    311353        const OwnerElement* ownerElement = this->ownerElement();
    312354        SVGDocumentExtensions* extensions = ownerElement->accessDocumentSVGExtensions();
     
    320362    void SVGAnimatedProperty<OwnerTypeArg, AnimatedTypeArg, TagName, PropertyName>::setBaseValue(typename SVGAnimatedProperty::DecoratedType newValue)
    321363    {
     364        ASSERT(m_registered);
    322365        const OwnerElement* ownerElement = this->ownerElement();
    323366        SVGDocumentExtensions* extensions = ownerElement->accessDocumentSVGExtensions();
     
    336379    SVGAnimatedProperty<OwnerTypeArg, AnimatedTypeArg, TagName, PropertyName>::animatedTearOff() const
    337380    {
     381        ASSERT(m_registered);
    338382        return lookupOrCreateWrapper<OwnerTypeArg, AnimatedTypeArg, TagName, PropertyName, TearOff, OwnerElement>(*this, ownerElement(), m_attributeName, m_attributeIdentifier);
    339383    }
    340384
    341385    template<typename OwnerTypeArg, typename AnimatedTypeArg, const char* TagName, const char* PropertyName>
     386    void SVGAnimatedProperty<OwnerTypeArg, AnimatedTypeArg, TagName, PropertyName>::registerProperty()
     387    {
     388        ASSERT(!m_registered);
     389        ownerElement()->propertyController().registerProperty(m_attributeName, this);
     390
     391#ifndef NDEBUG
     392        m_registered = true;
     393#endif
     394    }
     395
     396    template<typename OwnerTypeArg, typename AnimatedTypeArg, const char* TagName, const char* PropertyName>
    342397    void SVGAnimatedProperty<OwnerTypeArg, AnimatedTypeArg, TagName, PropertyName>::synchronize() const
    343398    {
     399        ASSERT(m_registered);
    344400        if (!m_value.needsSynchronization())
    345401            return;
     
    352408    void SVGAnimatedProperty<OwnerTypeArg, AnimatedTypeArg, TagName, PropertyName>::startAnimation() const
    353409    {
     410        ASSERT(m_registered);
    354411        const OwnerElement* ownerElement = this->ownerElement();
    355412        if (SVGDocumentExtensions* extensions = ownerElement->accessDocumentSVGExtensions()) {
     
    362419    void SVGAnimatedProperty<OwnerTypeArg, AnimatedTypeArg, TagName, PropertyName>::stopAnimation()
    363420    {
     421        ASSERT(m_registered);
    364422        const OwnerElement* ownerElement = this->ownerElement();
    365423        if (SVGDocumentExtensions* extensions = ownerElement->accessDocumentSVGExtensions()) {
    366424            ASSERT(extensions->hasBaseValue<DecoratedType>(ownerElement, m_attributeIdentifier));
    367425            setValue(extensions->baseValue<DecoratedType>(ownerElement, m_attributeIdentifier));
    368             extensions->removeBaseValue<AnimatedType>(ownerElement, m_attributeIdentifier);
     426            extensions->removeBaseValue<DecoratedType>(ownerElement, m_attributeIdentifier);
    369427        }
    370428    }
  • trunk/WebCore/svg/SVGAnimatedTemplate.h

    r37900 r49745  
    159159        if (!wrapper) {
    160160            wrapper = Type::create(creator, element, attrName);
    161             element->addSVGPropertySynchronizer(attrName, creator);
     161            element->propertyController().setPropertyNeedsSynchronization(attrName);
    162162            Type::wrapperCache()->set(key, wrapper.get());
    163163        }
  • trunk/WebCore/svg/SVGElement.cpp

    r49424 r49745  
    271271
    272272    if (name.isEmpty()) {
    273         invokeAllSVGPropertySynchronizers();
     273        m_propertyController.synchronizeAllProperties();
    274274        setSynchronizedSVGAttributes(true);
    275275    } else
    276         invokeSVGPropertySynchronizer(name);
     276        m_propertyController.synchronizeProperty(name);
    277277
    278278    m_synchronizingSVGAttributes = false;
  • trunk/WebCore/svg/SVGElement.h

    r49424 r49745  
    2626#include "StyledElement.h"
    2727#include "SVGAnimatedProperty.h"
     28#include "SynchronizablePropertyController.h"
    2829
    2930namespace WebCore {
     
    7879        HashSet<SVGElementInstance*> instancesForElement() const;
    7980
    80         void addSVGPropertySynchronizer(const QualifiedName& attrName, const SVGAnimatedPropertyBase& base) const
    81         {
    82             m_svgPropertyMap.set(attrName.localName(), &base);
    83         }
    84 
    8581        void setCursorElement(SVGCursorElement* cursorElement) { m_cursorElement = cursorElement; }
    8682        void setCursorImageValue(CSSCursorImageValue* cursorImageValue) { m_cursorImageValue = cursorImageValue; }
     83
     84        SynchronizablePropertyController& propertyController() const { return m_propertyController; }
    8785
    8886    protected:
     
    107105        virtual void buildPendingResource() { }
    108106
    109         // Inlined methods handling SVG property synchronization
    110         void invokeSVGPropertySynchronizer(const String& name) const
    111         {
    112             if (m_svgPropertyMap.contains(name)) {
    113                 const SVGAnimatedPropertyBase* property = m_svgPropertyMap.get(name);
    114                 ASSERT(property);
    115 
    116                 property->synchronize();
    117             }
    118         }
    119 
    120         void invokeAllSVGPropertySynchronizers() const
    121         {
    122             HashMap<String, const SVGAnimatedPropertyBase*>::const_iterator it = m_svgPropertyMap.begin();
    123             const HashMap<String, const SVGAnimatedPropertyBase*>::const_iterator end = m_svgPropertyMap.end();
    124             for (; it != end; ++it) {
    125                 const SVGAnimatedPropertyBase* property = it->second;
    126                 ASSERT(property);
    127 
    128                 property->synchronize();
    129             }
    130         }
    131 
    132107        void mapInstanceToElement(SVGElementInstance*);
    133108        void removeInstanceMapping(SVGElementInstance*);
     
    136111
    137112        ContainerNode* m_shadowParent;
    138         mutable HashMap<String, const SVGAnimatedPropertyBase*> m_svgPropertyMap;
     113        mutable SynchronizablePropertyController m_propertyController;
    139114
    140115        SVGCursorElement* m_cursorElement;
  • trunk/WebCore/svg/SVGViewSpec.cpp

    r49602 r49745  
    3535    : SVGFitToViewBox()
    3636    , SVGZoomAndPan()
     37    , m_contextElement(contextElement)
    3738    , m_viewBox(this, SVGNames::viewBoxAttr)
    3839    , m_preserveAspectRatio(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())
    3940    , m_transform(SVGTransformList::create(SVGNames::transformAttr))
    40     , m_contextElement(contextElement)
    4141{
    4242}
     
    7575SVGElement* SVGViewSpec::viewTarget() const
    7676{
    77     return static_cast<SVGElement*>(m_contextElement->ownerDocument()->getElementById(m_viewTargetString));
    78 }
    79 
    80 const SVGElement* SVGViewSpec::contextElement() const
    81 {
    82     return m_contextElement;
     77    return static_cast<SVGElement*>(m_contextElement->document()->getElementById(m_viewTargetString));
    8378}
    8479
  • trunk/WebCore/svg/SVGViewSpec.h

    r49602 r49745  
    5252        SVGElement* viewTarget() const;
    5353
    54         const SVGElement* contextElement() const;
     54        const SVGSVGElement* contextElement() const { return m_contextElement; }
    5555
    5656    private:
     57        const SVGSVGElement* m_contextElement;
     58
    5759        // SVGFitToViewBox
    5860        ANIMATED_PROPERTY_DECLARATIONS(SVGViewSpec, SVGFitToViewBoxIdentifier, SVGNames::viewBoxAttrString, FloatRect, ViewBox, viewBox)
     
    6062
    6163        mutable RefPtr<SVGTransformList> m_transform;
    62         const SVGSVGElement* m_contextElement;
    6364        String m_viewTargetString;
    6465    };
Note: See TracChangeset for help on using the changeset viewer.