Encapsulate globals in CSSPropertyAnimation.cpp
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Sep 2013 20:52:13 +0000 (20:52 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Sep 2013 20:52:13 +0000 (20:52 +0000)
commitbbe49cffd07b54b9a299597927b956bda5126253
treea20c130d305b1add41b1003d9787122ea4edec03
parentaf803c2e229c6171aacfdc68fe3b8ceaa2f42f69
Encapsulate globals in CSSPropertyAnimation.cpp
https://bugs.webkit.org/show_bug.cgi?id=121205

Reviewed by Antti Koivisto.

Encapsulated the globals inside a newly added CSSPropertyAnimationWrapperMap. Also removed the circular
dependency from ShorthandPropertyWrapper's constructor to CSSPropertyAnimationWrapperMap::instance().
The circular dependency still exists in ensurePropertyMap but I'm going to remove it in the bug 121199.

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::ShorthandPropertyWrapper::ShorthandPropertyWrapper): Takes a Vector of longhand wrappers instead of
calling wrapperForProperty in the middle of constructing the very table. This circular dependency is now
encapsulated in CSSPropertyAnimationWrapperMap::ensurePropertyMap.
(WebCore::CSSPropertyAnimationWrapperMap::instance): Added.
(WebCore::CSSPropertyAnimationWrapperMap::wrapperForProperty): Renamed from WebCore::wrapperForProperty.
(WebCore::CSSPropertyAnimationWrapperMap::wrapperForIndex): Added.
(WebCore::CSSPropertyAnimationWrapperMap::size): Added.
(WebCore::CSSPropertyAnimationWrapperMap::addPropertyWrapper): Renamed from WebCore::addPropertyWrapper. Also
cleaned up boolean logics to use early exits instead of nested ifs.
(WebCore::CSSPropertyAnimationWrapperMap::addShorthandProperties): Renamed from WebCore::addShorthandProperties.
(WebCore::CSSPropertyAnimationWrapperMap::ensurePropertyMap): Renamed from WebCore::ensurePropertyMap.
Added an alias gPropertyWrappers for m_propertyWrappers; this aliasing will be removed in the bug 121199.
(WebCore::CSSPropertyAnimation::blendProperties):
(WebCore::CSSPropertyAnimation::animationOfPropertyIsAccelerated):
(WebCore::CSSPropertyAnimation::animatableShorthandsAffectingProperty):
(WebCore::CSSPropertyAnimation::propertiesEqual):
(WebCore::CSSPropertyAnimation::getPropertyAtIndex):
(WebCore::CSSPropertyAnimation::getNumProperties):
* page/animation/CSSPropertyAnimation.h:
* rendering/style/RenderStyle.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/page/animation/CSSPropertyAnimation.h
Source/WebCore/rendering/style/RenderStyle.h