Index: Source/core/css/CSSParser-in.cpp |
diff --git a/Source/core/css/CSSParser-in.cpp b/Source/core/css/CSSParser-in.cpp |
index 368a1f8000f4bed956ab5a58a89864db2feac8ae..5074ae5f38914e72ddb8a673c0203a78124e9c63 100644 |
--- a/Source/core/css/CSSParser-in.cpp |
+++ b/Source/core/css/CSSParser-in.cpp |
@@ -145,9 +145,9 @@ static bool hasPrefix(const char* string, unsigned length, const char* prefix) |
return false; |
} |
-static PassRefPtr<CSSPrimitiveValue> createPrimitiveValuePair(PassRefPtr<CSSPrimitiveValue> first, PassRefPtr<CSSPrimitiveValue> second) |
+static PassRefPtr<CSSPrimitiveValue> createPrimitiveValuePair(PassRefPtr<CSSPrimitiveValue> first, PassRefPtr<CSSPrimitiveValue> second, Pair::IdenticalValuesPolicy identicalValuesPolicy = Pair::DropIdenticalValues) |
{ |
- return cssValuePool().createValue(Pair::create(first, second)); |
+ return cssValuePool().createValue(Pair::create(first, second, identicalValuesPolicy)); |
} |
class AnimationParseContext { |
@@ -2005,6 +2005,8 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important) |
m_implicitShorthand = false; |
return result; |
} |
+ case CSSPropertyObjectPosition: |
+ return RuntimeEnabledFeatures::objectFitPositionEnabled() && parseObjectPosition(important); |
case CSSPropertyListStyleImage: // <uri> | none | inherit |
case CSSPropertyBorderImageSource: |
case CSSPropertyWebkitMaskBoxImageSource: |
@@ -6631,6 +6633,20 @@ bool CSSParser::parseFlex(CSSParserValueList* args, bool important) |
return true; |
} |
+bool CSSParser::parseObjectPosition(bool important) |
+{ |
+ RefPtr<CSSValue> xValue; |
+ RefPtr<CSSValue> yValue; |
+ parseFillPosition(m_valueList.get(), xValue, yValue); |
+ if (!xValue || !yValue) |
+ return false; |
+ addProperty( |
+ CSSPropertyObjectPosition, |
+ createPrimitiveValuePair(toCSSPrimitiveValue(xValue.get()), toCSSPrimitiveValue(yValue.get()), Pair::KeepIdenticalValues), |
+ important); |
+ return true; |
+} |
+ |
struct BorderImageParseContext { |
BorderImageParseContext() |
: m_canAdvance(false) |