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

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

Issue 1715513002: Move background related shorthands into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase test Created 4 years, 10 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 51b57acc58112a500006a6602df1a74ad91874fd..5da06f170947e9b2028d6e8e8680b4f33ee6df74 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -655,7 +655,7 @@ StyleMotionRotation StyleBuilderConverter::convertMotionRotation(const CSSValue&
}
template <CSSValueID cssValueFor0, CSSValueID cssValueFor100>
-static Length convertPositionLength(StyleResolverState& state, const CSSValue& value)
+Length StyleBuilderConverter::convertPositionLength(StyleResolverState& state, const CSSValue& value)
{
if (value.isValuePair()) {
const CSSValuePair& pair = toCSSValuePair(value);
@@ -706,25 +706,6 @@ float StyleBuilderConverter::convertPerspective(StyleResolverState& state, const
return convertPerspectiveLength(state, primitiveValue);
}
-template <CSSValueID cssValueFor0, CSSValueID cssValueFor100>
-static Length convertOriginLength(StyleResolverState& state, const CSSPrimitiveValue& primitiveValue)
-{
- if (primitiveValue.isValueID()) {
- switch (primitiveValue.getValueID()) {
- case cssValueFor0:
- return Length(0, Percent);
- case cssValueFor100:
- return Length(100, Percent);
- case CSSValueCenter:
- return Length(50, Percent);
- default:
- ASSERT_NOT_REACHED();
- }
- }
-
- return StyleBuilderConverter::convertLength(state, primitiveValue);
-}
-
EPaintOrder StyleBuilderConverter::convertPaintOrder(StyleResolverState&, const CSSValue& cssPaintOrder)
{
if (cssPaintOrder.isValueList()) {
@@ -882,8 +863,8 @@ TransformOrigin StyleBuilderConverter::convertTransformOrigin(StyleResolverState
const CSSPrimitiveValue& primitiveValueZ = toCSSPrimitiveValue(*list.item(2));
return TransformOrigin(
- convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX),
- convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY),
+ convertPositionLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX),
+ convertPositionLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY),
StyleBuilderConverter::convertComputedLength<float>(state, primitiveValueZ)
);
}

Powered by Google App Engine
This is Rietveld 408576698