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

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

Issue 878863002: Animation: Add CSSPropertyClip and CSSPropertyBorderImageSlice to StringKeyframe (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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/LengthBoxStyleInterpolation.h
diff --git a/Source/core/animation/LengthBoxStyleInterpolation.h b/Source/core/animation/LengthBoxStyleInterpolation.h
index 1542dda42dce5f69c30f407eafbc0ce4b024e7c4..ff22f91738b913c0c9c62898c2c5b4624034beac 100644
--- a/Source/core/animation/LengthBoxStyleInterpolation.h
+++ b/Source/core/animation/LengthBoxStyleInterpolation.h
@@ -12,20 +12,20 @@ namespace blink {
class LengthBoxStyleInterpolation : public StyleInterpolation {
public:
- static PassRefPtrWillBeRawPtr<LengthBoxStyleInterpolation> create(const CSSValue& start, const CSSValue& end, CSSPropertyID id)
+ static PassRefPtrWillBeRawPtr<LengthBoxStyleInterpolation> maybeCreateFrom(const CSSValue& start, const CSSValue& end, CSSPropertyID id)
{
- return adoptRefWillBeNoop(new LengthBoxStyleInterpolation(lengthBoxtoInterpolableValue(start), lengthBoxtoInterpolableValue(end), id, false));
+ if (start.isPrimitiveValue() && toCSSPrimitiveValue(start).isRect()
+ && end.isPrimitiveValue() && toCSSPrimitiveValue(end).isRect())
+ return adoptRefWillBeNoop(new LengthBoxStyleInterpolation(lengthBoxtoInterpolableValue(start), lengthBoxtoInterpolableValue(end), id, false));
+
+ if (start.isBorderImageSliceValue() && toCSSBorderImageSliceValue(start).slices()
+ && end.isBorderImageSliceValue() && toCSSBorderImageSliceValue(end).slices()
+ && toCSSBorderImageSliceValue(start).m_fill == toCSSBorderImageSliceValue(end).m_fill)
+ return adoptRefWillBeNoop(new LengthBoxStyleInterpolation(borderImageSlicetoInterpolableValue(start), borderImageSlicetoInterpolableValue(end), id, toCSSBorderImageSliceValue(start).m_fill));
+ return nullptr;
}
- static PassRefPtrWillBeRawPtr<LengthBoxStyleInterpolation> createFromBorderImageSlice(CSSValue& start, CSSValue& end, CSSPropertyID id)
- {
- return adoptRefWillBeNoop(new LengthBoxStyleInterpolation(borderImageSlicetoInterpolableValue(start), borderImageSlicetoInterpolableValue(end), id, toCSSBorderImageSliceValue(start).m_fill));
- }
-
- static bool canCreateFrom(const CSSValue&);
-
- static bool matchingFill(CSSValue&, CSSValue&);
- static bool canCreateFromBorderImageSlice(CSSValue&);
+ static bool isAutoValue(const CSSValue&);
virtual void apply(StyleResolverState&) const override;
virtual void trace(Visitor*) override;
@@ -37,8 +37,8 @@ private:
{ }
static PassOwnPtrWillBeRawPtr<InterpolableValue> lengthBoxtoInterpolableValue(const CSSValue&);
- static PassOwnPtrWillBeRawPtr<InterpolableValue> borderImageSlicetoInterpolableValue(CSSValue&);
- static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToLengthBox(InterpolableValue*, InterpolationRange = RangeAll);
+ static PassOwnPtrWillBeRawPtr<InterpolableValue> borderImageSlicetoInterpolableValue(const CSSValue&);
+ static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToLengthBox(InterpolableValue*);
static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToBorderImageSlice(InterpolableValue*, bool);
bool m_fill;

Powered by Google App Engine
This is Rietveld 408576698