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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 2354463002: CSS Properties and Values API: Implement computation / computational independence (Closed)
Patch Set: test Created 4 years, 3 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/resolver/StyleBuilderConverter.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
index 1bc0a649f87fa512c378d544cfd6871b4eb3d722..a3156a8baf3764c0670be10540ace3ac32d1a1b2 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -1103,7 +1103,21 @@ PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat
const CSSValue& StyleBuilderConverter::convertRegisteredPropertyValue(const StyleResolverState& state, const CSSValue& value)
{
- // TODO(timloh): Resolve ems, etc.
+ // TODO(timloh): Images and transform-function values can also contain lengths.
+ if (value.isValueList()) {
+ CSSValueList* newList = CSSValueList::createSpaceSeparated();
+ for (const CSSValue* innerValue : toCSSValueList(value))
+ newList->append(convertRegisteredPropertyValue(state, *innerValue));
+ return *newList;
+ }
+
+ if (value.isPrimitiveValue()) {
+ const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value);
+ if (primitiveValue.isCalculated() || CSSPrimitiveValue::isRelativeUnit(primitiveValue.typeWithCalcResolved())) {
+ Length length = primitiveValue.convertToLength(state.cssToLengthConversionData().copyWithAdjustedZoom(1));
sashab 2016/09/22 00:29:22 I think we should really use the actual zoom here.
Timothy Loh 2016/09/22 02:42:48 I'm not sure what you're getting at here. If I spe
sashab 2016/09/22 06:02:35 Ok, add this comment then :)
alancutter (OOO until 2018) 2016/09/22 07:58:41 Agreed, at the very least add the comment. I think
Timothy Loh 2016/09/22 08:18:58 Comment added. Probably negligible, but I prefer i
+ return *CSSPrimitiveValue::create(length, 1);
+ }
+ }
return value;
}

Powered by Google App Engine
This is Rietveld 408576698