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

Unified Diff: third_party/WebKit/Source/core/css/cssom/SimpleLength.cpp

Issue 1642473002: Revert "Update StyleValue.cssString() to use existing methods instead of rolling our… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make sure it compiles Created 4 years, 11 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
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)
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/SimpleLength.h ('k') | third_party/WebKit/Source/core/css/cssom/StyleCalcLength.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698