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

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

Issue 2371673002: [CSS Typed OM] Implement support for CSSValue -> CSSCalcLength (Closed)
Patch Set: sync Created 3 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
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSLengthValue.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp b/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp
index 065656944d8ea8ce30a1f4482fee828e663e099a..e42c5e63ba43535721543535604831720457fa43 100644
--- a/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp
@@ -6,8 +6,10 @@
#include "core/css/CSSImageValue.h"
#include "core/css/CSSValue.h"
+#include "core/css/cssom/CSSCalcLength.h"
#include "core/css/cssom/CSSKeywordValue.h"
#include "core/css/cssom/CSSNumberValue.h"
+#include "core/css/cssom/CSSOMTypes.h"
#include "core/css/cssom/CSSSimpleLength.h"
#include "core/css/cssom/CSSStyleValue.h"
#include "core/css/cssom/CSSStyleVariableReferenceValue.h"
@@ -38,6 +40,13 @@ CSSStyleValue* createStyleValueWithPropertyInternal(CSSPropertyID propertyID,
// TODO(meade): Implement other properties.
break;
}
+ if (value.isPrimitiveValue() && toCSSPrimitiveValue(value).isCalculated()) {
+ // TODO(meade): Handle other calculated types, e.g. angles here.
+ if (CSSOMTypes::propertyCanTakeType(propertyID,
+ CSSStyleValue::CalcLengthType)) {
+ return CSSCalcLength::fromCSSValue(toCSSPrimitiveValue(value));
+ }
+ }
return nullptr;
}
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSLengthValue.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698