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 25 matching lines...) Expand all Loading... |
36 #include "core/dom/ExceptionCode.h" | 36 #include "core/dom/ExceptionCode.h" |
37 #include "core/svg/SVGAnimationElement.h" | 37 #include "core/svg/SVGAnimationElement.h" |
38 #include "core/svg/SVGParserUtilities.h" | 38 #include "core/svg/SVGParserUtilities.h" |
39 #include "platform/transforms/AffineTransform.h" | 39 #include "platform/transforms/AffineTransform.h" |
40 #include "wtf/text/StringBuilder.h" | 40 #include "wtf/text/StringBuilder.h" |
41 #include "wtf/text/WTFString.h" | 41 #include "wtf/text/WTFString.h" |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
45 SVGPoint::SVGPoint() | 45 SVGPoint::SVGPoint() |
46 : NewSVGPropertyBase(classType()) | 46 : SVGPropertyBase(classType()) |
47 { | 47 { |
48 } | 48 } |
49 | 49 |
50 SVGPoint::SVGPoint(const FloatPoint& point) | 50 SVGPoint::SVGPoint(const FloatPoint& point) |
51 : NewSVGPropertyBase(classType()) | 51 : SVGPropertyBase(classType()) |
52 , m_value(point) | 52 , m_value(point) |
53 { | 53 { |
54 } | 54 } |
55 | 55 |
56 PassRefPtr<SVGPoint> SVGPoint::clone() const | 56 PassRefPtr<SVGPoint> SVGPoint::clone() const |
57 { | 57 { |
58 return SVGPoint::create(m_value); | 58 return SVGPoint::create(m_value); |
59 } | 59 } |
60 | 60 |
61 PassRefPtr<NewSVGPropertyBase> SVGPoint::cloneForAnimation(const String& value)
const | 61 PassRefPtr<SVGPropertyBase> SVGPoint::cloneForAnimation(const String& value) con
st |
62 { | 62 { |
63 RefPtr<SVGPoint> point = SVGPoint::create(); | 63 RefPtr<SVGPoint> point = SVGPoint::create(); |
64 point->setValueAsString(value, IGNORE_EXCEPTION); | 64 point->setValueAsString(value, IGNORE_EXCEPTION); |
65 return point.release(); | 65 return point.release(); |
66 } | 66 } |
67 | 67 |
68 template<typename CharType> | 68 template<typename CharType> |
69 void SVGPoint::parse(const CharType*& ptr, const CharType* end, ExceptionState&
exceptionState) | 69 void SVGPoint::parse(const CharType*& ptr, const CharType* end, ExceptionState&
exceptionState) |
70 { | 70 { |
71 const CharType* start = ptr; | 71 const CharType* start = ptr; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 String SVGPoint::valueAsString() const | 119 String SVGPoint::valueAsString() const |
120 { | 120 { |
121 StringBuilder builder; | 121 StringBuilder builder; |
122 builder.append(String::number(x())); | 122 builder.append(String::number(x())); |
123 builder.append(' '); | 123 builder.append(' '); |
124 builder.append(String::number(y())); | 124 builder.append(String::number(y())); |
125 return builder.toString(); | 125 return builder.toString(); |
126 } | 126 } |
127 | 127 |
128 void SVGPoint::add(PassRefPtr<NewSVGPropertyBase> other, SVGElement*) | 128 void SVGPoint::add(PassRefPtr<SVGPropertyBase> other, SVGElement*) |
129 { | 129 { |
130 // SVGPoint is not animated by itself | 130 // SVGPoint is not animated by itself |
131 ASSERT_NOT_REACHED(); | 131 ASSERT_NOT_REACHED(); |
132 } | 132 } |
133 | 133 |
134 void SVGPoint::calculateAnimatedValue(SVGAnimationElement* animationElement, flo
at percentage, unsigned repeatCount, PassRefPtr<NewSVGPropertyBase> fromValue, P
assRefPtr<NewSVGPropertyBase> toValue, PassRefPtr<NewSVGPropertyBase> toAtEndOfD
urationValue, SVGElement*) | 134 void SVGPoint::calculateAnimatedValue(SVGAnimationElement* animationElement, flo
at percentage, unsigned repeatCount, PassRefPtr<SVGPropertyBase> fromValue, Pass
RefPtr<SVGPropertyBase> toValue, PassRefPtr<SVGPropertyBase> toAtEndOfDurationVa
lue, SVGElement*) |
135 { | 135 { |
136 // SVGPoint is not animated by itself | 136 // SVGPoint is not animated by itself |
137 ASSERT_NOT_REACHED(); | 137 ASSERT_NOT_REACHED(); |
138 } | 138 } |
139 | 139 |
140 float SVGPoint::calculateDistance(PassRefPtr<NewSVGPropertyBase> to, SVGElement*
contextElement) | 140 float SVGPoint::calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGElement* co
ntextElement) |
141 { | 141 { |
142 // SVGPoint is not animated by itself | 142 // SVGPoint is not animated by itself |
143 ASSERT_NOT_REACHED(); | 143 ASSERT_NOT_REACHED(); |
144 return 0.0f; | 144 return 0.0f; |
145 } | 145 } |
146 | 146 |
147 } | 147 } |
OLD | NEW |