diff options
author | Ben Murdoch <benm@google.com> | 2011-05-05 14:36:32 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-10 15:38:30 +0100 |
commit | f05b935882198ccf7d81675736e3aeb089c5113a (patch) | |
tree | 4ea0ca838d9ef1b15cf17ddb3928efb427c7e5a1 /WebCore/page/animation/AnimationBase.cpp | |
parent | 60fbdcc62bced8db2cb1fd233cc4d1e4ea17db1b (diff) | |
download | external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.zip external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.gz external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.bz2 |
Merge WebKit at r74534: Initial merge by git.
Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb
Diffstat (limited to 'WebCore/page/animation/AnimationBase.cpp')
-rw-r--r-- | WebCore/page/animation/AnimationBase.cpp | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/WebCore/page/animation/AnimationBase.cpp b/WebCore/page/animation/AnimationBase.cpp index 66172f7..1ba39d9 100644 --- a/WebCore/page/animation/AnimationBase.cpp +++ b/WebCore/page/animation/AnimationBase.cpp @@ -357,15 +357,19 @@ public: ShadowData defaultShadowData(0, 0, 0, 0, Normal, Color::transparent); ShadowData* newShadowData = 0; + ShadowData* lastShadow = 0; while (shadowA || shadowB) { const ShadowData* srcShadow = shadowA ? shadowA : &defaultShadowData; const ShadowData* dstShadow = shadowB ? shadowB : &defaultShadowData; - if (!newShadowData) - newShadowData = blendFunc(anim, srcShadow, dstShadow, progress); + ShadowData* blendedShadow = blendFunc(anim, srcShadow, dstShadow, progress); + if (!lastShadow) + newShadowData = blendedShadow; else - newShadowData->setNext(blendFunc(anim, srcShadow, dstShadow, progress)); + lastShadow->setNext(blendedShadow); + + lastShadow = blendedShadow; shadowA = shadowA ? shadowA->next() : 0; shadowB = shadowB ? shadowB->next() : 0; @@ -574,6 +578,8 @@ public: (*it)->blend(anim, dst, a, b, progress); } + const Vector<PropertyWrapperBase*> propertyWrappers() const { return m_propertyWrappers; } + private: Vector<PropertyWrapperBase*> m_propertyWrappers; }; @@ -731,7 +737,8 @@ static void addShorthandProperties() CSSPropertyWebkitMask, // for mask-position CSSPropertyWebkitMaskPosition, CSSPropertyBorderTop, CSSPropertyBorderRight, CSSPropertyBorderBottom, CSSPropertyBorderLeft, - CSSPropertyBorderColor, + CSSPropertyBorderColor, + CSSPropertyBorderRadius, CSSPropertyBorderWidth, CSSPropertyBorder, CSSPropertyBorderSpacing, @@ -862,6 +869,39 @@ bool AnimationBase::animationOfPropertyIsAccelerated(int prop) } #endif +static bool gatherEnclosingShorthandProperties(int property, PropertyWrapperBase* wrapper, HashSet<int>& propertySet) +{ + if (!wrapper->isShorthandWrapper()) + return false; + + ShorthandPropertyWrapper* shorthandWrapper = static_cast<ShorthandPropertyWrapper*>(wrapper); + + bool contained = false; + for (size_t i = 0; i < shorthandWrapper->propertyWrappers().size(); ++i) { + PropertyWrapperBase* currWrapper = shorthandWrapper->propertyWrappers()[i]; + + if (gatherEnclosingShorthandProperties(property, currWrapper, propertySet) || currWrapper->property() == property) + contained = true; + } + + if (contained) + propertySet.add(wrapper->property()); + + return contained; +} + +// Note: this is inefficient. It's only called from pauseTransitionAtTime(). +HashSet<int> AnimationBase::animatableShorthandsAffectingProperty(int property) +{ + ensurePropertyMap(); + + HashSet<int> foundProperties; + for (int i = 0; i < getNumProperties(); ++i) + gatherEnclosingShorthandProperties(property, (*gPropertyWrappers)[i], foundProperties); + + return foundProperties; +} + void AnimationBase::setNeedsStyleRecalc(Node* node) { ASSERT(!node || (node->document() && !node->document()->inPageCache())); |