OLD | NEW |
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 static PassRefPtrWillBeRawPtr<SVGNumber> create(float value = 0.0f) | 47 static PassRefPtrWillBeRawPtr<SVGNumber> create(float value = 0.0f) |
48 { | 48 { |
49 return adoptRefWillBeNoop(new SVGNumber(value)); | 49 return adoptRefWillBeNoop(new SVGNumber(value)); |
50 } | 50 } |
51 | 51 |
52 virtual PassRefPtrWillBeRawPtr<SVGNumber> clone() const; | 52 virtual PassRefPtrWillBeRawPtr<SVGNumber> clone() const; |
53 | 53 |
54 float value() const { return m_value; } | 54 float value() const { return m_value; } |
55 void setValue(float value) { m_value = value; } | 55 void setValue(float value) { m_value = value; } |
56 | 56 |
57 virtual String valueAsString() const override; | 57 String valueAsString() const override; |
58 virtual void setValueAsString(const String&, ExceptionState&); | 58 virtual void setValueAsString(const String&, ExceptionState&); |
59 | 59 |
60 virtual void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) overr
ide; | 60 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; |
61 virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage,
unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWi
llBeRawPtr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndO
fDurationValue, SVGElement* contextElement) override; | 61 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWillBeRawP
tr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDuratio
nValue, SVGElement* contextElement) override; |
62 virtual float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to,
SVGElement* contextElement) override; | 62 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt* contextElement) override; |
63 | 63 |
64 static AnimatedPropertyType classType() { return AnimatedNumber; } | 64 static AnimatedPropertyType classType() { return AnimatedNumber; } |
65 | 65 |
66 protected: | 66 protected: |
67 explicit SVGNumber(float); | 67 explicit SVGNumber(float); |
68 | 68 |
69 template<typename CharType> | 69 template<typename CharType> |
70 bool parse(const CharType*& ptr, const CharType* end); | 70 bool parse(const CharType*& ptr, const CharType* end); |
71 | 71 |
72 float m_value; | 72 float m_value; |
(...skipping 10 matching lines...) Expand all Loading... |
83 // This is used for <stop> "offset" | 83 // This is used for <stop> "offset" |
84 // Spec: http://www.w3.org/TR/SVG11/pservers.html#GradientStops | 84 // Spec: http://www.w3.org/TR/SVG11/pservers.html#GradientStops |
85 // offset = "<number> | <percentage>" | 85 // offset = "<number> | <percentage>" |
86 class SVGNumberAcceptPercentage final : public SVGNumber { | 86 class SVGNumberAcceptPercentage final : public SVGNumber { |
87 public: | 87 public: |
88 static PassRefPtrWillBeRawPtr<SVGNumberAcceptPercentage> create(float value
= 0) | 88 static PassRefPtrWillBeRawPtr<SVGNumberAcceptPercentage> create(float value
= 0) |
89 { | 89 { |
90 return adoptRefWillBeNoop(new SVGNumberAcceptPercentage(value)); | 90 return adoptRefWillBeNoop(new SVGNumberAcceptPercentage(value)); |
91 } | 91 } |
92 | 92 |
93 virtual PassRefPtrWillBeRawPtr<SVGNumber> clone() const override; | 93 PassRefPtrWillBeRawPtr<SVGNumber> clone() const override; |
94 virtual void setValueAsString(const String&, ExceptionState&) override; | 94 void setValueAsString(const String&, ExceptionState&) override; |
95 | 95 |
96 private: | 96 private: |
97 explicit SVGNumberAcceptPercentage(float); | 97 explicit SVGNumberAcceptPercentage(float); |
98 }; | 98 }; |
99 | 99 |
100 } // namespace blink | 100 } // namespace blink |
101 | 101 |
102 #endif // SVGNumber_h | 102 #endif // SVGNumber_h |
OLD | NEW |