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..720720ab0454a10f73fd2c94d17d0825a7b532f6 100644 |
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp |
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp |
@@ -1103,7 +1103,22 @@ 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())) { |
+ // Instead of the actual zoom, use 1 to avoid potential rounding errors |
+ Length length = primitiveValue.convertToLength(state.cssToLengthConversionData().copyWithAdjustedZoom(1)); |
+ return *CSSPrimitiveValue::create(length, 1); |
+ } |
+ } |
return value; |
} |