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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGTransformList.h

Issue 1544673003: Refactor propagation of parsing errors for SVG attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef SVGTransformList_h 31 #ifndef SVGTransformList_h
32 #define SVGTransformList_h 32 #define SVGTransformList_h
33 33
34 #include "bindings/core/v8/ScriptWrappable.h" 34 #include "core/svg/SVGParsingError.h"
35 #include "core/svg/SVGTransform.h" 35 #include "core/svg/SVGTransform.h"
36 #include "core/svg/properties/SVGListPropertyHelper.h" 36 #include "core/svg/properties/SVGListPropertyHelper.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 class SVGTransformListTearOff; 40 class SVGTransformListTearOff;
41 41
42 class SVGTransformList final : public SVGListPropertyHelper<SVGTransformList, SV GTransform> { 42 class SVGTransformList final : public SVGListPropertyHelper<SVGTransformList, SV GTransform> {
43 public: 43 public:
44 typedef SVGTransformListTearOff TearOffType; 44 typedef SVGTransformListTearOff TearOffType;
45 45
46 static PassRefPtrWillBeRawPtr<SVGTransformList> create() 46 static PassRefPtrWillBeRawPtr<SVGTransformList> create()
47 { 47 {
48 return adoptRefWillBeNoop(new SVGTransformList()); 48 return adoptRefWillBeNoop(new SVGTransformList());
49 } 49 }
50 50
51 static PassRefPtrWillBeRawPtr<SVGTransformList> create(SVGTransformType, con st String&); 51 static PassRefPtrWillBeRawPtr<SVGTransformList> create(SVGTransformType, con st String&);
52 52
53 ~SVGTransformList() override; 53 ~SVGTransformList() override;
54 54
55 PassRefPtrWillBeRawPtr<SVGTransform> consolidate(); 55 PassRefPtrWillBeRawPtr<SVGTransform> consolidate();
56 56
57 bool concatenate(AffineTransform& result) const; 57 bool concatenate(AffineTransform& result) const;
58 58
59 // SVGPropertyBase: 59 // SVGPropertyBase:
60 PassRefPtrWillBeRawPtr<SVGPropertyBase> cloneForAnimation(const String&) con st override; 60 PassRefPtrWillBeRawPtr<SVGPropertyBase> cloneForAnimation(const String&) con st override;
61 String valueAsString() const override; 61 String valueAsString() const override;
62 void setValueAsString(const String&, ExceptionState&); 62 SVGParsingError setValueAsString(const String&);
63 bool parse(const UChar*& ptr, const UChar* end); 63 bool parse(const UChar*& ptr, const UChar* end);
64 bool parse(const LChar*& ptr, const LChar* end); 64 bool parse(const LChar*& ptr, const LChar* end);
65 65
66 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; 66 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override;
67 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> fromValue, PassRefPtrWillB eRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEn dOfDurationValue, SVGElement*) override; 67 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> fromValue, PassRefPtrWillB eRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEn dOfDurationValue, SVGElement*) override;
68 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme nt*) override; 68 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme nt*) override;
69 69
70 static AnimatedPropertyType classType() { return AnimatedTransformList; } 70 static AnimatedPropertyType classType() { return AnimatedTransformList; }
71 71
72 private: 72 private:
73 SVGTransformList(); 73 SVGTransformList();
74 74
75 template <typename CharType> 75 template <typename CharType>
76 bool parseInternal(const CharType*& ptr, const CharType* end); 76 bool parseInternal(const CharType*& ptr, const CharType* end);
77 }; 77 };
78 78
79 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGTransformList); 79 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGTransformList);
80 80
81 SVGTransformType parseTransformType(const String&); 81 SVGTransformType parseTransformType(const String&);
82 82
83 } // namespace blink 83 } // namespace blink
84 84
85 #endif // SVGTransformList_h 85 #endif // SVGTransformList_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698