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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ImageSliceStyleInterpolation_h
6 #define ImageSliceStyleInterpolation_h
7
8 #include "core/animation/StyleInterpolation.h"
9
10 namespace blink {
11
12 class CSSBorderImageSliceValue;
13
14 class ImageSliceStyleInterpolation : public StyleInterpolation {
15 public:
16 static bool usesDefaultInterpolation(const CSSValue&, const CSSValue&);
17 static PassRefPtrWillBeRawPtr<ImageSliceStyleInterpolation> maybeCreate(cons t CSSValue&, const CSSValue&, CSSPropertyID);
18
19 virtual void apply(StyleResolverState&) const override;
20 DECLARE_VIRTUAL_TRACE();
21
22 private:
23 // Image slices can have either percentages or numbers: http://dev.w3.org/cs swg/css-backgrounds-3/#the-border-image-slice
24 struct Metadata {
25 bool isPercentage;
26 bool fill;
27 bool operator==(const Metadata& o) const { return isPercentage == o.isPe rcentage && fill == o.fill; }
28 };
29 struct PartitionResult {
30 OwnPtrWillBeRawPtr<InterpolableValue> interpolableValue;
31 Metadata metadata;
32 };
33
34 ImageSliceStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start , PassOwnPtrWillBeRawPtr<InterpolableValue> end, CSSPropertyID property, Metadat a metadata)
35 : StyleInterpolation(start, end, property)
36 , m_metadata(metadata)
37 { }
38
39 static PartitionResult partition(const CSSBorderImageSliceValue&);
40 static PassRefPtr<CSSBorderImageSliceValue> combine(const InterpolableValue& , const ImageSliceStyleInterpolation::Metadata&);
41
42 Metadata m_metadata;
43 };
44
45 } // namespace blink
46
47 #endif // ImageSliceStyleInterpolation_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698