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

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: use 0 instead of PassRefPtr<..>() 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
« no previous file with comments | « Source/core/animation/AnimatableShadow.h ('k') | Source/core/animation/AnimatableValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+ return m_shadowList == shadowList || (m_shadowList && shadowList && *m_shadowList == *shadowList);
}
} // namespace WebCore
« no previous file with comments | « Source/core/animation/AnimatableShadow.h ('k') | Source/core/animation/AnimatableValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698