Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Unified Diff: Source/core/animation/AnimatableShadow.cpp

Issue 38823002: Web Animations CSS: Support animation of {text,box,-webkit-box}-shadow and fix blur clamping (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/animation/AnimatableShadow.cpp
diff --git a/Source/core/animation/AnimatableSVGLength.cpp b/Source/core/animation/AnimatableShadow.cpp
similarity index 64%
copy from Source/core/animation/AnimatableSVGLength.cpp
copy to Source/core/animation/AnimatableShadow.cpp
index bbf13e3f2f3f636f7e8a87377c59edf60f6fa64f..4d1a847f319b7de819d8fe25a3f461aac6b45a53 100644
--- a/Source/core/animation/AnimatableSVGLength.cpp
+++ b/Source/core/animation/AnimatableShadow.cpp
@@ -29,26 +29,27 @@
*/
#include "config.h"
-#include "core/animation/AnimatableSVGLength.h"
-
-#include "platform/FloatConversion.h"
+#include "core/animation/AnimatableShadow.h"
namespace WebCore {
-PassRefPtr<AnimatableValue> AnimatableSVGLength::interpolateTo(const AnimatableValue* value, double fraction) const
+PassRefPtr<AnimatableValue> AnimatableShadow::interpolateTo(const AnimatableValue* value, double fraction) const
{
- return create(toAnimatableSVGLength(value)->toSVGLength().blend(m_length, narrowPrecisionToFloat(fraction)));
+ const AnimatableShadow* shadowList = toAnimatableShadow(value);
+ return AnimatableShadow::create(ShadowList::blend(m_shadowList.get(), shadowList->m_shadowList.get(), fraction));
}
-PassRefPtr<AnimatableValue> AnimatableSVGLength::addWith(const AnimatableValue* value) const
+PassRefPtr<AnimatableValue> AnimatableShadow::addWith(const AnimatableValue* value) const
{
- RELEASE_ASSERT_WITH_MESSAGE(false, "Web Animations not yet implemented: AnimatableSVGLength::addWith()");
- return 0;
+ // FIXME: The spec doesn't specify anything for shadow in particular, but
+ // the default behaviour is probably not what one would expect.
+ return AnimatableValue::defaultAddWith(this, value);
}
-bool AnimatableSVGLength::equalTo(const AnimatableValue* value) const
+bool AnimatableShadow::equalTo(const AnimatableValue* value) const
{
- return m_length == toAnimatableSVGLength(value)->m_length;
+ const ShadowList* shadowList = toAnimatableShadow(value)->m_shadowList.get();
mithro-old 2013/10/24 01:04:16 Where is toAnimatableShadow implemented?
Timothy Loh 2013/10/24 03:04:54 In this macro DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(A
+ return m_shadowList == shadowList || (m_shadowList && shadowList && *m_shadowList == *shadowList);
}
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698