Index: third_party/WebKit/Source/core/css/cssom/SimpleLength.cpp |
diff --git a/third_party/WebKit/Source/core/css/cssom/SimpleLength.cpp b/third_party/WebKit/Source/core/css/cssom/SimpleLength.cpp |
index 49fa4bcd97501ae14bba4609fbd8ad61768d9951..422ff07ad903cc15047f04deff848625b13c9f58 100644 |
--- a/third_party/WebKit/Source/core/css/cssom/SimpleLength.cpp |
+++ b/third_party/WebKit/Source/core/css/cssom/SimpleLength.cpp |
@@ -10,9 +10,18 @@ |
namespace blink { |
+String SimpleLength::cssString() const |
+{ |
+ StringBuilder s; |
+ s.appendNumber(m_value); |
+ s.append(unit()); |
+ return s.toString(); |
+} |
+ |
PassRefPtrWillBeRawPtr<CSSValue> SimpleLength::toCSSValue() const |
{ |
- return cssValuePool().createValue(m_value, LengthValue::lengthTypeToPrimitiveType(m_unit)); |
+ // TODO: Don't re-parse the unit. |
+ return cssValuePool().createValue(m_value, CSSPrimitiveValue::fromName(unit())); |
} |
LengthValue* SimpleLength::addInternal(const LengthValue* other, ExceptionState& exceptionState) |