From f05b935882198ccf7d81675736e3aeb089c5113a Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Thu, 5 May 2011 14:36:32 +0100 Subject: Merge WebKit at r74534: Initial merge by git. Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb --- WebCore/page/animation/AnimationBase.cpp | 48 +++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 4 deletions(-) (limited to 'WebCore/page/animation/AnimationBase.cpp') 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 propertyWrappers() const { return m_propertyWrappers; } + private: Vector 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& propertySet) +{ + if (!wrapper->isShorthandWrapper()) + return false; + + ShorthandPropertyWrapper* shorthandWrapper = static_cast(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 AnimationBase::animatableShorthandsAffectingProperty(int property) +{ + ensurePropertyMap(); + + HashSet 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())); -- cgit v1.1