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

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

Issue 995253002: Web Animations: Split image slice interpolation out of LengthBoxStyleInterpolation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: crbug.com/466536 Created 5 years, 9 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/ImageSliceStyleInterpolation.h
diff --git a/Source/core/animation/ImageSliceStyleInterpolation.h b/Source/core/animation/ImageSliceStyleInterpolation.h
new file mode 100644
index 0000000000000000000000000000000000000000..c6ca1128a962cecc0cc3331f8ba20fb13979e549
--- /dev/null
+++ b/Source/core/animation/ImageSliceStyleInterpolation.h
@@ -0,0 +1,40 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ImageSliceStyleInterpolation_h
+#define ImageSliceStyleInterpolation_h
+
+#include "core/animation/StyleInterpolation.h"
+
+namespace blink {
+
+class CSSBorderImageSliceValue;
+
+class ImageSliceStyleInterpolation : public StyleInterpolation {
+public:
+ static bool usesDefaultInterpolation(const CSSValue&, const CSSValue&);
+ static PassRefPtrWillBeRawPtr<ImageSliceStyleInterpolation> maybeCreate(const CSSValue&, const CSSValue&, CSSPropertyID);
+
+ virtual void apply(StyleResolverState&) const override;
+ DECLARE_VIRTUAL_TRACE();
+
+ // Image slices can have either percentages or numbers: http://dev.w3.org/csswg/css-backgrounds-3/#the-border-image-slice
+ struct Metadata {
+ bool isPercentage;
+ bool fill;
+ bool operator==(const Metadata& o) const { return isPercentage == o.isPercentage && fill == o.fill; }
+ };
+
+private:
+ ImageSliceStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, PassOwnPtrWillBeRawPtr<InterpolableValue> end, CSSPropertyID property, Metadata metadata)
+ : StyleInterpolation(start, end, property)
+ , m_metadata(metadata)
+ { }
+
+ Metadata m_metadata;
+};
+
+} // namespace blink
+
+#endif // ImageSliceStyleInterpolation_h

Powered by Google App Engine
This is Rietveld 408576698