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

Unified Diff: Source/core/animation/AnimatableRepeatable.h

Issue 26247003: Web Animations CSS: Support animation of background-position and background-image (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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/AnimatableRepeatable.h
diff --git a/Source/core/animation/AnimatableSVGLength.h b/Source/core/animation/AnimatableRepeatable.h
similarity index 67%
copy from Source/core/animation/AnimatableSVGLength.h
copy to Source/core/animation/AnimatableRepeatable.h
index 49d7d46ad549a10619a364fcd3458fe30b2b8255..9984a82e76b6876a8f0415d6994b5738a173c3f7 100644
--- a/Source/core/animation/AnimatableSVGLength.h
+++ b/Source/core/animation/AnimatableRepeatable.h
@@ -28,50 +28,48 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef AnimatableSVGLength_h
-#define AnimatableSVGLength_h
+#ifndef AnimatableRepeatable_h
+#define AnimatableRepeatable_h
#include "core/animation/AnimatableValue.h"
-#include "core/svg/SVGLength.h"
+#include "wtf/Vector.h"
namespace WebCore {
-class AnimatableSVGLength: public AnimatableValue {
+class AnimatableRepeatable : public AnimatableValue {
Steve Block 2013/10/08 23:21:49 'Repeatable' seems like the wrong name - it should
alancutter (OOO until 2018) 2013/10/09 07:20:55 Repeatable refers to the way this value interpolat
public:
- virtual ~AnimatableSVGLength() { }
+ virtual ~AnimatableRepeatable() { }
- static PassRefPtr<AnimatableSVGLength> create(const SVGLength& length)
+ // This will consume the vector passed into it.
+ static PassRefPtr<AnimatableRepeatable> create(Vector<RefPtr<AnimatableValue> >& values)
{
- return adoptRef(new AnimatableSVGLength(length));
+ return adoptRef(new AnimatableRepeatable(values));
}
- const SVGLength& toSVGLength() const
+ const Vector<RefPtr<AnimatableValue> >& values() const { return m_values; }
+
+private:
+ AnimatableRepeatable(Vector<RefPtr<AnimatableValue> >& values)
{
- return m_length;
+ ASSERT(!values.isEmpty());
dstockwell 2013/10/08 22:57:31 why?
alancutter (OOO until 2018) 2013/10/09 07:20:55 Removed non-zero length constraint.
+ m_values.swap(values);
}
-protected:
virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
virtual PassRefPtr<AnimatableValue> addWith(const AnimatableValue*) const OVERRIDE;
-private:
- AnimatableSVGLength(const SVGLength& length)
- : m_length(length)
- {
- }
-
- virtual AnimatableType type() const { return TypeSVGLength; }
+ virtual AnimatableType type() const OVERRIDE { return TypeRepeatable; }
virtual bool equalTo(const AnimatableValue*) const OVERRIDE;
- SVGLength m_length;
+ Vector<RefPtr<AnimatableValue> > m_values;
};
-inline const AnimatableSVGLength* toAnimatableSVGLength(const AnimatableValue* value)
+inline const AnimatableRepeatable* toAnimatableRepeatable(const AnimatableValue* value)
{
- ASSERT_WITH_SECURITY_IMPLICATION(value && value->isSVGLength());
- return static_cast<const AnimatableSVGLength*>(value);
+ ASSERT_WITH_SECURITY_IMPLICATION(value && value->isRepeatable());
+ return static_cast<const AnimatableRepeatable*>(value);
}
} // namespace WebCore
-#endif // AnimatableSVGLength_h
+#endif // AnimatableRepeatable_h

Powered by Google App Engine
This is Rietveld 408576698