Index: Source/core/css/CSSParser-in.cpp |
diff --git a/Source/core/css/CSSParser-in.cpp b/Source/core/css/CSSParser-in.cpp |
index 7011c66b3dfa1db637a686e783cd6ffea9513e73..7be594f5ab7db1efd66b5da370801b1eff6544e3 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 { |
@@ -1973,6 +1973,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: |
@@ -6588,6 +6590,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) |