Index: Source/core/css/CSSParser-in.cpp |
diff --git a/Source/core/css/CSSParser-in.cpp b/Source/core/css/CSSParser-in.cpp |
index 1ff2cfe8f1ab2355d990715a8dacce611992d08e..980d111cbe4a48e9c83bfcdf7f413d3ed52aeaa7 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 { |
@@ -1990,6 +1990,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: |
@@ -6616,6 +6618,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) |