Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
| diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
| index c13aaa1d3caca3decbb465e06aa979d474b70ad2..136e8a8837de05a693e123029200b9078dd2ae19 100644 |
| --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
| +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
| @@ -18,6 +18,7 @@ |
| #include "core/css/CSSGridAutoRepeatValue.h" |
| #include "core/css/CSSGridLineNamesValue.h" |
| #include "core/css/CSSGridTemplateAreasValue.h" |
| +#include "core/css/CSSIdentifierValue.h" |
| #include "core/css/CSSInheritedValue.h" |
| #include "core/css/CSSInitialValue.h" |
| #include "core/css/CSSPathValue.h" |
| @@ -460,7 +461,7 @@ public: |
| CSSValue* finalizeValue() |
| { |
| if (!m_result->length()) |
| - return CSSPrimitiveValue::createIdentifier(CSSValueNormal); |
| + return CSSIdentifierValue::createIdentifier(CSSValueNormal); |
| return m_result.release(); |
| } |
| @@ -487,7 +488,7 @@ static CSSValue* consumeFontVariantLigatures(CSSParserTokenRange& range) |
| return ligaturesParser.finalizeValue(); |
| } |
| -static CSSPrimitiveValue* consumeFontVariantCaps(CSSParserTokenRange& range) |
| +static CSSIdentifierValue* consumeFontVariantCaps(CSSParserTokenRange& range) |
| { |
| return consumeIdent<CSSValueNormal, CSSValueSmallCaps, CSSValueAllSmallCaps, |
| CSSValuePetiteCaps, CSSValueAllPetiteCaps, |
| @@ -556,7 +557,7 @@ public: |
| CSSValue* finalizeValue() |
| { |
| if (!m_result->length()) |
| - return CSSPrimitiveValue::createIdentifier(CSSValueNormal); |
| + return CSSIdentifierValue::createIdentifier(CSSValueNormal); |
| return m_result.release(); |
| } |
| @@ -585,7 +586,7 @@ static CSSValue* consumeFontVariantNumeric(CSSParserTokenRange& range) |
| return numericParser.finalizeValue(); |
| } |
| -static CSSPrimitiveValue* consumeFontVariantCSS21(CSSParserTokenRange& range) |
| +static CSSIdentifierValue* consumeFontVariantCSS21(CSSParserTokenRange& range) |
| { |
| return consumeIdent<CSSValueNormal, CSSValueSmallCaps>(range); |
| } |
| @@ -603,7 +604,7 @@ static CSSValue* consumeFontVariantList(CSSParserTokenRange& range) |
| return nullptr; |
| return consumeIdent(range); |
| } |
| - CSSPrimitiveValue* fontVariant = consumeFontVariantCSS21(range); |
| + CSSIdentifierValue* fontVariant = consumeFontVariantCSS21(range); |
| if (fontVariant) |
| values->append(*fontVariant); |
| } while (consumeCommaIncludingWhitespace(range)); |
| @@ -614,7 +615,7 @@ static CSSValue* consumeFontVariantList(CSSParserTokenRange& range) |
| return nullptr; |
| } |
| -static CSSPrimitiveValue* consumeFontWeight(CSSParserTokenRange& range) |
| +static CSSIdentifierValue* consumeFontWeight(CSSParserTokenRange& range) |
| { |
| const CSSParserToken& token = range.peek(); |
| if (token.id() >= CSSValueNormal && token.id() <= CSSValueLighter) |
| @@ -625,7 +626,7 @@ static CSSPrimitiveValue* consumeFontWeight(CSSParserTokenRange& range) |
| if ((weight % 100) || weight < 100 || weight > 900) |
| return nullptr; |
| range.consumeIncludingWhitespace(); |
| - return CSSPrimitiveValue::createIdentifier(static_cast<CSSValueID>(CSSValue100 + weight / 100 - 1)); |
| + return CSSIdentifierValue::createIdentifier(static_cast<CSSValueID>(CSSValue100 + weight / 100 - 1)); |
| } |
| static String concatenateFamilyName(CSSParserTokenRange& range) |
| @@ -713,7 +714,7 @@ static CSSValue* consumeFontSize(CSSParserTokenRange& range, CSSParserMode cssPa |
| return consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative, unitless); |
| } |
| -static CSSPrimitiveValue* consumeLineHeight(CSSParserTokenRange& range, CSSParserMode cssParserMode) |
| +static CSSValue* consumeLineHeight(CSSParserTokenRange& range, CSSParserMode cssParserMode) |
| { |
| if (range.peek().id() == CSSValueNormal) |
| return consumeIdent(range); |
| @@ -948,7 +949,7 @@ static CSSValue* consumeMarginOrOffset(CSSParserTokenRange& range, CSSParserMode |
| return consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, unitless); |
| } |
| -static CSSPrimitiveValue* consumeClipComponent(CSSParserTokenRange& range, CSSParserMode cssParserMode) |
| +static CSSValue* consumeClipComponent(CSSParserTokenRange& range, CSSParserMode cssParserMode) |
| { |
| if (range.peek().id() == CSSValueAuto) |
| return consumeIdent(range); |
| @@ -965,17 +966,17 @@ static CSSValue* consumeClip(CSSParserTokenRange& range, CSSParserMode cssParser |
| CSSParserTokenRange args = consumeFunction(range); |
| // rect(t, r, b, l) || rect(t r b l) |
| - CSSPrimitiveValue* top = consumeClipComponent(args, cssParserMode); |
| + CSSValue* top = consumeClipComponent(args, cssParserMode); |
| if (!top) |
| return nullptr; |
| bool needsComma = consumeCommaIncludingWhitespace(args); |
| - CSSPrimitiveValue* right = consumeClipComponent(args, cssParserMode); |
| + CSSValue* right = consumeClipComponent(args, cssParserMode); |
| if (!right || (needsComma && !consumeCommaIncludingWhitespace(args))) |
| return nullptr; |
| - CSSPrimitiveValue* bottom = consumeClipComponent(args, cssParserMode); |
| + CSSValue* bottom = consumeClipComponent(args, cssParserMode); |
| if (!bottom || (needsComma && !consumeCommaIncludingWhitespace(args))) |
| return nullptr; |
| - CSSPrimitiveValue* left = consumeClipComponent(args, cssParserMode); |
| + CSSValue* left = consumeClipComponent(args, cssParserMode); |
| if (!left || !args.atEnd()) |
| return nullptr; |
| return CSSQuadValue::create(top, right, bottom, left, CSSQuadValue::SerializeAsRect); |
| @@ -1073,7 +1074,7 @@ static CSSValue* consumeColumnSpan(CSSParserTokenRange& range) |
| static CSSValue* consumeZoom(CSSParserTokenRange& range, const CSSParserContext& context) |
| { |
| const CSSParserToken& token = range.peek(); |
| - CSSPrimitiveValue* zoom = nullptr; |
| + CSSValue* zoom = nullptr; |
| if (token.type() == IdentToken) { |
| zoom = consumeIdent<CSSValueNormal, CSSValueReset, CSSValueDocument>(range); |
| } else { |
| @@ -1083,8 +1084,8 @@ static CSSValue* consumeZoom(CSSParserTokenRange& range, const CSSParserContext& |
| } |
| if (zoom && context.useCounter()) { |
| if (!(token.id() == CSSValueNormal |
| - || (token.type() == NumberToken && zoom->getDoubleValue() == 1) |
| - || (token.type() == PercentageToken && zoom->getDoubleValue() == 100))) |
| + || (token.type() == NumberToken && toCSSPrimitiveValue(zoom)->getDoubleValue() == 1) |
| + || (token.type() == PercentageToken && toCSSPrimitiveValue(zoom)->getDoubleValue() == 100))) |
| context.useCounter()->count(UseCounter::CSSZoomNotEqualToOne); |
| if (token.id() == CSSValueReset) |
| context.useCounter()->count(UseCounter::CSSZoomReset); |
| @@ -1113,7 +1114,7 @@ static CSSValue* consumeAnimationName(CSSParserTokenRange& range, const CSSParse |
| const CSSParserToken& token = range.consumeIncludingWhitespace(); |
| if (equalIgnoringASCIICase(token.value(), "none")) |
| - return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| + return CSSIdentifierValue::createIdentifier(CSSValueNone); |
| return CSSCustomIdentValue::create(token.value().toAtomicString()); |
| } |
| @@ -1248,8 +1249,7 @@ static bool isValidAnimationPropertyList(CSSPropertyID property, const CSSValueL |
| if (property != CSSPropertyTransitionProperty || valueList.length() < 2) |
| return true; |
| for (auto& value : valueList) { |
| - if (value->isPrimitiveValue() && toCSSPrimitiveValue(*value).isValueID() |
| - && toCSSPrimitiveValue(*value).getValueID() == CSSValueNone) |
| + if (value->isIdentifierValue() && toCSSIdentifierValue(*value).getValueID() == CSSValueNone) |
| return false; |
| } |
| return true; |
| @@ -1325,7 +1325,7 @@ static CSSValue* consumeZIndex(CSSParserTokenRange& range) |
| static CSSShadowValue* parseSingleShadow(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool allowInset, bool allowSpread) |
| { |
| - CSSPrimitiveValue* style = nullptr; |
| + CSSIdentifierValue* style = nullptr; |
| CSSValue* color = nullptr; |
| if (range.atEnd()) |
| @@ -1457,7 +1457,7 @@ static CSSValue* consumeTextDecorationLine(CSSParserTokenRange& range) |
| CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| while (true) { |
| - CSSPrimitiveValue* ident = consumeIdent<CSSValueBlink, CSSValueUnderline, CSSValueOverline, CSSValueLineThrough>(range); |
| + CSSIdentifierValue* ident = consumeIdent<CSSValueBlink, CSSValueUnderline, CSSValueOverline, CSSValueLineThrough>(range); |
| if (!ident) |
| break; |
| if (list->hasValue(*ident)) |
| @@ -1483,7 +1483,7 @@ static CSSValue* consumeContain(CSSParserTokenRange& range) |
| return list; |
| } |
| while (true) { |
| - CSSPrimitiveValue* ident = consumeIdent<CSSValuePaint, CSSValueLayout, CSSValueStyle, CSSValueSize>(range); |
| + CSSIdentifierValue* ident = consumeIdent<CSSValuePaint, CSSValueLayout, CSSValueStyle, CSSValueSize>(range); |
| if (!ident) |
| break; |
| if (list->hasValue(*ident)) |
| @@ -1516,7 +1516,7 @@ static CSSValue* consumePath(CSSParserTokenRange& range) |
| range = functionRange; |
| if (byteStream->isEmpty()) |
| - return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| + return CSSIdentifierValue::createIdentifier(CSSValueNone); |
| return CSSPathValue::create(std::move(byteStream)); |
| } |
| @@ -1556,8 +1556,8 @@ static CSSValue* consumeTextEmphasisStyle(CSSParserTokenRange& range) |
| if (CSSValue* textEmphasisStyle = consumeString(range)) |
| return textEmphasisStyle; |
| - CSSPrimitiveValue* fill = consumeIdent<CSSValueFilled, CSSValueOpen>(range); |
| - CSSPrimitiveValue* shape = consumeIdent<CSSValueDot, CSSValueCircle, CSSValueDoubleCircle, CSSValueTriangle, CSSValueSesame>(range); |
| + CSSIdentifierValue* fill = consumeIdent<CSSValueFilled, CSSValueOpen>(range); |
| + CSSIdentifierValue* shape = consumeIdent<CSSValueDot, CSSValueCircle, CSSValueDoubleCircle, CSSValueTriangle, CSSValueSesame>(range); |
| if (!fill) |
| fill = consumeIdent<CSSValueFilled, CSSValueOpen>(range); |
| if (fill && shape) { |
| @@ -1581,7 +1581,7 @@ static CSSValue* consumeOutlineColor(CSSParserTokenRange& range, CSSParserMode c |
| return consumeColor(range, cssParserMode); |
| } |
| -static CSSPrimitiveValue* consumeLineWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) |
| +static CSSValue* consumeLineWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) |
| { |
| CSSValueID id = range.peek().id(); |
| if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick) |
| @@ -1589,17 +1589,17 @@ static CSSPrimitiveValue* consumeLineWidth(CSSParserTokenRange& range, CSSParser |
| return consumeLength(range, cssParserMode, ValueRangeNonNegative, unitless); |
| } |
| -static CSSPrimitiveValue* consumeBorderWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) |
| +static CSSValue* consumeBorderWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless) |
| { |
| return consumeLineWidth(range, cssParserMode, unitless); |
| } |
| -static CSSPrimitiveValue* consumeTextStrokeWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode) |
| +static CSSValue* consumeTextStrokeWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode) |
| { |
| return consumeLineWidth(range, cssParserMode, UnitlessQuirk::Forbid); |
| } |
| -static CSSPrimitiveValue* consumeColumnRuleWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode) |
| +static CSSValue* consumeColumnRuleWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode) |
| { |
| return consumeLineWidth(range, cssParserMode, UnitlessQuirk::Forbid); |
| } |
| @@ -1817,9 +1817,9 @@ static CSSValue* consumePaintOrder(CSSParserTokenRange& range) |
| return consumeIdent(range); |
| Vector<CSSValueID, 3> paintTypeList; |
| - CSSPrimitiveValue* fill = nullptr; |
| - CSSPrimitiveValue* stroke = nullptr; |
| - CSSPrimitiveValue* markers = nullptr; |
| + CSSIdentifierValue* fill = nullptr; |
| + CSSIdentifierValue* stroke = nullptr; |
| + CSSIdentifierValue* markers = nullptr; |
| do { |
| CSSValueID id = range.peek().id(); |
| if (id == CSSValueFill && !fill) |
| @@ -1892,7 +1892,7 @@ static CSSValue* consumeStrokeDasharray(CSSParserTokenRange& range) |
| return dashes; |
| } |
| -static CSSPrimitiveValue* consumeBaselineShift(CSSParserTokenRange& range) |
| +static CSSValue* consumeBaselineShift(CSSParserTokenRange& range) |
| { |
| CSSValueID id = range.peek().id(); |
| if (id == CSSValueBaseline || id == CSSValueSub || id == CSSValueSuper) |
| @@ -1900,7 +1900,7 @@ static CSSPrimitiveValue* consumeBaselineShift(CSSParserTokenRange& range) |
| return consumeLengthOrPercent(range, SVGAttributeMode, ValueRangeAll); |
| } |
| -static CSSPrimitiveValue* consumeRxOrRy(CSSParserTokenRange& range) |
| +static CSSValue* consumeRxOrRy(CSSParserTokenRange& range) |
| { |
| if (range.peek().id() == CSSValueAuto) |
| return consumeIdent(range); |
| @@ -1941,7 +1941,7 @@ static CSSValue* consumeCursor(CSSParserTokenRange& range, const CSSParserContex |
| if (id == CSSValueHand) { |
| if (!inQuirksMode) // Non-standard behavior |
| return nullptr; |
| - cursorType = CSSPrimitiveValue::createIdentifier(CSSValuePointer); |
| + cursorType = CSSIdentifierValue::createIdentifier(CSSValuePointer); |
| range.consumeIncludingWhitespace(); |
| } else if ((id >= CSSValueAuto && id <= CSSValueWebkitZoomOut) || id == CSSValueCopy || id == CSSValueNone) { |
| cursorType = consumeIdent(range); |
| @@ -1988,14 +1988,14 @@ static CSSValue* consumeCounterContent(CSSParserTokenRange args, bool counters) |
| separator = CSSStringValue::create(args.consumeIncludingWhitespace().value().toString()); |
| } |
| - CSSPrimitiveValue* listStyle = nullptr; |
| + CSSIdentifierValue* listStyle = nullptr; |
| if (consumeCommaIncludingWhitespace(args)) { |
| CSSValueID id = args.peek().id(); |
| if ((id != CSSValueNone && (id < CSSValueDisc || id > CSSValueKatakanaIroha))) |
| return nullptr; |
| listStyle = consumeIdent(args); |
| } else { |
| - listStyle = CSSPrimitiveValue::createIdentifier(CSSValueDecimal); |
| + listStyle = CSSIdentifierValue::createIdentifier(CSSValueDecimal); |
| } |
| if (!args.atEnd()) |
| @@ -2032,7 +2032,7 @@ static CSSValue* consumeContent(CSSParserTokenRange& range, CSSParserContext con |
| return values; |
| } |
| -static CSSPrimitiveValue* consumePerspective(CSSParserTokenRange& range, CSSParserMode cssParserMode, CSSPropertyID unresolvedProperty) |
| +static CSSValue* consumePerspective(CSSParserTokenRange& range, CSSParserMode cssParserMode, CSSPropertyID unresolvedProperty) |
| { |
| if (range.peek().id() == CSSValueNone) |
| return consumeIdent(range); |
| @@ -2094,15 +2094,15 @@ static CSSValue* consumeBorderRadiusCorner(CSSParserTokenRange& range, CSSParser |
| return CSSValuePair::create(parsedValue1, parsedValue2, CSSValuePair::DropIdenticalValues); |
| } |
| -static CSSPrimitiveValue* consumeVerticalAlign(CSSParserTokenRange& range, CSSParserMode cssParserMode) |
| +static CSSValue* consumeVerticalAlign(CSSParserTokenRange& range, CSSParserMode cssParserMode) |
| { |
| - CSSPrimitiveValue* parsedValue = consumeIdentRange(range, CSSValueBaseline, CSSValueWebkitBaselineMiddle); |
| + CSSValue* parsedValue = consumeIdentRange(range, CSSValueBaseline, CSSValueWebkitBaselineMiddle); |
| if (!parsedValue) |
| parsedValue = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow); |
| return parsedValue; |
| } |
| -static CSSPrimitiveValue* consumeShapeRadius(CSSParserTokenRange& args, CSSParserMode cssParserMode) |
| +static CSSValue* consumeShapeRadius(CSSParserTokenRange& args, CSSParserMode cssParserMode) |
| { |
| if (identMatches<CSSValueClosestSide, CSSValueFarthestSide>(args.peek().id())) |
| return consumeIdent(args); |
| @@ -2114,7 +2114,7 @@ static CSSBasicShapeCircleValue* consumeBasicShapeCircle(CSSParserTokenRange& ar |
| // spec: https://drafts.csswg.org/css-shapes/#supported-basic-shapes |
| // circle( [<shape-radius>]? [at <position>]? ) |
| CSSBasicShapeCircleValue* shape = CSSBasicShapeCircleValue::create(); |
| - if (CSSPrimitiveValue* radius = consumeShapeRadius(args, context.mode())) |
| + if (CSSValue* radius = consumeShapeRadius(args, context.mode())) |
| shape->setRadius(radius); |
| if (consumeIdent<CSSValueAt>(args)) { |
| CSSValue* centerX = nullptr; |
| @@ -2132,9 +2132,9 @@ static CSSBasicShapeEllipseValue* consumeBasicShapeEllipse(CSSParserTokenRange& |
| // spec: https://drafts.csswg.org/css-shapes/#supported-basic-shapes |
| // ellipse( [<shape-radius>{2}]? [at <position>]? ) |
| CSSBasicShapeEllipseValue* shape = CSSBasicShapeEllipseValue::create(); |
| - if (CSSPrimitiveValue* radiusX = consumeShapeRadius(args, context.mode())) { |
| + if (CSSValue* radiusX = consumeShapeRadius(args, context.mode())) { |
| shape->setRadiusX(radiusX); |
| - if (CSSPrimitiveValue* radiusY = consumeShapeRadius(args, context.mode())) |
| + if (CSSValue* radiusY = consumeShapeRadius(args, context.mode())) |
| shape->setRadiusY(radiusY); |
| } |
| if (consumeIdent<CSSValueAt>(args)) { |
| @@ -2169,7 +2169,7 @@ static CSSBasicShapePolygonValue* consumeBasicShapePolygon(CSSParserTokenRange& |
| return shape; |
| } |
| -static void complete4Sides(CSSPrimitiveValue* side[4]) |
| +static void complete4Sides(CSSValue* side[4]) |
| { |
| if (side[3]) |
| return; |
| @@ -2181,7 +2181,7 @@ static void complete4Sides(CSSPrimitiveValue* side[4]) |
| side[3] = side[1]; |
| } |
| -static bool consumeRadii(CSSPrimitiveValue* horizontalRadii[4], CSSPrimitiveValue* verticalRadii[4], CSSParserTokenRange& range, CSSParserMode cssParserMode, bool useLegacyParsing) |
| +static bool consumeRadii(CSSValue* horizontalRadii[4], CSSValue* verticalRadii[4], CSSParserTokenRange& range, CSSParserMode cssParserMode, bool useLegacyParsing) |
| { |
| unsigned i = 0; |
| for (; i < 4 && !range.atEnd() && range.peek().type() != DelimiterToken; ++i) { |
| @@ -2242,8 +2242,8 @@ static CSSBasicShapeInsetValue* consumeBasicShapeInset(CSSParserTokenRange& args |
| shape->updateShapeSize1Value(top); |
| if (consumeIdent<CSSValueRound>(args)) { |
| - CSSPrimitiveValue* horizontalRadii[4] = { 0 }; |
| - CSSPrimitiveValue* verticalRadii[4] = { 0 }; |
| + CSSValue* horizontalRadii[4] = { 0 }; |
| + CSSValue* verticalRadii[4] = { 0 }; |
| if (!consumeRadii(horizontalRadii, verticalRadii, args, context.mode(), false)) |
| return nullptr; |
| shape->setTopLeftRadius(CSSValuePair::create(horizontalRadii[0], verticalRadii[0], CSSValuePair::DropIdenticalValues)); |
| @@ -2343,17 +2343,17 @@ static CSSValue* consumeContentDistributionOverflowPosition(CSSParserTokenRange& |
| return CSSContentDistributionValue::create(distribution, position, overflow); |
| } |
| -static CSSPrimitiveValue* consumeBorderImageRepeatKeyword(CSSParserTokenRange& range) |
| +static CSSIdentifierValue* consumeBorderImageRepeatKeyword(CSSParserTokenRange& range) |
| { |
| return consumeIdent<CSSValueStretch, CSSValueRepeat, CSSValueSpace, CSSValueRound>(range); |
| } |
| static CSSValue* consumeBorderImageRepeat(CSSParserTokenRange& range) |
| { |
| - CSSPrimitiveValue* horizontal = consumeBorderImageRepeatKeyword(range); |
| + CSSIdentifierValue* horizontal = consumeBorderImageRepeatKeyword(range); |
| if (!horizontal) |
| return nullptr; |
| - CSSPrimitiveValue* vertical = consumeBorderImageRepeatKeyword(range); |
| + CSSIdentifierValue* vertical = consumeBorderImageRepeatKeyword(range); |
| if (!vertical) |
| vertical = horizontal; |
| return CSSValuePair::create(horizontal, vertical, CSSValuePair::DropIdenticalValues); |
| @@ -2362,7 +2362,7 @@ static CSSValue* consumeBorderImageRepeat(CSSParserTokenRange& range) |
| static CSSValue* consumeBorderImageSlice(CSSPropertyID property, CSSParserTokenRange& range) |
| { |
| bool fill = consumeIdent<CSSValueFill>(range); |
| - CSSPrimitiveValue* slices[4] = { 0 }; |
| + CSSValue* slices[4] = { 0 }; |
| for (size_t index = 0; index < 4; ++index) { |
| CSSPrimitiveValue* value = consumePercent(range, ValueRangeNonNegative); |
| @@ -2389,9 +2389,9 @@ static CSSValue* consumeBorderImageSlice(CSSPropertyID property, CSSParserTokenR |
| static CSSValue* consumeBorderImageOutset(CSSParserTokenRange& range) |
| { |
| - CSSPrimitiveValue* outsets[4] = { 0 }; |
| + CSSValue* outsets[4] = { 0 }; |
| - CSSPrimitiveValue* value = nullptr; |
| + CSSValue* value = nullptr; |
| for (size_t index = 0; index < 4; ++index) { |
| value = consumeNumber(range, ValueRangeNonNegative); |
| if (!value) |
| @@ -2408,9 +2408,9 @@ static CSSValue* consumeBorderImageOutset(CSSParserTokenRange& range) |
| static CSSValue* consumeBorderImageWidth(CSSParserTokenRange& range) |
| { |
| - CSSPrimitiveValue* widths[4] = { 0 }; |
| + CSSValue* widths[4] = { 0 }; |
| - CSSPrimitiveValue* value = nullptr; |
| + CSSValue* value = nullptr; |
| for (size_t index = 0; index < 4; ++index) { |
| value = consumeNumber(range, ValueRangeNonNegative); |
| if (!value) |
| @@ -2479,7 +2479,7 @@ static CSSValue* consumeWebkitBorderImage(CSSPropertyID property, CSSParserToken |
| static CSSValue* consumeReflect(CSSParserTokenRange& range, const CSSParserContext& context) |
| { |
| - CSSPrimitiveValue* direction = consumeIdent<CSSValueAbove, CSSValueBelow, CSSValueLeft, CSSValueRight>(range); |
| + CSSIdentifierValue* direction = consumeIdent<CSSValueAbove, CSSValueBelow, CSSValueLeft, CSSValueRight>(range); |
| if (!direction) |
| return nullptr; |
| @@ -2564,11 +2564,11 @@ static CSSValue* consumeBackgroundSize(CSSPropertyID unresolvedProperty, CSSPars |
| if (identMatches<CSSValueContain, CSSValueCover>(range.peek().id())) |
| return consumeIdent(range); |
| - CSSPrimitiveValue* horizontal = consumeIdent<CSSValueAuto>(range); |
| + CSSValue* horizontal = consumeIdent<CSSValueAuto>(range); |
| if (!horizontal) |
| horizontal = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Forbid); |
| - CSSPrimitiveValue* vertical = nullptr; |
| + CSSValue* vertical = nullptr; |
| if (!range.atEnd()) { |
| if (range.peek().id() == CSSValueAuto) // `auto' is the default |
| range.consumeIncludingWhitespace(); |
| @@ -2585,8 +2585,8 @@ static CSSValue* consumeBackgroundSize(CSSPropertyID unresolvedProperty, CSSPars |
| static CSSValueList* consumeGridAutoFlow(CSSParserTokenRange& range) |
| { |
| - CSSPrimitiveValue* rowOrColumnValue = consumeIdent<CSSValueRow, CSSValueColumn>(range); |
| - CSSPrimitiveValue* denseAlgorithm = consumeIdent<CSSValueDense>(range); |
| + CSSIdentifierValue* rowOrColumnValue = consumeIdent<CSSValueRow, CSSValueColumn>(range); |
| + CSSIdentifierValue* denseAlgorithm = consumeIdent<CSSValueDense>(range); |
| if (!rowOrColumnValue) { |
| rowOrColumnValue = consumeIdent<CSSValueRow, CSSValueColumn>(range); |
| if (!rowOrColumnValue && !denseAlgorithm) |
| @@ -2668,7 +2668,7 @@ static CSSValue* consumeCommaSeparatedBackgroundComponent(CSSPropertyID unresolv |
| return result; |
| } |
| -static CSSPrimitiveValue* consumeSelfPositionKeyword(CSSParserTokenRange& range) |
| +static CSSIdentifierValue* consumeSelfPositionKeyword(CSSParserTokenRange& range) |
| { |
| CSSValueID id = range.peek().id(); |
| if (id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter |
| @@ -2683,8 +2683,8 @@ static CSSValue* consumeSelfPositionOverflowPosition(CSSParserTokenRange& range) |
| if (identMatches<CSSValueAuto, CSSValueNormal, CSSValueStretch, CSSValueBaseline, CSSValueLastBaseline>(range.peek().id())) |
| return consumeIdent(range); |
| - CSSPrimitiveValue* overflowPosition = consumeIdent<CSSValueUnsafe, CSSValueSafe>(range); |
| - CSSPrimitiveValue* selfPosition = consumeSelfPositionKeyword(range); |
| + CSSIdentifierValue* overflowPosition = consumeIdent<CSSValueUnsafe, CSSValueSafe>(range); |
| + CSSIdentifierValue* selfPosition = consumeSelfPositionKeyword(range); |
| if (!selfPosition) |
| return nullptr; |
| if (!overflowPosition) |
| @@ -2705,8 +2705,8 @@ static CSSValue* consumeAlignItems(CSSParserTokenRange& range) |
| static CSSValue* consumeJustifyItems(CSSParserTokenRange& range) |
| { |
| CSSParserTokenRange rangeCopy = range; |
| - CSSPrimitiveValue* legacy = consumeIdent<CSSValueLegacy>(rangeCopy); |
| - CSSPrimitiveValue* positionKeyword = consumeIdent<CSSValueCenter, CSSValueLeft, CSSValueRight>(rangeCopy); |
| + CSSIdentifierValue* legacy = consumeIdent<CSSValueLegacy>(rangeCopy); |
| + CSSIdentifierValue* positionKeyword = consumeIdent<CSSValueCenter, CSSValueLeft, CSSValueRight>(rangeCopy); |
| if (!legacy) |
| legacy = consumeIdent<CSSValueLegacy>(rangeCopy); |
| if (legacy && positionKeyword) { |
| @@ -2741,7 +2741,7 @@ static CSSValue* consumeGridLine(CSSParserTokenRange& range) |
| if (range.peek().id() == CSSValueAuto) |
| return consumeIdent(range); |
| - CSSPrimitiveValue* spanValue = nullptr; |
| + CSSIdentifierValue* spanValue = nullptr; |
| CSSCustomIdentValue* gridLineName = nullptr; |
| CSSPrimitiveValue* numericValue = consumeInteger(range); |
| if (numericValue) { |
| @@ -2785,28 +2785,33 @@ static CSSValue* consumeGridLine(CSSParserTokenRange& range) |
| return values; |
| } |
| -static bool isGridTrackFixedSized(const CSSPrimitiveValue& primitiveValue) |
| +static bool isGridTrackFixedSizedInternal(const CSSValue& value) |
|
Timothy Loh
2016/09/21 07:55:06
I'm not sure about this name change, both of these
sashab
2016/09/23 01:01:10
Nice! Done
|
| { |
| - CSSValueID valueID = primitiveValue.getValueID(); |
| - if (valueID == CSSValueMinContent || valueID == CSSValueMaxContent || valueID == CSSValueAuto || primitiveValue.isFlex()) |
| - return false; |
| + if (value.isIdentifierValue()) { |
| + CSSValueID valueID = toCSSIdentifierValue(value).getValueID(); |
| + return !(valueID == CSSValueMinContent || valueID == CSSValueMaxContent || valueID == CSSValueAuto); |
| + } |
| + |
| + if (value.isPrimitiveValue()) { |
| + return !toCSSPrimitiveValue(value).isFlex(); |
| + } |
| return true; |
|
Timothy Loh
2016/09/21 07:55:06
Is this actually reached?
sashab
2016/09/23 01:01:10
Added NOTREACHED() and nothing failed :) So leavin
|
| } |
| static bool isGridTrackFixedSized(const CSSValue& value) |
| { |
| - if (value.isPrimitiveValue()) |
| - return isGridTrackFixedSized(toCSSPrimitiveValue(value)); |
| + if (value.isPrimitiveValue() || value.isIdentifierValue()) |
| + return isGridTrackFixedSizedInternal(value); |
| DCHECK(value.isFunctionValue()); |
| auto& function = toCSSFunctionValue(value); |
| if (function.functionType() == CSSValueFitContent) |
| return false; |
| - const CSSPrimitiveValue& minPrimitiveValue = toCSSPrimitiveValue(function.item(0)); |
| - const CSSPrimitiveValue& maxPrimitiveValue = toCSSPrimitiveValue(function.item(1)); |
| - return isGridTrackFixedSized(minPrimitiveValue) || isGridTrackFixedSized(maxPrimitiveValue); |
| + const CSSValue& minValue = function.item(0); |
| + const CSSValue& maxValue = function.item(1); |
| + return isGridTrackFixedSizedInternal(minValue) || isGridTrackFixedSizedInternal(maxValue); |
| } |
| static Vector<String> parseGridTemplateAreasColumnNames(const String& gridRowNames) |
| @@ -2903,7 +2908,7 @@ static bool parseGridTemplateAreasRow(const String& gridRowNames, NamedGridAreaM |
| return true; |
| } |
| -static CSSPrimitiveValue* consumeGridBreadth(CSSParserTokenRange& range, CSSParserMode cssParserMode) |
| +static CSSValue* consumeGridBreadth(CSSParserTokenRange& range, CSSParserMode cssParserMode) |
| { |
| const CSSParserToken& token = range.peek(); |
| if (identMatches<CSSValueMinContent, CSSValueMaxContent, CSSValueAuto>(token.id())) |
| @@ -2925,10 +2930,10 @@ static CSSValue* consumeGridTrackSize(CSSParserTokenRange& range, CSSParserMode |
| if (token.functionId() == CSSValueMinmax) { |
| CSSParserTokenRange rangeCopy = range; |
| CSSParserTokenRange args = consumeFunction(rangeCopy); |
| - CSSPrimitiveValue* minTrackBreadth = consumeGridBreadth(args, cssParserMode); |
| - if (!minTrackBreadth || minTrackBreadth->isFlex() || !consumeCommaIncludingWhitespace(args)) |
| + CSSValue* minTrackBreadth = consumeGridBreadth(args, cssParserMode); |
| + if (!minTrackBreadth || (minTrackBreadth->isPrimitiveValue() && toCSSPrimitiveValue(minTrackBreadth)->isFlex()) || !consumeCommaIncludingWhitespace(args)) |
| return nullptr; |
| - CSSPrimitiveValue* maxTrackBreadth = consumeGridBreadth(args, cssParserMode); |
| + CSSValue* maxTrackBreadth = consumeGridBreadth(args, cssParserMode); |
| if (!maxTrackBreadth || !args.atEnd()) |
| return nullptr; |
| range = rangeCopy; |
| @@ -3517,7 +3522,7 @@ const CSSValue* CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProp |
| } |
| } |
| -static CSSPrimitiveValue* consumeFontDisplay(CSSParserTokenRange& range) |
| +static CSSIdentifierValue* consumeFontDisplay(CSSParserTokenRange& range) |
| { |
| return consumeIdent<CSSValueAuto, CSSValueBlock, CSSValueSwap, CSSValueFallback, CSSValueOptional>(range); |
| } |
| @@ -3622,7 +3627,7 @@ bool CSSPropertyParser::parseFontFaceDescriptor(CSSPropertyID propId) |
| CSSValueID id = m_range.consumeIncludingWhitespace().id(); |
| if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id, m_context.mode())) |
| return false; |
| - parsedValue = CSSPrimitiveValue::createIdentifier(id); |
| + parsedValue = CSSIdentifierValue::createIdentifier(id); |
| break; |
| } |
| case CSSPropertyFontVariant: |
| @@ -3658,18 +3663,18 @@ bool CSSPropertyParser::consumeSystemFont(bool important) |
| AtomicString fontFamily; |
| LayoutTheme::theme().systemFont(systemFontID, fontStyle, fontWeight, fontSize, fontFamily); |
| - addProperty(CSSPropertyFontStyle, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(fontStyle == FontStyleItalic ? CSSValueItalic : CSSValueNormal), important); |
| - addProperty(CSSPropertyFontWeight, CSSPropertyFont, *CSSPrimitiveValue::create(fontWeight), important); |
| + addProperty(CSSPropertyFontStyle, CSSPropertyFont, *CSSIdentifierValue::createIdentifier(fontStyle == FontStyleItalic ? CSSValueItalic : CSSValueNormal), important); |
| + addProperty(CSSPropertyFontWeight, CSSPropertyFont, *CSSIdentifierValue::create(fontWeight), important); |
| addProperty(CSSPropertyFontSize, CSSPropertyFont, *CSSPrimitiveValue::create(fontSize, CSSPrimitiveValue::UnitType::Pixels), important); |
| CSSValueList* fontFamilyList = CSSValueList::createCommaSeparated(); |
| fontFamilyList->append(*CSSFontFamilyValue::create(fontFamily)); |
| addProperty(CSSPropertyFontFamily, CSSPropertyFont, *fontFamilyList, important); |
| - addProperty(CSSPropertyFontStretch, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important); |
| - addProperty(CSSPropertyFontVariantCaps, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important); |
| - addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important); |
| - addProperty(CSSPropertyFontVariantNumeric, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important); |
| - addProperty(CSSPropertyLineHeight, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important); |
| + addProperty(CSSPropertyFontStretch, CSSPropertyFont, *CSSIdentifierValue::createIdentifier(CSSValueNormal), important); |
| + addProperty(CSSPropertyFontVariantCaps, CSSPropertyFont, *CSSIdentifierValue::createIdentifier(CSSValueNormal), important); |
| + addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFont, *CSSIdentifierValue::createIdentifier(CSSValueNormal), important); |
| + addProperty(CSSPropertyFontVariantNumeric, CSSPropertyFont, *CSSIdentifierValue::createIdentifier(CSSValueNormal), important); |
| + addProperty(CSSPropertyLineHeight, CSSPropertyFont, *CSSIdentifierValue::createIdentifier(CSSValueNormal), important); |
| return true; |
| } |
| @@ -3683,10 +3688,10 @@ bool CSSPropertyParser::consumeFont(bool important) |
| return false; |
| } |
| // Optional font-style, font-variant, font-stretch and font-weight. |
| - CSSPrimitiveValue* fontStyle = nullptr; |
| - CSSPrimitiveValue* fontVariantCaps = nullptr; |
| - CSSPrimitiveValue* fontWeight = nullptr; |
| - CSSPrimitiveValue* fontStretch = nullptr; |
| + CSSIdentifierValue* fontStyle = nullptr; |
| + CSSIdentifierValue* fontVariantCaps = nullptr; |
| + CSSIdentifierValue* fontWeight = nullptr; |
| + CSSIdentifierValue* fontStretch = nullptr; |
| while (!m_range.atEnd()) { |
| CSSValueID id = m_range.peek().id(); |
| if (!fontStyle && CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyFontStyle, id, m_context.mode())) { |
| @@ -3714,13 +3719,13 @@ bool CSSPropertyParser::consumeFont(bool important) |
| if (m_range.atEnd()) |
| return false; |
| - addProperty(CSSPropertyFontStyle, CSSPropertyFont, fontStyle ? *fontStyle : *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important); |
| - addProperty(CSSPropertyFontVariantCaps, CSSPropertyFont, fontVariantCaps ? *fontVariantCaps : *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important); |
| - addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important); |
| - addProperty(CSSPropertyFontVariantNumeric, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important); |
| + addProperty(CSSPropertyFontStyle, CSSPropertyFont, fontStyle ? *fontStyle : *CSSIdentifierValue::createIdentifier(CSSValueNormal), important); |
| + addProperty(CSSPropertyFontVariantCaps, CSSPropertyFont, fontVariantCaps ? *fontVariantCaps : *CSSIdentifierValue::createIdentifier(CSSValueNormal), important); |
| + addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFont, *CSSIdentifierValue::createIdentifier(CSSValueNormal), important); |
| + addProperty(CSSPropertyFontVariantNumeric, CSSPropertyFont, *CSSIdentifierValue::createIdentifier(CSSValueNormal), important); |
| - addProperty(CSSPropertyFontWeight, CSSPropertyFont, fontWeight ? *fontWeight : *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important); |
| - addProperty(CSSPropertyFontStretch, CSSPropertyFont, fontStretch ? *fontStretch : *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important); |
| + addProperty(CSSPropertyFontWeight, CSSPropertyFont, fontWeight ? *fontWeight : *CSSIdentifierValue::createIdentifier(CSSValueNormal), important); |
| + addProperty(CSSPropertyFontStretch, CSSPropertyFont, fontStretch ? *fontStretch : *CSSIdentifierValue::createIdentifier(CSSValueNormal), important); |
| // Now a font size _must_ come. |
| CSSValue* fontSize = consumeFontSize(m_range, m_context.mode()); |
| @@ -3730,12 +3735,12 @@ bool CSSPropertyParser::consumeFont(bool important) |
| addProperty(CSSPropertyFontSize, CSSPropertyFont, *fontSize, important); |
| if (consumeSlashIncludingWhitespace(m_range)) { |
| - CSSPrimitiveValue* lineHeight = consumeLineHeight(m_range, m_context.mode()); |
| + CSSValue* lineHeight = consumeLineHeight(m_range, m_context.mode()); |
| if (!lineHeight) |
| return false; |
| addProperty(CSSPropertyLineHeight, CSSPropertyFont, *lineHeight, important); |
| } else { |
| - addProperty(CSSPropertyLineHeight, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important); |
| + addProperty(CSSPropertyLineHeight, CSSPropertyFont, *CSSIdentifierValue::createIdentifier(CSSValueNormal), important); |
| } |
| // Font family must come now. |
| @@ -3755,11 +3760,11 @@ bool CSSPropertyParser::consumeFontVariantShorthand(bool important) |
| { |
| if (identMatches<CSSValueNormal, CSSValueNone>(m_range.peek().id())) { |
| addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFontVariant, *consumeIdent(m_range), important); |
| - addProperty(CSSPropertyFontVariantCaps, CSSPropertyFontVariant, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important); |
| + addProperty(CSSPropertyFontVariantCaps, CSSPropertyFontVariant, *CSSIdentifierValue::createIdentifier(CSSValueNormal), important); |
| return m_range.atEnd(); |
| } |
| - CSSPrimitiveValue* capsValue = nullptr; |
| + CSSIdentifierValue* capsValue = nullptr; |
| FontVariantLigaturesParser ligaturesParser; |
| FontVariantNumericParser numericParser; |
| do { |
| @@ -3793,7 +3798,7 @@ bool CSSPropertyParser::consumeFontVariantShorthand(bool important) |
| addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFontVariant, *ligaturesParser.finalizeValue(), important); |
| addProperty(CSSPropertyFontVariantNumeric, CSSPropertyFontVariant, *numericParser.finalizeValue(), important); |
| - addProperty(CSSPropertyFontVariantCaps, CSSPropertyFontVariant, capsValue ? *capsValue : *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important); |
| + addProperty(CSSPropertyFontVariantCaps, CSSPropertyFontVariant, capsValue ? *capsValue : *CSSIdentifierValue::createIdentifier(CSSValueNormal), important); |
| return true; |
| } |
| @@ -3923,9 +3928,9 @@ bool CSSPropertyParser::consumeColumns(bool important) |
| if (!m_range.atEnd()) |
| return false; |
| if (!columnWidth) |
| - columnWidth = CSSPrimitiveValue::createIdentifier(CSSValueAuto); |
| + columnWidth = CSSIdentifierValue::createIdentifier(CSSValueAuto); |
| if (!columnCount) |
| - columnCount = CSSPrimitiveValue::createIdentifier(CSSValueAuto); |
| + columnCount = CSSIdentifierValue::createIdentifier(CSSValueAuto); |
| addProperty(CSSPropertyColumnWidth, CSSPropertyInvalid, *columnWidth, important); |
| addProperty(CSSPropertyColumnCount, CSSPropertyInvalid, *columnCount, important); |
| return true; |
| @@ -3963,12 +3968,12 @@ bool CSSPropertyParser::consumeFlex(bool important) |
| static const double unsetValue = -1; |
| double flexGrow = unsetValue; |
| double flexShrink = unsetValue; |
| - CSSPrimitiveValue* flexBasis = nullptr; |
| + CSSValue* flexBasis = nullptr; |
| if (m_range.peek().id() == CSSValueNone) { |
| flexGrow = 0; |
| flexShrink = 0; |
| - flexBasis = CSSPrimitiveValue::createIdentifier(CSSValueAuto); |
| + flexBasis = CSSIdentifierValue::createIdentifier(CSSValueAuto); |
| m_range.consumeIncludingWhitespace(); |
| } else { |
| unsigned index = 0; |
| @@ -4158,7 +4163,7 @@ bool CSSPropertyParser::consumeLegacyBreakProperty(CSSPropertyID property, bool |
| // The fragmentation spec says that page-break-(after|before|inside) are to be treated as |
| // shorthands for their break-(after|before|inside) counterparts. We'll do the same for the |
| // non-standard properties -webkit-column-break-(after|before|inside). |
| - CSSPrimitiveValue* keyword = consumeIdent(m_range); |
| + CSSIdentifierValue* keyword = consumeIdent(m_range); |
| if (!keyword) |
| return false; |
| if (!m_range.atEnd()) |
| @@ -4184,7 +4189,7 @@ bool CSSPropertyParser::consumeLegacyBreakProperty(CSSPropertyID property, bool |
| return false; |
| CSSPropertyID genericBreakProperty = mapFromLegacyBreakProperty(property); |
| - addProperty(genericBreakProperty, property, *CSSPrimitiveValue::createIdentifier(value), important); |
| + addProperty(genericBreakProperty, property, *CSSIdentifierValue::createIdentifier(value), important); |
| return true; |
| } |
| @@ -4204,14 +4209,14 @@ static bool consumeBackgroundPosition(CSSParserTokenRange& range, const CSSParse |
| static bool consumeRepeatStyleComponent(CSSParserTokenRange& range, CSSValue*& value1, CSSValue*& value2, bool& implicit) |
| { |
| if (consumeIdent<CSSValueRepeatX>(range)) { |
| - value1 = CSSPrimitiveValue::createIdentifier(CSSValueRepeat); |
| - value2 = CSSPrimitiveValue::createIdentifier(CSSValueNoRepeat); |
| + value1 = CSSIdentifierValue::createIdentifier(CSSValueRepeat); |
| + value2 = CSSIdentifierValue::createIdentifier(CSSValueNoRepeat); |
| implicit = true; |
| return true; |
| } |
| if (consumeIdent<CSSValueRepeatY>(range)) { |
| - value1 = CSSPrimitiveValue::createIdentifier(CSSValueNoRepeat); |
| - value2 = CSSPrimitiveValue::createIdentifier(CSSValueRepeat); |
| + value1 = CSSIdentifierValue::createIdentifier(CSSValueNoRepeat); |
| + value2 = CSSIdentifierValue::createIdentifier(CSSValueRepeat); |
| implicit = true; |
| return true; |
| } |
| @@ -4337,7 +4342,7 @@ bool CSSPropertyParser::consumeGridItemPositionShorthand(CSSPropertyID shorthand |
| if (!endValue) |
| return false; |
| } else { |
| - endValue = startValue->isCustomIdentValue() ? startValue : CSSPrimitiveValue::createIdentifier(CSSValueAuto); |
| + endValue = startValue->isCustomIdentValue() ? startValue : CSSIdentifierValue::createIdentifier(CSSValueAuto); |
| } |
| if (!m_range.atEnd()) |
| return false; |
| @@ -4374,11 +4379,11 @@ bool CSSPropertyParser::consumeGridAreaShorthand(bool important) |
| if (!m_range.atEnd()) |
| return false; |
| if (!columnStartValue) |
| - columnStartValue = rowStartValue->isCustomIdentValue() ? rowStartValue : CSSPrimitiveValue::createIdentifier(CSSValueAuto); |
| + columnStartValue = rowStartValue->isCustomIdentValue() ? rowStartValue : CSSIdentifierValue::createIdentifier(CSSValueAuto); |
| if (!rowEndValue) |
| - rowEndValue = rowStartValue->isCustomIdentValue() ? rowStartValue : CSSPrimitiveValue::createIdentifier(CSSValueAuto); |
| + rowEndValue = rowStartValue->isCustomIdentValue() ? rowStartValue : CSSIdentifierValue::createIdentifier(CSSValueAuto); |
| if (!columnEndValue) |
| - columnEndValue = columnStartValue->isCustomIdentValue() ? columnStartValue : CSSPrimitiveValue::createIdentifier(CSSValueAuto); |
| + columnEndValue = columnStartValue->isCustomIdentValue() ? columnStartValue : CSSIdentifierValue::createIdentifier(CSSValueAuto); |
| addProperty(CSSPropertyGridRowStart, CSSPropertyGridArea, *rowStartValue, important); |
| addProperty(CSSPropertyGridColumnStart, CSSPropertyGridArea, *columnStartValue, important); |
| @@ -4413,7 +4418,7 @@ bool CSSPropertyParser::consumeGridTemplateRowsAndAreasAndColumns(CSSPropertyID |
| // Handle template-rows's track-size. |
| CSSValue* value = consumeGridTrackSize(m_range, m_context.mode()); |
| if (!value) |
| - value = CSSPrimitiveValue::createIdentifier(CSSValueAuto); |
| + value = CSSIdentifierValue::createIdentifier(CSSValueAuto); |
| templateRows->append(*value); |
| // This will handle the trailing/leading <custom-ident>* in the grammar. |
| @@ -4430,7 +4435,7 @@ bool CSSPropertyParser::consumeGridTemplateRowsAndAreasAndColumns(CSSPropertyID |
| if (!columnsValue || !m_range.atEnd()) |
| return false; |
| } else { |
| - columnsValue = CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| + columnsValue = CSSIdentifierValue::createIdentifier(CSSValueNone); |
| } |
| addProperty(CSSPropertyGridTemplateRows, shorthandId, *templateRows, important); |
| addProperty(CSSPropertyGridTemplateColumns, shorthandId, *columnsValue, important); |
| @@ -4448,9 +4453,9 @@ bool CSSPropertyParser::consumeGridTemplateShorthand(CSSPropertyID shorthandId, |
| // 1- 'none' case. |
| if (rowsValue && m_range.atEnd()) { |
| - addProperty(CSSPropertyGridTemplateRows, shorthandId, *CSSPrimitiveValue::createIdentifier(CSSValueNone), important); |
| - addProperty(CSSPropertyGridTemplateColumns, shorthandId, *CSSPrimitiveValue::createIdentifier(CSSValueNone), important); |
| - addProperty(CSSPropertyGridTemplateAreas, shorthandId, *CSSPrimitiveValue::createIdentifier(CSSValueNone), important); |
| + addProperty(CSSPropertyGridTemplateRows, shorthandId, *CSSIdentifierValue::createIdentifier(CSSValueNone), important); |
| + addProperty(CSSPropertyGridTemplateColumns, shorthandId, *CSSIdentifierValue::createIdentifier(CSSValueNone), important); |
| + addProperty(CSSPropertyGridTemplateAreas, shorthandId, *CSSIdentifierValue::createIdentifier(CSSValueNone), important); |
| return true; |
| } |
| @@ -4467,7 +4472,7 @@ bool CSSPropertyParser::consumeGridTemplateShorthand(CSSPropertyID shorthandId, |
| addProperty(CSSPropertyGridTemplateRows, shorthandId, *rowsValue, important); |
| addProperty(CSSPropertyGridTemplateColumns, shorthandId, *columnsValue, important); |
| - addProperty(CSSPropertyGridTemplateAreas, shorthandId, *CSSPrimitiveValue::createIdentifier(CSSValueNone), important); |
| + addProperty(CSSPropertyGridTemplateAreas, shorthandId, *CSSIdentifierValue::createIdentifier(CSSValueNone), important); |
| return true; |
| } |
| @@ -4548,7 +4553,7 @@ bool CSSPropertyParser::parseShorthand(CSSPropertyID unresolvedProperty, bool im |
| CSSValueID id = m_range.consumeIncludingWhitespace().id(); |
| if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginBeforeCollapse, id, m_context.mode())) |
| return false; |
| - CSSValue* beforeCollapse = CSSPrimitiveValue::createIdentifier(id); |
| + CSSValue* beforeCollapse = CSSIdentifierValue::createIdentifier(id); |
| addProperty(CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginCollapse, *beforeCollapse, important); |
| if (m_range.atEnd()) { |
| addProperty(CSSPropertyWebkitMarginAfterCollapse, CSSPropertyWebkitMarginCollapse, *beforeCollapse, important); |
| @@ -4557,7 +4562,7 @@ bool CSSPropertyParser::parseShorthand(CSSPropertyID unresolvedProperty, bool im |
| id = m_range.consumeIncludingWhitespace().id(); |
| if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginAfterCollapse, id, m_context.mode())) |
| return false; |
| - addProperty(CSSPropertyWebkitMarginAfterCollapse, CSSPropertyWebkitMarginCollapse, *CSSPrimitiveValue::createIdentifier(id), important); |
| + addProperty(CSSPropertyWebkitMarginAfterCollapse, CSSPropertyWebkitMarginCollapse, *CSSIdentifierValue::createIdentifier(id), important); |
| return true; |
| } |
| case CSSPropertyOverflow: { |
| @@ -4566,7 +4571,7 @@ bool CSSPropertyParser::parseShorthand(CSSPropertyID unresolvedProperty, bool im |
| return false; |
| if (!m_range.atEnd()) |
| return false; |
| - CSSValue* overflowYValue = CSSPrimitiveValue::createIdentifier(id); |
| + CSSValue* overflowYValue = CSSIdentifierValue::createIdentifier(id); |
| CSSValue* overflowXValue = nullptr; |
| @@ -4575,7 +4580,7 @@ bool CSSPropertyParser::parseShorthand(CSSPropertyID unresolvedProperty, bool im |
| // pagination controls, it should default to hidden. If the overflow-y value is anything but |
| // paged-x or paged-y, then overflow-x and overflow-y should have the same value. |
| if (id == CSSValueWebkitPagedX || id == CSSValueWebkitPagedY) |
| - overflowXValue = CSSPrimitiveValue::createIdentifier(CSSValueAuto); |
| + overflowXValue = CSSIdentifierValue::createIdentifier(CSSValueAuto); |
| else |
| overflowXValue = overflowYValue; |
| addProperty(CSSPropertyOverflowX, CSSPropertyOverflow, *overflowXValue, important); |
| @@ -4639,8 +4644,8 @@ bool CSSPropertyParser::parseShorthand(CSSPropertyID unresolvedProperty, bool im |
| case CSSPropertyListStyle: |
| return consumeShorthandGreedily(listStyleShorthand(), important); |
| case CSSPropertyBorderRadius: { |
| - CSSPrimitiveValue* horizontalRadii[4] = { 0 }; |
| - CSSPrimitiveValue* verticalRadii[4] = { 0 }; |
| + CSSValue* horizontalRadii[4] = { 0 }; |
| + CSSValue* verticalRadii[4] = { 0 }; |
| if (!consumeRadii(horizontalRadii, verticalRadii, m_range, m_context.mode(), unresolvedProperty == CSSPropertyAliasWebkitBorderRadius)) |
| return false; |
| addProperty(CSSPropertyBorderTopLeftRadius, CSSPropertyBorderRadius, *CSSValuePair::create(horizontalRadii[0], verticalRadii[0], CSSValuePair::DropIdenticalValues), important); |