| 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 f72b025544513b475ada43480d8bca490e8ae8e2..463eeccd6606032e5dd2c5de0b2b861229ce8556 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::create(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::create(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::create(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);
|
| @@ -1080,7 +1081,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 {
|
| @@ -1090,8 +1091,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);
|
| @@ -1120,7 +1121,7 @@ static CSSValue* consumeAnimationName(CSSParserTokenRange& range, const CSSParse
|
|
|
| const CSSParserToken& token = range.consumeIncludingWhitespace();
|
| if (equalIgnoringASCIICase(token.value(), "none"))
|
| - return CSSPrimitiveValue::createIdentifier(CSSValueNone);
|
| + return CSSIdentifierValue::create(CSSValueNone);
|
| return CSSCustomIdentValue::create(token.value().toAtomicString());
|
| }
|
|
|
| @@ -1255,8 +1256,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;
|
| @@ -1332,7 +1332,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())
|
| @@ -1464,7 +1464,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))
|
| @@ -1490,7 +1490,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))
|
| @@ -1523,7 +1523,7 @@ static CSSValue* consumePath(CSSParserTokenRange& range)
|
|
|
| range = functionRange;
|
| if (byteStream->isEmpty())
|
| - return CSSPrimitiveValue::createIdentifier(CSSValueNone);
|
| + return CSSIdentifierValue::create(CSSValueNone);
|
| return CSSPathValue::create(std::move(byteStream));
|
| }
|
|
|
| @@ -1571,8 +1571,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) {
|
| @@ -1596,7 +1596,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)
|
| @@ -1604,17 +1604,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);
|
| }
|
| @@ -1832,9 +1832,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)
|
| @@ -1907,7 +1907,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)
|
| @@ -1915,7 +1915,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);
|
| @@ -1956,7 +1956,7 @@ static CSSValue* consumeCursor(CSSParserTokenRange& range, const CSSParserContex
|
| if (id == CSSValueHand) {
|
| if (!inQuirksMode) // Non-standard behavior
|
| return nullptr;
|
| - cursorType = CSSPrimitiveValue::createIdentifier(CSSValuePointer);
|
| + cursorType = CSSIdentifierValue::create(CSSValuePointer);
|
| range.consumeIncludingWhitespace();
|
| } else if ((id >= CSSValueAuto && id <= CSSValueWebkitZoomOut) || id == CSSValueCopy || id == CSSValueNone) {
|
| cursorType = consumeIdent(range);
|
| @@ -2003,14 +2003,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::create(CSSValueDecimal);
|
| }
|
|
|
| if (!args.atEnd())
|
| @@ -2047,7 +2047,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);
|
| @@ -2109,15 +2109,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);
|
| @@ -2129,7 +2129,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;
|
| @@ -2147,9 +2147,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)) {
|
| @@ -2184,7 +2184,7 @@ static CSSBasicShapePolygonValue* consumeBasicShapePolygon(CSSParserTokenRange&
|
| return shape;
|
| }
|
|
|
| -static void complete4Sides(CSSPrimitiveValue* side[4])
|
| +static void complete4Sides(CSSValue* side[4])
|
| {
|
| if (side[3])
|
| return;
|
| @@ -2196,7 +2196,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) {
|
| @@ -2257,8 +2257,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));
|
| @@ -2358,17 +2358,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);
|
| @@ -2377,7 +2377,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);
|
| @@ -2404,9 +2404,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)
|
| @@ -2423,9 +2423,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)
|
| @@ -2494,7 +2494,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;
|
|
|
| @@ -2579,11 +2579,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();
|
| @@ -2600,8 +2600,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)
|
| @@ -2683,7 +2683,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
|
| @@ -2698,8 +2698,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)
|
| @@ -2720,8 +2720,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) {
|
| @@ -2756,7 +2756,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) {
|
| @@ -2800,28 +2800,34 @@ static CSSValue* consumeGridLine(CSSParserTokenRange& range)
|
| return values;
|
| }
|
|
|
| -static bool isGridTrackFixedSized(const CSSPrimitiveValue& primitiveValue)
|
| +static bool isGridBreadthFixedSized(const CSSValue& value)
|
| {
|
| - 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();
|
| + }
|
|
|
| + NOTREACHED();
|
| return true;
|
| }
|
|
|
| static bool isGridTrackFixedSized(const CSSValue& value)
|
| {
|
| - if (value.isPrimitiveValue())
|
| - return isGridTrackFixedSized(toCSSPrimitiveValue(value));
|
| + if (value.isPrimitiveValue() || value.isIdentifierValue())
|
| + return isGridBreadthFixedSized(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 isGridBreadthFixedSized(minValue) || isGridBreadthFixedSized(maxValue);
|
| }
|
|
|
| static Vector<String> parseGridTemplateAreasColumnNames(const String& gridRowNames)
|
| @@ -2918,7 +2924,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()))
|
| @@ -2940,10 +2946,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;
|
| @@ -3535,7 +3541,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);
|
| }
|
| @@ -3640,7 +3646,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::create(id);
|
| break;
|
| }
|
| case CSSPropertyFontVariant:
|
| @@ -3676,18 +3682,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::create(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::create(CSSValueNormal), important);
|
| + addProperty(CSSPropertyFontVariantCaps, CSSPropertyFont, *CSSIdentifierValue::create(CSSValueNormal), important);
|
| + addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFont, *CSSIdentifierValue::create(CSSValueNormal), important);
|
| + addProperty(CSSPropertyFontVariantNumeric, CSSPropertyFont, *CSSIdentifierValue::create(CSSValueNormal), important);
|
| + addProperty(CSSPropertyLineHeight, CSSPropertyFont, *CSSIdentifierValue::create(CSSValueNormal), important);
|
| return true;
|
| }
|
|
|
| @@ -3701,10 +3707,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())) {
|
| @@ -3732,13 +3738,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::create(CSSValueNormal), important);
|
| + addProperty(CSSPropertyFontVariantCaps, CSSPropertyFont, fontVariantCaps ? *fontVariantCaps : *CSSIdentifierValue::create(CSSValueNormal), important);
|
| + addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFont, *CSSIdentifierValue::create(CSSValueNormal), important);
|
| + addProperty(CSSPropertyFontVariantNumeric, CSSPropertyFont, *CSSIdentifierValue::create(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::create(CSSValueNormal), important);
|
| + addProperty(CSSPropertyFontStretch, CSSPropertyFont, fontStretch ? *fontStretch : *CSSIdentifierValue::create(CSSValueNormal), important);
|
|
|
| // Now a font size _must_ come.
|
| CSSValue* fontSize = consumeFontSize(m_range, m_context.mode());
|
| @@ -3748,12 +3754,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::create(CSSValueNormal), important);
|
| }
|
|
|
| // Font family must come now.
|
| @@ -3773,11 +3779,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::create(CSSValueNormal), important);
|
| return m_range.atEnd();
|
| }
|
|
|
| - CSSPrimitiveValue* capsValue = nullptr;
|
| + CSSIdentifierValue* capsValue = nullptr;
|
| FontVariantLigaturesParser ligaturesParser;
|
| FontVariantNumericParser numericParser;
|
| do {
|
| @@ -3811,7 +3817,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::create(CSSValueNormal), important);
|
| return true;
|
| }
|
|
|
| @@ -3941,9 +3947,9 @@ bool CSSPropertyParser::consumeColumns(bool important)
|
| if (!m_range.atEnd())
|
| return false;
|
| if (!columnWidth)
|
| - columnWidth = CSSPrimitiveValue::createIdentifier(CSSValueAuto);
|
| + columnWidth = CSSIdentifierValue::create(CSSValueAuto);
|
| if (!columnCount)
|
| - columnCount = CSSPrimitiveValue::createIdentifier(CSSValueAuto);
|
| + columnCount = CSSIdentifierValue::create(CSSValueAuto);
|
| addProperty(CSSPropertyColumnWidth, CSSPropertyInvalid, *columnWidth, important);
|
| addProperty(CSSPropertyColumnCount, CSSPropertyInvalid, *columnCount, important);
|
| return true;
|
| @@ -3981,12 +3987,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::create(CSSValueAuto);
|
| m_range.consumeIncludingWhitespace();
|
| } else {
|
| unsigned index = 0;
|
| @@ -4176,7 +4182,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())
|
| @@ -4202,7 +4208,7 @@ bool CSSPropertyParser::consumeLegacyBreakProperty(CSSPropertyID property, bool
|
| return false;
|
|
|
| CSSPropertyID genericBreakProperty = mapFromLegacyBreakProperty(property);
|
| - addProperty(genericBreakProperty, property, *CSSPrimitiveValue::createIdentifier(value), important);
|
| + addProperty(genericBreakProperty, property, *CSSIdentifierValue::create(value), important);
|
| return true;
|
| }
|
|
|
| @@ -4222,14 +4228,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::create(CSSValueRepeat);
|
| + value2 = CSSIdentifierValue::create(CSSValueNoRepeat);
|
| implicit = true;
|
| return true;
|
| }
|
| if (consumeIdent<CSSValueRepeatY>(range)) {
|
| - value1 = CSSPrimitiveValue::createIdentifier(CSSValueNoRepeat);
|
| - value2 = CSSPrimitiveValue::createIdentifier(CSSValueRepeat);
|
| + value1 = CSSIdentifierValue::create(CSSValueNoRepeat);
|
| + value2 = CSSIdentifierValue::create(CSSValueRepeat);
|
| implicit = true;
|
| return true;
|
| }
|
| @@ -4355,7 +4361,7 @@ bool CSSPropertyParser::consumeGridItemPositionShorthand(CSSPropertyID shorthand
|
| if (!endValue)
|
| return false;
|
| } else {
|
| - endValue = startValue->isCustomIdentValue() ? startValue : CSSPrimitiveValue::createIdentifier(CSSValueAuto);
|
| + endValue = startValue->isCustomIdentValue() ? startValue : CSSIdentifierValue::create(CSSValueAuto);
|
| }
|
| if (!m_range.atEnd())
|
| return false;
|
| @@ -4392,11 +4398,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::create(CSSValueAuto);
|
| if (!rowEndValue)
|
| - rowEndValue = rowStartValue->isCustomIdentValue() ? rowStartValue : CSSPrimitiveValue::createIdentifier(CSSValueAuto);
|
| + rowEndValue = rowStartValue->isCustomIdentValue() ? rowStartValue : CSSIdentifierValue::create(CSSValueAuto);
|
| if (!columnEndValue)
|
| - columnEndValue = columnStartValue->isCustomIdentValue() ? columnStartValue : CSSPrimitiveValue::createIdentifier(CSSValueAuto);
|
| + columnEndValue = columnStartValue->isCustomIdentValue() ? columnStartValue : CSSIdentifierValue::create(CSSValueAuto);
|
|
|
| addProperty(CSSPropertyGridRowStart, CSSPropertyGridArea, *rowStartValue, important);
|
| addProperty(CSSPropertyGridColumnStart, CSSPropertyGridArea, *columnStartValue, important);
|
| @@ -4431,7 +4437,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::create(CSSValueAuto);
|
| templateRows->append(*value);
|
|
|
| // This will handle the trailing/leading <custom-ident>* in the grammar.
|
| @@ -4448,7 +4454,7 @@ bool CSSPropertyParser::consumeGridTemplateRowsAndAreasAndColumns(CSSPropertyID
|
| if (!columnsValue || !m_range.atEnd())
|
| return false;
|
| } else {
|
| - columnsValue = CSSPrimitiveValue::createIdentifier(CSSValueNone);
|
| + columnsValue = CSSIdentifierValue::create(CSSValueNone);
|
| }
|
| addProperty(CSSPropertyGridTemplateRows, shorthandId, *templateRows, important);
|
| addProperty(CSSPropertyGridTemplateColumns, shorthandId, *columnsValue, important);
|
| @@ -4466,9 +4472,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::create(CSSValueNone), important);
|
| + addProperty(CSSPropertyGridTemplateColumns, shorthandId, *CSSIdentifierValue::create(CSSValueNone), important);
|
| + addProperty(CSSPropertyGridTemplateAreas, shorthandId, *CSSIdentifierValue::create(CSSValueNone), important);
|
| return true;
|
| }
|
|
|
| @@ -4485,7 +4491,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::create(CSSValueNone), important);
|
| return true;
|
| }
|
|
|
| @@ -4542,7 +4548,7 @@ bool CSSPropertyParser::consumeGridShorthand(bool important)
|
| CSSValueList* gridAutoFlow = nullptr;
|
| if (identMatches<CSSValueDense, CSSValueAutoFlow>(m_range.peek().id())) {
|
| // 2- [ auto-flow && dense? ] <grid-auto-rows>? / <grid-template-columns>
|
| - gridAutoFlow = consumeImplicitAutoFlow(m_range, *CSSPrimitiveValue::createIdentifier(CSSValueRow));
|
| + gridAutoFlow = consumeImplicitAutoFlow(m_range, *CSSIdentifierValue::create(CSSValueRow));
|
| if (!gridAutoFlow)
|
| return false;
|
| if (consumeSlashIncludingWhitespace(m_range)) {
|
| @@ -4565,7 +4571,7 @@ bool CSSPropertyParser::consumeGridShorthand(bool important)
|
| return false;
|
| if (!consumeSlashIncludingWhitespace(m_range))
|
| return false;
|
| - gridAutoFlow = consumeImplicitAutoFlow(m_range, *CSSPrimitiveValue::createIdentifier(CSSValueColumn));
|
| + gridAutoFlow = consumeImplicitAutoFlow(m_range, *CSSIdentifierValue::create(CSSValueColumn));
|
| if (!gridAutoFlow)
|
| return false;
|
| if (m_range.atEnd()) {
|
| @@ -4604,7 +4610,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::create(id);
|
| addProperty(CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginCollapse, *beforeCollapse, important);
|
| if (m_range.atEnd()) {
|
| addProperty(CSSPropertyWebkitMarginAfterCollapse, CSSPropertyWebkitMarginCollapse, *beforeCollapse, important);
|
| @@ -4613,7 +4619,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::create(id), important);
|
| return true;
|
| }
|
| case CSSPropertyOverflow: {
|
| @@ -4622,7 +4628,7 @@ bool CSSPropertyParser::parseShorthand(CSSPropertyID unresolvedProperty, bool im
|
| return false;
|
| if (!m_range.atEnd())
|
| return false;
|
| - CSSValue* overflowYValue = CSSPrimitiveValue::createIdentifier(id);
|
| + CSSValue* overflowYValue = CSSIdentifierValue::create(id);
|
|
|
| CSSValue* overflowXValue = nullptr;
|
|
|
| @@ -4631,7 +4637,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::create(CSSValueAuto);
|
| else
|
| overflowXValue = overflowYValue;
|
| addProperty(CSSPropertyOverflowX, CSSPropertyOverflow, *overflowXValue, important);
|
| @@ -4697,8 +4703,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);
|
|
|