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

Unified Diff: Source/core/svg/SVGNumberList.h

Issue 19263002: Get rid of special casing for SVGNumber in the bindings generator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix style issues Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/svg/SVGNumber.h ('k') | Source/core/svg/SVGNumberList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGNumberList.h
diff --git a/Source/core/svg/SVGNumberList.h b/Source/core/svg/SVGNumberList.h
index 828131fc018236ff2ce60915efe27cf3d324cf65..85c197e0f55455d06fbddbff005d54fde9623a6b 100644
--- a/Source/core/svg/SVGNumberList.h
+++ b/Source/core/svg/SVGNumberList.h
@@ -21,18 +21,28 @@
#ifndef SVGNumberList_h
#define SVGNumberList_h
+#include "core/svg/SVGNumber.h"
#include "core/svg/properties/SVGPropertyTraits.h"
#include <wtf/Vector.h>
namespace WebCore {
-class SVGNumberList : public Vector<float> {
+class SVGNumberList : public Vector<SVGNumber> {
public:
SVGNumberList() { }
void parse(const String&);
String valueAsString() const;
+ Vector<float> toFloatVector() const
+ {
+ Vector<float> result;
+ result.reserveInitialCapacity(size());
+ for (size_t i = 0; i < size(); ++i)
+ result.uncheckedAppend(at(i).value());
+ return result;
+ }
+
private:
template<typename CharType>
void parseInternal(const CharType*& ptr, const CharType* end);
@@ -40,7 +50,7 @@ private:
template<>
struct SVGPropertyTraits<SVGNumberList> {
- typedef float ListItemType;
+ typedef SVGNumber ListItemType;
static SVGNumberList initialValue() { return SVGNumberList(); }
static String toString(const SVGNumberList& type) { return type.valueAsString(); }
« no previous file with comments | « Source/core/svg/SVGNumber.h ('k') | Source/core/svg/SVGNumberList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698