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

Unified Diff: Source/core/css/resolver/CSSToStyleMap.cpp

Issue 98193002: Call convertToLength in CSSToStyleMap instead of having it inlined (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/CSSToStyleMap.cpp
diff --git a/Source/core/css/resolver/CSSToStyleMap.cpp b/Source/core/css/resolver/CSSToStyleMap.cpp
index 6ba86c128d128deb4943403c34e611e5c28daa84..c9958b743032a50b2a4c21b828a9dbc11a1cd970 100644
--- a/Source/core/css/resolver/CSSToStyleMap.cpp
+++ b/Source/core/css/resolver/CSSToStyleMap.cpp
@@ -231,17 +231,8 @@ void CSSToStyleMap::mapFillXPosition(CSSPropertyID propertyID, FillLayer* layer,
primitiveValue = pair->second();
}
- Length length;
- if (primitiveValue->isLength())
- length = primitiveValue->computeLength<Length>(cssToLengthConversionData());
- else if (primitiveValue->isPercentage())
- length = Length(primitiveValue->getDoubleValue(), Percent);
- else if (primitiveValue->isCalculatedPercentageWithLength())
- length = Length(primitiveValue->cssCalcValue()->toCalcValue(cssToLengthConversionData()));
- else if (primitiveValue->isViewportPercentageLength())
- length = primitiveValue->viewportPercentageLength();
- else
- return;
+ Length length = primitiveValue->convertToLength<FixedConversion | PercentConversion>(cssToLengthConversionData());
+ ASSERT(!length.isUndefined());
layer->setXPosition(length);
if (pair)
@@ -260,17 +251,8 @@ void CSSToStyleMap::mapFillYPosition(CSSPropertyID propertyID, FillLayer* layer,
primitiveValue = pair->second();
}
- Length length;
- if (primitiveValue->isLength())
- length = primitiveValue->computeLength<Length>(cssToLengthConversionData());
- else if (primitiveValue->isPercentage())
- length = Length(primitiveValue->getDoubleValue(), Percent);
- else if (primitiveValue->isCalculatedPercentageWithLength())
- length = Length(primitiveValue->cssCalcValue()->toCalcValue(cssToLengthConversionData()));
- else if (primitiveValue->isViewportPercentageLength())
- length = primitiveValue->viewportPercentageLength();
- else
- return;
+ Length length = primitiveValue->convertToLength<FixedConversion | PercentConversion>(cssToLengthConversionData());
+ ASSERT(!length.isUndefined());
layer->setYPosition(length);
if (pair)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698