Chromium Code Reviews| Index: third_party/WebKit/Source/core/svg/SVGPath.h |
| diff --git a/third_party/WebKit/Source/core/svg/SVGNumberList.h b/third_party/WebKit/Source/core/svg/SVGPath.h |
| similarity index 68% |
| copy from third_party/WebKit/Source/core/svg/SVGNumberList.h |
| copy to third_party/WebKit/Source/core/svg/SVGPath.h |
| index 1bb4b4a1125208681dfe2cd7feaaf5d759c514e3..b0a3ff39171c4c1237caceef9e546883a882842d 100644 |
| --- a/third_party/WebKit/Source/core/svg/SVGNumberList.h |
| +++ b/third_party/WebKit/Source/core/svg/SVGPath.h |
| @@ -28,48 +28,55 @@ |
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| -#ifndef SVGNumberList_h |
| -#define SVGNumberList_h |
| +#ifndef SVGPath_h |
| +#define SVGPath_h |
| -#include "bindings/core/v8/ScriptWrappable.h" |
| -#include "core/svg/SVGNumber.h" |
| -#include "core/svg/properties/SVGListPropertyHelper.h" |
| +#include "core/svg/properties/SVGAnimatedProperty.h" |
| namespace blink { |
| -class SVGNumberListTearOff; |
| +class SVGPathByteStream; |
| -class SVGNumberList final : public SVGListPropertyHelper<SVGNumberList, SVGNumber> { |
| +class SVGPath : public SVGPropertyBase { |
| public: |
| - typedef SVGNumberListTearOff TearOffType; |
| + typedef void TearOffType; |
|
pdr.
2015/10/23 04:40:55
Is this needed?
fs
2015/10/23 09:12:33
Not required, but the alternative would be to have
|
| - static PassRefPtrWillBeRawPtr<SVGNumberList> create() |
| + static PassRefPtrWillBeRawPtr<SVGPath> create() |
| { |
| - return adoptRefWillBeNoop(new SVGNumberList()); |
| + return adoptRefWillBeNoop(new SVGPath()); |
| } |
| - ~SVGNumberList() override; |
| + ~SVGPath() override; |
| - void setValueAsString(const String&, ExceptionState&); |
| + const SVGPathByteStream& byteStream() const; |
| + SVGPathByteStream& mutableByteStream(); |
| // SVGPropertyBase: |
| + PassRefPtrWillBeRawPtr<SVGPath> clone() const; |
| + PassRefPtrWillBeRawPtr<SVGPropertyBase> cloneForAnimation(const String&) const override; |
| String valueAsString() const override; |
| + void setValueAsString(const String&, ExceptionState&); |
| void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; |
| void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> fromValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGElement*) override; |
| float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGElement*) override; |
| - static AnimatedPropertyType classType() { return AnimatedNumberList; } |
| - |
| - Vector<float> toFloatVector() const; |
| + static AnimatedPropertyType classType() { return AnimatedPath; } |
| private: |
| - SVGNumberList(); |
| + SVGPath(); |
| + explicit SVGPath(PassOwnPtr<SVGPathByteStream>); |
| - template <typename CharType> |
| - bool parse(const CharType*& ptr, const CharType* end); |
| + mutable OwnPtr<SVGPathByteStream> m_byteStream; |
|
pdr.
2015/10/23 04:40:55
Does this need to be mutable?
fs
2015/10/23 09:12:33
Should cancel out with the const_cast, so no. Drop
|
| }; |
| +inline PassRefPtrWillBeRawPtr<SVGPath> toSVGPath(PassRefPtrWillBeRawPtr<SVGPropertyBase> passBase) |
| +{ |
| + RefPtrWillBeRawPtr<SVGPropertyBase> base = passBase; |
| + ASSERT(base->type() == SVGPath::classType()); |
| + return static_pointer_cast<SVGPath>(base.release()); |
| +} |
| + |
| } // namespace blink |
| -#endif // SVGNumberList_h |
| +#endif |