[CSS Parser] Remove the old CSS Parser
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Dec 2016 18:31:13 +0000 (18:31 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Dec 2016 18:31:13 +0000 (18:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=165645

Reviewed by Daniel Bates.

Source/WebCore:

Remove the old CSS parser code. In doing so, code that used documentless
CSSParserContexts is now going through the new parser. This resulted in
some additional changes. These include:

(1) Canvas color parsing switched to new parser's code. This resulted in
progressions on canvas tests.

(2) Support for CSSNamespaceRule in the CSS OM, since the Inspector's
creation of CSS OM wrappers made it necessary to add this in. The old parser
did not create style rules for namespaces, but the new one (and other browsers)
did.

(3) <font face="X"> now uses the new parser's font-family parsing code. This
change was made in createFontFaceValue in CSSValuePool.

(4) FontFace now uses a new function on the new parser called
parseFontFaceDescriptor. This function sets things up so that parsing occurs
as though you are inside a @font-face. The old parser let you call parseValue
to parse "properties", but descriptors need to be handled differently in the
new parser.

(5) Illegal CSS rules in mediaControlsApple/ios.css forced me to add a quirk
to handle chained shadow DOM pseudo-elements. This should not be allowed, but
for now it is.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
* css/CSSCalculationValue.cpp:
(WebCore::unitCategory):
(WebCore::hasDoubleValue):
(WebCore::checkDepthAndIndexDeprecated): Deleted.
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseCalc): Deleted.
(WebCore::CSSCalcExpressionNodeParserDeprecated::operatorValue): Deleted.
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseValue): Deleted.
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueTerm): Deleted.
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueMultiplicativeExpression): Deleted.
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseAdditiveValueExpression): Deleted.
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueExpression): Deleted.
* css/CSSCalculationValue.h:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::specifiedValueForGridTrackSize):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::checkVariablesForCycles):
(WebCore::CSSCustomPropertyValue::resolveVariableReferences):
* css/CSSCustomPropertyValue.h:
* css/CSSFunctionValue.cpp:
(WebCore::CSSFunctionValue::CSSFunctionValue):
(WebCore::CSSFunctionValue::customCSSText):
(WebCore::CSSFunctionValue::append):
(WebCore::CSSFunctionValue::buildParserValueSubstitutingVariables): Deleted.
* css/CSSFunctionValue.h:
* css/CSSGrammar.y.in: Removed.
* css/CSSGrammar.y.includes: Removed.
* css/CSSGroupingRule.cpp:
(WebCore::CSSGroupingRule::insertRule):
* css/CSSKeyframeRule.h:
* css/CSSKeyframesRule.cpp:
(WebCore::CSSKeyframesRule::appendRule):
* css/CSSNamespaceRule.cpp: Added.
(WebCore::CSSNamespaceRule::CSSNamespaceRule):
(WebCore::CSSNamespaceRule::~CSSNamespaceRule):
(WebCore::CSSNamespaceRule::namespaceURI):
(WebCore::CSSNamespaceRule::prefix):
(WebCore::CSSNamespaceRule::cssText):
(WebCore::CSSNamespaceRule::reattach):
* css/CSSNamespaceRule.h: Added.
* css/CSSNamespaceRule.idl: Added.
* css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::isStringType):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
(WebCore::CSSPrimitiveValue::equals):
(WebCore::CSSPrimitiveValue::buildParserValue): Deleted.
* css/CSSPrimitiveValue.h:
* css/CSSRule.h:
* css/CSSRule.idl:
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::insertRule):
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isCustomPropertyValue):
(WebCore::CSSValue::hasVariableReferences):
(WebCore::CSSValue::isVariableDependentValue): Deleted.
(WebCore::CSSValue::isVariableValue): Deleted.
* css/CSSValueList.cpp:
(WebCore::CSSValueList::customCSSText):
(WebCore::CSSValueList::containsVariables): Deleted.
(WebCore::CSSValueList::checkVariablesForCycles): Deleted.
(WebCore::CSSValueList::buildParserValueSubstitutingVariables): Deleted.
(WebCore::CSSValueList::buildParserValueListSubstitutingVariables): Deleted.
* css/CSSValueList.h:
(WebCore::CSSValueList::createSlashSeparated):
(WebCore::CSSValueList::createFromParserValueList): Deleted.
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createFontFaceValue):
* css/CSSVariableData.cpp:
* css/CSSVariableDependentValue.cpp: Removed.
* css/CSSVariableDependentValue.h: Removed.
* css/CSSVariableValue.cpp: Removed.
* css/CSSVariableValue.h: Removed.
* css/DOMCSSNamespace.cpp:
* css/FontFace.cpp:
(WebCore::FontFace::parseString):
* css/InspectorCSSOMWrappers.cpp:
* css/MediaQueryExp.cpp:
(WebCore::isFeatureValidWithIdentifier): Deleted.
(WebCore::isFeatureValidWithNonNegativeLengthOrNumber): Deleted.
(WebCore::isFeatureValidWithDensity): Deleted.
(WebCore::isFeatureValidWithNonNegativeInteger): Deleted.
(WebCore::isFeatureValidWithNonNegativeNumber): Deleted.
(WebCore::isFeatureValidWithZeroOrOne): Deleted.
(WebCore::isFeatureValidWithNumberWithUnit): Deleted.
(WebCore::isFeatureValidWithNumber): Deleted.
(WebCore::isSlash): Deleted.
(WebCore::isPositiveIntegerValue): Deleted.
* css/MediaQueryExp.h:
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setCssText):
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
* css/SelectorPseudoTypeMap.h:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
(WebCore::StyleProperties::getPropertyCSSValue):
(WebCore::MutableStyleProperties::setCustomProperty):
(WebCore::MutableStyleProperties::parseDeclaration):
(WebCore::StyleProperties::asText):
* css/StyleProperties.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
* css/StyleResolver.h:
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::createCSSOMWrapper):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
(WebCore::StyleSheetContents::parseString):
(WebCore::StyleSheetContents::completeURL):
(WebCore::StyleSheetContents::parseStringAtPosition): Deleted.
* css/StyleSheetContents.h:
* css/WebKitCSSMatrix.cpp:
* css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::CSSParser::CSSParser):
(WebCore::CSSParser::parseSheet):
(WebCore::CSSParser::parseRule):
(WebCore::CSSParser::parseKeyframeRule):
(WebCore::CSSParser::parseSupportsCondition):
(WebCore::CSSParser::parseColor):
(WebCore::CSSParser::parseSystemColor):
(WebCore::CSSParser::parseSingleValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseCustomPropertyValue):
(WebCore::CSSParser::parseSelector):
(WebCore::CSSParser::parseInlineStyleDeclaration):
(WebCore::CSSParser::parseDeclaration):
(WebCore::CSSParser::parseValueWithVariableReferences):
(WebCore::CSSParser::parseKeyframeKeyList):
(WebCore::CSSParser::parseFontFaceDescriptor):
(WebCore::equalLettersIgnoringASCIICase): Deleted.
(WebCore::hasPrefix): Deleted.
(WebCore::createPrimitiveValuePair): Deleted.
(WebCore::AnimationParseContext::commitFirstAnimation): Deleted.
(WebCore::AnimationParseContext::hasCommittedFirstAnimation): Deleted.
(WebCore::AnimationParseContext::commitAnimationPropertyKeyword): Deleted.
(WebCore::AnimationParseContext::animationPropertyKeywordAllowed): Deleted.
(WebCore::AnimationParseContext::hasSeenAnimationPropertyKeyword): Deleted.
(WebCore::AnimationParseContext::sawAnimationPropertyKeyword): Deleted.
(): Deleted.
(WebCore::convertToASCIILowercaseInPlace): Deleted.
(WebCore::CSSParserString::convertToASCIILowercaseInPlace): Deleted.
(WebCore::CSSParser::setupParser): Deleted.
(WebCore::isColorPropertyID): Deleted.
(WebCore::CSSParser::isValidSystemColorValue): Deleted.
(WebCore::validPrimitiveValueColor): Deleted.
(WebCore::parseColorValue): Deleted.
(WebCore::isSimpleLengthPropertyID): Deleted.
(WebCore::parseSimpleLength): Deleted.
(WebCore::parseSimpleLengthValue): Deleted.
(WebCore::isValidKeywordPropertyAndValue): Deleted.
(WebCore::isUniversalKeyword): Deleted.
(WebCore::isKeywordPropertyID): Deleted.
(WebCore::parseKeywordValue): Deleted.
(WebCore::parseTransformTranslateArguments): Deleted.
(WebCore::parseTranslateTransformValue): Deleted.
(WebCore::CSSParser::parseFontFaceValue): Deleted.
(WebCore::CSSParser::parseColorFromString): Deleted.
(WebCore::CSSParser::parseDeclarationDeprecated): Deleted.
(WebCore::filterProperties): Deleted.
(WebCore::CSSParser::createStyleProperties): Deleted.
(WebCore::CSSParser::addProperty): Deleted.
(WebCore::CSSParser::rollbackLastProperties): Deleted.
(WebCore::CSSParser::clearProperties): Deleted.
(WebCore::CSSParser::completeURL): Deleted.
(WebCore::CSSParser::validateCalculationUnit): Deleted.
(WebCore::CSSParser::shouldAcceptUnitLessValues): Deleted.
(WebCore::CSSParser::validateUnit): Deleted.
(WebCore::CSSParser::createPrimitiveNumericValue): Deleted.
(WebCore::CSSParser::createPrimitiveStringValue): Deleted.
(WebCore::isComma): Deleted.
(WebCore::isForwardSlashOperator): Deleted.
(WebCore::CSSParser::isValidSize): Deleted.
(WebCore::CSSParser::parseValidPrimitive): Deleted.
(WebCore::CSSParser::addExpandedPropertyForValue): Deleted.
(WebCore::isImageSetFunctionValue): Deleted.
(WebCore::CSSParser::addFillValue): Deleted.
(WebCore::isContentDistributionKeyword): Deleted.
(WebCore::isContentPositionKeyword): Deleted.
(WebCore::isBaselinePositionKeyword): Deleted.
(WebCore::isAlignmentOverflowKeyword): Deleted.
(WebCore::isItemPositionKeyword): Deleted.
(WebCore::CSSParser::parseLegacyPosition): Deleted.
(WebCore::CSSParser::parseContentDistributionOverflowPosition): Deleted.
(WebCore::CSSParser::parseItemPositionOverflowPosition): Deleted.
(WebCore::parseBackgroundClip): Deleted.
(WebCore::CSSParser::useLegacyBackgroundSizeShorthandBehavior): Deleted.
(WebCore::CSSParser::parseNonElementSnapPoints): Deleted.
(WebCore::CSSParser::parseScrollSnapPositions): Deleted.
(WebCore::CSSParser::parseScrollSnapDestination): Deleted.
(WebCore::CSSParser::parseScrollSnapCoordinate): Deleted.
(WebCore::CSSParser::parseFillShorthand): Deleted.
(WebCore::CSSParser::addAnimationValue): Deleted.
(WebCore::CSSParser::parseAnimationShorthand): Deleted.
(WebCore::CSSParser::parseColumnWidth): Deleted.
(WebCore::CSSParser::parseColumnCount): Deleted.
(WebCore::CSSParser::parseColumnsShorthand): Deleted.
(WebCore::CSSParser::parseTransitionShorthand): Deleted.
(WebCore::CSSParser::parseShorthand): Deleted.
(WebCore::CSSParser::parse4Values): Deleted.
(WebCore::CSSParser::parsePage): Deleted.
(WebCore::CSSParser::parseSize): Deleted.
(WebCore::CSSParser::parseSizeParameter): Deleted.
(WebCore::CSSParser::parseQuotes): Deleted.
(WebCore::CSSParser::parseAlt): Deleted.
(WebCore::CSSParser::parseCustomPropertyDeclaration): Deleted.
(WebCore::CSSParser::parseContent): Deleted.
(WebCore::CSSParser::parseAttr): Deleted.
(WebCore::CSSParser::parseBackgroundColor): Deleted.
(WebCore::CSSParser::parseFillImage): Deleted.
(WebCore::CSSParser::parsePositionX): Deleted.
(WebCore::CSSParser::parsePositionY): Deleted.
(WebCore::CSSParser::parseFillPositionComponent): Deleted.
(WebCore::isValueConflictingWithCurrentEdge): Deleted.
(WebCore::isFillPositionKeyword): Deleted.
(WebCore::CSSParser::parse4ValuesFillPosition): Deleted.
(WebCore::CSSParser::parse3ValuesFillPosition): Deleted.
(WebCore::CSSParser::isPotentialPositionValue): Deleted.
(WebCore::CSSParser::parseFillPosition): Deleted.
(WebCore::CSSParser::parse2ValuesFillPosition): Deleted.
(WebCore::CSSParser::parseFillRepeat): Deleted.
(WebCore::CSSParser::parseFillSize): Deleted.
(WebCore::CSSParser::parseFillProperty): Deleted.
(WebCore::CSSParser::parseAnimationDelay): Deleted.
(WebCore::CSSParser::parseAnimationDirection): Deleted.
(WebCore::CSSParser::parseAnimationDuration): Deleted.
(WebCore::CSSParser::parseAnimationFillMode): Deleted.
(WebCore::CSSParser::parseAnimationIterationCount): Deleted.
(WebCore::CSSParser::parseAnimationName): Deleted.
(WebCore::CSSParser::parseAnimationPlayState): Deleted.
(WebCore::CSSParser::parseAnimationTrigger): Deleted.
(WebCore::CSSParser::parseAnimationProperty): Deleted.
(WebCore::CSSParser::parseTransformOriginShorthand): Deleted.
(WebCore::CSSParser::isSpringTimingFunctionEnabled): Deleted.
(WebCore::CSSParser::parseCubicBezierTimingFunctionValue): Deleted.
(WebCore::CSSParser::parseSpringTimingFunctionValue): Deleted.
(WebCore::CSSParser::parseAnimationTimingFunction): Deleted.
(WebCore::isValidGridPositionCustomIdent): Deleted.
(WebCore::CSSParser::parseIntegerOrCustomIdentFromGridPosition): Deleted.
(WebCore::CSSParser::parseGridPosition): Deleted.
(WebCore::gridMissingGridPositionValue): Deleted.
(WebCore::CSSParser::parseGridItemPositionShorthand): Deleted.
(WebCore::CSSParser::parseGridGapShorthand): Deleted.
(WebCore::CSSParser::parseGridTemplateColumns): Deleted.
(WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): Deleted.
(WebCore::CSSParser::parseGridTemplateShorthand): Deleted.
(WebCore::parseImplicitAutoFlow): Deleted.
(WebCore::CSSParser::parseGridShorthand): Deleted.
(WebCore::CSSParser::parseGridAreaShorthand): Deleted.
(WebCore::CSSParser::parseSingleGridAreaLonghand): Deleted.
(WebCore::CSSParser::parseGridLineNames): Deleted.
(WebCore::isGridTrackFixedSized): Deleted.
(WebCore::CSSParser::parseGridTrackList): Deleted.
(WebCore::CSSParser::parseGridTrackRepeatFunction): Deleted.
(WebCore::CSSParser::parseGridTrackSize): Deleted.
(WebCore::CSSParser::parseGridBreadth): Deleted.
(WebCore::isValidGridAutoFlowId): Deleted.
(WebCore::CSSParser::parseGridAutoFlow): Deleted.
(WebCore::skipCommaInDashboardRegion): Deleted.
(WebCore::CSSParser::parseDashboardRegions): Deleted.
(WebCore::parseGridTemplateAreasColumnNames): Deleted.
(WebCore::CSSParser::parseGridTemplateAreasRow): Deleted.
(WebCore::CSSParser::parseGridTemplateAreas): Deleted.
(WebCore::CSSParser::parseCounterContent): Deleted.
(WebCore::CSSParser::parseClipShape): Deleted.
(WebCore::completeBorderRadii): Deleted.
(WebCore::CSSParser::parseInsetRoundedCorners): Deleted.
(WebCore::CSSParser::parseBasicShapeInset): Deleted.
(WebCore::CSSParser::parseShapeRadius): Deleted.
(WebCore::CSSParser::parseBasicShapeCircle): Deleted.
(WebCore::CSSParser::parseBasicShapeEllipse): Deleted.
(WebCore::CSSParser::parseBasicShapePolygon): Deleted.
(WebCore::CSSParser::parseBasicShapePath): Deleted.
(WebCore::isBoxValue): Deleted.
(WebCore::CSSParser::parseBasicShapeAndOrBox): Deleted.
(WebCore::CSSParser::parseShapeProperty): Deleted.
(WebCore::CSSParser::parseClipPath): Deleted.
(WebCore::CSSParser::parseBasicShape): Deleted.
(WebCore::CSSParser::parseFont): Deleted.
(WebCore::CSSParser::parseSystemFont): Deleted.
(WebCore::FontFamilyValueBuilder::FontFamilyValueBuilder): Deleted.
(WebCore::FontFamilyValueBuilder::add): Deleted.
(WebCore::FontFamilyValueBuilder::commit): Deleted.
(WebCore::valueIsCSSKeyword): Deleted.
(WebCore::CSSParser::parseFontFamily): Deleted.
(WebCore::CSSParser::parseLineHeight): Deleted.
(WebCore::CSSParser::parseFontSize): Deleted.
(WebCore::createFontWeightValueKeyword): Deleted.
(WebCore::CSSParser::parseFontWeight): Deleted.
(WebCore::CSSParser::parseFontSynthesis): Deleted.
(WebCore::CSSParser::parseFontFaceSrcURI): Deleted.
(WebCore::CSSParser::parseFontFaceSrcLocal): Deleted.
(WebCore::CSSParser::parseFontFaceSrc): Deleted.
(WebCore::CSSParser::parseFontFaceUnicodeRange): Deleted.
(WebCore::checkForValidDouble): Deleted.
(WebCore::parseDouble): Deleted.
(WebCore::parseColorIntOrPercentage): Deleted.
(WebCore::isTenthAlpha): Deleted.
(WebCore::parseAlphaValue): Deleted.
(WebCore::mightBeRGBA): Deleted.
(WebCore::mightBeRGB): Deleted.
(WebCore::fastParseColorInternal): Deleted.
(WebCore::CSSParser::fastParseColor): Deleted.
(WebCore::CSSParser::parsedDouble): Deleted.
(WebCore::CSSParser::isCalculation): Deleted.
(WebCore::isPercent): Deleted.
(WebCore::CSSParser::parseColorInt): Deleted.
(WebCore::CSSParser::parseColorDouble): Deleted.
(WebCore::CSSParser::parseRGBParameters): Deleted.
(WebCore::CSSParser::parseColorFunctionParameters): Deleted.
(WebCore::CSSParser::parseHSLParameters): Deleted.
(WebCore::CSSParser::parseColorFromValue): Deleted.
(WebCore::ShadowParseContext::ShadowParseContext): Deleted.
(WebCore::ShadowParseContext::allowLength): Deleted.
(WebCore::ShadowParseContext::commitValue): Deleted.
(WebCore::ShadowParseContext::commitLength): Deleted.
(WebCore::ShadowParseContext::commitColor): Deleted.
(WebCore::ShadowParseContext::commitStyle): Deleted.
(WebCore::CSSParser::parseShadow): Deleted.
(WebCore::CSSParser::parseReflect): Deleted.
(WebCore::CSSParser::parseFlex): Deleted.
(WebCore::BorderImageParseContext::BorderImageParseContext): Deleted.
(WebCore::BorderImageParseContext::canAdvance): Deleted.
(WebCore::BorderImageParseContext::setCanAdvance): Deleted.
(WebCore::BorderImageParseContext::allowCommit): Deleted.
(WebCore::BorderImageParseContext::allowImage): Deleted.
(WebCore::BorderImageParseContext::allowImageSlice): Deleted.
(WebCore::BorderImageParseContext::allowRepeat): Deleted.
(WebCore::BorderImageParseContext::allowForwardSlashOperator): Deleted.
(WebCore::BorderImageParseContext::requireWidth): Deleted.
(WebCore::BorderImageParseContext::requireOutset): Deleted.
(WebCore::BorderImageParseContext::commitImage): Deleted.
(WebCore::BorderImageParseContext::commitImageSlice): Deleted.
(WebCore::BorderImageParseContext::commitForwardSlashOperator): Deleted.
(WebCore::BorderImageParseContext::commitBorderWidth): Deleted.
(WebCore::BorderImageParseContext::commitBorderOutset): Deleted.
(WebCore::BorderImageParseContext::commitRepeat): Deleted.
(WebCore::BorderImageParseContext::commitWebKitBorderImage): Deleted.
(WebCore::BorderImageParseContext::commitBorderImage): Deleted.
(WebCore::BorderImageParseContext::commitBorderImageProperty): Deleted.
(WebCore::CSSParser::parseBorderImage): Deleted.
(WebCore::isBorderImageRepeatKeyword): Deleted.
(WebCore::CSSParser::parseBorderImageRepeat): Deleted.
(WebCore::BorderImageSliceParseContext::BorderImageSliceParseContext): Deleted.
(WebCore::BorderImageSliceParseContext::allowNumber): Deleted.
(WebCore::BorderImageSliceParseContext::allowFill): Deleted.
(WebCore::BorderImageSliceParseContext::allowFinalCommit): Deleted.
(WebCore::BorderImageSliceParseContext::top): Deleted.
(WebCore::BorderImageSliceParseContext::commitNumber): Deleted.
(WebCore::BorderImageSliceParseContext::commitFill): Deleted.
(WebCore::BorderImageSliceParseContext::commitBorderImageSlice): Deleted.
(WebCore::CSSParser::parseBorderImageSlice): Deleted.
(WebCore::BorderImageQuadParseContext::BorderImageQuadParseContext): Deleted.
(WebCore::BorderImageQuadParseContext::allowNumber): Deleted.
(WebCore::BorderImageQuadParseContext::allowFinalCommit): Deleted.
(WebCore::BorderImageQuadParseContext::top): Deleted.
(WebCore::BorderImageQuadParseContext::commitNumber): Deleted.
(WebCore::BorderImageQuadParseContext::setAllowFinalCommit): Deleted.
(WebCore::BorderImageQuadParseContext::setTop): Deleted.
(WebCore::BorderImageQuadParseContext::commitBorderImageQuad): Deleted.
(WebCore::CSSParser::parseBorderImageQuad): Deleted.
(WebCore::CSSParser::parseBorderImageWidth): Deleted.
(WebCore::CSSParser::parseBorderImageOutset): Deleted.
(WebCore::CSSParser::parseBorderRadius): Deleted.
(WebCore::CSSParser::parseAspectRatio): Deleted.
(WebCore::CSSParser::parseCounter): Deleted.
(WebCore::parseDeprecatedGradientPoint): Deleted.
(WebCore::parseDeprecatedGradientColorStop): Deleted.
(WebCore::CSSParser::parseDeprecatedGradient): Deleted.
(WebCore::valueFromSideKeyword): Deleted.
(WebCore::parseGradientColorOrKeyword): Deleted.
(WebCore::CSSParser::parseDeprecatedLinearGradient): Deleted.
(WebCore::CSSParser::parseDeprecatedRadialGradient): Deleted.
(WebCore::CSSParser::parseLinearGradient): Deleted.
(WebCore::CSSParser::parseRadialGradient): Deleted.
(WebCore::CSSParser::parseGradientColorStops): Deleted.
(WebCore::CSSParser::isGeneratedImageValue): Deleted.
(WebCore::CSSParser::parseGeneratedImage): Deleted.
(WebCore::CSSParser::parseFilterImage): Deleted.
(WebCore::CSSParser::parseCrossfade): Deleted.
(WebCore::CSSParser::parseCanvas): Deleted.
(WebCore::CSSParser::parseNamedImage): Deleted.
(WebCore::CSSParser::parseImageResolution): Deleted.
(WebCore::CSSParser::parseImageSet): Deleted.
(WebCore::TransformOperationInfo::TransformOperationInfo): Deleted.
(WebCore::TransformOperationInfo::type): Deleted.
(WebCore::TransformOperationInfo::argCount): Deleted.
(WebCore::TransformOperationInfo::unit): Deleted.
(WebCore::TransformOperationInfo::unknown): Deleted.
(WebCore::TransformOperationInfo::hasCorrectArgCount): Deleted.
(WebCore::CSSParser::parseTransform): Deleted.
(WebCore::CSSParser::parseTransformValue): Deleted.
(WebCore::CSSParser::isBlendMode): Deleted.
(WebCore::CSSParser::isCompositeOperator): Deleted.
(WebCore::isValidPrimitiveFilterFunction): Deleted.
(WebCore::CSSParser::parseBuiltinFilterArguments): Deleted.
(WebCore::cssValueKeywordIDForFunctionName): Deleted.
(WebCore::CSSParser::parseFilter): Deleted.
(WebCore::validFlowName): Deleted.
(WebCore::CSSParser::isTextAutosizingEnabled): Deleted.
(WebCore::CSSParser::isCSSGridLayoutEnabled): Deleted.
(WebCore::CSSParser::parseFlowThread): Deleted.
(WebCore::CSSParser::parseRegionThread): Deleted.
(WebCore::CSSParser::parseTransformOrigin): Deleted.
(WebCore::CSSParser::parsePerspectiveOrigin): Deleted.
(WebCore::CSSParser::addTextDecorationProperty): Deleted.
(WebCore::CSSParser::parseTextDecoration): Deleted.
(WebCore::CSSParser::parseTextDecorationSkip): Deleted.
(WebCore::CSSParser::parseTextUnderlinePosition): Deleted.
(WebCore::CSSParser::parseTextEmphasisStyle): Deleted.
(WebCore::CSSParser::parseTextEmphasisPosition): Deleted.
(WebCore::CSSParser::parseTextIndent): Deleted.
(WebCore::CSSParser::parseHangingPunctuation): Deleted.
(WebCore::CSSParser::parseLineBoxContain): Deleted.
(WebCore::CSSParser::parseFontFeatureTag): Deleted.
(WebCore::CSSParser::parseFontFeatureSettings): Deleted.
(WebCore::CSSParser::parseFontVariationTag): Deleted.
(WebCore::CSSParser::parseFontVariationSettings): Deleted.
(WebCore::CSSParser::parseFontVariantLigatures): Deleted.
(WebCore::CSSParser::parseFontVariantNumeric): Deleted.
(WebCore::CSSParser::parseFontVariantEastAsian): Deleted.
(WebCore::CSSParser::parseFontVariant): Deleted.
(WebCore::isValidWillChangeAnimatableFeature): Deleted.
(WebCore::CSSParser::parseWillChange): Deleted.
(WebCore::CSSParser::parseCalculation): Deleted.
(WebCore::isCSSLetter): Deleted.
(WebCore::isCSSEscape): Deleted.
(WebCore::isURILetter): Deleted.
(WebCore::isIdentifierStartAfterDash): Deleted.
(WebCore::isCustomPropertyIdentifier): Deleted.
(WebCore::isEqualToCSSIdentifier): Deleted.
(WebCore::isEqualToCSSCaseSensitiveIdentifier): Deleted.
(WebCore::checkAndSkipEscape): Deleted.
(WebCore::skipWhiteSpace): Deleted.
(WebCore::CSSParserString::characters<LChar>): Deleted.
(WebCore::CSSParserString::characters<UChar>): Deleted.
(WebCore::CSSParser::currentCharacter<LChar>): Deleted.
(WebCore::CSSParser::currentCharacter<UChar>): Deleted.
(WebCore::CSSParser::currentCharacter16): Deleted.
(WebCore::CSSParser::tokenStart<LChar>): Deleted.
(WebCore::CSSParser::tokenStart<UChar>): Deleted.
(WebCore::CSSParser::currentLocation): Deleted.
(WebCore::CSSParser::isIdentifierStart): Deleted.
(WebCore::checkAndSkipString): Deleted.
(WebCore::CSSParser::parseEscape): Deleted.
(WebCore::CSSParser::UnicodeToChars<LChar>): Deleted.
(WebCore::CSSParser::UnicodeToChars<UChar>): Deleted.
(WebCore::CSSParser::parseIdentifierInternal): Deleted.
(WebCore::CSSParser::parseIdentifier): Deleted.
(WebCore::CSSParser::parseStringInternal): Deleted.
(WebCore::CSSParser::parseString): Deleted.
(WebCore::CSSParser::findURI): Deleted.
(WebCore::CSSParser::parseURIInternal): Deleted.
(WebCore::CSSParser::parseURI): Deleted.
(WebCore::CSSParser::parseUnicodeRange): Deleted.
(WebCore::CSSParser::parseNthChild): Deleted.
(WebCore::CSSParser::parseNthChildExtra): Deleted.
(WebCore::CSSParser::detectFunctionTypeToken): Deleted.
(WebCore::CSSParser::detectMediaQueryToken): Deleted.
(WebCore::CSSParser::detectNumberToken): Deleted.
(WebCore::CSSParser::detectDashToken): Deleted.
(WebCore::CSSParser::detectAtToken): Deleted.
(WebCore::CSSParser::detectSupportsToken): Deleted.
(WebCore::CSSParser::realLex): Deleted.
(WebCore::CSSParser::createImportRule): Deleted.
(WebCore::CSSParser::createMediaRule): Deleted.
(WebCore::CSSParser::createEmptyMediaRule): Deleted.
(WebCore::CSSParser::createSupportsRule): Deleted.
(WebCore::CSSParser::markSupportsRuleHeaderStart): Deleted.
(WebCore::CSSParser::markSupportsRuleHeaderEnd): Deleted.
(WebCore::CSSParser::popSupportsRuleData): Deleted.
(WebCore::CSSParser::processAndAddNewRuleToSourceTreeIfNeeded): Deleted.
(WebCore::CSSParser::addNewRuleToSourceTree): Deleted.
(WebCore::CSSParser::popRuleData): Deleted.
(WebCore::CSSParser::syntaxError): Deleted.
(WebCore::CSSParser::isLoggingErrors): Deleted.
(WebCore::CSSParser::logError): Deleted.
(WebCore::CSSParser::createKeyframesRule): Deleted.
(WebCore::CSSParser::createStyleRule): Deleted.
(WebCore::CSSParser::createFontFaceRule): Deleted.
(WebCore::CSSParser::addNamespace): Deleted.
(WebCore::CSSParser::determineNameInNamespace): Deleted.
(WebCore::CSSParser::rewriteSpecifiersWithNamespaceIfNeeded): Deleted.
(WebCore::CSSParser::rewriteSpecifiersWithElementName): Deleted.
(WebCore::CSSParser::rewriteSpecifiers): Deleted.
(WebCore::CSSParser::createPageRule): Deleted.
(WebCore::CSSParser::createSelectorVector): Deleted.
(WebCore::CSSParser::recycleSelectorVector): Deleted.
(WebCore::CSSParser::createRegionRule): Deleted.
(WebCore::CSSParser::createMarginAtRule): Deleted.
(WebCore::CSSParser::startDeclarationsForMarginBox): Deleted.
(WebCore::CSSParser::endDeclarationsForMarginBox): Deleted.
(WebCore::CSSParser::createKeyframe): Deleted.
(WebCore::CSSParser::invalidBlockHit): Deleted.
(WebCore::CSSParser::updateLastMediaLine): Deleted.
(WebCore::fixUnparsedProperties): Deleted.
(WebCore::CSSParser::fixUnparsedPropertyRanges): Deleted.
(WebCore::CSSParser::markRuleHeaderStart): Deleted.
(WebCore::CSSParser::setRuleHeaderEnd): Deleted.
(WebCore::CSSParser::markRuleHeaderEnd): Deleted.
(WebCore::CSSParser::markSelectorStart): Deleted.
(WebCore::CSSParser::markSelectorEnd): Deleted.
(WebCore::CSSParser::markRuleBodyStart): Deleted.
(WebCore::CSSParser::markRuleBodyEnd): Deleted.
(WebCore::CSSParser::markPropertyStart): Deleted.
(WebCore::CSSParser::markPropertyEnd): Deleted.
(WebCore::CSSParser::createViewportRule): Deleted.
(WebCore::CSSParser::parseViewportProperty): Deleted.
(WebCore::CSSParser::parseViewportShorthand): Deleted.
(WebCore::isAppleLegacyCSSPropertyKeyword): Deleted.
(WebCore::cssPropertyID): Deleted.
(WebCore::cssPropertyNameIOSAliasing): Deleted.
(WebCore::isAppleLegacyCSSValueKeyword): Deleted.
(WebCore::cssValueKeywordID): Deleted.
(WebCore::isValidNthToken): Deleted.
* css/parser/CSSParser.h:
(): Deleted.
(WebCore::CSSParser::ValueWithCalculation::ValueWithCalculation): Deleted.
(WebCore::CSSParser::ValueWithCalculation::value): Deleted.
(WebCore::CSSParser::ValueWithCalculation::operator CSSParserValue&): Deleted.
(WebCore::CSSParser::ValueWithCalculation::calculation): Deleted.
(WebCore::CSSParser::ValueWithCalculation::setCalculation): Deleted.
(WebCore::CSSParser::hasProperties): Deleted.
(WebCore::CSSParser::startNestedSelectorList): Deleted.
(WebCore::CSSParser::endNestedSelectorList): Deleted.
(WebCore::CSSParser::resetPropertyRange): Deleted.
(WebCore::CSSParser::isExtractingSourceData): Deleted.
(WebCore::CSSParser::lex): Deleted.
(WebCore::CSSParser::token): Deleted.
(WebCore::CSSParser::markViewportRuleBodyStart): Deleted.
(WebCore::CSSParser::markViewportRuleBodyEnd): Deleted.
(WebCore::CSSParser::setCustomPropertyName): Deleted.
(WebCore::CSSParser::is8BitSource): Deleted.
(WebCore::CSSParser::setStyleSheet): Deleted.
(WebCore::CSSParser::inStrictMode): Deleted.
(WebCore::CSSParser::inQuirksMode): Deleted.
(WebCore::CSSParser::setupParser): Deleted.
(WebCore::CSSParser::inShorthand): Deleted.
(WebCore::CSSParser::inViewport): Deleted.
(WebCore::CSSParser::operator|): Deleted.
(WebCore::CSSParser::validateUnit): Deleted.
(WebCore::ShorthandScope::ShorthandScope): Deleted.
(WebCore::ShorthandScope::~ShorthandScope): Deleted.
(WebCore::CSSParser::setTokenStart<LChar>): Deleted.
(WebCore::CSSParser::setTokenStart<UChar>): Deleted.
(WebCore::CSSParser::tokenStartOffset): Deleted.
(WebCore::CSSParser::currentCharacterOffset): Deleted.
(WebCore::CSSParser::tokenStartChar): Deleted.
(WebCore::isCustomPropertyName): Deleted.
(WebCore::cssyylex): Deleted.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContextHash::hash):
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::setSelectorList):
(WebCore::destroy): Deleted.
(WebCore::CSSParserValueList::~CSSParserValueList): Deleted.
(WebCore::CSSParserValueList::addValue): Deleted.
(WebCore::CSSParserValueList::insertValueAt): Deleted.
(WebCore::CSSParserValueList::extend): Deleted.
(WebCore::CSSParserValueList::containsVariables): Deleted.
(WebCore::CSSParserValue::createCSSValue): Deleted.
(WebCore::CSSParserSelector::parsePseudoElementSelector): Deleted.
(WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector): Deleted.
(WebCore::CSSParserSelector::parsePseudoElementSlottedFunctionSelector): Deleted.
(WebCore::CSSParserSelector::parsePseudoClassHostFunctionSelector): Deleted.
(WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector): Deleted.
(WebCore::CSSParserSelector::setPseudoClassValue): Deleted.
* css/parser/CSSParserValues.h:
(WebCore::CSSParserString::init): Deleted.
(WebCore::CSSParserString::clear): Deleted.
(WebCore::CSSParserString::is8Bit): Deleted.
(WebCore::CSSParserString::characters8): Deleted.
(WebCore::CSSParserString::characters16): Deleted.
(WebCore::CSSParserString::length): Deleted.
(WebCore::CSSParserString::setLength): Deleted.
(WebCore::CSSParserString::operator[]): Deleted.
(WebCore::CSSParserString::operator String): Deleted.
(WebCore::CSSParserString::operator AtomicString): Deleted.
(WebCore::CSSParserString::toStringView): Deleted.
(): Deleted.
(WebCore::CSSParserValueList::CSSParserValueList): Deleted.
(WebCore::CSSParserValueList::size): Deleted.
(WebCore::CSSParserValueList::currentIndex): Deleted.
(WebCore::CSSParserValueList::current): Deleted.
(WebCore::CSSParserValueList::next): Deleted.
(WebCore::CSSParserValueList::previous): Deleted.
(WebCore::CSSParserValueList::setCurrentIndex): Deleted.
(WebCore::CSSParserValueList::valueAt): Deleted.
(WebCore::CSSParserValueList::clear): Deleted.
(WebCore::CSSParserValue::setFromValueList): Deleted.
(WebCore::equalLettersIgnoringASCIICase): Deleted.
* css/parser/CSSPropertyParser.cpp:
(WebCore::isCustomPropertyName):
(WebCore::cssPropertyNameIOSAliasing):
* css/parser/CSSPropertyParser.h:
* css/parser/SVGCSSParser.cpp: Removed.
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::ensureSourceData):
(WebCore::InspectorStyleSheetForInlineStyle::ruleSourceData):
* page/animation/AnimationController.cpp:
* rendering/style/RenderStyle.cpp:
* svg/SVGAnimateElementBase.cpp:
* svg/SVGAnimationElement.cpp:
* svg/SVGElement.cpp:

Source/WebKit/mac:

* DOM/DOMCSS.mm:
(kitClass):
* DOM/DOMCSSRule.h:

Tools:

* TestWebKitAPI/Tests/WebCore/CSSParser.cpp:
(TestWebKitAPI::TEST):

LayoutTests:

* TestExpectations:
Some canvas tests pass now that they use the new parser's color parsing.

* fast/dom/HTMLFontElement/face-attribute-expected.txt:
* fast/dom/HTMLFontElement/face-attribute.html:
Converted font face parsing over to just use the CSS parser's font-family
parsing. This matches other browsers, so removing cases that we used to
accept now that we're more strict.

* platform/mac/canvas/philip/tests/2d.fillStyle.parse.rgb-eof-expected.txt:
* platform/mac/canvas/philip/tests/2d.fillStyle.parse.rgba-eof-expected.txt:
These tests pass now that canvas uses the new parser's color parsing.

* platform/ios-simulator/svg/custom/fill-SVGPaint-interface-expected.txt: Removed.
* platform/mac/svg/custom/fill-SVGPaint-interface-expected.png: Removed.
* platform/mac/svg/custom/fill-SVGPaint-interface-expected.txt: Removed.
* svg/custom/fill-SVGPaint-interface.svg: Removed.
Remove another test of the SVG CSS OM, since the SVG CSS OM for SVGPaint etc.
is gone now.

* platform/mac/js/dom/global-constructors-attributes-expected.txt:
Rebaselined because of CSSNamespaceRule.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209666 268f45cc-cd09-0410-ab3c-d52691b4dbfc

86 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/dom/HTMLFontElement/face-attribute-expected.txt
LayoutTests/fast/dom/HTMLFontElement/face-attribute.html
LayoutTests/platform/ios-simulator/svg/custom/fill-SVGPaint-interface-expected.txt [deleted file]
LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac/canvas/philip/tests/2d.fillStyle.parse.rgb-eof-expected.txt
LayoutTests/platform/mac/canvas/philip/tests/2d.fillStyle.parse.rgba-eof-expected.txt
LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac/svg/custom/fill-SVGPaint-interface-expected.png [deleted file]
LayoutTests/platform/mac/svg/custom/fill-SVGPaint-interface-expected.txt [deleted file]
LayoutTests/svg/custom/fill-SVGPaint-interface.svg [deleted file]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSCSSRuleCustom.cpp
Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
Source/WebCore/css/CSSAllInOne.cpp
Source/WebCore/css/CSSCalculationValue.cpp
Source/WebCore/css/CSSCalculationValue.h
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSCustomPropertyValue.cpp
Source/WebCore/css/CSSCustomPropertyValue.h
Source/WebCore/css/CSSFunctionValue.cpp
Source/WebCore/css/CSSFunctionValue.h
Source/WebCore/css/CSSGrammar.y.in [deleted file]
Source/WebCore/css/CSSGrammar.y.includes [deleted file]
Source/WebCore/css/CSSGroupingRule.cpp
Source/WebCore/css/CSSKeyframeRule.h
Source/WebCore/css/CSSKeyframesRule.cpp
Source/WebCore/css/CSSNamespaceRule.cpp [moved from Source/WebCore/css/CSSVariableValue.h with 51% similarity]
Source/WebCore/css/CSSNamespaceRule.h [moved from Source/WebCore/css/CSSVariableDependentValue.cpp with 62% similarity]
Source/WebCore/css/CSSNamespaceRule.idl [new file with mode: 0644]
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSPrimitiveValue.h
Source/WebCore/css/CSSRule.h
Source/WebCore/css/CSSRule.idl
Source/WebCore/css/CSSStyleSheet.cpp
Source/WebCore/css/CSSValue.cpp
Source/WebCore/css/CSSValue.h
Source/WebCore/css/CSSValueList.cpp
Source/WebCore/css/CSSValueList.h
Source/WebCore/css/CSSValuePool.cpp
Source/WebCore/css/CSSVariableData.cpp
Source/WebCore/css/CSSVariableDependentValue.h [deleted file]
Source/WebCore/css/CSSVariableValue.cpp [deleted file]
Source/WebCore/css/DOMCSSNamespace.cpp
Source/WebCore/css/FontFace.cpp
Source/WebCore/css/InspectorCSSOMWrappers.cpp
Source/WebCore/css/MediaQueryExp.cpp
Source/WebCore/css/MediaQueryExp.h
Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
Source/WebCore/css/SelectorPseudoTypeMap.h
Source/WebCore/css/StyleProperties.cpp
Source/WebCore/css/StyleProperties.h
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleResolver.h
Source/WebCore/css/StyleRule.cpp
Source/WebCore/css/StyleSheetContents.cpp
Source/WebCore/css/StyleSheetContents.h
Source/WebCore/css/WebKitCSSMatrix.cpp
Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py
Source/WebCore/css/parser/CSSParser.cpp
Source/WebCore/css/parser/CSSParser.h
Source/WebCore/css/parser/CSSParserFastPaths.cpp
Source/WebCore/css/parser/CSSParserMode.h
Source/WebCore/css/parser/CSSParserValues.cpp
Source/WebCore/css/parser/CSSParserValues.h
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/css/parser/CSSPropertyParser.h
Source/WebCore/css/parser/CSSSelectorParser.cpp
Source/WebCore/css/parser/CSSSelectorParser.h
Source/WebCore/css/parser/SVGCSSParser.cpp [deleted file]
Source/WebCore/dom/InlineStyleSheetOwner.cpp
Source/WebCore/inspector/InspectorStyleSheet.cpp
Source/WebCore/page/animation/AnimationController.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/svg/SVGAnimateElementBase.cpp
Source/WebCore/svg/SVGAnimationElement.cpp
Source/WebCore/svg/SVGElement.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/DOM/DOMCSS.mm
Source/WebKit/mac/DOM/DOMCSSRule.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/CSSParser.cpp

index d3fbacc..4c2cd32 100644 (file)
@@ -1,3 +1,33 @@
+2016-12-09  Dave Hyatt  <hyatt@apple.com>
+
+        [CSS Parser] Remove the old CSS Parser
+        https://bugs.webkit.org/show_bug.cgi?id=165645
+
+        Reviewed by Daniel Bates.
+
+        * TestExpectations:
+        Some canvas tests pass now that they use the new parser's color parsing.
+
+        * fast/dom/HTMLFontElement/face-attribute-expected.txt:
+        * fast/dom/HTMLFontElement/face-attribute.html:
+        Converted font face parsing over to just use the CSS parser's font-family
+        parsing. This matches other browsers, so removing cases that we used to
+        accept now that we're more strict.
+
+        * platform/mac/canvas/philip/tests/2d.fillStyle.parse.rgb-eof-expected.txt:
+        * platform/mac/canvas/philip/tests/2d.fillStyle.parse.rgba-eof-expected.txt:
+        These tests pass now that canvas uses the new parser's color parsing.
+
+        * platform/ios-simulator/svg/custom/fill-SVGPaint-interface-expected.txt: Removed.
+        * platform/mac/svg/custom/fill-SVGPaint-interface-expected.png: Removed.
+        * platform/mac/svg/custom/fill-SVGPaint-interface-expected.txt: Removed.
+        * svg/custom/fill-SVGPaint-interface.svg: Removed.
+        Remove another test of the SVG CSS OM, since the SVG CSS OM for SVGPaint etc.
+        is gone now.
+
+        * platform/mac/js/dom/global-constructors-attributes-expected.txt:
+        Rebaselined because of CSSNamespaceRule.
+
 2016-12-10  Jiewen Tan  <jiewen_tan@apple.com>
 
         [WebCrypto] RSA algorithms should allow importing keys without usages
index fa69d8d..7c7ad43 100644 (file)
@@ -363,7 +363,6 @@ webkit.org/b/138676 imported/w3c/canvas/security.reset.html [ Failure ]
 webkit.org/b/138676 imported/w3c/canvas/security.pattern.cross.html [ Failure ]
 webkit.org/b/138676 imported/w3c/canvas/2d.pattern.image.incomplete.html [ Failure ]
 webkit.org/b/138676 imported/w3c/canvas/2d.drawImage.animated.poster.html [ Failure ]
-webkit.org/b/138676 imported/w3c/canvas/2d.fillStyle.parse.rgb-eof.html [ Failure ]
 webkit.org/b/138676 imported/w3c/canvas/2d.imageData.put.null.html [ Failure ]
 webkit.org/b/138676 imported/w3c/canvas/security.pattern.image.strokeStyle.html [ Failure ]
 webkit.org/b/138676 imported/w3c/canvas/2d.imageData.get.nonfinite.html [ Failure ]
@@ -380,7 +379,6 @@ webkit.org/b/138676 imported/w3c/canvas/security.drawImage.image.html [ Failure
 webkit.org/b/138676 imported/w3c/canvas/2d.drawImage.broken.html [ Failure ]
 webkit.org/b/138676 imported/w3c/canvas/2d.imageData.create1.zero.html [ Failure ]
 webkit.org/b/138676 imported/w3c/canvas/2d.gradient.linear.nonfinite.html [ Failure ]
-webkit.org/b/138676 imported/w3c/canvas/2d.fillStyle.parse.rgba-eof.html [ Failure ]
 webkit.org/b/138676 imported/w3c/canvas/security.drawImage.canvas.html [ Failure ]
 webkit.org/b/138676 imported/w3c/canvas/security.pattern.image.fillStyle.html [ Failure ]
 webkit.org/b/138676 imported/w3c/canvas/2d.imageData.put.nonfinite.html [ Failure ]
index 4162f22..832589d 100644 (file)
@@ -22,13 +22,6 @@ PASS fontFaceAttributeEffect(" Serif") is "serif"
 PASS fontFaceAttributeEffect(" Serif ") is "serif"
 PASS fontFaceAttributeEffect(",Serif ") is null
 PASS fontFaceAttributeEffect("Inherited") is "Inherited"
-PASS fontFaceAttributeEffect("Initial") is "Initial"
-PASS fontFaceAttributeEffect("foo + foo") is "'foo + foo'"
-PASS fontFaceAttributeEffect(" foo + foo") is "'foo + foo'"
-PASS fontFaceAttributeEffect(" foo + foo ") is "'foo + foo'"
-PASS fontFaceAttributeEffect("foo + foo ") is "'foo + foo'"
-PASS fontFaceAttributeEffect("foo + foo,serif") is "'foo + foo', serif"
-PASS fontFaceAttributeEffect("serif,foo + foo,serif") is "serif, 'foo + foo', serif"
 PASS fontFaceAttributeEffect(",foo + foo,serif") is null
 PASS fontFaceAttributeEffect("serif,foo + foo,") is null
 PASS successfullyParsed is true
index 3aaa69f..f7cdb86 100644 (file)
@@ -45,15 +45,6 @@ shouldBe('fontFaceAttributeEffect(" Serif ")', '"serif"');
 shouldBe('fontFaceAttributeEffect(",Serif ")', 'null');
 
 shouldBe('fontFaceAttributeEffect("Inherited")', '"Inherited"');
-shouldBe('fontFaceAttributeEffect("Initial")', '"Initial"');
-
-shouldBe('fontFaceAttributeEffect("foo + foo")', '"\'foo + foo\'"');
-shouldBe('fontFaceAttributeEffect(" foo + foo")', '"\'foo + foo\'"');
-shouldBe('fontFaceAttributeEffect(" foo + foo ")', '"\'foo + foo\'"');
-shouldBe('fontFaceAttributeEffect("foo + foo ")', '"\'foo + foo\'"');
-
-shouldBe('fontFaceAttributeEffect("foo + foo,serif")', '"\'foo + foo\', serif"');
-shouldBe('fontFaceAttributeEffect("serif,foo + foo,serif")', '"serif, \'foo + foo\', serif"');
 shouldBe('fontFaceAttributeEffect(",foo + foo,serif")', 'null');
 shouldBe('fontFaceAttributeEffect("serif,foo + foo,")', 'null');
 
diff --git a/LayoutTests/platform/ios-simulator/svg/custom/fill-SVGPaint-interface-expected.txt b/LayoutTests/platform/ios-simulator/svg/custom/fill-SVGPaint-interface-expected.txt
deleted file mode 100644 (file)
index 9d3fa39..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (0,0) size 800x600
-    RenderSVGContainer {a} at (0,0) size 0x0
-    RenderSVGForeignObject {foreignObject} at (0,0) size 800x600
-      RenderBlock {html} at (0,0) size 800x20
-        RenderBlock {div} at (0,0) size 800x20
-          RenderText {#text} at (0,0) size 569x19
-            text run at (0,0) width 569: "This test tests that the type of the fill css attribute is correctly reported as SVGPaint. See "
-          RenderInline {a} at (0,0) size 72x19 [color=#0000EE]
-            RenderText {#text} at (568,0) size 72x19
-              text run at (568,0) width 72: "Bug 14064"
-          RenderText {#text} at (639,0) size 5x19
-            text run at (639,0) width 5: "."
-    RenderSVGRect {rect} at (10,50) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=10.00] [y=50.00] [width=100.00] [height=100.00]
index b28ac23..85602da 100644 (file)
@@ -168,6 +168,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'CSSMediaRule').hasOwnProperty('get
 PASS Object.getOwnPropertyDescriptor(global, 'CSSMediaRule').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSMediaRule').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSMediaRule').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'CSSNamespaceRule').value is CSSNamespaceRule
+PASS Object.getOwnPropertyDescriptor(global, 'CSSNamespaceRule').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSNamespaceRule').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSNamespaceRule').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSNamespaceRule').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'CSSPageRule').value is CSSPageRule
 PASS Object.getOwnPropertyDescriptor(global, 'CSSPageRule').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSPageRule').hasOwnProperty('set') is false
index 926092e..ef4e6c4 100644 (file)
@@ -168,6 +168,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'CSSMediaRule').hasOwnProperty('get
 PASS Object.getOwnPropertyDescriptor(global, 'CSSMediaRule').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSMediaRule').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSMediaRule').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'CSSNamespaceRule').value is CSSNamespaceRule
+PASS Object.getOwnPropertyDescriptor(global, 'CSSNamespaceRule').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSNamespaceRule').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSNamespaceRule').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSNamespaceRule').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'CSSPageRule').value is CSSPageRule
 PASS Object.getOwnPropertyDescriptor(global, 'CSSPageRule').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSPageRule').hasOwnProperty('set') is false
diff --git a/LayoutTests/platform/mac/svg/custom/fill-SVGPaint-interface-expected.png b/LayoutTests/platform/mac/svg/custom/fill-SVGPaint-interface-expected.png
deleted file mode 100644 (file)
index 9d5bab0..0000000
Binary files a/LayoutTests/platform/mac/svg/custom/fill-SVGPaint-interface-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac/svg/custom/fill-SVGPaint-interface-expected.txt b/LayoutTests/platform/mac/svg/custom/fill-SVGPaint-interface-expected.txt
deleted file mode 100644 (file)
index 4b0fc7f..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (0,0) size 800x600
-    RenderSVGContainer {a} at (0,0) size 0x0
-    RenderSVGForeignObject {foreignObject} at (0,0) size 800x600
-      RenderBlock {html} at (0,0) size 800x18
-        RenderBlock {div} at (0,0) size 800x18
-          RenderText {#text} at (0,0) size 568x18
-            text run at (0,0) width 568: "This test tests that the type of the fill css attribute is correctly reported as SVGPaint. See "
-          RenderInline {a} at (0,0) size 72x18 [color=#0000EE]
-            RenderText {#text} at (567,0) size 72x18
-              text run at (567,0) width 72: "Bug 14064"
-          RenderText {#text} at (638,0) size 5x18
-            text run at (638,0) width 5: "."
-    RenderSVGRect {rect} at (10,50) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=10.00] [y=50.00] [width=100.00] [height=100.00]
diff --git a/LayoutTests/svg/custom/fill-SVGPaint-interface.svg b/LayoutTests/svg/custom/fill-SVGPaint-interface.svg
deleted file mode 100644 (file)
index bd865dc..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" onload="runTest()">
-
-<script>
-<![CDATA[
-    function log(string) {
-      var newDiv = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
-      newDiv.textContent = string;
-      document.getElementById('log').appendChild(newDiv);
-    }
-    function runTest()
-    {
-        var rect = document.rootElement.lastChild.previousSibling;
-        if (rect.getPresentationAttribute('fill').toString() != "[object SVGPaint]") {
-            log("SVGPaint css property is not reported as of type SVGPaint");
-            return;
-        }
-        rect.setAttribute('fill', 'green');
-    }
-    ]]>
-</script>
-This test tests that the type of the fill css attribute is correctly reported as SVGPaint.
-See <a href="http://bugs.webkit.org/show_bug.cgi?id=14064">Bug 14064</a>.
-<foreignObject width="100%" height="100%">
-    <html xmlns="http://www.w3.org/1999/xhtml">
-        <div id="log">
-This test tests that the type of the fill css attribute is correctly reported as SVGPaint.
-See <a href="http://bugs.webkit.org/show_bug.cgi?id=14064">Bug 14064</a>.
-        </div>
-    </html>
-</foreignObject>
-
-    <rect x="10" y="50" width="100" height="100" fill="red" style="color:yellow" border-top="10"/>
-</svg>
index 840f345..11b75e7 100644 (file)
@@ -344,6 +344,7 @@ set(WebCore_NON_SVG_IDL_FILES
     css/CSSKeyframeRule.idl
     css/CSSKeyframesRule.idl
     css/CSSMediaRule.idl
+    css/CSSNamespaceRule.idl
     css/CSSPageRule.idl
     css/CSSPrimitiveValue.idl
     css/CSSRule.idl
@@ -1305,6 +1306,7 @@ set(WebCore_SOURCES
     css/CSSMarkup.cpp
     css/CSSMediaRule.cpp
     css/CSSNamedImageValue.cpp
+    css/CSSNamespaceRule.cpp
     css/CSSPageRule.cpp
     css/CSSPendingSubstitutionValue.cpp
     css/CSSPrimitiveValue.cpp
@@ -1330,9 +1332,7 @@ set(WebCore_SOURCES
     css/CSSValueList.cpp
     css/CSSValuePool.cpp
     css/CSSVariableData.cpp
-    css/CSSVariableDependentValue.cpp
     css/CSSVariableReferenceValue.cpp
-    css/CSSVariableValue.cpp
     css/DOMCSSNamespace.cpp
     css/DocumentRuleSets.cpp
     css/ElementRuleCollector.cpp
@@ -1392,7 +1392,6 @@ set(WebCore_SOURCES
     css/parser/MediaQueryParser.cpp
     css/parser/SizesAttributeParser.cpp
     css/parser/SizesCalcParser.cpp
-    css/parser/SVGCSSParser.cpp
 
     cssjit/SelectorCompiler.cpp
 
@@ -3602,7 +3601,6 @@ list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/CSSPropertyNa
 list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/StyleBuilder.cpp)
 list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/StylePropertyShorthandFunctions.cpp)
 ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSParser.cpp CSSValueKeywords.h)
-ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_WEBCORE_DIR}/CSSGrammar.cpp CSSPropertyNames.h)
 
 # Generate CSS value keywords
 add_custom_command(
@@ -3616,7 +3614,6 @@ add_custom_command(
 list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/CSSValueKeywords.cpp)
 ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSParser.cpp CSSValueKeywords.h)
 ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSPrimitiveValueMappings.h CSSValueKeywords.h)
-ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_WEBCORE_DIR}/CSSGrammar.cpp CSSValueKeywords.h)
 
 # Generate CSS Selector pseudo type name to value maps.
 add_custom_command(
@@ -3684,9 +3681,6 @@ add_custom_command(
 list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/PlugInsResourcesData.cpp)
 ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/StyleResolver.cpp PlugInsResourcesData.cpp PlugInsResources.h)
 
-GENERATE_GRAMMAR(cssyy ${WEBCORE_DIR}/css/CSSGrammar.y.in ${DERIVED_SOURCES_WEBCORE_DIR}/CSSGrammar.h ${DERIVED_SOURCES_WEBCORE_DIR}/CSSGrammar.cpp "${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}")
-list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/CSSGrammar.cpp)
-
 GENERATE_GRAMMAR(xpathyy ${WEBCORE_DIR}/xml/XPathGrammar.y ${DERIVED_SOURCES_WEBCORE_DIR}/XPathGrammar.h ${DERIVED_SOURCES_WEBCORE_DIR}/XPathGrammar.cpp "")
 list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/XPathGrammar.cpp)
 
index 886255f..e1445aa 100644 (file)
@@ -1,3 +1,656 @@
+2016-12-09  Dave Hyatt  <hyatt@apple.com>
+
+        [CSS Parser] Remove the old CSS Parser
+        https://bugs.webkit.org/show_bug.cgi?id=165645
+
+        Reviewed by Daniel Bates.
+
+        Remove the old CSS parser code. In doing so, code that used documentless
+        CSSParserContexts is now going through the new parser. This resulted in
+        some additional changes. These include:
+
+        (1) Canvas color parsing switched to new parser's code. This resulted in
+        progressions on canvas tests.
+
+        (2) Support for CSSNamespaceRule in the CSS OM, since the Inspector's
+        creation of CSS OM wrappers made it necessary to add this in. The old parser
+        did not create style rules for namespaces, but the new one (and other browsers)
+        did.
+
+        (3) <font face="X"> now uses the new parser's font-family parsing code. This
+        change was made in createFontFaceValue in CSSValuePool.
+
+        (4) FontFace now uses a new function on the new parser called
+        parseFontFaceDescriptor. This function sets things up so that parsing occurs
+        as though you are inside a @font-face. The old parser let you call parseValue
+        to parse "properties", but descriptors need to be handled differently in the
+        new parser.
+
+        (5) Illegal CSS rules in mediaControlsApple/ios.css forced me to add a quirk
+        to handle chained shadow DOM pseudo-elements. This should not be allowed, but
+        for now it is.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSCSSRuleCustom.cpp:
+        (WebCore::toJSNewlyCreated):
+        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+        * css/CSSCalculationValue.cpp:
+        (WebCore::unitCategory):
+        (WebCore::hasDoubleValue):
+        (WebCore::checkDepthAndIndexDeprecated): Deleted.
+        (WebCore::CSSCalcExpressionNodeParserDeprecated::parseCalc): Deleted.
+        (WebCore::CSSCalcExpressionNodeParserDeprecated::operatorValue): Deleted.
+        (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValue): Deleted.
+        (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueTerm): Deleted.
+        (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueMultiplicativeExpression): Deleted.
+        (WebCore::CSSCalcExpressionNodeParserDeprecated::parseAdditiveValueExpression): Deleted.
+        (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueExpression): Deleted.
+        * css/CSSCalculationValue.h:
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::specifiedValueForGridTrackSize):
+        * css/CSSCustomPropertyValue.cpp:
+        (WebCore::CSSCustomPropertyValue::checkVariablesForCycles):
+        (WebCore::CSSCustomPropertyValue::resolveVariableReferences):
+        * css/CSSCustomPropertyValue.h:
+        * css/CSSFunctionValue.cpp:
+        (WebCore::CSSFunctionValue::CSSFunctionValue):
+        (WebCore::CSSFunctionValue::customCSSText):
+        (WebCore::CSSFunctionValue::append):
+        (WebCore::CSSFunctionValue::buildParserValueSubstitutingVariables): Deleted.
+        * css/CSSFunctionValue.h:
+        * css/CSSGrammar.y.in: Removed.
+        * css/CSSGrammar.y.includes: Removed.
+        * css/CSSGroupingRule.cpp:
+        (WebCore::CSSGroupingRule::insertRule):
+        * css/CSSKeyframeRule.h:
+        * css/CSSKeyframesRule.cpp:
+        (WebCore::CSSKeyframesRule::appendRule):
+        * css/CSSNamespaceRule.cpp: Added.
+        (WebCore::CSSNamespaceRule::CSSNamespaceRule):
+        (WebCore::CSSNamespaceRule::~CSSNamespaceRule):
+        (WebCore::CSSNamespaceRule::namespaceURI):
+        (WebCore::CSSNamespaceRule::prefix):
+        (WebCore::CSSNamespaceRule::cssText):
+        (WebCore::CSSNamespaceRule::reattach):
+        * css/CSSNamespaceRule.h: Added.
+        * css/CSSNamespaceRule.idl: Added.
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::isValidCSSUnitTypeForDoubleConversion):
+        (WebCore::isStringType):
+        (WebCore::CSSPrimitiveValue::cleanup):
+        (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
+        (WebCore::CSSPrimitiveValue::cloneForCSSOM):
+        (WebCore::CSSPrimitiveValue::equals):
+        (WebCore::CSSPrimitiveValue::buildParserValue): Deleted.
+        * css/CSSPrimitiveValue.h:
+        * css/CSSRule.h:
+        * css/CSSRule.idl:
+        * css/CSSStyleSheet.cpp:
+        (WebCore::CSSStyleSheet::insertRule):
+        * css/CSSValue.cpp:
+        (WebCore::CSSValue::equals):
+        (WebCore::CSSValue::cssText):
+        (WebCore::CSSValue::destroy):
+        * css/CSSValue.h:
+        (WebCore::CSSValue::isCustomPropertyValue):
+        (WebCore::CSSValue::hasVariableReferences):
+        (WebCore::CSSValue::isVariableDependentValue): Deleted.
+        (WebCore::CSSValue::isVariableValue): Deleted.
+        * css/CSSValueList.cpp:
+        (WebCore::CSSValueList::customCSSText):
+        (WebCore::CSSValueList::containsVariables): Deleted.
+        (WebCore::CSSValueList::checkVariablesForCycles): Deleted.
+        (WebCore::CSSValueList::buildParserValueSubstitutingVariables): Deleted.
+        (WebCore::CSSValueList::buildParserValueListSubstitutingVariables): Deleted.
+        * css/CSSValueList.h:
+        (WebCore::CSSValueList::createSlashSeparated):
+        (WebCore::CSSValueList::createFromParserValueList): Deleted.
+        * css/CSSValuePool.cpp:
+        (WebCore::CSSValuePool::createFontFaceValue):
+        * css/CSSVariableData.cpp:
+        * css/CSSVariableDependentValue.cpp: Removed.
+        * css/CSSVariableDependentValue.h: Removed.
+        * css/CSSVariableValue.cpp: Removed.
+        * css/CSSVariableValue.h: Removed.
+        * css/DOMCSSNamespace.cpp:
+        * css/FontFace.cpp:
+        (WebCore::FontFace::parseString):
+        * css/InspectorCSSOMWrappers.cpp:
+        * css/MediaQueryExp.cpp:
+        (WebCore::isFeatureValidWithIdentifier): Deleted.
+        (WebCore::isFeatureValidWithNonNegativeLengthOrNumber): Deleted.
+        (WebCore::isFeatureValidWithDensity): Deleted.
+        (WebCore::isFeatureValidWithNonNegativeInteger): Deleted.
+        (WebCore::isFeatureValidWithNonNegativeNumber): Deleted.
+        (WebCore::isFeatureValidWithZeroOrOne): Deleted.
+        (WebCore::isFeatureValidWithNumberWithUnit): Deleted.
+        (WebCore::isFeatureValidWithNumber): Deleted.
+        (WebCore::isSlash): Deleted.
+        (WebCore::isPositiveIntegerValue): Deleted.
+        * css/MediaQueryExp.h:
+        * css/PropertySetCSSStyleDeclaration.cpp:
+        (WebCore::PropertySetCSSStyleDeclaration::setCssText):
+        (WebCore::PropertySetCSSStyleDeclaration::setProperty):
+        * css/SelectorPseudoTypeMap.h:
+        * css/StyleProperties.cpp:
+        (WebCore::StyleProperties::getPropertyValue):
+        (WebCore::StyleProperties::getPropertyCSSValue):
+        (WebCore::MutableStyleProperties::setCustomProperty):
+        (WebCore::MutableStyleProperties::parseDeclaration):
+        (WebCore::StyleProperties::asText):
+        * css/StyleProperties.h:
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::applyProperty):
+        * css/StyleResolver.h:
+        * css/StyleRule.cpp:
+        (WebCore::StyleRuleBase::createCSSOMWrapper):
+        * css/StyleSheetContents.cpp:
+        (WebCore::StyleSheetContents::parseAuthorStyleSheet):
+        (WebCore::StyleSheetContents::parseString):
+        (WebCore::StyleSheetContents::completeURL):
+        (WebCore::StyleSheetContents::parseStringAtPosition): Deleted.
+        * css/StyleSheetContents.h:
+        * css/WebKitCSSMatrix.cpp:
+        * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
+        * css/parser/CSSParser.cpp:
+        (WebCore::CSSParserContext::CSSParserContext):
+        (WebCore::CSSParser::CSSParser):
+        (WebCore::CSSParser::parseSheet):
+        (WebCore::CSSParser::parseRule):
+        (WebCore::CSSParser::parseKeyframeRule):
+        (WebCore::CSSParser::parseSupportsCondition):
+        (WebCore::CSSParser::parseColor):
+        (WebCore::CSSParser::parseSystemColor):
+        (WebCore::CSSParser::parseSingleValue):
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::parseCustomPropertyValue):
+        (WebCore::CSSParser::parseSelector):
+        (WebCore::CSSParser::parseInlineStyleDeclaration):
+        (WebCore::CSSParser::parseDeclaration):
+        (WebCore::CSSParser::parseValueWithVariableReferences):
+        (WebCore::CSSParser::parseKeyframeKeyList):
+        (WebCore::CSSParser::parseFontFaceDescriptor):
+        (WebCore::equalLettersIgnoringASCIICase): Deleted.
+        (WebCore::hasPrefix): Deleted.
+        (WebCore::createPrimitiveValuePair): Deleted.
+        (WebCore::AnimationParseContext::commitFirstAnimation): Deleted.
+        (WebCore::AnimationParseContext::hasCommittedFirstAnimation): Deleted.
+        (WebCore::AnimationParseContext::commitAnimationPropertyKeyword): Deleted.
+        (WebCore::AnimationParseContext::animationPropertyKeywordAllowed): Deleted.
+        (WebCore::AnimationParseContext::hasSeenAnimationPropertyKeyword): Deleted.
+        (WebCore::AnimationParseContext::sawAnimationPropertyKeyword): Deleted.
+        (): Deleted.
+        (WebCore::convertToASCIILowercaseInPlace): Deleted.
+        (WebCore::CSSParserString::convertToASCIILowercaseInPlace): Deleted.
+        (WebCore::CSSParser::setupParser): Deleted.
+        (WebCore::isColorPropertyID): Deleted.
+        (WebCore::CSSParser::isValidSystemColorValue): Deleted.
+        (WebCore::validPrimitiveValueColor): Deleted.
+        (WebCore::parseColorValue): Deleted.
+        (WebCore::isSimpleLengthPropertyID): Deleted.
+        (WebCore::parseSimpleLength): Deleted.
+        (WebCore::parseSimpleLengthValue): Deleted.
+        (WebCore::isValidKeywordPropertyAndValue): Deleted.
+        (WebCore::isUniversalKeyword): Deleted.
+        (WebCore::isKeywordPropertyID): Deleted.
+        (WebCore::parseKeywordValue): Deleted.
+        (WebCore::parseTransformTranslateArguments): Deleted.
+        (WebCore::parseTranslateTransformValue): Deleted.
+        (WebCore::CSSParser::parseFontFaceValue): Deleted.
+        (WebCore::CSSParser::parseColorFromString): Deleted.
+        (WebCore::CSSParser::parseDeclarationDeprecated): Deleted.
+        (WebCore::filterProperties): Deleted.
+        (WebCore::CSSParser::createStyleProperties): Deleted.
+        (WebCore::CSSParser::addProperty): Deleted.
+        (WebCore::CSSParser::rollbackLastProperties): Deleted.
+        (WebCore::CSSParser::clearProperties): Deleted.
+        (WebCore::CSSParser::completeURL): Deleted.
+        (WebCore::CSSParser::validateCalculationUnit): Deleted.
+        (WebCore::CSSParser::shouldAcceptUnitLessValues): Deleted.
+        (WebCore::CSSParser::validateUnit): Deleted.
+        (WebCore::CSSParser::createPrimitiveNumericValue): Deleted.
+        (WebCore::CSSParser::createPrimitiveStringValue): Deleted.
+        (WebCore::isComma): Deleted.
+        (WebCore::isForwardSlashOperator): Deleted.
+        (WebCore::CSSParser::isValidSize): Deleted.
+        (WebCore::CSSParser::parseValidPrimitive): Deleted.
+        (WebCore::CSSParser::addExpandedPropertyForValue): Deleted.
+        (WebCore::isImageSetFunctionValue): Deleted.
+        (WebCore::CSSParser::addFillValue): Deleted.
+        (WebCore::isContentDistributionKeyword): Deleted.
+        (WebCore::isContentPositionKeyword): Deleted.
+        (WebCore::isBaselinePositionKeyword): Deleted.
+        (WebCore::isAlignmentOverflowKeyword): Deleted.
+        (WebCore::isItemPositionKeyword): Deleted.
+        (WebCore::CSSParser::parseLegacyPosition): Deleted.
+        (WebCore::CSSParser::parseContentDistributionOverflowPosition): Deleted.
+        (WebCore::CSSParser::parseItemPositionOverflowPosition): Deleted.
+        (WebCore::parseBackgroundClip): Deleted.
+        (WebCore::CSSParser::useLegacyBackgroundSizeShorthandBehavior): Deleted.
+        (WebCore::CSSParser::parseNonElementSnapPoints): Deleted.
+        (WebCore::CSSParser::parseScrollSnapPositions): Deleted.
+        (WebCore::CSSParser::parseScrollSnapDestination): Deleted.
+        (WebCore::CSSParser::parseScrollSnapCoordinate): Deleted.
+        (WebCore::CSSParser::parseFillShorthand): Deleted.
+        (WebCore::CSSParser::addAnimationValue): Deleted.
+        (WebCore::CSSParser::parseAnimationShorthand): Deleted.
+        (WebCore::CSSParser::parseColumnWidth): Deleted.
+        (WebCore::CSSParser::parseColumnCount): Deleted.
+        (WebCore::CSSParser::parseColumnsShorthand): Deleted.
+        (WebCore::CSSParser::parseTransitionShorthand): Deleted.
+        (WebCore::CSSParser::parseShorthand): Deleted.
+        (WebCore::CSSParser::parse4Values): Deleted.
+        (WebCore::CSSParser::parsePage): Deleted.
+        (WebCore::CSSParser::parseSize): Deleted.
+        (WebCore::CSSParser::parseSizeParameter): Deleted.
+        (WebCore::CSSParser::parseQuotes): Deleted.
+        (WebCore::CSSParser::parseAlt): Deleted.
+        (WebCore::CSSParser::parseCustomPropertyDeclaration): Deleted.
+        (WebCore::CSSParser::parseContent): Deleted.
+        (WebCore::CSSParser::parseAttr): Deleted.
+        (WebCore::CSSParser::parseBackgroundColor): Deleted.
+        (WebCore::CSSParser::parseFillImage): Deleted.
+        (WebCore::CSSParser::parsePositionX): Deleted.
+        (WebCore::CSSParser::parsePositionY): Deleted.
+        (WebCore::CSSParser::parseFillPositionComponent): Deleted.
+        (WebCore::isValueConflictingWithCurrentEdge): Deleted.
+        (WebCore::isFillPositionKeyword): Deleted.
+        (WebCore::CSSParser::parse4ValuesFillPosition): Deleted.
+        (WebCore::CSSParser::parse3ValuesFillPosition): Deleted.
+        (WebCore::CSSParser::isPotentialPositionValue): Deleted.
+        (WebCore::CSSParser::parseFillPosition): Deleted.
+        (WebCore::CSSParser::parse2ValuesFillPosition): Deleted.
+        (WebCore::CSSParser::parseFillRepeat): Deleted.
+        (WebCore::CSSParser::parseFillSize): Deleted.
+        (WebCore::CSSParser::parseFillProperty): Deleted.
+        (WebCore::CSSParser::parseAnimationDelay): Deleted.
+        (WebCore::CSSParser::parseAnimationDirection): Deleted.
+        (WebCore::CSSParser::parseAnimationDuration): Deleted.
+        (WebCore::CSSParser::parseAnimationFillMode): Deleted.
+        (WebCore::CSSParser::parseAnimationIterationCount): Deleted.
+        (WebCore::CSSParser::parseAnimationName): Deleted.
+        (WebCore::CSSParser::parseAnimationPlayState): Deleted.
+        (WebCore::CSSParser::parseAnimationTrigger): Deleted.
+        (WebCore::CSSParser::parseAnimationProperty): Deleted.
+        (WebCore::CSSParser::parseTransformOriginShorthand): Deleted.
+        (WebCore::CSSParser::isSpringTimingFunctionEnabled): Deleted.
+        (WebCore::CSSParser::parseCubicBezierTimingFunctionValue): Deleted.
+        (WebCore::CSSParser::parseSpringTimingFunctionValue): Deleted.
+        (WebCore::CSSParser::parseAnimationTimingFunction): Deleted.
+        (WebCore::isValidGridPositionCustomIdent): Deleted.
+        (WebCore::CSSParser::parseIntegerOrCustomIdentFromGridPosition): Deleted.
+        (WebCore::CSSParser::parseGridPosition): Deleted.
+        (WebCore::gridMissingGridPositionValue): Deleted.
+        (WebCore::CSSParser::parseGridItemPositionShorthand): Deleted.
+        (WebCore::CSSParser::parseGridGapShorthand): Deleted.
+        (WebCore::CSSParser::parseGridTemplateColumns): Deleted.
+        (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): Deleted.
+        (WebCore::CSSParser::parseGridTemplateShorthand): Deleted.
+        (WebCore::parseImplicitAutoFlow): Deleted.
+        (WebCore::CSSParser::parseGridShorthand): Deleted.
+        (WebCore::CSSParser::parseGridAreaShorthand): Deleted.
+        (WebCore::CSSParser::parseSingleGridAreaLonghand): Deleted.
+        (WebCore::CSSParser::parseGridLineNames): Deleted.
+        (WebCore::isGridTrackFixedSized): Deleted.
+        (WebCore::CSSParser::parseGridTrackList): Deleted.
+        (WebCore::CSSParser::parseGridTrackRepeatFunction): Deleted.
+        (WebCore::CSSParser::parseGridTrackSize): Deleted.
+        (WebCore::CSSParser::parseGridBreadth): Deleted.
+        (WebCore::isValidGridAutoFlowId): Deleted.
+        (WebCore::CSSParser::parseGridAutoFlow): Deleted.
+        (WebCore::skipCommaInDashboardRegion): Deleted.
+        (WebCore::CSSParser::parseDashboardRegions): Deleted.
+        (WebCore::parseGridTemplateAreasColumnNames): Deleted.
+        (WebCore::CSSParser::parseGridTemplateAreasRow): Deleted.
+        (WebCore::CSSParser::parseGridTemplateAreas): Deleted.
+        (WebCore::CSSParser::parseCounterContent): Deleted.
+        (WebCore::CSSParser::parseClipShape): Deleted.
+        (WebCore::completeBorderRadii): Deleted.
+        (WebCore::CSSParser::parseInsetRoundedCorners): Deleted.
+        (WebCore::CSSParser::parseBasicShapeInset): Deleted.
+        (WebCore::CSSParser::parseShapeRadius): Deleted.
+        (WebCore::CSSParser::parseBasicShapeCircle): Deleted.
+        (WebCore::CSSParser::parseBasicShapeEllipse): Deleted.
+        (WebCore::CSSParser::parseBasicShapePolygon): Deleted.
+        (WebCore::CSSParser::parseBasicShapePath): Deleted.
+        (WebCore::isBoxValue): Deleted.
+        (WebCore::CSSParser::parseBasicShapeAndOrBox): Deleted.
+        (WebCore::CSSParser::parseShapeProperty): Deleted.
+        (WebCore::CSSParser::parseClipPath): Deleted.
+        (WebCore::CSSParser::parseBasicShape): Deleted.
+        (WebCore::CSSParser::parseFont): Deleted.
+        (WebCore::CSSParser::parseSystemFont): Deleted.
+        (WebCore::FontFamilyValueBuilder::FontFamilyValueBuilder): Deleted.
+        (WebCore::FontFamilyValueBuilder::add): Deleted.
+        (WebCore::FontFamilyValueBuilder::commit): Deleted.
+        (WebCore::valueIsCSSKeyword): Deleted.
+        (WebCore::CSSParser::parseFontFamily): Deleted.
+        (WebCore::CSSParser::parseLineHeight): Deleted.
+        (WebCore::CSSParser::parseFontSize): Deleted.
+        (WebCore::createFontWeightValueKeyword): Deleted.
+        (WebCore::CSSParser::parseFontWeight): Deleted.
+        (WebCore::CSSParser::parseFontSynthesis): Deleted.
+        (WebCore::CSSParser::parseFontFaceSrcURI): Deleted.
+        (WebCore::CSSParser::parseFontFaceSrcLocal): Deleted.
+        (WebCore::CSSParser::parseFontFaceSrc): Deleted.
+        (WebCore::CSSParser::parseFontFaceUnicodeRange): Deleted.
+        (WebCore::checkForValidDouble): Deleted.
+        (WebCore::parseDouble): Deleted.
+        (WebCore::parseColorIntOrPercentage): Deleted.
+        (WebCore::isTenthAlpha): Deleted.
+        (WebCore::parseAlphaValue): Deleted.
+        (WebCore::mightBeRGBA): Deleted.
+        (WebCore::mightBeRGB): Deleted.
+        (WebCore::fastParseColorInternal): Deleted.
+        (WebCore::CSSParser::fastParseColor): Deleted.
+        (WebCore::CSSParser::parsedDouble): Deleted.
+        (WebCore::CSSParser::isCalculation): Deleted.
+        (WebCore::isPercent): Deleted.
+        (WebCore::CSSParser::parseColorInt): Deleted.
+        (WebCore::CSSParser::parseColorDouble): Deleted.
+        (WebCore::CSSParser::parseRGBParameters): Deleted.
+        (WebCore::CSSParser::parseColorFunctionParameters): Deleted.
+        (WebCore::CSSParser::parseHSLParameters): Deleted.
+        (WebCore::CSSParser::parseColorFromValue): Deleted.
+        (WebCore::ShadowParseContext::ShadowParseContext): Deleted.
+        (WebCore::ShadowParseContext::allowLength): Deleted.
+        (WebCore::ShadowParseContext::commitValue): Deleted.
+        (WebCore::ShadowParseContext::commitLength): Deleted.
+        (WebCore::ShadowParseContext::commitColor): Deleted.
+        (WebCore::ShadowParseContext::commitStyle): Deleted.
+        (WebCore::CSSParser::parseShadow): Deleted.
+        (WebCore::CSSParser::parseReflect): Deleted.
+        (WebCore::CSSParser::parseFlex): Deleted.
+        (WebCore::BorderImageParseContext::BorderImageParseContext): Deleted.
+        (WebCore::BorderImageParseContext::canAdvance): Deleted.
+        (WebCore::BorderImageParseContext::setCanAdvance): Deleted.
+        (WebCore::BorderImageParseContext::allowCommit): Deleted.
+        (WebCore::BorderImageParseContext::allowImage): Deleted.
+        (WebCore::BorderImageParseContext::allowImageSlice): Deleted.
+        (WebCore::BorderImageParseContext::allowRepeat): Deleted.
+        (WebCore::BorderImageParseContext::allowForwardSlashOperator): Deleted.
+        (WebCore::BorderImageParseContext::requireWidth): Deleted.
+        (WebCore::BorderImageParseContext::requireOutset): Deleted.
+        (WebCore::BorderImageParseContext::commitImage): Deleted.
+        (WebCore::BorderImageParseContext::commitImageSlice): Deleted.
+        (WebCore::BorderImageParseContext::commitForwardSlashOperator): Deleted.
+        (WebCore::BorderImageParseContext::commitBorderWidth): Deleted.
+        (WebCore::BorderImageParseContext::commitBorderOutset): Deleted.
+        (WebCore::BorderImageParseContext::commitRepeat): Deleted.
+        (WebCore::BorderImageParseContext::commitWebKitBorderImage): Deleted.
+        (WebCore::BorderImageParseContext::commitBorderImage): Deleted.
+        (WebCore::BorderImageParseContext::commitBorderImageProperty): Deleted.
+        (WebCore::CSSParser::parseBorderImage): Deleted.
+        (WebCore::isBorderImageRepeatKeyword): Deleted.
+        (WebCore::CSSParser::parseBorderImageRepeat): Deleted.
+        (WebCore::BorderImageSliceParseContext::BorderImageSliceParseContext): Deleted.
+        (WebCore::BorderImageSliceParseContext::allowNumber): Deleted.
+        (WebCore::BorderImageSliceParseContext::allowFill): Deleted.
+        (WebCore::BorderImageSliceParseContext::allowFinalCommit): Deleted.
+        (WebCore::BorderImageSliceParseContext::top): Deleted.
+        (WebCore::BorderImageSliceParseContext::commitNumber): Deleted.
+        (WebCore::BorderImageSliceParseContext::commitFill): Deleted.
+        (WebCore::BorderImageSliceParseContext::commitBorderImageSlice): Deleted.
+        (WebCore::CSSParser::parseBorderImageSlice): Deleted.
+        (WebCore::BorderImageQuadParseContext::BorderImageQuadParseContext): Deleted.
+        (WebCore::BorderImageQuadParseContext::allowNumber): Deleted.
+        (WebCore::BorderImageQuadParseContext::allowFinalCommit): Deleted.
+        (WebCore::BorderImageQuadParseContext::top): Deleted.
+        (WebCore::BorderImageQuadParseContext::commitNumber): Deleted.
+        (WebCore::BorderImageQuadParseContext::setAllowFinalCommit): Deleted.
+        (WebCore::BorderImageQuadParseContext::setTop): Deleted.
+        (WebCore::BorderImageQuadParseContext::commitBorderImageQuad): Deleted.
+        (WebCore::CSSParser::parseBorderImageQuad): Deleted.
+        (WebCore::CSSParser::parseBorderImageWidth): Deleted.
+        (WebCore::CSSParser::parseBorderImageOutset): Deleted.
+        (WebCore::CSSParser::parseBorderRadius): Deleted.
+        (WebCore::CSSParser::parseAspectRatio): Deleted.
+        (WebCore::CSSParser::parseCounter): Deleted.
+        (WebCore::parseDeprecatedGradientPoint): Deleted.
+        (WebCore::parseDeprecatedGradientColorStop): Deleted.
+        (WebCore::CSSParser::parseDeprecatedGradient): Deleted.
+        (WebCore::valueFromSideKeyword): Deleted.
+        (WebCore::parseGradientColorOrKeyword): Deleted.
+        (WebCore::CSSParser::parseDeprecatedLinearGradient): Deleted.
+        (WebCore::CSSParser::parseDeprecatedRadialGradient): Deleted.
+        (WebCore::CSSParser::parseLinearGradient): Deleted.
+        (WebCore::CSSParser::parseRadialGradient): Deleted.
+        (WebCore::CSSParser::parseGradientColorStops): Deleted.
+        (WebCore::CSSParser::isGeneratedImageValue): Deleted.
+        (WebCore::CSSParser::parseGeneratedImage): Deleted.
+        (WebCore::CSSParser::parseFilterImage): Deleted.
+        (WebCore::CSSParser::parseCrossfade): Deleted.
+        (WebCore::CSSParser::parseCanvas): Deleted.
+        (WebCore::CSSParser::parseNamedImage): Deleted.
+        (WebCore::CSSParser::parseImageResolution): Deleted.
+        (WebCore::CSSParser::parseImageSet): Deleted.
+        (WebCore::TransformOperationInfo::TransformOperationInfo): Deleted.
+        (WebCore::TransformOperationInfo::type): Deleted.
+        (WebCore::TransformOperationInfo::argCount): Deleted.
+        (WebCore::TransformOperationInfo::unit): Deleted.
+        (WebCore::TransformOperationInfo::unknown): Deleted.
+        (WebCore::TransformOperationInfo::hasCorrectArgCount): Deleted.
+        (WebCore::CSSParser::parseTransform): Deleted.
+        (WebCore::CSSParser::parseTransformValue): Deleted.
+        (WebCore::CSSParser::isBlendMode): Deleted.
+        (WebCore::CSSParser::isCompositeOperator): Deleted.
+        (WebCore::isValidPrimitiveFilterFunction): Deleted.
+        (WebCore::CSSParser::parseBuiltinFilterArguments): Deleted.
+        (WebCore::cssValueKeywordIDForFunctionName): Deleted.
+        (WebCore::CSSParser::parseFilter): Deleted.
+        (WebCore::validFlowName): Deleted.
+        (WebCore::CSSParser::isTextAutosizingEnabled): Deleted.
+        (WebCore::CSSParser::isCSSGridLayoutEnabled): Deleted.
+        (WebCore::CSSParser::parseFlowThread): Deleted.
+        (WebCore::CSSParser::parseRegionThread): Deleted.
+        (WebCore::CSSParser::parseTransformOrigin): Deleted.
+        (WebCore::CSSParser::parsePerspectiveOrigin): Deleted.
+        (WebCore::CSSParser::addTextDecorationProperty): Deleted.
+        (WebCore::CSSParser::parseTextDecoration): Deleted.
+        (WebCore::CSSParser::parseTextDecorationSkip): Deleted.
+        (WebCore::CSSParser::parseTextUnderlinePosition): Deleted.
+        (WebCore::CSSParser::parseTextEmphasisStyle): Deleted.
+        (WebCore::CSSParser::parseTextEmphasisPosition): Deleted.
+        (WebCore::CSSParser::parseTextIndent): Deleted.
+        (WebCore::CSSParser::parseHangingPunctuation): Deleted.
+        (WebCore::CSSParser::parseLineBoxContain): Deleted.
+        (WebCore::CSSParser::parseFontFeatureTag): Deleted.
+        (WebCore::CSSParser::parseFontFeatureSettings): Deleted.
+        (WebCore::CSSParser::parseFontVariationTag): Deleted.
+        (WebCore::CSSParser::parseFontVariationSettings): Deleted.
+        (WebCore::CSSParser::parseFontVariantLigatures): Deleted.
+        (WebCore::CSSParser::parseFontVariantNumeric): Deleted.
+        (WebCore::CSSParser::parseFontVariantEastAsian): Deleted.
+        (WebCore::CSSParser::parseFontVariant): Deleted.
+        (WebCore::isValidWillChangeAnimatableFeature): Deleted.
+        (WebCore::CSSParser::parseWillChange): Deleted.
+        (WebCore::CSSParser::parseCalculation): Deleted.
+        (WebCore::isCSSLetter): Deleted.
+        (WebCore::isCSSEscape): Deleted.
+        (WebCore::isURILetter): Deleted.
+        (WebCore::isIdentifierStartAfterDash): Deleted.
+        (WebCore::isCustomPropertyIdentifier): Deleted.
+        (WebCore::isEqualToCSSIdentifier): Deleted.
+        (WebCore::isEqualToCSSCaseSensitiveIdentifier): Deleted.
+        (WebCore::checkAndSkipEscape): Deleted.
+        (WebCore::skipWhiteSpace): Deleted.
+        (WebCore::CSSParserString::characters<LChar>): Deleted.
+        (WebCore::CSSParserString::characters<UChar>): Deleted.
+        (WebCore::CSSParser::currentCharacter<LChar>): Deleted.
+        (WebCore::CSSParser::currentCharacter<UChar>): Deleted.
+        (WebCore::CSSParser::currentCharacter16): Deleted.
+        (WebCore::CSSParser::tokenStart<LChar>): Deleted.
+        (WebCore::CSSParser::tokenStart<UChar>): Deleted.
+        (WebCore::CSSParser::currentLocation): Deleted.
+        (WebCore::CSSParser::isIdentifierStart): Deleted.
+        (WebCore::checkAndSkipString): Deleted.
+        (WebCore::CSSParser::parseEscape): Deleted.
+        (WebCore::CSSParser::UnicodeToChars<LChar>): Deleted.
+        (WebCore::CSSParser::UnicodeToChars<UChar>): Deleted.
+        (WebCore::CSSParser::parseIdentifierInternal): Deleted.
+        (WebCore::CSSParser::parseIdentifier): Deleted.
+        (WebCore::CSSParser::parseStringInternal): Deleted.
+        (WebCore::CSSParser::parseString): Deleted.
+        (WebCore::CSSParser::findURI): Deleted.
+        (WebCore::CSSParser::parseURIInternal): Deleted.
+        (WebCore::CSSParser::parseURI): Deleted.
+        (WebCore::CSSParser::parseUnicodeRange): Deleted.
+        (WebCore::CSSParser::parseNthChild): Deleted.
+        (WebCore::CSSParser::parseNthChildExtra): Deleted.
+        (WebCore::CSSParser::detectFunctionTypeToken): Deleted.
+        (WebCore::CSSParser::detectMediaQueryToken): Deleted.
+        (WebCore::CSSParser::detectNumberToken): Deleted.
+        (WebCore::CSSParser::detectDashToken): Deleted.
+        (WebCore::CSSParser::detectAtToken): Deleted.
+        (WebCore::CSSParser::detectSupportsToken): Deleted.
+        (WebCore::CSSParser::realLex): Deleted.
+        (WebCore::CSSParser::createImportRule): Deleted.
+        (WebCore::CSSParser::createMediaRule): Deleted.
+        (WebCore::CSSParser::createEmptyMediaRule): Deleted.
+        (WebCore::CSSParser::createSupportsRule): Deleted.
+        (WebCore::CSSParser::markSupportsRuleHeaderStart): Deleted.
+        (WebCore::CSSParser::markSupportsRuleHeaderEnd): Deleted.
+        (WebCore::CSSParser::popSupportsRuleData): Deleted.
+        (WebCore::CSSParser::processAndAddNewRuleToSourceTreeIfNeeded): Deleted.
+        (WebCore::CSSParser::addNewRuleToSourceTree): Deleted.
+        (WebCore::CSSParser::popRuleData): Deleted.
+        (WebCore::CSSParser::syntaxError): Deleted.
+        (WebCore::CSSParser::isLoggingErrors): Deleted.
+        (WebCore::CSSParser::logError): Deleted.
+        (WebCore::CSSParser::createKeyframesRule): Deleted.
+        (WebCore::CSSParser::createStyleRule): Deleted.
+        (WebCore::CSSParser::createFontFaceRule): Deleted.
+        (WebCore::CSSParser::addNamespace): Deleted.
+        (WebCore::CSSParser::determineNameInNamespace): Deleted.
+        (WebCore::CSSParser::rewriteSpecifiersWithNamespaceIfNeeded): Deleted.
+        (WebCore::CSSParser::rewriteSpecifiersWithElementName): Deleted.
+        (WebCore::CSSParser::rewriteSpecifiers): Deleted.
+        (WebCore::CSSParser::createPageRule): Deleted.
+        (WebCore::CSSParser::createSelectorVector): Deleted.
+        (WebCore::CSSParser::recycleSelectorVector): Deleted.
+        (WebCore::CSSParser::createRegionRule): Deleted.
+        (WebCore::CSSParser::createMarginAtRule): Deleted.
+        (WebCore::CSSParser::startDeclarationsForMarginBox): Deleted.
+        (WebCore::CSSParser::endDeclarationsForMarginBox): Deleted.
+        (WebCore::CSSParser::createKeyframe): Deleted.
+        (WebCore::CSSParser::invalidBlockHit): Deleted.
+        (WebCore::CSSParser::updateLastMediaLine): Deleted.
+        (WebCore::fixUnparsedProperties): Deleted.
+        (WebCore::CSSParser::fixUnparsedPropertyRanges): Deleted.
+        (WebCore::CSSParser::markRuleHeaderStart): Deleted.
+        (WebCore::CSSParser::setRuleHeaderEnd): Deleted.
+        (WebCore::CSSParser::markRuleHeaderEnd): Deleted.
+        (WebCore::CSSParser::markSelectorStart): Deleted.
+        (WebCore::CSSParser::markSelectorEnd): Deleted.
+        (WebCore::CSSParser::markRuleBodyStart): Deleted.
+        (WebCore::CSSParser::markRuleBodyEnd): Deleted.
+        (WebCore::CSSParser::markPropertyStart): Deleted.
+        (WebCore::CSSParser::markPropertyEnd): Deleted.
+        (WebCore::CSSParser::createViewportRule): Deleted.
+        (WebCore::CSSParser::parseViewportProperty): Deleted.
+        (WebCore::CSSParser::parseViewportShorthand): Deleted.
+        (WebCore::isAppleLegacyCSSPropertyKeyword): Deleted.
+        (WebCore::cssPropertyID): Deleted.
+        (WebCore::cssPropertyNameIOSAliasing): Deleted.
+        (WebCore::isAppleLegacyCSSValueKeyword): Deleted.
+        (WebCore::cssValueKeywordID): Deleted.
+        (WebCore::isValidNthToken): Deleted.
+        * css/parser/CSSParser.h:
+        (): Deleted.
+        (WebCore::CSSParser::ValueWithCalculation::ValueWithCalculation): Deleted.
+        (WebCore::CSSParser::ValueWithCalculation::value): Deleted.
+        (WebCore::CSSParser::ValueWithCalculation::operator CSSParserValue&): Deleted.
+        (WebCore::CSSParser::ValueWithCalculation::calculation): Deleted.
+        (WebCore::CSSParser::ValueWithCalculation::setCalculation): Deleted.
+        (WebCore::CSSParser::hasProperties): Deleted.
+        (WebCore::CSSParser::startNestedSelectorList): Deleted.
+        (WebCore::CSSParser::endNestedSelectorList): Deleted.
+        (WebCore::CSSParser::resetPropertyRange): Deleted.
+        (WebCore::CSSParser::isExtractingSourceData): Deleted.
+        (WebCore::CSSParser::lex): Deleted.
+        (WebCore::CSSParser::token): Deleted.
+        (WebCore::CSSParser::markViewportRuleBodyStart): Deleted.
+        (WebCore::CSSParser::markViewportRuleBodyEnd): Deleted.
+        (WebCore::CSSParser::setCustomPropertyName): Deleted.
+        (WebCore::CSSParser::is8BitSource): Deleted.
+        (WebCore::CSSParser::setStyleSheet): Deleted.
+        (WebCore::CSSParser::inStrictMode): Deleted.
+        (WebCore::CSSParser::inQuirksMode): Deleted.
+        (WebCore::CSSParser::setupParser): Deleted.
+        (WebCore::CSSParser::inShorthand): Deleted.
+        (WebCore::CSSParser::inViewport): Deleted.
+        (WebCore::CSSParser::operator|): Deleted.
+        (WebCore::CSSParser::validateUnit): Deleted.
+        (WebCore::ShorthandScope::ShorthandScope): Deleted.
+        (WebCore::ShorthandScope::~ShorthandScope): Deleted.
+        (WebCore::CSSParser::setTokenStart<LChar>): Deleted.
+        (WebCore::CSSParser::setTokenStart<UChar>): Deleted.
+        (WebCore::CSSParser::tokenStartOffset): Deleted.
+        (WebCore::CSSParser::currentCharacterOffset): Deleted.
+        (WebCore::CSSParser::tokenStartChar): Deleted.
+        (WebCore::isCustomPropertyName): Deleted.
+        (WebCore::cssyylex): Deleted.
+        * css/parser/CSSParserFastPaths.cpp:
+        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
+        * css/parser/CSSParserMode.h:
+        (WebCore::CSSParserContextHash::hash):
+        * css/parser/CSSParserValues.cpp:
+        (WebCore::CSSParserSelector::setSelectorList):
+        (WebCore::destroy): Deleted.
+        (WebCore::CSSParserValueList::~CSSParserValueList): Deleted.
+        (WebCore::CSSParserValueList::addValue): Deleted.
+        (WebCore::CSSParserValueList::insertValueAt): Deleted.
+        (WebCore::CSSParserValueList::extend): Deleted.
+        (WebCore::CSSParserValueList::containsVariables): Deleted.
+        (WebCore::CSSParserValue::createCSSValue): Deleted.
+        (WebCore::CSSParserSelector::parsePseudoElementSelector): Deleted.
+        (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector): Deleted.
+        (WebCore::CSSParserSelector::parsePseudoElementSlottedFunctionSelector): Deleted.
+        (WebCore::CSSParserSelector::parsePseudoClassHostFunctionSelector): Deleted.
+        (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector): Deleted.
+        (WebCore::CSSParserSelector::setPseudoClassValue): Deleted.
+        * css/parser/CSSParserValues.h:
+        (WebCore::CSSParserString::init): Deleted.
+        (WebCore::CSSParserString::clear): Deleted.
+        (WebCore::CSSParserString::is8Bit): Deleted.
+        (WebCore::CSSParserString::characters8): Deleted.
+        (WebCore::CSSParserString::characters16): Deleted.
+        (WebCore::CSSParserString::length): Deleted.
+        (WebCore::CSSParserString::setLength): Deleted.
+        (WebCore::CSSParserString::operator[]): Deleted.
+        (WebCore::CSSParserString::operator String): Deleted.
+        (WebCore::CSSParserString::operator AtomicString): Deleted.
+        (WebCore::CSSParserString::toStringView): Deleted.
+        (): Deleted.
+        (WebCore::CSSParserValueList::CSSParserValueList): Deleted.
+        (WebCore::CSSParserValueList::size): Deleted.
+        (WebCore::CSSParserValueList::currentIndex): Deleted.
+        (WebCore::CSSParserValueList::current): Deleted.
+        (WebCore::CSSParserValueList::next): Deleted.
+        (WebCore::CSSParserValueList::previous): Deleted.
+        (WebCore::CSSParserValueList::setCurrentIndex): Deleted.
+        (WebCore::CSSParserValueList::valueAt): Deleted.
+        (WebCore::CSSParserValueList::clear): Deleted.
+        (WebCore::CSSParserValue::setFromValueList): Deleted.
+        (WebCore::equalLettersIgnoringASCIICase): Deleted.
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::isCustomPropertyName):
+        (WebCore::cssPropertyNameIOSAliasing):
+        * css/parser/CSSPropertyParser.h:
+        * css/parser/SVGCSSParser.cpp: Removed.
+        * dom/InlineStyleSheetOwner.cpp:
+        (WebCore::InlineStyleSheetOwner::createSheet):
+        * inspector/InspectorStyleSheet.cpp:
+        (WebCore::InspectorStyleSheet::ensureSourceData):
+        (WebCore::InspectorStyleSheetForInlineStyle::ruleSourceData):
+        * page/animation/AnimationController.cpp:
+        * rendering/style/RenderStyle.cpp:
+        * svg/SVGAnimateElementBase.cpp:
+        * svg/SVGAnimationElement.cpp:
+        * svg/SVGElement.cpp:
+
 2016-12-10  Konstantin Tokarev  <annulen@yandex.ru>
 
         [cmake] Include WTF, JSC, and WebCore headers automatically to targers using them
index 7f2289b..bfbf21d 100644 (file)
@@ -269,6 +269,7 @@ JS_BINDING_IDLS = \
     $(WebCore)/css/CSSKeyframeRule.idl \
     $(WebCore)/css/CSSKeyframesRule.idl \
     $(WebCore)/css/CSSMediaRule.idl \
+       $(WebCore)/css/CSSNamespaceRule.idl \
     $(WebCore)/css/CSSPageRule.idl \
     $(WebCore)/css/CSSPrimitiveValue.idl \
     $(WebCore)/css/CSSRule.idl \
@@ -865,7 +866,6 @@ all : \
     $(JS_DOM_HEADERS) \
     $(WEB_DOM_HEADERS) \
     \
-    CSSGrammar.cpp \
     CSSPropertyNames.cpp \
     CSSPropertyNames.h \
     CSSValueKeywords.cpp \
@@ -1033,12 +1033,6 @@ endif
 
 # --------
 
-# CSS grammar
-CSSGrammar.cpp : css/CSSGrammar.y.in $(PLATFORM_FEATURE_DEFINES)
-       $(PERL) $(WebCore)/css/makegrammar.pl --extraDefines "$(FEATURE_DEFINES)" --outputDir . --bison "$(BISON)" --symbolsPrefix cssyy $<
-
-# --------
-
 # XPath grammar
 XPathGrammar.cpp : xml/XPathGrammar.y $(PROJECT_FILE)
        $(PERL) $(WebCore)/css/makegrammar.pl --outputDir . --bison "$(BISON)" --symbolsPrefix xpathyy $<
index 83cb925..2382606 100644 (file)
                63189AE30E83A33300012E41 /* NodeRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 63189AE20E83A33300012E41 /* NodeRareData.h */; settings = {ATTRIBUTES = (); }; };
                63D7B32D0E78CD3F00F7617C /* NodeRenderStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 63D7B32C0E78CD3F00F7617C /* NodeRenderStyle.h */; settings = {ATTRIBUTES = (Private, ); }; };
                63F5D4F70E8C4B7100C0BD04 /* ElementRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 637B7ADE0E8767B800E32194 /* ElementRareData.h */; };
-               650F53DC09D15DDA00C9B0C8 /* CSSGrammar.h in Headers */ = {isa = PBXBuildFile; fileRef = 650F53DB09D15DDA00C9B0C8 /* CSSGrammar.h */; };
-               650F53DD09D15DDF00C9B0C8 /* CSSGrammar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6565814409D13043000E61D7 /* CSSGrammar.cpp */; settings = {COMPILER_FLAGS = "-Wno-unreachable-code"; }; };
                650FBF2A0D9AF047008FC292 /* SVGHKernElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 650FBF270D9AF046008FC292 /* SVGHKernElement.cpp */; };
                650FBF2B0D9AF047008FC292 /* SVGHKernElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 650FBF280D9AF047008FC292 /* SVGHKernElement.h */; };
                6515EC910D9723FF0063D49A /* JSSVGAltGlyphElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6515EC8F0D9723FF0063D49A /* JSSVGAltGlyphElement.cpp */; };
                946D372F1D6CB2940077084F /* CSSParserMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D372A1D6CB28B0077084F /* CSSParserMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                946D37301D6CB2940077084F /* CSSParserValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 946D372B1D6CB28B0077084F /* CSSParserValues.cpp */; };
                946D37311D6CB2940077084F /* CSSParserValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D372C1D6CB28B0077084F /* CSSParserValues.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               946D37331D6CC42B0077084F /* SVGCSSParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 946D37321D6CC3720077084F /* SVGCSSParser.cpp */; };
                946D37391D6CDFC00077084F /* CSSTokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 946D37341D6CDF980077084F /* CSSTokenizer.cpp */; };
                946D373A1D6CDFC00077084F /* CSSTokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D37371D6CDF980077084F /* CSSTokenizer.h */; };
                946D373B1D6CDFC00077084F /* CSSTokenizerInputStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 946D37351D6CDF980077084F /* CSSTokenizerInputStream.cpp */; };
                94DE5C921D83011D00164F2A /* CSSSupportsParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 94DE5C901D8300CB00164F2A /* CSSSupportsParser.h */; };
                94DE5C951D8301BD00164F2A /* CSSParserImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94DE5C931D8301B000164F2A /* CSSParserImpl.cpp */; };
                94DE5C961D8301BD00164F2A /* CSSParserImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 94DE5C941D8301B000164F2A /* CSSParserImpl.h */; };
+               94E839511DFB2A0E007BC6A7 /* CSSNamespaceRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 94E8394F1DFB2700007BC6A7 /* CSSNamespaceRule.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               94E839521DFB2A12007BC6A7 /* CSSNamespaceRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94E8394E1DFB2700007BC6A7 /* CSSNamespaceRule.cpp */; };
+               94E839551DFB2BC4007BC6A7 /* JSCSSNamespaceRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94E839531DFB2BA6007BC6A7 /* JSCSSNamespaceRule.cpp */; };
+               94E839561DFB2BC4007BC6A7 /* JSCSSNamespaceRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 94E839541DFB2BA6007BC6A7 /* JSCSSNamespaceRule.h */; };
                96ABA42314BCB80E00D56204 /* GraphicsContext3DOpenGLCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 96ABA42214BCB80E00D56204 /* GraphicsContext3DOpenGLCommon.cpp */; };
                9703E1BF15DC4E37001F24C8 /* JSVoidCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97E9EC8B15DC492F004F2E71 /* JSVoidCallback.cpp */; };
                97059977107D975200A50A7C /* PolicyCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97059973107D975200A50A7C /* PolicyCallback.cpp */; };
                BC128B01137C8D4600CAC845 /* RenderGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC128B00137C8D4600CAC845 /* RenderGrid.cpp */; };
                BC14028A0E83680800319717 /* ScrollbarThemeComposite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1402880E83680800319717 /* ScrollbarThemeComposite.cpp */; };
                BC14028B0E83680800319717 /* ScrollbarThemeComposite.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1402890E83680800319717 /* ScrollbarThemeComposite.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               BC1790BB1BB5AB3F0006D13E /* CSSVariableDependentValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1790BA1BB5AB3F0006D13E /* CSSVariableDependentValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               BC1790BD1BBB36A80006D13E /* CSSVariableDependentValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1790BC1BBB36A80006D13E /* CSSVariableDependentValue.cpp */; };
-               BC1790C01BBF2C430006D13E /* CSSVariableValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1790BE1BBF2C430006D13E /* CSSVariableValue.cpp */; };
-               BC1790C11BBF2C430006D13E /* CSSVariableValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1790BF1BBF2C430006D13E /* CSSVariableValue.h */; };
                BC17F9660B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */; };
                BC1A7D9718FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1A7D9518FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.cpp */; };
                BC1A7D9818FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1A7D9618FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.h */; };
                637B7ADE0E8767B800E32194 /* ElementRareData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementRareData.h; sourceTree = "<group>"; };
                63D7B32C0E78CD3F00F7617C /* NodeRenderStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NodeRenderStyle.h; sourceTree = "<group>"; };
                65086DA719AC1719009AF46B /* CFLocaleSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFLocaleSPI.h; sourceTree = "<group>"; };
-               650F53DB09D15DDA00C9B0C8 /* CSSGrammar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSGrammar.h; sourceTree = "<group>"; };
                650FBF270D9AF046008FC292 /* SVGHKernElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGHKernElement.cpp; sourceTree = "<group>"; };
                650FBF280D9AF047008FC292 /* SVGHKernElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGHKernElement.h; sourceTree = "<group>"; };
                650FBF290D9AF047008FC292 /* SVGHKernElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SVGHKernElement.idl; sourceTree = "<group>"; };
                65653F2C0D9727D200CA9723 /* SVGAltGlyphElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SVGAltGlyphElement.idl; sourceTree = "<group>"; };
                656580EE09D12B20000E61D7 /* CSSPropertyNames.gperf */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSPropertyNames.gperf; sourceTree = "<group>"; };
                656580EF09D12B20000E61D7 /* CSSPropertyNames.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSPropertyNames.h; sourceTree = "<group>"; };
-               6565814409D13043000E61D7 /* CSSGrammar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSGrammar.cpp; sourceTree = "<group>"; };
                6565814709D13043000E61D7 /* CSSValueKeywords.gperf */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSValueKeywords.gperf; sourceTree = "<group>"; };
                6565814809D13043000E61D7 /* CSSValueKeywords.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSValueKeywords.h; sourceTree = "<group>"; };
                656581AC09D14EE6000E61D7 /* CharsetData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CharsetData.cpp; sourceTree = "<group>"; };
                946D372A1D6CB28B0077084F /* CSSParserMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParserMode.h; path = parser/CSSParserMode.h; sourceTree = "<group>"; };
                946D372B1D6CB28B0077084F /* CSSParserValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSParserValues.cpp; path = parser/CSSParserValues.cpp; sourceTree = "<group>"; };
                946D372C1D6CB28B0077084F /* CSSParserValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParserValues.h; path = parser/CSSParserValues.h; sourceTree = "<group>"; };
-               946D37321D6CC3720077084F /* SVGCSSParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SVGCSSParser.cpp; path = parser/SVGCSSParser.cpp; sourceTree = "<group>"; };
                946D37341D6CDF980077084F /* CSSTokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSTokenizer.cpp; path = parser/CSSTokenizer.cpp; sourceTree = "<group>"; };
                946D37351D6CDF980077084F /* CSSTokenizerInputStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSTokenizerInputStream.cpp; path = parser/CSSTokenizerInputStream.cpp; sourceTree = "<group>"; };
                946D37371D6CDF980077084F /* CSSTokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSTokenizer.h; path = parser/CSSTokenizer.h; sourceTree = "<group>"; };
                94DE5C901D8300CB00164F2A /* CSSSupportsParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSSupportsParser.h; path = parser/CSSSupportsParser.h; sourceTree = "<group>"; };
                94DE5C931D8301B000164F2A /* CSSParserImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSParserImpl.cpp; path = parser/CSSParserImpl.cpp; sourceTree = "<group>"; };
                94DE5C941D8301B000164F2A /* CSSParserImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParserImpl.h; path = parser/CSSParserImpl.h; sourceTree = "<group>"; };
+               94E8394E1DFB2700007BC6A7 /* CSSNamespaceRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSNamespaceRule.cpp; sourceTree = "<group>"; };
+               94E8394F1DFB2700007BC6A7 /* CSSNamespaceRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSNamespaceRule.h; sourceTree = "<group>"; };
+               94E839501DFB29A4007BC6A7 /* CSSNamespaceRule.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSNamespaceRule.idl; sourceTree = "<group>"; };
+               94E839531DFB2BA6007BC6A7 /* JSCSSNamespaceRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSNamespaceRule.cpp; sourceTree = "<group>"; };
+               94E839541DFB2BA6007BC6A7 /* JSCSSNamespaceRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSNamespaceRule.h; sourceTree = "<group>"; };
                950C4C02BED8936F818E2F99 /* JSSVGGraphicsElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGGraphicsElement.h; sourceTree = "<group>"; };
                96ABA42214BCB80E00D56204 /* GraphicsContext3DOpenGLCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DOpenGLCommon.cpp; sourceTree = "<group>"; };
                97059973107D975200A50A7C /* PolicyCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolicyCallback.cpp; sourceTree = "<group>"; };
                BC128B00137C8D4600CAC845 /* RenderGrid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderGrid.cpp; sourceTree = "<group>"; };
                BC1402880E83680800319717 /* ScrollbarThemeComposite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollbarThemeComposite.cpp; sourceTree = "<group>"; };
                BC1402890E83680800319717 /* ScrollbarThemeComposite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeComposite.h; sourceTree = "<group>"; };
-               BC1790BA1BB5AB3F0006D13E /* CSSVariableDependentValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSVariableDependentValue.h; sourceTree = "<group>"; };
-               BC1790BC1BBB36A80006D13E /* CSSVariableDependentValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSVariableDependentValue.cpp; sourceTree = "<group>"; };
-               BC1790BE1BBF2C430006D13E /* CSSVariableValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSVariableValue.cpp; sourceTree = "<group>"; };
-               BC1790BF1BBF2C430006D13E /* CSSVariableValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSVariableValue.h; sourceTree = "<group>"; };
                BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLSelectElementCustom.cpp; sourceTree = "<group>"; };
                BC1A7D9518FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMultiColumnSpannerPlaceholder.cpp; sourceTree = "<group>"; };
                BC1A7D9618FCB5B000421879 /* RenderMultiColumnSpannerPlaceholder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMultiColumnSpannerPlaceholder.h; sourceTree = "<group>"; };
                FC9A0F72164094CF003D6B8D /* DOMCSSNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCSSNamespace.h; sourceTree = "<group>"; };
                FC9A0F73164094CF003D6B8D /* DOMCSSNamespace.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMCSSNamespace.idl; sourceTree = "<group>"; };
                FC9E0E4B16419C1E00392BE3 /* JSDOMCSSNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMCSSNamespace.h; sourceTree = "<group>"; };
-               FCEBCD711623A7910029965E /* CSSGrammar.y.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; path = CSSGrammar.y.in; sourceTree = "<group>"; };
-               FCEBCD721623A7910029965E /* CSSGrammar.y.includes */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; path = CSSGrammar.y.includes; sourceTree = "<group>"; };
                FD00D7A214A3F61900734011 /* SincResampler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SincResampler.cpp; sourceTree = "<group>"; };
                FD00D7A314A3F61900734011 /* SincResampler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SincResampler.h; sourceTree = "<group>"; };
                FD06DFA3134A4DEF006F5D7D /* DefaultAudioDestinationNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DefaultAudioDestinationNode.cpp; sourceTree = "<group>"; };
                                E406F3FB1198307D009D59D6 /* ColorData.cpp */,
                                9908B0F61BCAD07D00ED0F65 /* CountQueuingStrategyBuiltins.cpp */,
                                9908B0F71BCAD07D00ED0F65 /* CountQueuingStrategyBuiltins.h */,
-                               6565814409D13043000E61D7 /* CSSGrammar.cpp */,
-                               650F53DB09D15DDA00C9B0C8 /* CSSGrammar.h */,
                                E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */,
                                656580EE09D12B20000E61D7 /* CSSPropertyNames.gperf */,
                                656580EF09D12B20000E61D7 /* CSSPropertyNames.h */,
                                9444CBD11D860C740073A074 /* SizesAttributeParser.h */,
                                9444CBD01D860C740073A074 /* SizesCalcParser.cpp */,
                                9444CBCF1D860C740073A074 /* SizesCalcParser.h */,
-                               946D37321D6CC3720077084F /* SVGCSSParser.cpp */,
                        );
                        name = parser;
                        sourceTree = "<group>";
                                316FE0700E6CCBEE00BF6088 /* JSCSSKeyframesRule.h */,
                                BC46C1F60C0DDC8F0020CFC3 /* JSCSSMediaRule.cpp */,
                                BC46C1F70C0DDC8F0020CFC3 /* JSCSSMediaRule.h */,
+                               94E839531DFB2BA6007BC6A7 /* JSCSSNamespaceRule.cpp */,
+                               94E839541DFB2BA6007BC6A7 /* JSCSSNamespaceRule.h */,
                                BC46C1F80C0DDC8F0020CFC3 /* JSCSSPageRule.cpp */,
                                BC46C1F90C0DDC8F0020CFC3 /* JSCSSPageRule.h */,
                                930705E809E0C9F000B17FE4 /* JSCSSPrimitiveValue.cpp */,
                                BC02A63B0E09A9CF004B6D2B /* CSSFunctionValue.h */,
                                BC23E4E00DAACE0F009FDC91 /* CSSGradientValue.cpp */,
                                BC53C6910DA591140021EB5D /* CSSGradientValue.h */,
-                               FCEBCD711623A7910029965E /* CSSGrammar.y.in */,
-                               FCEBCD721623A7910029965E /* CSSGrammar.y.includes */,
                                E110032E1C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.cpp */,
                                E110032F1C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.h */,
                                CD7DBB2618CA11FF00C11066 /* CSSGridLineNamesValue.cpp */,
                                85C56CA20AA89C1000D95755 /* CSSMediaRule.idl */,
                                314BE3A21B30F6D100141982 /* CSSNamedImageValue.cpp */,
                                314BE3A01B30F6B700141982 /* CSSNamedImageValue.h */,
+                               94E8394E1DFB2700007BC6A7 /* CSSNamespaceRule.cpp */,
+                               94E8394F1DFB2700007BC6A7 /* CSSNamespaceRule.h */,
+                               94E839501DFB29A4007BC6A7 /* CSSNamespaceRule.idl */,
                                A80E6CCB0A1989CA007FB8C5 /* CSSPageRule.cpp */,
                                A80E6CD60A1989CA007FB8C5 /* CSSPageRule.h */,
                                85C56CA60AA89D5F00D95755 /* CSSPageRule.idl */,
                                E49BD9F9131FD2ED003C56F0 /* CSSValuePool.h */,
                                9444CBDE1D8861580073A074 /* CSSVariableData.cpp */,
                                9444CBDD1D8861580073A074 /* CSSVariableData.h */,
-                               BC1790BC1BBB36A80006D13E /* CSSVariableDependentValue.cpp */,
-                               BC1790BA1BB5AB3F0006D13E /* CSSVariableDependentValue.h */,
                                9444CBDC1D8861580073A074 /* CSSVariableReferenceValue.cpp */,
                                9444CBDB1D8861580073A074 /* CSSVariableReferenceValue.h */,
-                               BC1790BE1BBF2C430006D13E /* CSSVariableValue.cpp */,
-                               BC1790BF1BBF2C430006D13E /* CSSVariableValue.h */,
                                A80E6CE10A1989CA007FB8C5 /* DashboardRegion.h */,
                                4A4F48A716B0DFC000EDBB29 /* DocumentRuleSets.cpp */,
                                4A4F48A816B0DFC000EDBB29 /* DocumentRuleSets.h */,
                                C21DF2EA1D9E4E9900F5B24C /* CSSFontVariationValue.h in Headers */,
                                BC02A63C0E09A9CF004B6D2B /* CSSFunctionValue.h in Headers */,
                                BC53C6920DA591140021EB5D /* CSSGradientValue.h in Headers */,
-                               650F53DC09D15DDA00C9B0C8 /* CSSGrammar.h in Headers */,
                                E11003311C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.h in Headers */,
                                CD7DBB2918CA19C600C11066 /* CSSGridLineNamesValue.h in Headers */,
                                996E59DF1DF0128D006612B9 /* NavigatorWebDriver.h in Headers */,
                                A80E6CEE0A1989CA007FB8C5 /* CSSValue.h in Headers */,
                                6565815109D13043000E61D7 /* CSSValueKeywords.h in Headers */,
                                A80E6CE90A1989CA007FB8C5 /* CSSValueList.h in Headers */,
+                               94E839511DFB2A0E007BC6A7 /* CSSNamespaceRule.h in Headers */,
                                E49BD9FA131FD2ED003C56F0 /* CSSValuePool.h in Headers */,
                                9444CBE81D8861C20073A074 /* CSSVariableData.h in Headers */,
-                               BC1790BB1BB5AB3F0006D13E /* CSSVariableDependentValue.h in Headers */,
                                9444CBDA1D88483A0073A074 /* CSSVariableParser.h in Headers */,
                                9444CBEA1D8861CA0073A074 /* CSSVariableReferenceValue.h in Headers */,
-                               BC1790C11BBF2C430006D13E /* CSSVariableValue.h in Headers */,
                                93F1992F08245E59001E9ABC /* Cursor.h in Headers */,
                                BC2272A20E82E87C00E7F975 /* CursorData.h in Headers */,
                                BC2272AD0E82E8F300E7F975 /* CursorList.h in Headers */,
                                A81369DC097374F600D74463 /* HTMLOptionElement.h in Headers */,
                                A81369DA097374F600D74463 /* HTMLOptionsCollection.h in Headers */,
                                4AD01009127E642A0015035F /* HTMLOutputElement.h in Headers */,
+                               94E839561DFB2BC4007BC6A7 /* JSCSSNamespaceRule.h in Headers */,
                                A8EA7CB50A192B9C00A8EF5F /* HTMLParagraphElement.h in Headers */,
                                A871D4580A127CBC00B12A68 /* HTMLParamElement.h in Headers */,
                                93E2A307123E9DC0009FE12A /* HTMLParserIdioms.h in Headers */,
                                C21DF2E91D9E4E9900F5B24C /* CSSFontVariationValue.cpp in Sources */,
                                BC02A6460E09AAE9004B6D2B /* CSSFunctionValue.cpp in Sources */,
                                BC23E4E10DAACE0F009FDC91 /* CSSGradientValue.cpp in Sources */,
-                               650F53DD09D15DDF00C9B0C8 /* CSSGrammar.cpp in Sources */,
                                E11003301C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.cpp in Sources */,
                                CD7DBB2818CA19A400C11066 /* CSSGridLineNamesValue.cpp in Sources */,
                                CD3E252318046BCD00E27F56 /* CSSGridTemplateAreasValue.cpp in Sources */,
                                A80E6CE40A1989CA007FB8C5 /* CSSValueList.cpp in Sources */,
                                E49BDA0B131FD3E5003C56F0 /* CSSValuePool.cpp in Sources */,
                                9444CBE71D8861C20073A074 /* CSSVariableData.cpp in Sources */,
-                               BC1790BD1BBB36A80006D13E /* CSSVariableDependentValue.cpp in Sources */,
                                9444CBD91D88483A0073A074 /* CSSVariableParser.cpp in Sources */,
                                9444CBE91D8861CA0073A074 /* CSSVariableReferenceValue.cpp in Sources */,
                                E307DECF1D81E4C300141CAF /* CachedModuleScriptLoader.cpp in Sources */,
-                               BC1790C01BBF2C430006D13E /* CSSVariableValue.cpp in Sources */,
                                E11AF15111B9A1A300805103 /* Cursor.cpp in Sources */,
                                265541521489B233000DFC5D /* CursorIOS.cpp in Sources */,
                                93F19A2608245E59001E9ABC /* CursorMac.mm in Sources */,
                                37E3524B12450C5200BAF5D9 /* InputType.cpp in Sources */,
                                C348612315FDE21E007A1CC9 /* InputTypeNames.cpp in Sources */,
                                93309DE9099E64920056E581 /* InsertIntoTextNodeCommand.cpp in Sources */,
+                               94E839521DFB2A12007BC6A7 /* CSSNamespaceRule.cpp in Sources */,
                                93309DEB099E64920056E581 /* InsertLineBreakCommand.cpp in Sources */,
                                D07DEAB90A36554A00CA30F8 /* InsertListCommand.cpp in Sources */,
                                93309DED099E64920056E581 /* InsertNodeBeforeCommand.cpp in Sources */,
                                93C4A4161629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.mm in Sources */,
                                0FC4E40F187F82E10045882C /* ScrollingTreeIOS.cpp in Sources */,
                                0FE5806319327A6200DE32EB /* ScrollingTreeMac.cpp in Sources */,
+                               94E839551DFB2BC4007BC6A7 /* JSCSSNamespaceRule.cpp in Sources */,
                                1AAADDE314DC8C8F00AF64B3 /* ScrollingTreeNode.cpp in Sources */,
                                0FEA3E7F191B3169000F1B55 /* ScrollingTreeOverflowScrollingNode.cpp in Sources */,
                                9391A99C1629D70000297330 /* ScrollingTreeScrollingNode.cpp in Sources */,
                                B22279A10D00BF220071B782 /* SVGColor.cpp in Sources */,
                                B22279A40D00BF220071B782 /* SVGComponentTransferFunctionElement.cpp in Sources */,
                                B2227B050D00BFF10071B782 /* SVGCSSComputedStyleDeclaration.cpp in Sources */,
-                               946D37331D6CC42B0077084F /* SVGCSSParser.cpp in Sources */,
                                B22279A70D00BF220071B782 /* SVGCursorElement.cpp in Sources */,
                                B22279AD0D00BF220071B782 /* SVGDefsElement.cpp in Sources */,
                                B22279B00D00BF220071B782 /* SVGDescElement.cpp in Sources */,
index 91e6ede..666757b 100644 (file)
@@ -31,6 +31,7 @@
 #include "CSSKeyframeRule.h"
 #include "CSSKeyframesRule.h"
 #include "CSSMediaRule.h"
+#include "CSSNamespaceRule.h"
 #include "CSSPageRule.h"
 #include "CSSStyleRule.h"
 #include "CSSSupportsRule.h"
@@ -39,6 +40,7 @@
 #include "JSCSSKeyframeRule.h"
 #include "JSCSSKeyframesRule.h"
 #include "JSCSSMediaRule.h"
+#include "JSCSSNamespaceRule.h"
 #include "JSCSSPageRule.h"
 #include "JSCSSStyleRule.h"
 #include "JSCSSSupportsRule.h"
@@ -71,6 +73,8 @@ JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<CSSRul
         return createWrapper<CSSPageRule>(globalObject, WTFMove(rule));
     case CSSRule::IMPORT_RULE:
         return createWrapper<CSSImportRule>(globalObject, WTFMove(rule));
+    case CSSRule::NAMESPACE_RULE:
+        return createWrapper<CSSNamespaceRule>(globalObject, WTFMove(rule));
     case CSSRule::KEYFRAME_RULE:
         return createWrapper<CSSKeyframeRule>(globalObject, WTFMove(rule));
     case CSSRule::KEYFRAMES_RULE:
index b7ae0e4..a4a9a92 100644 (file)
@@ -26,9 +26,9 @@
 #include "config.h"
 #include "JSCSSStyleDeclarationCustom.h"
 
-#include "CSSParser.h"
 #include "CSSPrimitiveValue.h"
 #include "CSSPropertyNames.h"
+#include "CSSPropertyParser.h"
 #include "CSSRule.h"
 #include "CSSStyleDeclaration.h"
 #include "CSSStyleSheet.h"
index 0214ea4..e577795 100644 (file)
@@ -89,8 +89,6 @@
 #include "CSSValue.cpp"
 #include "CSSValueList.cpp"
 #include "CSSValuePool.cpp"
-#include "CSSVariableDependentValue.cpp"
-#include "CSSVariableValue.cpp"
 #include "DOMCSSNamespace.cpp"
 #include "DocumentRuleSets.cpp"
 #include "ElementRuleCollector.cpp"
 #include "RuleFeature.cpp"
 #include "RuleSet.cpp"
 #include "SVGCSSComputedStyleDeclaration.cpp"
-#include "SVGCSSParser.cpp"
 #include "SelectorChecker.cpp"
 #include "SelectorFilter.cpp"
 #include "StyleInvalidationAnalysis.cpp"
index 54e34b5..934f10a 100644 (file)
@@ -56,7 +56,6 @@ static CalculationCategory unitCategory(CSSPrimitiveValue::UnitTypes type)
 {
     switch (type) {
     case CSSPrimitiveValue::CSS_NUMBER:
-    case CSSPrimitiveValue::CSS_PARSER_INTEGER:
         return CalcNumber;
     case CSSPrimitiveValue::CSS_EMS:
     case CSSPrimitiveValue::CSS_EXS:
@@ -96,7 +95,6 @@ static bool hasDoubleValue(CSSPrimitiveValue::UnitTypes type)
     switch (type) {
     case CSSPrimitiveValue::CSS_FR:
     case CSSPrimitiveValue::CSS_NUMBER:
-    case CSSPrimitiveValue::CSS_PARSER_INTEGER:
     case CSSPrimitiveValue::CSS_PERCENTAGE:
     case CSSPrimitiveValue::CSS_EMS:
     case CSSPrimitiveValue::CSS_EXS:
@@ -136,10 +134,6 @@ static bool hasDoubleValue(CSSPrimitiveValue::UnitTypes type)
     case CSSPrimitiveValue::CSS_RGBCOLOR:
     case CSSPrimitiveValue::CSS_PAIR:
     case CSSPrimitiveValue::CSS_UNICODE_RANGE:
-    case CSSPrimitiveValue::CSS_PARSER_OPERATOR:
-    case CSSPrimitiveValue::CSS_PARSER_HEXCOLOR:
-    case CSSPrimitiveValue::CSS_PARSER_IDENTIFIER:
-    case CSSPrimitiveValue::CSS_PARSER_WHITESPACE:
     case CSSPrimitiveValue::CSS_COUNTER_NAME:
     case CSSPrimitiveValue::CSS_SHAPE:
     case CSSPrimitiveValue::CSS_QUAD:
@@ -374,7 +368,7 @@ public:
 
         // Simplify numbers.
         if (leftCategory == CalcNumber && rightCategory == CalcNumber) {
-            CSSPrimitiveValue::UnitTypes evaluationType = isInteger ? CSSPrimitiveValue::CSS_PARSER_INTEGER : CSSPrimitiveValue::CSS_NUMBER;
+            CSSPrimitiveValue::UnitTypes evaluationType = CSSPrimitiveValue::CSS_NUMBER;
             return CSSCalcPrimitiveValue::create(evaluateOperator(op, leftSide->doubleValue(), rightSide->doubleValue()), evaluationType, isInteger);
         }
 
@@ -487,8 +481,6 @@ private:
         switch (category()) {
         case CalcNumber:
             ASSERT(m_leftSide->category() == CalcNumber && m_rightSide->category() == CalcNumber);
-            if (isInteger())
-                return CSSPrimitiveValue::CSS_PARSER_INTEGER;
             return CSSPrimitiveValue::CSS_NUMBER;
         case CalcLength:
         case CalcPercent: {
@@ -688,140 +680,6 @@ private:
         return parseAdditiveValueExpression(tokens, depth, result);
     }
 };
-    
-static ParseState checkDepthAndIndexDeprecated(int* depth, unsigned index, CSSParserValueList* tokens)
-{
-    (*depth)++;
-    if (*depth > maxExpressionDepth)
-        return TooDeep;
-    if (index >= tokens->size())
-        return NoMoreTokens;
-    return OK;
-}
-
-class CSSCalcExpressionNodeParserDeprecated {
-public:
-    RefPtr<CSSCalcExpressionNode> parseCalc(CSSParserValueList* tokens)
-    {
-        unsigned index = 0;
-        Value result;
-        bool ok = parseValueExpression(tokens, 0, &index, &result);
-        ASSERT_WITH_SECURITY_IMPLICATION(index <= tokens->size());
-        if (!ok || index != tokens->size())
-            return nullptr;
-        return result.value;
-    }
-
-private:
-    struct Value {
-        RefPtr<CSSCalcExpressionNode> value;
-    };
-
-    char operatorValue(CSSParserValueList* tokens, unsigned index)
-    {
-        if (index >= tokens->size())
-            return 0;
-        CSSParserValue* value = tokens->valueAt(index);
-        if (value->unit != CSSParserValue::Operator)
-            return 0;
-
-        return value->iValue;
-    }
-
-    bool parseValue(CSSParserValueList* tokens, unsigned* index, Value* result)
-    {
-        CSSParserValue* parserValue = tokens->valueAt(*index);
-        if (parserValue->unit == CSSParserValue::Operator || parserValue->unit == CSSParserValue::Function)
-            return false;
-
-        RefPtr<CSSValue> value = parserValue->createCSSValue();
-        if (!is<CSSPrimitiveValue>(value.get()))
-            return false;
-
-        result->value = CSSCalcPrimitiveValue::create(Ref<CSSPrimitiveValue>(downcast<CSSPrimitiveValue>(*value)), parserValue->isInt);
-
-        ++*index;
-        return true;
-    }
-
-    bool parseValueTerm(CSSParserValueList* tokens, int depth, unsigned* index, Value* result)
-    {
-        if (checkDepthAndIndexDeprecated(&depth, *index, tokens) != OK)
-            return false;
-
-        if (operatorValue(tokens, *index) == '(') {
-            unsigned currentIndex = *index + 1;
-            if (!parseValueExpression(tokens, depth, &currentIndex, result))
-                return false;
-
-            if (operatorValue(tokens, currentIndex) != ')')
-                return false;
-            *index = currentIndex + 1;
-            return true;
-        }
-
-        return parseValue(tokens, index, result);
-    }
-
-    bool parseValueMultiplicativeExpression(CSSParserValueList* tokens, int depth, unsigned* index, Value* result)
-    {
-        if (checkDepthAndIndexDeprecated(&depth, *index, tokens) != OK)
-            return false;
-
-        if (!parseValueTerm(tokens, depth, index, result))
-            return false;
-
-        while (*index < tokens->size() - 1) {
-            char operatorCharacter = operatorValue(tokens, *index);
-            if (operatorCharacter != CalcMultiply && operatorCharacter != CalcDivide)
-                break;
-            ++*index;
-
-            Value rhs;
-            if (!parseValueTerm(tokens, depth, index, &rhs))
-                return false;
-
-            result->value = CSSCalcBinaryOperation::createSimplified(static_cast<CalcOperator>(operatorCharacter), result->value, rhs.value);
-            if (!result->value)
-                return false;
-        }
-
-        ASSERT_WITH_SECURITY_IMPLICATION(*index <= tokens->size());
-        return true;
-    }
-
-    bool parseAdditiveValueExpression(CSSParserValueList* tokens, int depth, unsigned* index, Value* result)
-    {
-        if (checkDepthAndIndexDeprecated(&depth, *index, tokens) != OK)
-            return false;
-
-        if (!parseValueMultiplicativeExpression(tokens, depth, index, result))
-            return false;
-
-        while (*index < tokens->size() - 1) {
-            char operatorCharacter = operatorValue(tokens, *index);
-            if (operatorCharacter != CalcAdd && operatorCharacter != CalcSubtract)
-                break;
-            ++*index;
-
-            Value rhs;
-            if (!parseValueMultiplicativeExpression(tokens, depth, index, &rhs))
-                return false;
-
-            result->value = CSSCalcBinaryOperation::createSimplified(static_cast<CalcOperator>(operatorCharacter), result->value, rhs.value);
-            if (!result->value)
-                return false;
-        }
-
-        ASSERT_WITH_SECURITY_IMPLICATION(*index <= tokens->size());
-        return true;
-    }
-
-    bool parseValueExpression(CSSParserValueList* tokens, int depth, unsigned* index, Value* result)
-    {
-        return parseAdditiveValueExpression(tokens, depth, index, result);
-    }
-};
 
 static inline RefPtr<CSSCalcBinaryOperation> createBlendHalf(const Length& length, const RenderStyle& style, float progress)
 {
@@ -880,17 +738,6 @@ static RefPtr<CSSCalcExpressionNode> createCSS(const Length& length, const Rende
     return nullptr;
 }
 
-RefPtr<CSSCalcValue> CSSCalcValue::create(CSSParserString name, CSSParserValueList& parserValueList, ValueRange range)
-{
-    CSSCalcExpressionNodeParserDeprecated parser;
-    RefPtr<CSSCalcExpressionNode> expression;
-
-    if (equalLettersIgnoringASCIICase(name, "calc(") || equalLettersIgnoringASCIICase(name, "-webkit-calc("))
-        expression = parser.parseCalc(&parserValueList);
-
-    return expression ? adoptRef(new CSSCalcValue(expression.releaseNonNull(), range != ValueRangeAll)) : nullptr;
-}
-
 RefPtr<CSSCalcValue> CSSCalcValue::create(const CSSParserTokenRange& tokens, ValueRange range)
 {
     CSSCalcExpressionNodeParser parser;
index ea7bf54..77310d0 100644 (file)
 namespace WebCore {
 
 class CSSParserTokenRange;
-class CSSParserValueList;
 class CSSToLengthConversionData;
 class RenderStyle;
 
-struct CSSParserString;
-
 enum CalculationCategory {
     CalcNumber = 0,
     CalcLength,
@@ -88,8 +85,6 @@ private:
 
 class CSSCalcValue final : public CSSValue {
 public:
-    // FIXME-NEWPARSER: Remove the CSSParserString create when old parser goes away.
-    static RefPtr<CSSCalcValue> create(CSSParserString name, CSSParserValueList& arguments, ValueRange);
     static RefPtr<CSSCalcValue> create(const CSSParserTokenRange&, ValueRange);
     
     static RefPtr<CSSCalcValue> create(const CalculationValue&, const RenderStyle&);
index 788563b..3bc58d0 100644 (file)
 #include "CSSFontVariationValue.h"
 #include "CSSFunctionValue.h"
 #include "CSSLineBoxContainValue.h"
-#include "CSSParser.h"
 #include "CSSPrimitiveValue.h"
 #include "CSSPrimitiveValueMappings.h"
 #include "CSSPropertyNames.h"
+#include "CSSPropertyParser.h"
 #include "CSSReflectValue.h"
 #include "CSSSelector.h"
 #include "CSSShadowValue.h"
@@ -1008,7 +1008,7 @@ static Ref<CSSValue> specifiedValueForGridTrackSize(const GridTrackSize& trackSi
     case FitContentTrackSizing: {
         auto fitContentTrackSize = CSSValueList::createCommaSeparated();
         fitContentTrackSize->append(zoomAdjustedPixelValueForLength(trackSize.fitContentTrackBreadth().length(), style));
-        return CSSFunctionValue::create("fit-content(", WTFMove(fitContentTrackSize));
+        return CSSFunctionValue::create(CSSValueFitContent, WTFMove(fitContentTrackSize));
     }
     default:
         ASSERT(trackSize.type() == MinMaxTrackSizing);
@@ -1018,7 +1018,7 @@ static Ref<CSSValue> specifiedValueForGridTrackSize(const GridTrackSize& trackSi
         auto minMaxTrackBreadths = CSSValueList::createCommaSeparated();
         minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.minTrackBreadth(), style));
         minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.maxTrackBreadth(), style));
-        return CSSFunctionValue::create("minmax(", WTFMove(minMaxTrackBreadths));
+        return CSSFunctionValue::create(CSSValueMinmax, WTFMove(minMaxTrackBreadths));
     }
 }
 
index c5201f8..769ce18 100644 (file)
@@ -33,8 +33,6 @@ namespace WebCore {
 bool CSSCustomPropertyValue::checkVariablesForCycles(const AtomicString& name, CustomPropertyValueMap& customProperties, HashSet<AtomicString>& seenProperties, HashSet<AtomicString>& invalidProperties) const
 {
     ASSERT(containsVariables());
-    if (m_deprecatedValue && m_deprecatedValue->isVariableDependentValue())
-        return downcast<CSSVariableDependentValue>(*m_deprecatedValue).checkVariablesForCycles(name, customProperties, seenProperties, invalidProperties);
     if (m_value)
         return m_value->checkVariablesForCycles(name, customProperties, seenProperties, invalidProperties);
     return true;
@@ -43,15 +41,6 @@ bool CSSCustomPropertyValue::checkVariablesForCycles(const AtomicString& name, C
 void CSSCustomPropertyValue::resolveVariableReferences(const CustomPropertyValueMap& customProperties, Vector<Ref<CSSCustomPropertyValue>>& resolvedValues) const
 {
     ASSERT(containsVariables());
-    if (m_deprecatedValue && m_deprecatedValue->isVariableDependentValue()) {
-        CSSParserValueList parserList;
-        if (!downcast<CSSVariableDependentValue>(*m_deprecatedValue).valueList().buildParserValueListSubstitutingVariables(&parserList, customProperties))
-            resolvedValues.append(CSSCustomPropertyValue::create(m_name, CSSCustomPropertyValue::createInvalid()));
-        else
-            resolvedValues.append(CSSCustomPropertyValue::create(m_name, CSSValueList::createFromParserValueList(parserList)));
-        return;
-    }
-    
     if (!m_value)
         return;
     
@@ -60,7 +49,7 @@ void CSSCustomPropertyValue::resolveVariableReferences(const CustomPropertyValue
     if (resolvedData)
         resolvedValues.append(CSSCustomPropertyValue::createWithVariableData(m_name, resolvedData.releaseNonNull()));
     else
-        resolvedValues.append(CSSCustomPropertyValue::create(m_name, CSSCustomPropertyValue::createInvalid()));
+        resolvedValues.append(CSSCustomPropertyValue::createWithID(m_name, CSSValueInvalid));
 }
 
 }
index b3b4f91..31958b2 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "CSSValue.h"
 #include "CSSVariableData.h"
-#include "CSSVariableDependentValue.h"
 #include <wtf/RefPtr.h>
 #include <wtf/text/WTFString.h>
 
@@ -35,11 +34,6 @@ namespace WebCore {
 
 class CSSCustomPropertyValue final : public CSSValue {
 public:
-    static Ref<CSSCustomPropertyValue> create(const AtomicString& name, Ref<CSSValue>&& value)
-    {
-        return adoptRef(*new CSSCustomPropertyValue(name, WTFMove(value)));
-    }
-    
     static Ref<CSSCustomPropertyValue> createWithVariableData(const AtomicString& name, Ref<CSSVariableData>&& value)
     {
         return adoptRef(*new CSSCustomPropertyValue(name, WTFMove(value)));
@@ -59,9 +53,7 @@ public:
     {
         if (!m_serialized) {
             m_serialized = true;
-            if (m_deprecatedValue)
-                m_stringValue = m_deprecatedValue->cssText();
-            else if (m_value)
+            if (m_value)
                 m_stringValue = m_value->tokenRange().serialize();
             else if (m_valueId != CSSValueInvalid)
                 m_stringValue = getValueName(m_valueId);
@@ -73,27 +65,17 @@ public:
 
     const AtomicString& name() const { return m_name; }
     
-    bool equals(const CSSCustomPropertyValue& other) const { return m_name == other.m_name && m_deprecatedValue == other.m_deprecatedValue && m_value == other.m_value && m_valueId == other.m_valueId; }
+    bool equals(const CSSCustomPropertyValue& other) const { return m_name == other.m_name && m_value == other.m_value && m_valueId == other.m_valueId; }
 
     bool containsVariables() const { return m_containsVariables; }
     bool checkVariablesForCycles(const AtomicString& name, CustomPropertyValueMap&, HashSet<AtomicString>& seenProperties, HashSet<AtomicString>& invalidProperties) const;
 
     void resolveVariableReferences(const CustomPropertyValueMap&, Vector<Ref<CSSCustomPropertyValue>>&) const;
 
-    const RefPtr<CSSValue> deprecatedValue() const { return m_deprecatedValue.get(); }
-    
     CSSValueID valueID() const { return m_valueId; }
     CSSVariableData* value() const { return m_value.get(); }
 
 private:
-    CSSCustomPropertyValue(const AtomicString& name, Ref<CSSValue>&& value)
-        : CSSValue(CustomPropertyClass)
-        , m_name(name)
-        , m_deprecatedValue(WTFMove(value))
-        , m_containsVariables(m_deprecatedValue->isVariableDependentValue())
-    {
-    }
-    
     CSSCustomPropertyValue(const AtomicString& name, const String& serializedValue)
         : CSSValue(CustomPropertyClass)
         , m_name(name)
@@ -107,7 +89,7 @@ private:
         , m_name(name)
         , m_valueId(id)
     {
-        ASSERT(id == CSSValueInherit || id == CSSValueInitial || id == CSSValueUnset || id == CSSValueRevert);
+        ASSERT(id == CSSValueInherit || id == CSSValueInitial || id == CSSValueUnset || id == CSSValueRevert || id == CSSValueInvalid);
     }
     
     CSSCustomPropertyValue(const AtomicString& name, Ref<CSSVariableData>&& value)
@@ -121,9 +103,8 @@ private:
     
     const AtomicString m_name;
     
-    RefPtr<CSSValue> m_deprecatedValue; // Used by old parser
-    RefPtr<CSSVariableData> m_value; // Used by new parser.
-    CSSValueID m_valueId { CSSValueInvalid }; // Used by new parser.
+    RefPtr<CSSVariableData> m_value;
+    CSSValueID m_valueId { CSSValueInvalid };
     
     mutable String m_stringValue;
     bool m_containsVariables { false };
index a2f8b52..cc5591d 100644 (file)
 #include "config.h"
 #include "CSSFunctionValue.h"
 
-#include "CSSParserValues.h"
 #include "CSSValueList.h"
 #include <wtf/text/StringBuilder.h>
 
 namespace WebCore {
 
-CSSFunctionValue::CSSFunctionValue(CSSParserFunction* function)
+CSSFunctionValue::CSSFunctionValue(CSSValueID name, Ref<CSSValueList>&& args)
     : CSSValue(FunctionClass)
-    , m_nameDeprecated(function->name)
-    , m_args(function->args ? RefPtr<CSSValueList>(CSSValueList::createFromParserValueList(*function->args)) : nullptr)
-{
-}
-
-CSSFunctionValue::CSSFunctionValue(const String& name, Ref<CSSValueList>&& args)
-    : CSSValue(FunctionClass)
-    , m_nameDeprecated(name)
+    , m_name(name)
     , m_args(WTFMove(args))
 {
 }
 
-CSSFunctionValue::CSSFunctionValue(CSSValueID keyword)
+CSSFunctionValue::CSSFunctionValue(CSSValueID name)
     : CSSValue(FunctionClass)
-    , m_name(keyword)
+    , m_name(name)
 {
 }
     
@@ -58,8 +50,7 @@ String CSSFunctionValue::customCSSText() const
     if (m_name != CSSValueInvalid) {
         result.append(getValueName(m_name));
         result.append('(');
-    } else
-        result.append(m_nameDeprecated); // Includes the '('
+    }
     if (m_args)
         result.append(m_args->cssText());
     result.append(')');
@@ -77,20 +68,5 @@ void CSSFunctionValue::append(Ref<CSSValue>&& value)
         m_args = CSSValueList::createCommaSeparated();
     m_args->append(WTFMove(value));
 }
-    
-bool CSSFunctionValue::buildParserValueSubstitutingVariables(CSSParserValue* result, const CustomPropertyValueMap& customProperties) const
-{
-    result->id = CSSValueInvalid;
-    result->unit = CSSParserValue::Function;
-    result->function = new CSSParserFunction;
-    result->function->name.init(m_nameDeprecated);
-    bool success = true;
-    if (m_args) {
-        CSSParserValueList* argList = new CSSParserValueList;
-        success = m_args->buildParserValueListSubstitutingVariables(argList, customProperties);
-        result->function->args.reset(argList);
-    }
-    return success;
-}
 
 }
index 788fc35..5803eaf 100644 (file)
 namespace WebCore {
 
 class CSSValueList;
-struct CSSParserFunction;
-struct CSSParserValue;
 
 // FIXME-NEWPARSER: This can just *be* a CSSValueList subclass.
 class CSSFunctionValue final : public CSSValue {
 public:
-    static Ref<CSSFunctionValue> create(CSSParserFunction* function)
-    {
-        return adoptRef(*new CSSFunctionValue(function));
-    }
-
-    static Ref<CSSFunctionValue> create(const String& name, Ref<CSSValueList>&& args)
+    static Ref<CSSFunctionValue> create(CSSValueID name, Ref<CSSValueList>&& args)
     {
         return adoptRef(*new CSSFunctionValue(name, WTFMove(args)));
     }
 
-    static Ref<CSSFunctionValue> create(CSSValueID keyword)
+    static Ref<CSSFunctionValue> create(CSSValueID name)
     {
-        return adoptRef(*new CSSFunctionValue(keyword));
+        return adoptRef(*new CSSFunctionValue(name));
     }
     
     String customCSSText() const;
@@ -57,22 +50,15 @@ public:
     bool equals(const CSSFunctionValue&) const;
     
     CSSValueID name() const { return m_name; }
-
     CSSValueList* arguments() const { return m_args.get(); }
 
-    bool buildParserValueSubstitutingVariables(CSSParserValue*, const CustomPropertyValueMap& customProperties) const;
-
     void append(Ref<CSSValue>&&);
 
 private:
-    explicit CSSFunctionValue(CSSParserFunction*);
-    CSSFunctionValue(const String&, Ref<CSSValueList>&&);
+    CSSFunctionValue(CSSValueID, Ref<CSSValueList>&&);
     CSSFunctionValue(CSSValueID);
 
     CSSValueID m_name { CSSValueInvalid };
-
-    // FIXME-NEWPARSER: Remove these.
-    String m_nameDeprecated;
     RefPtr<CSSValueList> m_args;
 };
 
diff --git a/Source/WebCore/css/CSSGrammar.y.in b/Source/WebCore/css/CSSGrammar.y.in
deleted file mode 100644 (file)
index aa97397..0000000
+++ /dev/null
@@ -1,1990 +0,0 @@
-/*
- *  Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org)
- *  Copyright (C) 2004-2015 Apple Inc. All rights reserved.
- *  Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
- *  Copyright (C) 2008 Eric Seidel <eric@webkit.org>
- *  Copyright (C) 2012 Intel Corporation. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-%pure-parser
-
-%parse-param { CSSParser* parser }
-%lex-param { CSSParser* parser }
-
-%union {
-    double number;
-    CSSParserString string;
-    CSSSelector::MarginBoxType marginBox;
-    CSSParserValue value;
-    CSSParserSelectorCombinator relation;
-    StyleRuleBase* rule;
-    Vector<RefPtr<StyleRuleBase>>* ruleList;
-    MediaQuerySet* mediaList;
-    MediaQuery* mediaQuery;
-    MediaQuery::Restrictor mediaQueryRestrictor;
-    MediaQueryExpression* mediaQueryExpression;
-    Vector<MediaQueryExpression>* mediaQueryExpressionList;
-    StyleKeyframe* keyframe;
-    Vector<RefPtr<StyleKeyframe>>* keyframeRuleList;
-    CSSPropertyID id;
-    CSSParserSelector* selector;
-    Vector<std::unique_ptr<CSSParserSelector>>* selectorList;
-    bool boolean;
-    CSSSelector::Match match;
-    int integer;
-    char character;
-    CSSParserValueList* valueList;
-    Vector<CSSParserString>* stringList;
-    CSSParser::Location location;
-}
-
-%{
-
-static inline int cssyyerror(void*, const char*)
-{
-    return 1;
-}
-
-#if YYDEBUG > 0
-
-static inline bool isCSSTokenAString(int yytype)
-{
-    switch (yytype) {
-    case IDENT:
-    case STRING:
-    case NTH:
-    case HEX:
-    case IDSEL:
-    case DIMEN:
-    case INVALIDDIMEN:
-    case URI:
-    case FUNCTION:
-    case ANYFUNCTION:
-    case NOTFUNCTION:
-    case CALCFUNCTION:
-    case MATCHESFUNCTION:
-    case MAXFUNCTION:
-    case MINFUNCTION:
-    case NTHCHILDFUNCTIONS:
-    case NTHCHILDSELECTORSEPARATOR:
-    case LANGFUNCTION:
-    case VARFUNCTION:
-#if ENABLE_CSS_SELECTORS_LEVEL4
-    case DIRFUNCTION:
-    case ROLEFUNCTION:
-#endif
-    case CUSTOM_PROPERTY:
-    case UNICODERANGE:
-        return true;
-    default:
-        return false;
-    }
-}
-
-#endif
-
-static inline CSSParserValue makeIdentValue(CSSParserString string)
-{
-    CSSParserValue v;
-    v.id = cssValueKeywordID(string);
-    v.unit = CSSPrimitiveValue::CSS_IDENT;
-    v.string = string;
-    return v;
-}
-
-static bool selectorListDoesNotMatchAnyPseudoElement(const Vector<std::unique_ptr<CSSParserSelector>>* selectorVector)
-{
-    if (!selectorVector)
-        return true;
-
-    for (unsigned i = 0; i < selectorVector->size(); ++i) {
-        for (const CSSParserSelector* selector = selectorVector->at(i).get(); selector; selector = selector->tagHistory()) {
-            if (selector->matchesPseudoElement())
-                return false;
-        }
-    }
-    return true;
-}
-
-%}
-
-#if ENABLE_CSS_GRID_LAYOUT
-%expect 39
-#else
-%expect 38
-#endif
-
-%nonassoc LOWEST_PREC
-
-%left UNIMPORTANT_TOK
-
-%token WHITESPACE SGML_CD
-%token TOKEN_EOF 0
-
-%token INCLUDES
-%token DASHMATCH
-%token BEGINSWITH
-%token ENDSWITH
-%token CONTAINS
-
-%token <string> STRING
-%right <string> IDENT
-%token <string> NTH
-%token <string> NTHCHILDSELECTORSEPARATOR
-
-%nonassoc <string> HEX
-%nonassoc <string> IDSEL
-%nonassoc ':'
-%nonassoc '.'
-%nonassoc '['
-%nonassoc <string> '*'
-%nonassoc error
-%left '|'
-
-%token IMPORT_SYM
-%token PAGE_SYM
-%token MEDIA_SYM
-%token FONT_FACE_SYM
-%token CHARSET_SYM
-%token KEYFRAME_RULE_SYM
-%token KEYFRAMES_SYM
-%token NAMESPACE_SYM
-%token WEBKIT_RULE_SYM
-%token WEBKIT_DECLS_SYM
-%token WEBKIT_VALUE_SYM
-%token WEBKIT_MEDIAQUERY_SYM
-%token WEBKIT_SIZESATTR_SYM
-%token WEBKIT_SELECTOR_SYM
-%token WEBKIT_REGION_RULE_SYM
-%token WEBKIT_VIEWPORT_RULE_SYM
-%token <marginBox> TOPLEFTCORNER_SYM
-%token <marginBox> TOPLEFT_SYM
-%token <marginBox> TOPCENTER_SYM
-%token <marginBox> TOPRIGHT_SYM
-%token <marginBox> TOPRIGHTCORNER_SYM
-%token <marginBox> BOTTOMLEFTCORNER_SYM
-%token <marginBox> BOTTOMLEFT_SYM
-%token <marginBox> BOTTOMCENTER_SYM
-%token <marginBox> BOTTOMRIGHT_SYM
-%token <marginBox> BOTTOMRIGHTCORNER_SYM
-%token <marginBox> LEFTTOP_SYM
-%token <marginBox> LEFTMIDDLE_SYM
-%token <marginBox> LEFTBOTTOM_SYM
-%token <marginBox> RIGHTTOP_SYM
-%token <marginBox> RIGHTMIDDLE_SYM
-%token <marginBox> RIGHTBOTTOM_SYM
-
-%token ATKEYWORD
-
-%token IMPORTANT_SYM
-%token MEDIA_ONLY
-%token MEDIA_NOT
-%token MEDIA_AND
-
-%token <number> REMS
-%token <number> CHS
-%token <number> QEMS
-%token <number> EMS
-%token <number> EXS
-%token <number> PXS
-%token <number> CMS
-%token <number> MMS
-%token <number> INS
-%token <number> PTS
-%token <number> PCS
-%token <number> DEGS
-%token <number> RADS
-%token <number> GRADS
-%token <number> TURNS
-%token <number> MSECS
-%token <number> SECS
-%token <number> HERTZ
-%token <number> KHERTZ
-%token <string> DIMEN
-%token <string> INVALIDDIMEN
-%token <number> PERCENTAGE
-%token <number> FLOATTOKEN
-%token <number> INTEGER
-%token <number> VW
-%token <number> VH
-%token <number> VMIN
-%token <number> VMAX
-%token <number> DPPX
-%token <number> DPI
-%token <number> DPCM
-%token <number> FR
-
-%token <string> URI
-%token <string> FUNCTION
-%token <string> ANYFUNCTION
-%token <string> NOTFUNCTION
-%token <string> CALCFUNCTION
-%token <string> MATCHESFUNCTION
-%token <string> MAXFUNCTION
-%token <string> MINFUNCTION
-%token <string> NTHCHILDFUNCTIONS
-%token <string> LANGFUNCTION
-%token <string> VARFUNCTION
-
-#if ENABLE_CSS_SELECTORS_LEVEL4
-%token <string> DIRFUNCTION
-%token <string> ROLEFUNCTION
-#endif
-
-%token <string> CUSTOM_PROPERTY
-
-%token <string> UNICODERANGE
-
-%type <relation> combinator
-
-%type <rule> block_rule block_valid_rule font_face import keyframes media page region rule ruleset valid_rule
-%destructor { if ($$) $$->deref(); } block_rule block_valid_rule font_face import keyframes media page region rule ruleset valid_rule
-
-%type <ruleList> block_rule_list block_valid_rule_list
-%destructor { delete $$; } block_rule_list block_valid_rule_list
-
-%type <string> ident_or_string maybe_ns_prefix namespace_selector string_or_uri
-
-%type <marginBox> margin_sym
-
-%type <mediaList> media_list maybe_media_list
-%destructor { if ($$) $$->deref(); } media_list maybe_media_list
-
-%type <mediaQuery> media_query
-%destructor { delete $$; } media_query
-
-%type <mediaQueryRestrictor> maybe_media_restrictor
-
-%type <mediaQueryExpression> media_query_expression base_media_query_expression
-%destructor { delete $$; } media_query_expression base_media_query_expression
-
-%type <mediaQueryExpressionList> media_query_expression_list maybe_and_media_query_expression_list
-%destructor { delete $$; } media_query_expression_list maybe_and_media_query_expression_list
-
-%type <string> keyframe_name
-
-%type <keyframe> keyframe_rule
-%destructor { if ($$) $$->deref(); } keyframe_rule
-
-%type <keyframeRuleList> keyframes_rule
-%destructor { delete $$; } keyframes_rule
-
-// These parser values never need to be destroyed because they are never functions, value lists, or variables.
-%type <value> key unary_term
-
-// These parser values need to be destroyed because they might be functions, value lists, or variables.
-%type <value> calc_func_term calc_function function min_or_max_function term variable_function
-%destructor { destroy($$); } calc_func_term calc_function function min_or_max_function term variable_function
-
-%type <id> property
-
-%type <selector> attrib class page_selector pseudo pseudo_page complex_selector complex_selector_with_trailing_whitespace compound_selector specifier specifier_list
-%destructor { delete $$; } attrib class page_selector pseudo pseudo_page complex_selector complex_selector_with_trailing_whitespace compound_selector specifier specifier_list
-
-%type <selectorList> selector_list nested_selector_list simple_selector_list nth_selector_ending
-%destructor { delete $$; } selector_list nested_selector_list simple_selector_list
-%destructor { delete $$; } nth_selector_ending
-
-%type <boolean> attrib_flags declaration declaration_list decl_list priority
-
-%type <match> match
-
-%type <integer> unary_operator maybe_unary_operator
-
-%type <character> operator calc_func_operator
-
-%type <valueList> calc_func_expr calc_func_expr_list calc_func_paren_expr expr key_list maybe_media_value valid_calc_func_expr valid_expr whitespace_or_expr maybe_expr
-%destructor { delete $$; } calc_func_expr calc_func_expr_list calc_func_paren_expr expr key_list maybe_media_value valid_calc_func_expr valid_expr whitespace_or_expr maybe_expr
-
-%type <string> lang_range
-%type <stringList> comma_separated_lang_ranges
-%destructor { delete $$; } comma_separated_lang_ranges
-
-%type <string> min_or_max
-
-%type <string> element_name
-
-%type <location> error_location
-
-#if ENABLE_CSS_GRID_LAYOUT
-
-%type <valueList> ident_list
-%destructor { delete $$; } ident_list
-
-%type <value> track_names_list
-%destructor { destroy($$); } track_names_list
-
-#endif
-
-%token SUPPORTS_AND
-%token SUPPORTS_NOT
-%token SUPPORTS_OR
-%token SUPPORTS_SYM
-%token WEBKIT_SUPPORTS_CONDITION_SYM
-
-%type <rule> supports
-%destructor { if ($$) $$->deref(); } supports
-
-%type <boolean> supports_condition supports_condition_in_parens supports_conjunction supports_declaration_condition supports_disjunction supports_error supports_negation
-
-#if ENABLE_CSS_DEVICE_ADAPTATION
-
-%type <rule> viewport
-%destructor { if ($$) $$->deref(); } viewport
-
-#endif
-
-#if ENABLE_VIDEO_TRACK
-
-%token <string> CUEFUNCTION
-
-#endif
-
-
-%token <string> SLOTTEDFUNCTION
-%token <string> HOSTFUNCTION
-
-
-%%
-
-stylesheet:
-    maybe_space maybe_charset maybe_sgml rule_list
-  | webkit_rule maybe_space
-  | webkit_decls maybe_space
-  | webkit_value maybe_space
-  | webkit_mediaquery maybe_space
-  | webkit_selector maybe_space
-  | webkit_keyframe_rule maybe_space
-  | webkit_supports_condition maybe_space
-  ;
-
-webkit_rule: WEBKIT_RULE_SYM '{' maybe_space valid_rule maybe_space '}' { parser->m_rule = adoptRef($4); } ;
-
-webkit_keyframe_rule: KEYFRAME_RULE_SYM '{' maybe_space keyframe_rule maybe_space '}' { parser->m_keyframe = adoptRef($4); } ;
-
-webkit_decls: WEBKIT_DECLS_SYM '{' maybe_space_before_declaration declaration_list '}' ;
-
-webkit_value:
-    WEBKIT_VALUE_SYM '{' maybe_space expr '}' {
-        if ($4) {
-            parser->m_valueList = std::unique_ptr<CSSParserValueList>($4);
-            int oldParsedProperties = parser->m_parsedProperties.size();
-            if (!parser->parseValue(parser->m_id, parser->m_important))
-                parser->rollbackLastProperties(parser->m_parsedProperties.size() - oldParsedProperties);
-            parser->m_valueList = nullptr;
-        }
-    }
-;
-
-webkit_mediaquery: WEBKIT_MEDIAQUERY_SYM WHITESPACE maybe_space media_query '}' { parser->m_mediaQuery = std::unique_ptr<MediaQuery>($4); } ;
-
-webkit_selector:
-    WEBKIT_SELECTOR_SYM '{' maybe_space selector_list '}' {
-        if ($4) {
-            if (parser->m_selectorListForParseSelector)
-                parser->m_selectorListForParseSelector->adoptSelectorVector(*$4);
-            parser->recycleSelectorVector(std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));
-        }
-    }
-;
-
-webkit_supports_condition: WEBKIT_SUPPORTS_CONDITION_SYM WHITESPACE maybe_space supports_condition '}' { parser->m_supportsCondition = $4; } ;
-
-/* for expressions that require at least one whitespace to be present, like the + and - operators in calc expressions */
-space: WHITESPACE | space WHITESPACE ;
-
-maybe_space: /* empty */ %prec UNIMPORTANT_TOK | maybe_space WHITESPACE ;
-
-maybe_sgml: /* empty */ | maybe_sgml SGML_CD | maybe_sgml WHITESPACE ;
-
-maybe_charset: /* empty */ | charset ;
-
-closing_brace: '}' | %prec LOWEST_PREC TOKEN_EOF ;
-
-closing_parenthesis: ')' | %prec LOWEST_PREC TOKEN_EOF ;
-
-closing_bracket: ']' | %prec LOWEST_PREC TOKEN_EOF;
-
-charset:
-  CHARSET_SYM maybe_space STRING maybe_space ';' {
-     if (parser->m_styleSheet)
-         parser->m_styleSheet->parserSetEncodingFromCharsetRule($3);
-     if (parser->isExtractingSourceData() && parser->m_currentRuleDataStack->isEmpty() && parser->m_ruleSourceDataResult)
-         parser->addNewRuleToSourceTree(CSSRuleSourceData::createUnknown());
-  }
-  | CHARSET_SYM error invalid_block
-  | CHARSET_SYM error ';'
-;
-
-// Ignore any @charset rule not at the beginning of the style sheet.
-ignored_charset: CHARSET_SYM maybe_space STRING maybe_space ';' | CHARSET_SYM maybe_space ';' ;
-
-rule_list:
-    /* empty */
-    | rule_list rule maybe_sgml {
-        if (RefPtr<StyleRuleBase> rule = adoptRef($2)) {
-            if (parser->m_styleSheet)
-                parser->m_styleSheet->parserAppendRule(rule.releaseNonNull());
-        }
-    }
-    ;
-
-valid_rule:
-    ruleset
-  | media
-  | page
-  | font_face
-  | keyframes
-  | namespace { $$ = nullptr; }
-  | import
-  | region
-  | supports
-#if ENABLE_CSS_DEVICE_ADAPTATION
-  | viewport
-#endif
-  ;
-
-rule:
-    valid_rule {
-        $$ = $1;
-        parser->m_hadSyntacticallyValidCSSRule = true;
-    }
-    | ignored_charset { $$ = nullptr; }
-    | invalid_rule { $$ = nullptr; }
-    | invalid_at { $$ = nullptr; }
-    ;
-
-block_rule_list: 
-    /* empty */ { $$ = nullptr; }
-  | block_rule_list block_rule maybe_sgml {
-      $$ = $1;
-      if (RefPtr<StyleRuleBase> rule = adoptRef($2)) {
-          if (!$$)
-              $$ = new Vector<RefPtr<StyleRuleBase>>;
-          $$->append(WTFMove(rule));
-      }
-  }
-  ;
-
-block_valid_rule_list:
-    /* empty */ { $$ = nullptr; }
-  | block_valid_rule_list block_valid_rule maybe_sgml {
-      $$ = $1;
-      if (RefPtr<StyleRuleBase> rule = adoptRef($2)) {
-          if (!$$)
-              $$ = new Vector<RefPtr<StyleRuleBase>>;
-          $$->append(WTFMove(rule));
-      }
-  }
-  ;
-
-block_valid_rule:
-    ruleset
-  | page
-  | font_face
-  | media
-  | keyframes
-  | supports
-#if ENABLE_CSS_DEVICE_ADAPTATION
-  | viewport
-#endif
-  ;
-
-block_rule: block_valid_rule | invalid_rule { $$ = nullptr; } | invalid_at { $$ = nullptr; } | namespace { $$ = nullptr; } | import | region ;
-
-at_import_header_end_maybe_space:
-    maybe_space {
-        parser->markRuleHeaderEnd();
-        parser->markRuleBodyStart();
-    }
-    ;
-
-before_import_rule:
-    /* empty */ {
-        parser->markRuleHeaderStart(StyleRule::Import);
-    }
-    ;
-
-import:
-    before_import_rule IMPORT_SYM at_import_header_end_maybe_space string_or_uri maybe_space maybe_media_list ';' {
-        $$ = parser->createImportRule($4, adoptRef($6)).leakRef();
-    }
-  | before_import_rule IMPORT_SYM at_import_header_end_maybe_space string_or_uri maybe_space maybe_media_list TOKEN_EOF {
-        $$ = parser->createImportRule($4, adoptRef($6)).leakRef();
-    }
-  | before_import_rule IMPORT_SYM at_import_header_end_maybe_space string_or_uri maybe_space maybe_media_list invalid_block {
-        $$ = nullptr;
-        parser->popRuleData();
-        if ($6)
-            $6->deref();
-    }
-  | before_import_rule IMPORT_SYM error ';' {
-        $$ = nullptr;
-        parser->popRuleData();
-    }
-  | before_import_rule IMPORT_SYM error invalid_block {
-        $$ = nullptr;
-        parser->popRuleData();
-    }
-  ;
-
-namespace:
-    NAMESPACE_SYM maybe_space maybe_ns_prefix string_or_uri maybe_space ';' { parser->addNamespace($3, $4); }
-    | NAMESPACE_SYM maybe_space maybe_ns_prefix string_or_uri maybe_space invalid_block
-    | NAMESPACE_SYM error invalid_block
-    | NAMESPACE_SYM error ';'
-    ;
-
-maybe_ns_prefix: /* empty */ { $$.clear(); } | IDENT maybe_space;
-
-string_or_uri: STRING | URI ;
-
-maybe_media_value: /*empty*/ { $$ = nullptr; } | ':' maybe_space expr maybe_space { $$ = $3; } ;
-
-base_media_query_expression: '(' maybe_space IDENT maybe_space maybe_media_value ')' {
-        std::unique_ptr<CSSParserValueList> mediaValue($5);
-        $3.convertToASCIILowercaseInPlace();
-        $$ = new MediaQueryExpression($3, mediaValue.get());
-    }
-    ;
-
-media_query_expression:
-    maybe_media_restrictor maybe_space base_media_query_expression maybe_space {
-        if ($1 != MediaQuery::None) {
-            // If restrictor is specified, media query expression is invalid.
-            // Create empty media query expression and continue parsing media query.
-            delete $3;
-            $$ = new MediaQueryExpression;
-        } else
-            $$ = $3;
-    }
-    ;
-
-media_query_expression_list:
-    media_query_expression {
-        $$ = new Vector<MediaQueryExpression>;
-        $$->append(WTFMove(*$1));
-        delete $1;
-    }
-    | media_query_expression_list maybe_space MEDIA_AND maybe_space media_query_expression {
-        $$ = $1;
-        $$->append(WTFMove(*$5));
-        delete $5;
-    }
-    ;
-
-maybe_and_media_query_expression_list:
-    /*empty*/ {
-        $$ = new Vector<MediaQueryExpression>;
-    }
-    | MEDIA_AND maybe_space media_query_expression_list {
-        $$ = $3;
-    }
-    ;
-
-maybe_media_restrictor:
-    /*empty*/ {
-        $$ = MediaQuery::None;
-    }
-    | MEDIA_ONLY {
-        $$ = MediaQuery::Only;
-    }
-    | MEDIA_NOT {
-        $$ = MediaQuery::Not;
-    }
-    ;
-
-media_query:
-    media_query_expression_list {
-        $$ = new MediaQuery(MediaQuery::None, "all", WTFMove(*$1));
-        delete $1;
-    }
-    |
-    maybe_media_restrictor maybe_space IDENT maybe_space maybe_and_media_query_expression_list {
-        $3.convertToASCIILowercaseInPlace();
-        $$ = new MediaQuery($1, $3, WTFMove(*$5));
-        delete $5;
-    }
-    ;
-
-maybe_media_list: /* empty */ { $$ = &MediaQuerySet::create().leakRef(); } | media_list ;
-
-media_list:
-    media_query {
-        $$ = &MediaQuerySet::create().leakRef();
-        $$->addMediaQuery(WTFMove(*$1));
-        delete $1;
-        parser->updateLastMediaLine(*$$);
-    }
-    | media_list ',' maybe_space media_query {
-        $$ = $1;
-        if ($$) {
-            $$->addMediaQuery(WTFMove(*$4));
-            parser->updateLastMediaLine(*$$);
-        }
-        delete $4;
-    }
-    | media_list error {
-        $$ = nullptr;
-        if ($1)
-            $1->deref();
-    }
-    ;
-
-at_rule_body_start:
-    /* empty */ {
-        parser->markRuleBodyStart();
-    }
-    ;
-
-before_media_rule:
-    /* empty */ {
-        parser->markRuleHeaderStart(StyleRule::Media);
-    }
-    ;
-
-at_rule_header_end_maybe_space:
-    maybe_space {
-        parser->markRuleHeaderEnd();
-    }
-    ;
-
-media:
-    before_media_rule MEDIA_SYM maybe_space media_list at_rule_header_end '{' at_rule_body_start maybe_space block_rule_list save_block {
-        $$ = &parser->createMediaRule(adoptRef($4), std::unique_ptr<Vector<RefPtr<StyleRuleBase>>>($9).get()).leakRef();
-    }
-    | before_media_rule MEDIA_SYM at_rule_header_end_maybe_space '{' at_rule_body_start maybe_space block_rule_list save_block {
-        $$ = &parser->createEmptyMediaRule(std::unique_ptr<Vector<RefPtr<StyleRuleBase>>>($7).get()).leakRef();
-    }
-    | before_media_rule MEDIA_SYM at_rule_header_end_maybe_space ';' {
-        $$ = nullptr;
-        parser->popRuleData();
-    }
-    ;
-
-supports:
-    before_supports_rule SUPPORTS_SYM maybe_space supports_condition at_supports_rule_header_end '{' at_rule_body_start maybe_space block_rule_list save_block {
-        $$ = &parser->createSupportsRule($4, std::unique_ptr<Vector<RefPtr<StyleRuleBase>>>($9).get()).leakRef();
-    }
-    | before_supports_rule SUPPORTS_SYM supports_error {
-        $$ = nullptr;
-        parser->popRuleData();
-        parser->popSupportsRuleData();
-    }
-    ;
-
-supports_error: 
-    error ';' {
-        $$ = false;
-    }
-    | error invalid_block {
-        $$ = false;
-    }
-    ;
-
-before_supports_rule:
-    /* empty */ {
-        parser->markRuleHeaderStart(StyleRule::Supports);
-        parser->markSupportsRuleHeaderStart();
-    }
-    ;
-
-at_supports_rule_header_end:
-    /* empty */ {
-        parser->markRuleHeaderEnd();
-        parser->markSupportsRuleHeaderEnd();
-    }
-    ;
-
-supports_condition: supports_condition_in_parens | supports_negation | supports_conjunction | supports_disjunction ;
-
-supports_negation: SUPPORTS_NOT maybe_space supports_condition_in_parens { $$ = !$3; } ;
-
-supports_conjunction:
-    supports_condition_in_parens SUPPORTS_AND maybe_space supports_condition_in_parens { $$ = $1 && $4; }
-    | supports_conjunction SUPPORTS_AND maybe_space supports_condition_in_parens { $$ = $1 && $4; }
-    ;
-
-supports_disjunction:
-    supports_condition_in_parens SUPPORTS_OR maybe_space supports_condition_in_parens { $$ = $1 || $4; }
-    | supports_disjunction SUPPORTS_OR maybe_space supports_condition_in_parens { $$ = $1 || $4; }
-    ;
-
-supports_condition_in_parens:
-    '(' maybe_space supports_condition ')' maybe_space { $$ = $3; }
-    | supports_declaration_condition { $$ = $1; }
-    | '(' error ')' { $$ = false; }
-    ;
-
-supports_declaration_condition:
-    '(' maybe_space property ':' maybe_space expr priority ')' maybe_space {
-        $$ = false;
-        CSSParser* p = static_cast<CSSParser*>(parser);
-        std::unique_ptr<CSSParserValueList> propertyValue($6);
-        if ($3 && propertyValue) {
-            p->m_valueList = WTFMove(propertyValue);
-            int oldParsedProperties = p->m_parsedProperties.size();
-            $$ = p->parseValue($3, $7);
-            // We just need to know if the declaration is supported as it is written. Rollback any additions.
-            if ($$)
-                p->rollbackLastProperties(p->m_parsedProperties.size() - oldParsedProperties);
-            p->m_valueList = nullptr;
-        }
-        p->markPropertyEnd($7, false);
-    }
-    |
-    '(' maybe_space CUSTOM_PROPERTY maybe_space ':' whitespace_or_expr priority ')' maybe_space {
-        $$ = false;
-        CSSParser* p = static_cast<CSSParser*>(parser);
-        std::unique_ptr<CSSParserValueList> propertyValue($6);
-        if (propertyValue) {
-            parser->m_valueList = WTFMove(propertyValue);
-            int oldParsedProperties = p->m_parsedProperties.size();
-            p->setCustomPropertyName($3);
-            $$ = p->parseValue(CSSPropertyCustom, $7);
-            if ($$)
-                p->rollbackLastProperties(p->m_parsedProperties.size() - oldParsedProperties);
-            p->m_valueList = nullptr;
-        }
-        p->markPropertyEnd($7, false);
-    }
-    ;
-
-before_keyframes_rule:
-    /* empty */ {
-        parser->markRuleHeaderStart(StyleRule::Keyframe);
-    }
-    ;
-
-keyframes:
-    before_keyframes_rule KEYFRAMES_SYM maybe_space keyframe_name at_rule_header_end_maybe_space '{' at_rule_body_start maybe_space keyframes_rule closing_brace {
-        $$ = &parser->createKeyframesRule($4, std::unique_ptr<Vector<RefPtr<StyleKeyframe>>>($9)).leakRef();
-    }
-    ;
-
-keyframe_name: IDENT | STRING ;
-
-keyframes_rule:
-    /* empty */ { $$ = new Vector<RefPtr<StyleKeyframe>>; }
-    | keyframes_rule keyframe_rule maybe_space {
-        $$ = $1;
-        if (RefPtr<StyleKeyframe> keyframe = adoptRef($2))
-            $$->append(WTFMove(keyframe));
-    }
-    ;
-
-keyframe_rule: key_list maybe_space '{' maybe_space declaration_list closing_brace { $$ = parser->createKeyframe(*std::unique_ptr<CSSParserValueList>($1)).leakRef(); } ;
-
-key_list:
-    key {
-        $$ = new CSSParserValueList;
-        $$->addValue($1);
-    }
-    | key_list maybe_space ',' maybe_space key {
-        $$ = $1;
-        if ($$)
-            $$->addValue($5);
-    }
-    ;
-
-key:
-    maybe_unary_operator PERCENTAGE {
-        $$.id = CSSValueInvalid;
-        $$.isInt = false;
-        $$.fValue = $1 * $2;
-        $$.unit = CSSPrimitiveValue::CSS_NUMBER;
-    }
-    | IDENT {
-        $$.id = CSSValueInvalid;
-        $$.isInt = false;
-        if (equalLettersIgnoringASCIICase($1, "from"))
-            $$.fValue = 0;
-        else if (equalLettersIgnoringASCIICase($1, "to"))
-            $$.fValue = 100;
-        else {
-            $$.unit = 0;
-            YYERROR;
-        }
-        $$.unit = CSSPrimitiveValue::CSS_NUMBER;
-    }
-    | error {
-        $$.unit = 0;
-    }
-    ;
-
-before_page_rule:
-    /* empty */ {
-        parser->markRuleHeaderStart(StyleRule::Page);
-    }
-    ;
-
-page:
-    before_page_rule PAGE_SYM maybe_space page_selector at_rule_header_end_maybe_space
-    '{' at_rule_body_start maybe_space_before_declaration declarations_and_margins closing_brace {
-        if ($4)
-            $$ = parser->createPageRule(std::unique_ptr<CSSParserSelector>($4)).leakRef();
-        else {
-            // Clear properties in the invalid @page rule.
-            parser->clearProperties();
-            // Also clear margin at-rules here once we fully implement margin at-rules parsing.
-            $$ = nullptr;
-            parser->popRuleData();
-        }
-    }
-    | before_page_rule PAGE_SYM error invalid_block {
-        parser->popRuleData();
-        $$ = nullptr;
-    }
-    | before_page_rule PAGE_SYM error ';' {
-        parser->popRuleData();
-        $$ = nullptr;
-    }
-    ;
-
-page_selector:
-    IDENT {
-        $$ = new CSSParserSelector(QualifiedName(nullAtom, $1, parser->m_defaultNamespace));
-        $$->setForPage();
-    }
-    | IDENT pseudo_page {
-        $$ = $2;
-        if ($$) {
-            $$->prependTagSelector(QualifiedName(nullAtom, $1, parser->m_defaultNamespace));
-            $$->setForPage();
-        }
-    }
-    | pseudo_page {
-        $$ = $1;
-        if ($$)
-            $$->setForPage();
-    }
-    | /* empty */ {
-        $$ = new CSSParserSelector;
-        $$->setForPage();
-    }
-    ;
-
-declarations_and_margins: declaration_list | declarations_and_margins margin_box maybe_space declaration_list ;
-
-margin_box:
-    margin_sym {
-        parser->startDeclarationsForMarginBox();
-    } maybe_space '{' maybe_space declaration_list closing_brace {
-        parser->createMarginAtRule($1);
-    }
-    ;
-
-margin_sym:
-    TOPLEFTCORNER_SYM {
-        $$ = CSSSelector::TopLeftCornerMarginBox;
-    }
-    | TOPLEFT_SYM {
-        $$ = CSSSelector::TopLeftMarginBox;
-    }
-    | TOPCENTER_SYM {
-        $$ = CSSSelector::TopCenterMarginBox;
-    }
-    | TOPRIGHT_SYM {
-        $$ = CSSSelector::TopRightMarginBox;
-    }
-    | TOPRIGHTCORNER_SYM {
-        $$ = CSSSelector::TopRightCornerMarginBox;
-    }
-    | BOTTOMLEFTCORNER_SYM {
-        $$ = CSSSelector::BottomLeftCornerMarginBox;
-    }
-    | BOTTOMLEFT_SYM {
-        $$ = CSSSelector::BottomLeftMarginBox;
-    }
-    | BOTTOMCENTER_SYM {
-        $$ = CSSSelector::BottomCenterMarginBox;
-    }
-    | BOTTOMRIGHT_SYM {
-        $$ = CSSSelector::BottomRightMarginBox;
-    }
-    | BOTTOMRIGHTCORNER_SYM {
-        $$ = CSSSelector::BottomRightCornerMarginBox;
-    }
-    | LEFTTOP_SYM {
-        $$ = CSSSelector::LeftTopMarginBox;
-    }
-    | LEFTMIDDLE_SYM {
-        $$ = CSSSelector::LeftMiddleMarginBox;
-    }
-    | LEFTBOTTOM_SYM {
-        $$ = CSSSelector::LeftBottomMarginBox;
-    }
-    | RIGHTTOP_SYM {
-        $$ = CSSSelector::RightTopMarginBox;
-    }
-    | RIGHTMIDDLE_SYM {
-        $$ = CSSSelector::RightMiddleMarginBox;
-    }
-    | RIGHTBOTTOM_SYM {
-        $$ = CSSSelector::RightBottomMarginBox;
-    }
-    ;
-
-before_font_face_rule:
-    /* empty */ {
-        parser->markRuleHeaderStart(StyleRule::FontFace);
-    }
-    ;
-
-font_face:
-    before_font_face_rule FONT_FACE_SYM at_rule_header_end_maybe_space '{' at_rule_body_start maybe_space_before_declaration declaration_list closing_brace {
-        $$ = parser->createFontFaceRule().leakRef();
-    }
-    | before_font_face_rule FONT_FACE_SYM error invalid_block {
-        $$ = nullptr;
-        parser->popRuleData();
-    }
-    | before_font_face_rule FONT_FACE_SYM error ';' {
-        $$ = nullptr;
-        parser->popRuleData();
-    }
-;
-
-#if ENABLE_CSS_DEVICE_ADAPTATION
-
-before_viewport_rule:
-    /* empty */ {
-        parser->markViewportRuleBodyStart();
-        parser->markRuleHeaderStart(StyleRule::Viewport);
-    }
-    ;
-
-viewport:
-    before_viewport_rule WEBKIT_VIEWPORT_RULE_SYM at_rule_header_end_maybe_space
-    '{' at_rule_body_start maybe_space_before_declaration declaration_list closing_brace {
-        $$ = &parser->createViewportRule().leakRef();
-        parser->markViewportRuleBodyEnd();
-    }
-    | before_viewport_rule WEBKIT_VIEWPORT_RULE_SYM error invalid_block {
-        $$ = nullptr;
-        parser->popRuleData();
-        parser->markViewportRuleBodyEnd();
-    }
-    | before_viewport_rule WEBKIT_VIEWPORT_RULE_SYM error ';' {
-        $$ = nullptr;
-        parser->popRuleData();
-        parser->markViewportRuleBodyEnd();
-    }
-;
-
-#endif
-
-before_region_rule:
-    /* empty */ {
-        parser->markRuleHeaderStart(StyleRule::Region);
-    }
-    ;
-
-region:
-    before_region_rule WEBKIT_REGION_RULE_SYM maybe_space selector_list at_rule_header_end '{' at_rule_body_start maybe_space block_valid_rule_list save_block {
-        std::unique_ptr<Vector<RefPtr<StyleRuleBase>>> ruleList($9);
-        if ($4)
-            $$ = parser->createRegionRule(std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4).get(), ruleList.get()).leakRef();
-        else {
-            $$ = nullptr;
-            parser->popRuleData();
-        }
-    }
-;
-
-combinator:
-    '+' maybe_space { $$ = CSSParserSelectorCombinator::DirectAdjacent; }
-  | '~' maybe_space { $$ = CSSParserSelectorCombinator::IndirectAdjacent; }
-  | '>' maybe_space { $$ = CSSParserSelectorCombinator::Child; }
-#if ENABLE_CSS_SELECTORS_LEVEL4
-  | '>' '>' maybe_space { $$ = CSSParserSelectorCombinator::DescendantDoubleChild; }
-#endif
-  ;
-
-maybe_unary_operator: unary_operator | { $$ = 1; } ;
-
-unary_operator: '-' { $$ = -1; } | '+' { $$ = 1; } ;
-
-maybe_space_before_declaration: maybe_space { parser->markPropertyStart(); } ;
-
-before_selector_list:
-    {
-        parser->markRuleHeaderStart(StyleRule::Style);
-        parser->markSelectorStart();
-    }
-  ;
-
-at_rule_header_end: { parser->markRuleHeaderEnd(); } ;
-
-at_selector_end: { parser->markSelectorEnd(); } ;
-
-ruleset:
-    before_selector_list selector_list at_selector_end at_rule_header_end '{' at_rule_body_start maybe_space_before_declaration declaration_list closing_brace {
-        $$ = parser->createStyleRule($2).leakRef();
-        parser->recycleSelectorVector(std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($2));
-    }
-  ;
-
-before_selector_group_item: { parser->markSelectorStart(); } ;
-
-selector_list:
-    complex_selector %prec UNIMPORTANT_TOK {
-        $$ = nullptr;
-        if ($1) {
-            $$ = parser->createSelectorVector().release();
-            $$->append(std::unique_ptr<CSSParserSelector>($1));
-        }
-    }
-    | selector_list at_selector_end ',' maybe_space before_selector_group_item complex_selector %prec UNIMPORTANT_TOK {
-        std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>> selectorList($1);
-        std::unique_ptr<CSSParserSelector> selector($6);
-        $$ = nullptr;
-        if (selectorList && selector) {
-            $$ = selectorList.release();
-            $$->append(WTFMove(selector));
-        }
-    }
-    | selector_list error {
-        $$ = nullptr;
-        delete $1;
-    }
-   ;
-
-before_nested_selector_list: { parser->startNestedSelectorList(); } ;
-after_nested_selector_list: { parser->endNestedSelectorList(); } ;
-
-nested_selector_list:
-    before_nested_selector_list selector_list after_nested_selector_list {
-        $$ = $2;
-    }
-    ;
-
-lang_range: IDENT | STRING ;
-
-comma_separated_lang_ranges:
-    lang_range %prec UNIMPORTANT_TOK {
-        $$ = new Vector<CSSParserString>;
-        $$->append($1);
-    }
-    | comma_separated_lang_ranges maybe_space ',' maybe_space lang_range %prec UNIMPORTANT_TOK {
-        $$ = $1;
-        if ($$)
-            $1->append($5);
-    }
-    | comma_separated_lang_ranges error {
-        $$ = nullptr;
-        delete $1;
-    }
-    ;
-
-complex_selector_with_trailing_whitespace:
-    complex_selector WHITESPACE;
-
-complex_selector:
-    compound_selector
-    | complex_selector_with_trailing_whitespace
-    | complex_selector_with_trailing_whitespace compound_selector {
-        std::unique_ptr<CSSParserSelector> left($1);
-        std::unique_ptr<CSSParserSelector> right($2);
-        $$ = nullptr;
-        if (left && right) {
-            right->appendTagHistory(CSSParserSelectorCombinator::DescendantSpace, WTFMove(left));
-            $$ = right.release();
-        }
-    }
-    | complex_selector combinator compound_selector {
-        std::unique_ptr<CSSParserSelector> left($1);
-        std::unique_ptr<CSSParserSelector> right($3);
-        $$ = nullptr;
-        if (left && right) {
-            right->appendTagHistory($2, WTFMove(left));
-            $$ = right.release();
-        }
-    }
-    | complex_selector error {
-        $$ = nullptr;
-        delete $1;
-    }
-    ;
-
-namespace_selector:
-    '|' {
-        static LChar emptyString = '\0';
-        $$.init(&emptyString, 0);
-    }
-    | '*' '|' { static LChar star = '*'; $$.init(&star, 1); }
-    | IDENT '|'
-;
-
-compound_selector:
-    element_name {
-        $$ = new CSSParserSelector(QualifiedName(nullAtom, $1, parser->m_defaultNamespace));
-    }
-    | element_name specifier_list {
-        $$ = $2;
-        if ($$) {
-            QualifiedName elementName(nullAtom, $1, parser->m_defaultNamespace);
-            parser->rewriteSpecifiersWithElementName(elementName, *$$);
-        }
-    }
-    | specifier_list {
-        $$ = $1;
-        if ($$)
-            parser->rewriteSpecifiersWithNamespaceIfNeeded(*$$);
-    }
-    | namespace_selector element_name {
-        $$ = new CSSParserSelector(parser->determineNameInNamespace($1, $2));
-    }
-    | namespace_selector element_name specifier_list {
-        $$ = $3;
-        if ($$)
-            parser->rewriteSpecifiersWithElementName($1, $2, *$$);
-    }
-    | namespace_selector specifier_list {
-        $$ = $2;
-        if ($$)
-            parser->rewriteSpecifiersWithElementName($1, starAtom, *$$);
-    }
-  ;
-
-simple_selector_list:
-    compound_selector %prec UNIMPORTANT_TOK {
-        $$ = nullptr;
-        if ($1) {
-            $$ = parser->createSelectorVector().release();
-            $$->append(std::unique_ptr<CSSParserSelector>($1));
-        }
-    }
-    | simple_selector_list maybe_space ',' maybe_space compound_selector %prec UNIMPORTANT_TOK {
-        std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>> list($1);
-        std::unique_ptr<CSSParserSelector> selector($5);
-        $$ = nullptr;
-        if (list && selector) {
-            $$ = list.release();
-            $$->append(WTFMove(selector));
-        }
-    }
-    | simple_selector_list error {
-        $$ = nullptr;
-        delete $1;
-    }
-    ;
-
-element_name:
-    IDENT {
-        $$ = $1;
-    }
-    | '*' {
-        static LChar star = '*';
-        $$.init(&star, 1);
-    }
-    ;
-
-specifier_list:
-    specifier
-    | specifier_list specifier {
-        std::unique_ptr<CSSParserSelector> list($1);
-        std::unique_ptr<CSSParserSelector> specifier($2);
-        $$ = nullptr;
-        if (list && specifier)
-            $$ = parser->rewriteSpecifiers(WTFMove(list), WTFMove(specifier)).release();
-    }
-    | specifier_list error {
-        $$ = nullptr;
-        delete $1;
-    }
-;
-
-specifier:
-    IDSEL {
-        $$ = new CSSParserSelector;
-        $$->setMatch(CSSSelector::Id);
-        $$->setValue($1, parser->m_context.mode == HTMLQuirksMode);
-    }
-  | HEX {
-        if (isASCIIDigit($1[0]))
-            $$ = nullptr;
-        else {
-            $$ = new CSSParserSelector;
-            $$->setMatch(CSSSelector::Id);
-            $$->setValue($1, parser->m_context.mode == HTMLQuirksMode);
-        }
-    }
-  | class
-  | attrib
-  | pseudo
-    ;
-
-class:
-    '.' IDENT {
-        $$ = new CSSParserSelector;
-        $$->setMatch(CSSSelector::Class);
-        $$->setValue($2, parser->m_context.mode == HTMLQuirksMode);
-    }
-  ;
-
-attrib:
-    '[' maybe_space IDENT maybe_space ']' {
-        $$ = new CSSParserSelector;
-        $$->setAttribute(QualifiedName(nullAtom, $3, nullAtom), parser->m_context.isHTMLDocument);
-        $$->setMatch(CSSSelector::Set);
-    }
-    | '[' maybe_space IDENT maybe_space match maybe_space ident_or_string maybe_space attrib_flags ']' {
-        $$ = new CSSParserSelector;
-        $$->setAttribute(QualifiedName(nullAtom, $3, nullAtom), parser->m_context.isHTMLDocument);
-        $$->setMatch($5);
-        $$->setValue($7);
-        $$->setAttributeValueMatchingIsCaseInsensitive($9);
-    }
-    | '[' maybe_space namespace_selector IDENT maybe_space ']' {
-        $$ = new CSSParserSelector;
-        $$->setAttribute(parser->determineNameInNamespace($3, $4), parser->m_context.isHTMLDocument);
-        $$->setMatch(CSSSelector::Set);
-    }
-    | '[' maybe_space namespace_selector IDENT maybe_space match maybe_space ident_or_string maybe_space attrib_flags ']' {
-        $$ = new CSSParserSelector;
-        $$->setAttribute(parser->determineNameInNamespace($3, $4), parser->m_context.isHTMLDocument);
-        $$->setMatch($6);
-        $$->setValue($8);
-        $$->setAttributeValueMatchingIsCaseInsensitive($10);
-    }
-  ;
-
-attrib_flags:
-    IDENT maybe_space {
-        if (UNLIKELY($1.length() != 1 || !isASCIIAlphaCaselessEqual($1[0], 'i')))
-            YYERROR;
-        $$ = true;
-    }
-    |
-    /* empty */ {
-        $$ = false;
-    }
-
-match:
-    '=' {
-        $$ = CSSSelector::Exact;
-    }
-    | INCLUDES {
-        $$ = CSSSelector::List;
-    }
-    | DASHMATCH {
-        $$ = CSSSelector::Hyphen;
-    }
-    | BEGINSWITH {
-        $$ = CSSSelector::Begin;
-    }
-    | ENDSWITH {
-        $$ = CSSSelector::End;
-    }
-    | CONTAINS {
-        $$ = CSSSelector::Contain;
-    }
-    ;
-
-ident_or_string: IDENT | STRING ;
-
-pseudo_page:
-    ':' IDENT {
-        $$ = CSSParserSelector::parsePagePseudoSelector($2);
-    }
-
-nth_selector_ending:
-    ')' {
-        $$ = nullptr;
-    }
-    | space ')' {
-        $$ = nullptr;
-    }
-    | space NTHCHILDSELECTORSEPARATOR space nested_selector_list maybe_space ')' {
-        if ($4)
-            $$ = $4;
-        else
-            YYERROR;
-    }
-    ;
-
-pseudo:
-    ':' IDENT {
-        $$ = CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector($2);
-    }
-    | ':' ':' IDENT {
-        $$ = CSSParserSelector::parsePseudoElementSelector($3);
-    }
-#if ENABLE_VIDEO_TRACK
-    // used by ::cue(:past/:future)
-    | ':' ':' CUEFUNCTION maybe_space simple_selector_list maybe_space ')' {
-        $$ = CSSParserSelector::parsePseudoElementCueFunctionSelector($3, $5);
-    }
-#endif
-    | ':' ':' SLOTTEDFUNCTION maybe_space compound_selector maybe_space ')' {
-        $$ = CSSParserSelector::parsePseudoElementSlottedFunctionSelector($3, $5);
-    }
-    | ':' HOSTFUNCTION maybe_space compound_selector maybe_space ')' {
-        $$ = CSSParserSelector::parsePseudoClassHostFunctionSelector($2, $4);
-    }
-    // use by :-webkit-any.
-    // FIXME: should we support generic selectors here or just simple_selectors?
-    // Use simple_selector_list for now to match -moz-any.
-    // See http://lists.w3.org/Archives/Public/www-style/2010Sep/0566.html for some
-    // related discussion with respect to :not.
-    | ':' ANYFUNCTION maybe_space simple_selector_list maybe_space ')' {
-        $$ = nullptr;
-        if ($4) {
-            auto selector = std::make_unique<CSSParserSelector>();
-            selector->setMatch(CSSSelector::PseudoClass);
-            selector->adoptSelectorVector(*std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));
-            selector->setPseudoClassValue($2);
-            if (selector->pseudoClassType() == CSSSelector::PseudoClassAny)
-                $$ = selector.release();
-        }
-    }
-    | ':' MATCHESFUNCTION maybe_space nested_selector_list maybe_space ')' {
-        $$ = nullptr;
-        if ($4) {
-            auto selector = std::make_unique<CSSParserSelector>();
-            selector->setMatch(CSSSelector::PseudoClass);
-            selector->adoptSelectorVector(*std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));
-            selector->setPseudoClassValue($2);
-            if (selector->pseudoClassType() == CSSSelector::PseudoClassMatches)
-                $$ = selector.release();
-        }
-    }
-    | ':' LANGFUNCTION maybe_space comma_separated_lang_ranges maybe_space ')' {
-        $$ = nullptr;
-        if ($4) {
-            auto selector = std::make_unique<CSSParserSelector>();
-            selector->setMatch(CSSSelector::PseudoClass);
-            selector->setLangArgumentList(*std::unique_ptr<Vector<CSSParserString>>($4));
-            selector->setPseudoClassValue($2);
-            if (selector->pseudoClassType() == CSSSelector::PseudoClassLang)
-                $$ = selector.release();
-        }
-    }
-
-#if ENABLE_CSS_SELECTORS_LEVEL4
-    | ':' DIRFUNCTION maybe_space IDENT maybe_space ')' {
-        $$ = nullptr;
-        auto selector = std::make_unique<CSSParserSelector>();
-        selector->setMatch(CSSSelector::PseudoClass);
-        selector->setArgument($4);
-        selector->setPseudoClassValue($2);
-        if (selector->pseudoClassType() == CSSSelector::PseudoClassDir)
-            $$ = selector.release();
-    }
-
-    | ':' ROLEFUNCTION maybe_space IDENT maybe_space ')' {
-        $$ = nullptr;
-        auto selector = std::make_unique<CSSParserSelector>();
-        selector->setMatch(CSSSelector::PseudoClass);
-        selector->setArgument($4);
-        selector->setPseudoClassValue($2);
-        if (selector->pseudoClassType() == CSSSelector::PseudoClassRole)
-            $$ = selector.release();
-    }
-#endif
-
-    // Definition of :nth-child().
-    | ':' NTHCHILDFUNCTIONS maybe_space NTH nth_selector_ending {
-        $$ = nullptr;
-        std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>> ending($5);
-        if (selectorListDoesNotMatchAnyPseudoElement(ending.get())) {
-            auto selector = std::make_unique<CSSParserSelector>();
-            selector->setMatch(CSSSelector::PseudoClass);
-            selector->setArgument($4);
-            selector->setPseudoClassValue($2);
-            if (ending)
-                selector->adoptSelectorVector(*ending);
-            CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType();
-            if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
-                $$ = selector.release();
-        }
-    }
-    | ':' NTHCHILDFUNCTIONS maybe_space maybe_unary_operator INTEGER nth_selector_ending {
-        $$ = nullptr;
-        std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>> ending($6);
-        if (selectorListDoesNotMatchAnyPseudoElement(ending.get())) {
-            auto selector = std::make_unique<CSSParserSelector>();
-            selector->setMatch(CSSSelector::PseudoClass);
-            selector->setArgument(AtomicString::number($4 * $5));
-            selector->setPseudoClassValue($2);
-            if (ending)
-                selector->adoptSelectorVector(*ending);
-            CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType();
-            if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
-                $$ = selector.release();
-        }
-    }
-    | ':' NTHCHILDFUNCTIONS maybe_space IDENT nth_selector_ending {
-        $$ = nullptr;
-        std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>> ending($5);
-        if (isValidNthToken($4) && selectorListDoesNotMatchAnyPseudoElement(ending.get())) {
-            auto selector = std::make_unique<CSSParserSelector>();
-            selector->setMatch(CSSSelector::PseudoClass);
-            selector->setArgument($4);
-            selector->setPseudoClassValue($2);
-            if (ending)
-               selector->adoptSelectorVector(*ending);
-            CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType();
-            if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild)
-                $$ = selector.release();
-        }
-    }
-
-    // used by :nth-*(ax+b)
-    | ':' FUNCTION maybe_space NTH maybe_space ')' {
-        $$ = nullptr;
-        auto selector = std::make_unique<CSSParserSelector>();
-        selector->setMatch(CSSSelector::PseudoClass);
-        selector->setArgument($4);
-        selector->setPseudoClassValue($2);
-        if (selector->pseudoClassType() != CSSSelector::PseudoClassUnknown)
-            $$ = selector.release();
-    }
-    // used by :nth-*
-    | ':' FUNCTION maybe_space maybe_unary_operator INTEGER maybe_space ')' {
-        $$ = nullptr;
-        auto selector = std::make_unique<CSSParserSelector>();
-        selector->setMatch(CSSSelector::PseudoClass);
-        selector->setArgument(AtomicString::number($4 * $5));
-        selector->setPseudoClassValue($2);
-        if (selector->pseudoClassType() != CSSSelector::PseudoClassUnknown)
-            $$ = selector.release();
-    }
-    // used by :nth-*(odd/even) and :lang
-    | ':' FUNCTION maybe_space IDENT maybe_space ')' {
-        auto selector = std::make_unique<CSSParserSelector>();
-        selector->setMatch(CSSSelector::PseudoClass);
-        selector->setArgument($4);
-        selector->setPseudoClassValue($2);
-        CSSSelector::PseudoClassType type = selector->pseudoClassType();
-        if (type == CSSSelector::PseudoClassUnknown)
-            selector = nullptr;
-        else if (type == CSSSelector::PseudoClassNthChild ||
-                 type == CSSSelector::PseudoClassNthOfType ||
-                 type == CSSSelector::PseudoClassNthLastChild ||
-                 type == CSSSelector::PseudoClassNthLastOfType) {
-            if (!isValidNthToken($4))
-                selector = nullptr;
-        }
-        $$ = selector.release();
-    }
-    // Definition of :not().
-    | ':' NOTFUNCTION maybe_space nested_selector_list maybe_space ')' {
-        $$ = nullptr;
-        if ($4) {
-            std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>> list($4);
-            if (selectorListDoesNotMatchAnyPseudoElement(list.get())) {
-                auto selector = std::make_unique<CSSParserSelector>();
-                selector->setMatch(CSSSelector::PseudoClass);
-                selector->setPseudoClassValue($2);
-                selector->adoptSelectorVector(*list);
-                if (selector->pseudoClassType() == CSSSelector::PseudoClassNot)
-                    $$ = selector.release();
-            }
-        }
-    }
-  ;
-
-declaration_list:
-    /* empty */ { $$ = false; }
-    | declaration
-    | decl_list declaration { $$ = $1 || $2; }
-    | decl_list
-    | decl_list_recovery { $$ = false; }
-    | decl_list decl_list_recovery
-    ;
-
-decl_list:
-    declaration ';' maybe_space {
-        parser->markPropertyStart();
-        $$ = $1;
-    }
-    | decl_list_recovery ';' maybe_space {
-        parser->markPropertyStart();
-        $$ = false;
-    }
-    | decl_list declaration ';' maybe_space {
-        parser->markPropertyStart();
-        $$ = $1;
-        if ($2)
-            $$ = $2;
-    }
-    | decl_list decl_list_recovery ';' maybe_space {
-        parser->markPropertyStart();
-        $$ = $1;
-    }
-    ;
-
-decl_list_recovery:
-    error error_location error_recovery {
-        parser->syntaxError($2, CSSParser::PropertyDeclarationError);
-    }
-    ;
-
-declaration:
-    CUSTOM_PROPERTY maybe_space ':' whitespace_or_expr priority {
-        $$ = false;
-        bool isPropertyParsed = false;
-        std::unique_ptr<CSSParserValueList> propertyValue($4);
-        if (propertyValue) {
-            parser->m_valueList = WTFMove(propertyValue);
-            int oldParsedProperties = parser->m_parsedProperties.size();
-            parser->setCustomPropertyName($1);
-            $$ = parser->parseValue(CSSPropertyCustom, $5);
-            if (!$$)
-                parser->rollbackLastProperties(parser->m_parsedProperties.size() - oldParsedProperties);
-            else
-                isPropertyParsed = true;
-            parser->m_valueList = nullptr;
-        }
-        parser->markPropertyEnd($5, isPropertyParsed);
-    }
-    | property ':' maybe_space expr priority {
-        $$ = false;
-        bool isPropertyParsed = false;
-        std::unique_ptr<CSSParserValueList> propertyValue($4);
-        if ($1 && propertyValue) {
-            parser->m_valueList = WTFMove(propertyValue);
-            int oldParsedProperties = parser->m_parsedProperties.size();
-            $$ = parser->parseValue($1, $5);
-            if (!$$)
-                parser->rollbackLastProperties(parser->m_parsedProperties.size() - oldParsedProperties);
-            else
-                isPropertyParsed = true;
-            parser->m_valueList = nullptr;
-        }
-        parser->markPropertyEnd($5, isPropertyParsed);
-    }
-    | property declaration_recovery { $$ = false; }
-    | property ':' maybe_space expr priority declaration_recovery {
-        // When we encounter something like p {color: red !important fail;} we should drop the declaration.
-        parser->markPropertyEnd(false, false);
-        delete $4;
-        $$ = false;
-    }
-    | IMPORTANT_SYM maybe_space declaration_recovery {
-        // Handle this case -- div { text-align: center; !important } -- by just reducing away the stray !important.
-        $$ = false;
-    }
-    | property ':' maybe_space declaration_recovery {
-        // If we come across rules with invalid values like this case: p { weight: *; }, just discard the rule.
-        parser->markPropertyEnd(false, false);
-        $$ = false;
-    }
-  ;
-
-declaration_recovery: error error_location error_recovery { parser->syntaxError($2); } ;
-
-property: IDENT maybe_space { $$ = cssPropertyID($1); } ;
-
-priority: IMPORTANT_SYM maybe_space { $$ = true; } | /* empty */ { $$ = false; } ;
-
-#if ENABLE_CSS_GRID_LAYOUT
-
-ident_list:
-    IDENT maybe_space {
-        $$ = new CSSParserValueList;
-        $$->addValue(makeIdentValue($1));
-    }
-    | ident_list IDENT maybe_space {
-        $$ = $1;
-        $$->addValue(makeIdentValue($2));
-    }
-    ;
-
-track_names_list:
-    '[' maybe_space closing_bracket {
-        $$.setFromValueList(std::make_unique<CSSParserValueList>());
-    }
-    | '[' maybe_space ident_list closing_bracket {
-        $$.setFromValueList(std::unique_ptr<CSSParserValueList>($3));
-    }
-    | '[' maybe_space expr_recovery closing_bracket {
-        $$.id = CSSValueInvalid;
-        $$.unit = 0;
-        YYERROR;
-    }
-  ;
-
-#endif
-
-whitespace_or_expr:
-    WHITESPACE maybe_expr {
-        if ($2)
-            $$ = $2;
-        else {
-            CSSParserValue val;
-            val.id = CSSValueInvalid;
-            val.unit = CSSPrimitiveValue::CSS_PARSER_WHITESPACE;
-            val.string.init(emptyString());
-            $$ = new CSSParserValueList;
-            $$->addValue(val);
-        }
-    }
-    | maybe_space expr { $$ = $2; }
-    ;
-
-maybe_expr: /* empty */ { $$ = nullptr; } | expr { $$ = $1; };
-
-expr: valid_expr | valid_expr expr_recovery { $$ = nullptr; delete $1; } ;
-
-valid_expr:
-    term {
-        $$ = new CSSParserValueList;
-        $$->addValue($1);
-    }
-    | valid_expr operator term {
-        $$ = $1;
-        if (!$$)
-            destroy($3);
-        else {
-            if ($2) {
-                CSSParserValue v;
-                v.id = CSSValueInvalid;
-                v.unit = CSSParserValue::Operator;
-                v.iValue = $2;
-                $$->addValue(v);
-            }
-            $$->addValue($3);
-        }
-    }
-  ;
-
-expr_recovery: error error_location error_recovery ;
-
-operator: '/' maybe_space { $$ = '/'; } | ',' maybe_space { $$ = ','; } | /* empty */ { $$ = 0; } ;
-
-term:
-  unary_term maybe_space
-  | unary_operator unary_term maybe_space { $$ = $2; $$.fValue *= $1; }
-  | STRING maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_STRING; }
-  | IDENT maybe_space { $$ = makeIdentValue($1); }
-  /* We might need to actually parse the number from a dimension, but we can't just put something that uses $$.string into unary_term. */
-  | DIMEN maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_DIMENSION; }
-  | unary_operator DIMEN maybe_space { $$.id = CSSValueInvalid; $$.string = $2; $$.unit = CSSPrimitiveValue::CSS_DIMENSION; }
-  | URI maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_URI; }
-  | UNICODERANGE maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_UNICODE_RANGE; }
-  | HEX maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; }
-  | '#' maybe_space { $$.id = CSSValueInvalid; $$.string = CSSParserString(); $$.unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; } /* Handle error case: "color: #;" */
-  /* FIXME: according to the specs a function can have a unary_operator in front. I know no case where this makes sense */
-  | function maybe_space
-  | calc_function maybe_space
-  | variable_function maybe_space
-  | min_or_max_function maybe_space
-  | '%' maybe_space { /* Handle width: %; */
-      $$.id = CSSValueInvalid; $$.unit = 0;
-  }
-#if ENABLE_CSS_GRID_LAYOUT
-  | track_names_list maybe_space
-#endif
-  ;
-
-unary_term:
-  INTEGER { $$.id = CSSValueInvalid; $$.isInt = true; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_NUMBER; }
-  | FLOATTOKEN { $$.id = CSSValueInvalid; $$.isInt = false; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_NUMBER; }
-  | PERCENTAGE { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_PERCENTAGE; }
-  | PXS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_PX; }
-  | CMS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_CM; }
-  | MMS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_MM; }
-  | INS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_IN; }
-  | PTS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_PT; }
-  | PCS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_PC; }
-  | DEGS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_DEG; }
-  | RADS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_RAD; }
-  | GRADS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_GRAD; }
-  | TURNS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_TURN; }
-  | MSECS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_MS; }
-  | SECS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_S; }
-  | HERTZ { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_HZ; }
-  | KHERTZ { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_KHZ; }
-  | EMS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_EMS; }
-  | QEMS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSParserValue::Q_EMS; }
-  | EXS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_EXS; }
-  | REMS {
-      $$.id = CSSValueInvalid;
-      $$.fValue = $1;
-      $$.unit = CSSPrimitiveValue::CSS_REMS;
-  }
-  | CHS { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_CHS; }
-  | VW { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_VW; }
-  | VH { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_VH; }
-  | VMIN { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_VMIN; }
-  | VMAX { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_VMAX; }
-  | DPPX { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_DPPX; }
-  | DPI { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_DPI; }
-  | DPCM { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_DPCM; }
-  | FR { $$.id = CSSValueInvalid; $$.fValue = $1; $$.unit = CSSPrimitiveValue::CSS_FR; }
-  ;
-
-function:
-    FUNCTION maybe_space expr closing_parenthesis {
-        CSSParserFunction* f = new CSSParserFunction;
-        f->name = $1;
-        f->args = std::unique_ptr<CSSParserValueList>($3);
-        $$.id = CSSValueInvalid;
-        $$.unit = CSSParserValue::Function;
-        $$.function = f;
-    } |
-    FUNCTION maybe_space closing_parenthesis {
-        CSSParserFunction* f = new CSSParserFunction;
-        f->name = $1;
-        f->args = std::make_unique<CSSParserValueList>();
-        $$.id = CSSValueInvalid;
-        $$.unit = CSSParserValue::Function;
-        $$.function = f;
-    } |
-    FUNCTION maybe_space expr_recovery closing_parenthesis {
-        CSSParserFunction* f = new CSSParserFunction;
-        f->name = $1;
-        f->args = nullptr;
-        $$.id = CSSValueInvalid;
-        $$.unit = CSSParserValue::Function;
-        $$.function = f;
-  }
-  ;
-
-variable_function:
-    VARFUNCTION maybe_space CUSTOM_PROPERTY maybe_space closing_parenthesis {
-        CSSParserVariable* var = new CSSParserVariable;
-        var->name = $3;
-        var->args = nullptr;
-        $$.id = CSSValueInvalid;
-        $$.unit = CSSParserValue::Variable;
-        $$.variable = var;
-    }
-    | VARFUNCTION maybe_space CUSTOM_PROPERTY maybe_space ',' maybe_space expr closing_parenthesis {
-        CSSParserVariable* var = new CSSParserVariable;
-        var->name = $3;
-        var->args = std::unique_ptr<CSSParserValueList>($7);
-        $$.id = CSSValueInvalid;
-        $$.unit = CSSParserValue::Variable;
-        $$.variable = var;
-    }
-    | VARFUNCTION maybe_space CUSTOM_PROPERTY maybe_space ',' maybe_space closing_parenthesis {
-        CSSParserVariable* var = new CSSParserVariable;
-        var->name = $3;
-        var->args = std::make_unique<CSSParserValueList>();
-        $$.id = CSSValueInvalid;
-        $$.unit = CSSParserValue::Variable;
-        $$.variable = var;
-    }
-    // Error handling cases
-    | VARFUNCTION maybe_space CUSTOM_PROPERTY maybe_space ',' closing_parenthesis {
-        $$.id = CSSValueInvalid;
-        $$.unit = 0;
-        YYERROR;
-    }
-    | VARFUNCTION maybe_space CUSTOM_PROPERTY maybe_space ',' maybe_space invalid_var_fallback maybe_space closing_parenthesis {
-        $$.id = CSSValueInvalid;
-        $$.unit = 0;
-        YYERROR;
-    }
-    | VARFUNCTION maybe_space CUSTOM_PROPERTY maybe_space ',' maybe_space priority closing_parenthesis {
-        $$.id = CSSValueInvalid;
-        $$.unit = 0;
-        YYERROR;
-    }
-    | VARFUNCTION maybe_space expr closing_parenthesis {
-        $$.id = CSSValueInvalid;
-        $$.unit = 0;
-        delete $3;
-        YYERROR;
-    }
-    | VARFUNCTION maybe_space expr_recovery closing_parenthesis {
-        $$.id = CSSValueInvalid;
-        $$.unit = 0;
-        YYERROR;
-    }
-    ;
-
-invalid_var_fallback:
-    '!' | ';';
-
-calc_func_term:
-    unary_term
-    | unary_operator unary_term { $$ = $2; $$.fValue *= $1; }
-    | variable_function
-    ;
-
-/*
- * The grammar requires spaces around binary ‘+’ and ‘-’ operators.
- * The '*' and '/' operators do not require spaces.
- * http://www.w3.org/TR/css3-values/#calc-syntax
- */
-calc_func_operator:
-    space '+' space {
-        $$ = '+';
-    }
-    | space '-' space {
-        $$ = '-';
-    }
-    | calc_maybe_space '*' maybe_space {
-        $$ = '*';
-    }
-    | calc_maybe_space '/' maybe_space {
-        $$ = '/';
-    }
-  ;
-
-calc_maybe_space: /* empty */ | WHITESPACE ;
-
-calc_func_paren_expr:
-    '(' maybe_space calc_func_expr calc_maybe_space closing_parenthesis {
-        $$ = nullptr;
-        if ($3) {
-            $$ = $3;
-            CSSParserValue v;
-            v.id = CSSValueInvalid;
-            v.unit = CSSParserValue::Operator;
-            v.iValue = '(';
-            $$->insertValueAt(0, v);
-            v.iValue = ')';
-            $$->addValue(v);
-        }
-    }
-  ;
-
-calc_func_expr: valid_calc_func_expr | valid_calc_func_expr expr_recovery { $$ = nullptr; delete $1; } ;
-
-valid_calc_func_expr:
-    calc_func_term {
-        $$ = new CSSParserValueList;
-        $$->addValue($1);
-    }
-    | calc_func_expr calc_func_operator calc_func_term {
-        std::unique_ptr<CSSParserValueList> expression($1);
-        $$ = nullptr;
-        if (expression && $2) {
-            $$ = expression.release();
-            CSSParserValue v;
-            v.id = CSSValueInvalid;
-            v.unit = CSSParserValue::Operator;
-            v.iValue = $2;
-            $$->addValue(v);
-            $$->addValue($3);
-        } else {
-            destroy($3);
-        }
-
-    }
-    | calc_func_expr calc_func_operator calc_func_paren_expr {
-        std::unique_ptr<CSSParserValueList> left($1);
-        std::unique_ptr<CSSParserValueList> right($3);
-        $$ = nullptr;
-        if (left && $2 && right) {
-            CSSParserValue v;
-            v.id = CSSValueInvalid;
-            v.unit = CSSParserValue::Operator;
-            v.iValue = $2;
-            left->addValue(v);
-            left->extend(*right);
-            $$ = left.release();
-        }
-    }
-    | calc_func_paren_expr
-  ;
-
-calc_func_expr_list:
-    calc_func_expr calc_maybe_space
-    | calc_func_expr_list ',' maybe_space calc_func_expr calc_maybe_space {
-        std::unique_ptr<CSSParserValueList> list($1);
-        std::unique_ptr<CSSParserValueList> expression($4);
-        $$ = nullptr;
-        if (list && expression) {
-            $$ = list.release();
-            CSSParserValue v;
-            v.id = CSSValueInvalid;
-            v.unit = CSSParserValue::Operator;
-            v.iValue = ',';
-            $$->addValue(v);
-            $$->extend(*expression);
-        }
-    }
-  ;
-
-calc_function:
-    CALCFUNCTION maybe_space calc_func_expr calc_maybe_space closing_parenthesis {
-        CSSParserFunction* f = new CSSParserFunction;
-        f->name = $1;
-        f->args = std::unique_ptr<CSSParserValueList>($3);
-        $$.id = CSSValueInvalid;
-        $$.unit = CSSParserValue::Function;
-        $$.function = f;
-    }
-    | CALCFUNCTION maybe_space expr_recovery closing_parenthesis {
-        $$.id = CSSValueInvalid;
-        $$.unit = 0;
-        YYERROR;
-    }
-    ;
-
-
-min_or_max: MINFUNCTION | MAXFUNCTION ;
-
-min_or_max_function:
-    min_or_max maybe_space calc_func_expr_list closing_parenthesis {
-        CSSParserFunction* f = new CSSParserFunction;
-        f->name = $1;
-        f->args = std::unique_ptr<CSSParserValueList>($3);
-        $$.id = CSSValueInvalid;
-        $$.unit = CSSParserValue::Function;
-        $$.function = f;
-    }
-    | min_or_max maybe_space expr_recovery closing_parenthesis {
-        $$.id = CSSValueInvalid;
-        $$.unit = 0;
-        YYERROR;
-    }
-    ;
-
-/* error handling rules */
-
-save_block: closing_brace | error closing_brace ;
-
-invalid_at: ATKEYWORD error invalid_block | ATKEYWORD error ';' ;
-
-invalid_rule: error invalid_block ;
-
-invalid_block: '{' error_recovery closing_brace { parser->invalidBlockHit(); } ;
-
-invalid_square_brackets_block: '[' error_recovery closing_bracket ;
-
-invalid_parentheses_block: opening_parenthesis error_recovery closing_parenthesis;
-
-opening_parenthesis:
-    '(' | FUNCTION | VARFUNCTION | CALCFUNCTION | MATCHESFUNCTION | MAXFUNCTION | MINFUNCTION | ANYFUNCTION | NOTFUNCTION | LANGFUNCTION
-#if ENABLE_CSS_SELECTORS_LEVEL4
-    | DIRFUNCTION | ROLEFUNCTION
-#endif
-#if ENABLE_VIDEO_TRACK
-    | CUEFUNCTION
-#endif
-    ;
-
-error_location: { $$ = parser->currentLocation(); } ;
-
-error_recovery:
-    /* empty */
-  | error_recovery error
-  | error_recovery invalid_block
-  | error_recovery invalid_square_brackets_block
-  | error_recovery invalid_parentheses_block
-    ;
-
-%%
diff --git a/Source/WebCore/css/CSSGrammar.y.includes b/Source/WebCore/css/CSSGrammar.y.includes
deleted file mode 100644 (file)
index 3c17ee9..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-%{
-
-/*
- *  Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org)
- *  Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
- *  Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
- *  Copyright (C) 2008 Eric Seidel <eric@webkit.org>
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-#include "config.h"
-
-#include "CSSParser.h"
-#include "CSSParserMode.h"
-#include "CSSPrimitiveValue.h"
-#include "CSSPropertyNames.h"
-#include "CSSSelector.h"
-#include "CSSSelectorList.h"
-#include "Document.h"
-#include "HTMLNames.h"
-#include "MediaList.h"
-#include "MediaQueryExp.h"
-#include "StyleRule.h"
-#include "StyleSheetContents.h"
-#include "CSSKeyframeRule.h"
-#include "CSSKeyframesRule.h"
-#include <wtf/FastMalloc.h>
-#include <stdlib.h>
-#include <string.h>
-
-using namespace WebCore;
-using namespace HTMLNames;
-
-#if COMPILER(MSVC)
-// See https://msdn.microsoft.com/en-us/library/1wea5zwe.aspx
-#pragma warning(disable: 4701)
-#endif
-
-#define YYMALLOC fastMalloc
-#define YYFREE fastFree
-
-#define YYENABLE_NLS 0
-#define YYLTYPE_IS_TRIVIAL 1
-#define YYMAXDEPTH 10000
-#define YYDEBUG 0
-
-#if YYDEBUG > 0
-#include <wtf/text/CString.h>
-#define YYPRINT(File,Type,Value) if (isCSSTokenAString(Type)) YYFPRINTF(File, "%s", String((Value).string).utf8().data())
-#endif
-
-%}
index d749286..42bb83b 100644 (file)
@@ -66,9 +66,8 @@ ExceptionOr<unsigned> CSSGroupingRule::insertRule(const String& ruleString, unsi
         return Exception { INDEX_SIZE_ERR };
     }
 
-    CSSParser parser(parserContext());
     CSSStyleSheet* styleSheet = parentStyleSheet();
-    RefPtr<StyleRuleBase> newRule = parser.parseRule(styleSheet ? &styleSheet->contents() : nullptr, ruleString);
+    RefPtr<StyleRuleBase> newRule = CSSParser::parseRule(parserContext(), styleSheet ? &styleSheet->contents() : nullptr, ruleString);
     if (!newRule) {
         // SYNTAX_ERR: Raised if the specified rule has a syntax error and is unparsable.
         return Exception { SYNTAX_ERR };
index 169f0c8..349decd 100644 (file)
@@ -28,6 +28,7 @@
 #include "CSSParser.h"
 #include "CSSRule.h"
 #include "StyleProperties.h"
+#include "StyleRule.h"
 
 namespace WebCore {
 
index b7ef03c..62d03ad 100644 (file)
@@ -113,8 +113,7 @@ void CSSKeyframesRule::appendRule(const String& ruleText)
     ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size());
 
     CSSParser parser(parserContext());
-    CSSStyleSheet* styleSheet = parentStyleSheet();
-    RefPtr<StyleKeyframe> keyframe = parser.parseKeyframeRule(styleSheet ? &styleSheet->contents() : nullptr, ruleText);
+    RefPtr<StyleKeyframe> keyframe = parser.parseKeyframeRule(ruleText);
     if (!keyframe)
         return;
 
similarity index 51%
rename from Source/WebCore/css/CSSVariableValue.h
rename to Source/WebCore/css/CSSNamespaceRule.cpp
index 8ac52c2..4a88ee9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#pragma once
+#include "config.h"
+#include "CSSNamespaceRule.h"
 
-#include "CSSValue.h"
+#include "CSSMarkup.h"
+#include "StyleRule.h"
+#include <wtf/text/StringBuilder.h>
 
-// FIXME-NEWPARSER: This will be removed in favor of the new variables implementation.
 namespace WebCore {
 
-class CSSValueList;
-class CSSParserValueList;
-struct CSSParserVariable;
+CSSNamespaceRule::CSSNamespaceRule(StyleRuleNamespace& namespaceRule, CSSStyleSheet* parent)
+    : CSSRule(parent)
+    , m_namespaceRule(namespaceRule)
+{
+}
 
-class CSSVariableValue final : public CSSValue {
-public:
-    static Ref<CSSVariableValue> create(CSSParserVariable* Variable)
-    {
-        return adoptRef(*new CSSVariableValue(Variable));
-    }
+CSSNamespaceRule::~CSSNamespaceRule()
+{
+}
 
-    static Ref<CSSVariableValue> create(const String& name, PassRefPtr<CSSValueList> fallbackArguments)
-    {
-        return adoptRef(*new CSSVariableValue(name, fallbackArguments));
-    }
-
-    String customCSSText() const;
-
-    bool equals(const CSSVariableValue&) const;
+AtomicString CSSNamespaceRule::namespaceURI() const
+{
+    return m_namespaceRule->uri();
+}
     
-    const String& name() const { return m_name; }
-    CSSValueList* fallbackArguments() const { return m_fallbackArguments.get(); }
+AtomicString CSSNamespaceRule::prefix() const
+{
+    return m_namespaceRule->prefix();
+}
 
-    bool buildParserValueListSubstitutingVariables(CSSParserValueList*, const CustomPropertyValueMap& customProperties) const;
+String CSSNamespaceRule::cssText() const
+{
+    StringBuilder result;
+    result.appendLiteral("@namespace ");
+    serializeIdentifier(prefix(), result);
+    if (!prefix().isEmpty())
+        result.append(' ');
+    result.append("url(");
+    result.append(serializeString(namespaceURI()));
+    result.append(");");
+    return result.toString();
+}
 
-private:
-    explicit CSSVariableValue(CSSParserVariable*);
-    CSSVariableValue(const String&, PassRefPtr<CSSValueList>);
-
-    String m_name;
-    RefPtr<CSSValueList> m_fallbackArguments;
-};
+void CSSNamespaceRule::reattach(StyleRuleBase&)
+{
+}
 
 } // namespace WebCore
-
-SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSVariableValue, isVariableValue())
similarity index 62%
rename from Source/WebCore/css/CSSVariableDependentValue.cpp
rename to Source/WebCore/css/CSSNamespaceRule.h
index 3239dc5..cd70043 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc.  All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "config.h"
-#include "CSSVariableDependentValue.h"
+#pragma once
 
-#include "CSSCustomPropertyValue.h"
-#include <wtf/text/AtomicStringHash.h>
+#include "CSSRule.h"
 
 namespace WebCore {
 
-bool CSSVariableDependentValue::checkVariablesForCycles(const AtomicString& name, CustomPropertyValueMap& customProperties, const HashSet<AtomicString>& seenProperties, HashSet<AtomicString>& invalidProperties)
-{
-    if (invalidProperties.contains(name))
-        return false;
+class StyleRuleNamespace;
 
-    HashSet<AtomicString> newSeenProperties = seenProperties;
-    newSeenProperties.add(name);
-    
-    bool valid = valueList().checkVariablesForCycles(customProperties, newSeenProperties, invalidProperties);
-    if (!valid)
-        invalidProperties.add(name);
+class CSSNamespaceRule final : public CSSRule {
+public:
+    static Ref<CSSNamespaceRule> create(StyleRuleNamespace& rule, CSSStyleSheet* sheet) { return adoptRef(*new CSSNamespaceRule(rule, sheet)); }
 
-    return valid;
-}
+    virtual ~CSSNamespaceRule();
 
-}
+    AtomicString namespaceURI() const;
+    AtomicString prefix() const;
+
+private:
+    CSSNamespaceRule(StyleRuleNamespace&, CSSStyleSheet*);
+
+    CSSRule::Type type() const final { return NAMESPACE_RULE; }
+    String cssText() const final;
+    void reattach(StyleRuleBase&) final;
+
+    Ref<StyleRuleNamespace> m_namespaceRule;
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_CSS_RULE(CSSNamespaceRule, CSSRule::NAMESPACE_RULE)
diff --git a/Source/WebCore/css/CSSNamespaceRule.idl b/Source/WebCore/css/CSSNamespaceRule.idl
new file mode 100644 (file)
index 0000000..83b2ac9
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+* Copyright (C) 2016 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+// https://drafts.csswg.org/cssom/#the-cssnamespacerule-interface
+
+interface CSSNamespaceRule : CSSRule {
+
+    readonly attribute DOMString namespaceURI;
+    readonly attribute DOMString prefix;
+
+};
index 78965e8..9f8d031 100644 (file)
@@ -109,11 +109,6 @@ static inline bool isValidCSSUnitTypeForDoubleConversion(CSSPrimitiveValue::Unit
     case CSSPrimitiveValue::CSS_FONT_FAMILY:
     case CSSPrimitiveValue::CSS_IDENT:
     case CSSPrimitiveValue::CSS_PAIR:
-    case CSSPrimitiveValue::CSS_PARSER_HEXCOLOR:
-    case CSSPrimitiveValue::CSS_PARSER_IDENTIFIER:
-    case CSSPrimitiveValue::CSS_PARSER_INTEGER:
-    case CSSPrimitiveValue::CSS_PARSER_OPERATOR:
-    case CSSPrimitiveValue::CSS_PARSER_WHITESPACE:
     case CSSPrimitiveValue::CSS_PROPERTY_ID:
     case CSSPrimitiveValue::CSS_QUAD:
     case CSSPrimitiveValue::CSS_RECT:
@@ -147,9 +142,6 @@ static inline bool isStringType(CSSPrimitiveValue::UnitTypes type)
     case CSSPrimitiveValue::CSS_ATTR:
     case CSSPrimitiveValue::CSS_COUNTER_NAME:
     case CSSPrimitiveValue::CSS_DIMENSION:
-    case CSSPrimitiveValue::CSS_PARSER_HEXCOLOR:
-    case CSSPrimitiveValue::CSS_PARSER_IDENTIFIER:
-    case CSSPrimitiveValue::CSS_PARSER_WHITESPACE:
         return true;
     case CSSPrimitiveValue::CSS_CALC:
     case CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_LENGTH:
@@ -175,8 +167,6 @@ static inline bool isStringType(CSSPrimitiveValue::UnitTypes type)
     case CSSPrimitiveValue::CSS_MS:
     case CSSPrimitiveValue::CSS_NUMBER:
     case CSSPrimitiveValue::CSS_PAIR:
-    case CSSPrimitiveValue::CSS_PARSER_INTEGER:
-    case CSSPrimitiveValue::CSS_PARSER_OPERATOR:
     case CSSPrimitiveValue::CSS_PC:
     case CSSPrimitiveValue::CSS_PERCENTAGE:
     case CSSPrimitiveValue::CSS_PROPERTY_ID:
@@ -327,13 +317,6 @@ CSSPrimitiveValue::CSSPrimitiveValue(CSSPropertyID propertyID)
     m_value.propertyID = propertyID;
 }
 
-CSSPrimitiveValue::CSSPrimitiveValue(int parserOperator)
-    : CSSValue(PrimitiveClass)
-{
-    m_primitiveUnitType = CSS_PARSER_OPERATOR;
-    m_value.parserOperator = parserOperator;
-}
-
 CSSPrimitiveValue::CSSPrimitiveValue(double num, UnitTypes type)
     : CSSValue(PrimitiveClass)
 {
@@ -529,14 +512,10 @@ void CSSPrimitiveValue::cleanup()
     case CSS_URI:
     case CSS_ATTR:
     case CSS_COUNTER_NAME:
-    case CSS_DIMENSION:
-    case CSS_PARSER_HEXCOLOR:
-    case CSS_PARSER_IDENTIFIER:
-    case CSS_PARSER_WHITESPACE:
-        ASSERT(isStringType(type));
         if (m_value.string)
             m_value.string->deref();
         break;
+    case CSS_DIMENSION:
     case CSS_COUNTER:
         m_value.counter->deref();
         break;
@@ -581,7 +560,6 @@ void CSSPrimitiveValue::cleanup()
         m_value.color = nullptr;
         break;
     case CSS_NUMBER:
-    case CSS_PARSER_INTEGER:
     case CSS_PERCENTAGE:
     case CSS_EMS:
     case CSS_QUIRKY_EMS:
@@ -613,7 +591,6 @@ void CSSPrimitiveValue::cleanup()
     case CSS_IDENT:
     case CSS_UNKNOWN:
     case CSS_UNICODE_RANGE:
-    case CSS_PARSER_OPERATOR:
     case CSS_PROPERTY_ID:
     case CSS_VALUE_ID:
         ASSERT(!isStringType(type));
@@ -1014,7 +991,6 @@ ALWAYS_INLINE String CSSPrimitiveValue::formatNumberForCustomCSSText() const
     case CSS_UNKNOWN:
         return String();
     case CSS_NUMBER:
-    case CSS_PARSER_INTEGER:
         return formatNumberValue("");
     case CSS_PERCENTAGE:
         return formatNumberValue("%");
@@ -1122,11 +1098,6 @@ ALWAYS_INLINE String CSSPrimitiveValue::formatNumberForCustomCSSText() const
     case CSS_LENGTH_REPEAT:
         return lengthRepeatValue()->cssText();
 #endif
-    case CSS_PARSER_HEXCOLOR: {
-        RGBA32 rgb;
-        Color::parseHexColor((String)m_value.string, rgb);
-        return Color(rgb).cssText();
-    }
     case CSS_RGBCOLOR:
         return color().cssText();
     case CSS_PAIR:
@@ -1167,14 +1138,6 @@ ALWAYS_INLINE String CSSPrimitiveValue::formatNumberForCustomCSSText() const
         return result.toString();
     }
 #endif
-    case CSS_PARSER_OPERATOR: {
-        char c = static_cast<char>(m_value.parserOperator);
-        return String(&c, 1U);
-    }
-    case CSS_PARSER_IDENTIFIER:
-        return m_value.string;
-    case CSS_PARSER_WHITESPACE:
-        return " ";
     case CSS_CALC:
         return m_value.calc->cssText();
     case CSS_SHAPE:
@@ -1258,7 +1221,6 @@ Ref<CSSPrimitiveValue> CSSPrimitiveValue::cloneForCSSOM() const
         result = CSSPrimitiveValue::create(Ref<CSSBasicShape>(*m_value.shape));
         break;
     case CSS_NUMBER:
-    case CSS_PARSER_INTEGER:
     case CSS_PERCENTAGE:
     case CSS_EMS:
     case CSS_QUIRKY_EMS:
@@ -1302,10 +1264,6 @@ Ref<CSSPrimitiveValue> CSSPrimitiveValue::cloneForCSSOM() const
         break;
     case CSS_DIMENSION:
     case CSS_UNKNOWN:
-    case CSS_PARSER_OPERATOR:
-    case CSS_PARSER_IDENTIFIER:
-    case CSS_PARSER_WHITESPACE:
-    case CSS_PARSER_HEXCOLOR:
         ASSERT_NOT_REACHED();
         break;
     }
@@ -1323,7 +1281,6 @@ bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const
     case CSS_UNKNOWN:
         return false;
     case CSS_NUMBER:
-    case CSS_PARSER_INTEGER:
     case CSS_PERCENTAGE:
     case CSS_EMS:
     case CSS_QUIRKY_EMS:
@@ -1362,9 +1319,6 @@ bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const
     case CSS_URI:
     case CSS_ATTR:
     case CSS_COUNTER_NAME:
-    case CSS_PARSER_IDENTIFIER:
-    case CSS_PARSER_HEXCOLOR:
-    case CSS_PARSER_WHITESPACE:
         return equal(m_value.string, other.m_value.string);
     case CSS_COUNTER:
         return m_value.counter && other.m_value.counter && m_value.counter->equals(*other.m_value.counter);
@@ -1384,8 +1338,6 @@ bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const
     case CSS_DASHBOARD_REGION:
         return m_value.region && other.m_value.region && m_value.region->equals(*other.m_value.region);
 #endif
-    case CSS_PARSER_OPERATOR:
-        return m_value.parserOperator == other.m_value.parserOperator;
     case CSS_CALC:
         return m_value.calc && other.m_value.calc && m_value.calc->equals(*other.m_value.calc);
     case CSS_SHAPE:
@@ -1396,77 +1348,4 @@ bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const
     return false;
 }
 
-bool CSSPrimitiveValue::buildParserValue(CSSParserValue* result) const
-{
-    switch (m_primitiveUnitType) {
-    case CSS_VALUE_ID:
-        result->id = m_value.valueID;
-        result->unit = CSSPrimitiveValue::CSS_IDENT;
-        result->string.init(valueName(m_value.valueID));
-        break;
-    case CSS_PARSER_IDENTIFIER:
-        result->id = CSSValueInvalid;
-        result->unit = CSSPrimitiveValue::CSS_IDENT;
-        result->string.init(m_value.string);
-        break;
-    case CSS_NUMBER:
-    case CSS_PERCENTAGE:
-    case CSS_EMS:
-    case CSS_QUIRKY_EMS:
-    case CSS_EXS:
-    case CSS_REMS:
-    case CSS_PX:
-    case CSS_CM:
-#if ENABLE(CSS_IMAGE_RESOLUTION) || ENABLE(RESOLUTION_MEDIA_QUERY)
-    case CSS_DPPX:
-    case CSS_DPI:
-    case CSS_DPCM:
-#endif
-    case CSS_MM:
-    case CSS_IN:
-    case CSS_PT:
-    case CSS_PC:
-    case CSS_DEG:
-    case CSS_RAD:
-    case CSS_GRAD:
-    case CSS_MS:
-    case CSS_S:
-    case CSS_HZ:
-    case CSS_KHZ:
-    case CSS_TURN:
-    case CSS_VW:
-    case CSS_VH:
-    case CSS_VMIN:
-    case CSS_FR:
-        result->fValue = m_value.num;
-        result->unit = m_primitiveUnitType;
-        break;
-    case CSS_PARSER_INTEGER:
-        result->fValue = m_value.num;
-        result->unit = CSSPrimitiveValue::CSS_NUMBER;
-        result->isInt = true;
-        break;
-    case CSS_PARSER_OPERATOR:
-        result->iValue = m_value.parserOperator;
-        result->unit = CSSParserValue::Operator;
-        break;
-    case CSS_DIMENSION:
-    case CSS_STRING:
-    case CSS_URI:
-    case CSS_ATTR:
-    case CSS_COUNTER_NAME:
-    case CSS_PARSER_HEXCOLOR:
-        result->string.init(m_value.string);
-        result->unit = m_primitiveUnitType;
-        break;
-    case CSS_PARSER_WHITESPACE:
-        return false;
-    default:
-        ASSERT_NOT_REACHED();
-        break;
-    }
-    
-    return true;
-}
-
 } // namespace WebCore
index bbe817e..3e4d91f 100644 (file)
@@ -46,7 +46,6 @@ class Rect;
 class RenderStyle;
 
 struct CSSFontFamily;
-struct CSSParserValue;
 struct Length;
 struct LengthSize;
 
@@ -122,14 +121,6 @@ public:
 #endif
         CSS_UNICODE_RANGE = 102,
 
-        // These next types are just used internally to allow us to translate back and forth from CSSPrimitiveValues to CSSParserValues.
-        CSS_PARSER_OPERATOR = 103,
-        CSS_PARSER_INTEGER = 104,
-        CSS_PARSER_HEXCOLOR = 105,
-
-        // This is used internally for unknown identifiers
-        CSS_PARSER_IDENTIFIER = 106,
-
         // These are from CSS3 Values and Units, but that isn't a finished standard yet
         CSS_TURN = 107,
         CSS_REMS = 108,
@@ -153,9 +144,6 @@ public:
         CSS_PROPERTY_ID = 117,
         CSS_VALUE_ID = 118,
         
-        // More internal parse stuff for CSS variables
-        CSS_PARSER_WHITESPACE = 119,
-        
         // This value is used to handle quirky margins in reflow roots (body, td, and th) like WinIE.
         // The basic idea is that a stylesheet can use the value __qem (for quirky em) instead of em.
         // When the quirky value is used, if you're in quirks mode, the margin will collapse away
@@ -222,13 +210,9 @@ public:
     bool isViewportPercentageMin() const { return m_primitiveUnitType == CSS_VMIN; }
     bool isValueID() const { return m_primitiveUnitType == CSS_VALUE_ID; }
     bool isFlex() const { return primitiveType() == CSS_FR; }
-    
-    bool isParserOperator() const { return primitiveType() == CSS_PARSER_OPERATOR; }
-    int parserOperator() const { return isParserOperator() ? m_value.parserOperator : 0; }
 
     static Ref<CSSPrimitiveValue> createIdentifier(CSSValueID valueID) { return adoptRef(*new CSSPrimitiveValue(valueID)); }
     static Ref<CSSPrimitiveValue> createIdentifier(CSSPropertyID propertyID) { return adoptRef(*new CSSPrimitiveValue(propertyID)); }
-    static Ref<CSSPrimitiveValue> createParserOperator(int parserOperator) { return adoptRef(*new CSSPrimitiveValue(parserOperator)); }
 
     static Ref<CSSPrimitiveValue> create(double value, UnitTypes type) { return adoptRef(*new CSSPrimitiveValue(value, type)); }
     static Ref<CSSPrimitiveValue> create(const String& value, UnitTypes type) { return adoptRef(*new CSSPrimitiveValue(value, type)); }
@@ -258,8 +242,6 @@ public:
 
     double computeDegrees() const;
     
-    bool buildParserValue(CSSParserValue*) const;
-    
     enum TimeUnit { Seconds, Milliseconds };
     template<typename T, TimeUnit timeUnit> T computeTime() const;
 
@@ -328,7 +310,6 @@ private:
 
     CSSPrimitiveValue(CSSValueID);
     CSSPrimitiveValue(CSSPropertyID);
-    CSSPrimitiveValue(int parserOperator);
     CSSPrimitiveValue(const Color&);
     CSSPrimitiveValue(const Length&);
     CSSPrimitiveValue(const Length&, const RenderStyle&);
@@ -371,7 +352,6 @@ private:
     union {
         CSSPropertyID propertyID;
         CSSValueID valueID;
-        int parserOperator;
         double num;
         StringImpl* string;
         Counter* counter;
index 0081887..e52c563 100644 (file)
@@ -49,6 +49,7 @@ public:
         // <https://bugs.webkit.org/show_bug.cgi?id=71293>.
         KEYFRAMES_RULE,
         KEYFRAME_RULE,
+        NAMESPACE_RULE = 10, // Matches other browsers.
         SUPPORTS_RULE = 12,
 #if ENABLE(CSS_DEVICE_ADAPTATION)
         WEBKIT_VIEWPORT_RULE = 15,
index 1268f11..3069b01 100644 (file)
@@ -35,6 +35,7 @@
     const unsigned short PAGE_RULE = 6;
     const unsigned short KEYFRAMES_RULE = 7;
     const unsigned short KEYFRAME_RULE = 8;
+    const unsigned short NAMESPACE_RULE = 10;
     const unsigned short SUPPORTS_RULE = 12;
     [Conditional=CSS_DEVICE_ADAPTATION] const unsigned short WEBKIT_VIEWPORT_RULE = 15;
     [Conditional=CSS_REGIONS] const unsigned short WEBKIT_REGION_RULE = 16;
index 60eb336..e0f7245 100644 (file)
@@ -289,8 +289,7 @@ ExceptionOr<unsigned> CSSStyleSheet::insertRule(const String& ruleString, unsign
 
     if (index > length())
         return Exception { INDEX_SIZE_ERR };
-    CSSParser p(m_contents.get().parserContext());
-    RefPtr<StyleRuleBase> rule = p.parseRule(m_contents.ptr(), ruleString);
+    RefPtr<StyleRuleBase> rule = CSSParser::parseRule(m_contents.get().parserContext(), m_contents.ptr(), ruleString);
 
     if (!rule)
         return Exception { SYNTAX_ERR };
index 1d54022..cbed4ca 100644 (file)
@@ -60,9 +60,7 @@
 #include "CSSUnicodeRangeValue.h"
 #include "CSSUnsetValue.h"
 #include "CSSValueList.h"
-#include "CSSVariableDependentValue.h"
 #include "CSSVariableReferenceValue.h"
-#include "CSSVariableValue.h"
 #include "SVGColor.h"
 #include "SVGPaint.h"
 #include "WebKitCSSTransformValue.h"
@@ -246,10 +244,6 @@ bool CSSValue::equals(const CSSValue& other) const
             return compareCSSValues<CSSVariableReferenceValue>(*this, other);
         case PendingSubstitutionValueClass:
             return compareCSSValues<CSSPendingSubstitutionValue>(*this, other);
-        case VariableDependentClass:
-            return compareCSSValues<CSSVariableDependentValue>(*this, other);
-        case VariableClass:
-            return compareCSSValues<CSSVariableValue>(*this, other);
         default:
             ASSERT_NOT_REACHED();
             return false;
@@ -354,10 +348,6 @@ String CSSValue::cssText() const
         return downcast<CSSContentDistributionValue>(*this).customCSSText();
     case CustomPropertyClass:
         return downcast<CSSCustomPropertyValue>(*this).customCSSText();
-    case VariableDependentClass:
-        return downcast<CSSVariableDependentValue>(*this).customCSSText();
-    case VariableClass:
-        return downcast<CSSVariableValue>(*this).customCSSText();
     case CustomIdentClass:
         return downcast<CSSCustomIdentValue>(*this).customCSSText();
     case VariableReferenceClass:
@@ -503,12 +493,6 @@ void CSSValue::destroy()
     case CustomPropertyClass:
         delete downcast<CSSCustomPropertyValue>(this);
         return;
-    case VariableDependentClass:
-        delete downcast<CSSVariableDependentValue>(this);
-        return;
-    case VariableClass:
-        delete downcast<CSSVariableValue>(this);
-        return;
     case CustomIdentClass:
         delete downcast<CSSCustomIdentValue>(this);
         return;
index b3ae9a7..2dfdd4f 100644 (file)
@@ -79,8 +79,6 @@ public:
     bool isCrossfadeValue() const { return m_classType == CrossfadeClass; }
     bool isCursorImageValue() const { return m_classType == CursorImageClass; }
     bool isCustomPropertyValue() const { return m_classType == CustomPropertyClass; }
-    bool isVariableDependentValue() const { return m_classType == VariableDependentClass; }
-    bool isVariableValue() const { return m_classType == VariableClass; }
     bool isFunctionValue() const { return m_classType == FunctionClass; }
     bool isFontFeatureValue() const { return m_classType == FontFeatureClass; }
 #if ENABLE(VARIATION_FONTS)
@@ -129,7 +127,7 @@ public:
     bool isVariableReferenceValue() const { return m_classType == VariableReferenceClass; }
     bool isPendingSubstitutionValue() const { return m_classType == PendingSubstitutionValueClass; }
     
-    bool hasVariableReferences() const { return isVariableDependentValue() || isVariableReferenceValue() || isPendingSubstitutionValue(); }
+    bool hasVariableReferences() const { return isVariableReferenceValue() || isPendingSubstitutionValue(); }
 
     bool isCSSOMSafe() const { return m_isCSSOMSafe; }
     bool isSubtypeExposedToCSSOM() const
@@ -204,12 +202,7 @@ protected:
         
         CustomIdentClass,
 
-        // FIXME-NEWPARSER: Unify variables implementation.
         CustomPropertyClass,
-        VariableDependentClass,
-        VariableClass,
-
-        // New variables implementation.
         VariableReferenceClass,
         PendingSubstitutionValueClass,
 
index 258e748..5535258 100644 (file)
 
 #include "CSSCustomPropertyValue.h"
 #include "CSSFunctionValue.h"
-#include "CSSParserValues.h"
 #include "CSSPrimitiveValue.h"
-#include "CSSVariableDependentValue.h"
-#include "CSSVariableValue.h"
 #include <wtf/text/StringBuilder.h>
 
 namespace WebCore {
@@ -43,18 +40,6 @@ CSSValueList::CSSValueList(ValueListSeparator listSeparator)
     m_valueListSeparator = listSeparator;
 }
 
-CSSValueList::CSSValueList(CSSParserValueList& parserValues)
-    : CSSValue(ValueListClass)
-{
-    m_valueListSeparator = SpaceSeparator;
-    m_values.reserveInitialCapacity(parserValues.size());
-    for (unsigned i = 0, size = parserValues.size(); i < size; ++i) {
-        RefPtr<CSSValue> value = parserValues.valueAt(i)->createCSSValue();
-        ASSERT(value);
-        m_values.uncheckedAppend(value.releaseNonNull());
-    }
-}
-
 bool CSSValueList::removeAll(CSSValue* value)
 {
     // FIXME: Why even take a pointer?
@@ -119,13 +104,7 @@ String CSSValueList::customCSSText() const
     }
 
     for (auto& value : m_values) {
-        bool suppressSeparator = false;
-        if (m_valueListSeparator == SpaceSeparator && value->isPrimitiveValue()) {
-            auto* primitiveValue = &downcast<CSSPrimitiveValue>(*value.ptr());
-            if (primitiveValue->parserOperator() == ',')
-                suppressSeparator = true;
-        }
-        if (!suppressSeparator && !result.isEmpty())
+        if (!result.isEmpty())
             result.append(separator);
         result.append(value.get().cssText());
     }
@@ -179,112 +158,4 @@ Ref<CSSValueList> CSSValueList::cloneForCSSOM() const
     return adoptRef(*new CSSValueList(*this));
 }
 
-
-bool CSSValueList::containsVariables() const
-{
-    for (unsigned i = 0; i < m_values.size(); i++) {
-        if (m_values[i]->isVariableValue())
-            return true;
-        if (m_values[i]->isFunctionValue()) {
-            auto& functionValue = downcast<CSSFunctionValue>(*item(i));
-            CSSValueList* args = functionValue.arguments();
-            if (args && args->containsVariables())
-                return true;
-        } else if (m_values[i]->isValueList()) {
-            auto& listValue = downcast<CSSValueList>(*item(i));
-            if (listValue.containsVariables())
-                return true;
-        }
-    }
-    return false;
-}
-
-bool CSSValueList::checkVariablesForCycles(CustomPropertyValueMap& customProperties, HashSet<AtomicString>& seenProperties, HashSet<AtomicString>& invalidProperties) const
-{
-    for (unsigned i = 0; i < m_values.size(); i++) {
-        auto* value = item(i);
-        if (value->isVariableValue()) {
-            auto& variableValue = downcast<CSSVariableValue>(*value);
-            if (seenProperties.contains(variableValue.name()))
-                return false;
-            RefPtr<CSSCustomPropertyValue> value = customProperties.get(variableValue.name());
-            if (value && value->containsVariables() && !downcast<CSSVariableDependentValue>(*(value->deprecatedValue())).checkVariablesForCycles(variableValue.name(), customProperties, seenProperties, invalidProperties))
-                return false;
-
-            // Have to check the fallback values.
-            auto* fallbackArgs = variableValue.fallbackArguments();
-            if (!fallbackArgs || !fallbackArgs->length())
-                continue;
-            
-            if (!fallbackArgs->checkVariablesForCycles(customProperties, seenProperties, invalidProperties))
-                return false;
-        } else if (value->isFunctionValue()) {
-            auto& functionValue = downcast<CSSFunctionValue>(*value);
-            auto* args = functionValue.arguments();
-            if (args && !args->checkVariablesForCycles(customProperties, seenProperties, invalidProperties))
-                return false;
-        } else if (value->isValueList()) {
-            auto& listValue = downcast<CSSValueList>(*value);
-            if (!listValue.checkVariablesForCycles(customProperties, seenProperties, invalidProperties))
-                return false;
-        }
-    }
-    return true;
-}
-
-bool CSSValueList::buildParserValueSubstitutingVariables(CSSParserValue* result, const CustomPropertyValueMap& customProperties) const
-{
-    result->id = CSSValueInvalid;
-    result->unit = CSSParserValue::ValueList;
-    result->valueList = new CSSParserValueList();
-    return buildParserValueListSubstitutingVariables(result->valueList, customProperties);
-}
-
-bool CSSValueList::buildParserValueListSubstitutingVariables(CSSParserValueList* parserList, const CustomPropertyValueMap& customProperties) const
-{
-    for (auto& value : m_values) {
-        switch (value.get().classType()) {
-        case FunctionClass: {
-            CSSParserValue result;
-            result.id = CSSValueInvalid;
-            if (!downcast<CSSFunctionValue>(value.get()).buildParserValueSubstitutingVariables(&result, customProperties)) {
-                WebCore::destroy(result);
-                return false;
-            }
-            parserList->addValue(result);
-            break;
-        }
-        case ValueListClass: {
-            CSSParserValue result;
-            result.id = CSSValueInvalid;
-            if (!downcast<CSSValueList>(value.get()).buildParserValueSubstitutingVariables(&result, customProperties)) {
-                WebCore::destroy(result);
-                return false;
-            }
-            parserList->addValue(result);
-            break;
-        }
-        case VariableClass: {
-            if (!downcast<CSSVariableValue>(value.get()).buildParserValueListSubstitutingVariables(parserList, customProperties))
-                return false;
-            break;
-        }
-        case PrimitiveClass: {
-            // FIXME: Will have to change this if we start preserving invalid tokens.
-            CSSParserValue result;
-            result.id = CSSValueInvalid;
-            if (downcast<CSSPrimitiveValue>(value.get()).buildParserValue(&result))
-                parserList->addValue(result);
-            else
-                WebCore::destroy(result);
-            break;
-        }
-        default:
-            ASSERT_NOT_REACHED();
-            return false;
-        }
-    }
-    return true;
-}
-    
 } // namespace WebCore
index a963251..aad156b 100644 (file)
@@ -46,10 +46,6 @@ public:
     {
         return adoptRef(*new CSSValueList(SlashSeparator));
     }
-    static Ref<CSSValueList> createFromParserValueList(CSSParserValueList& list)
-    {
-        return adoptRef(*new CSSValueList(list));
-    }
 
     size_t length() const { return m_values.size(); }
     CSSValue* item(size_t index) { return index < m_values.size() ? m_values[index].ptr() : nullptr; }
@@ -76,19 +72,12 @@ public:
     
     Ref<CSSValueList> cloneForCSSOM() const;
 
-    bool containsVariables() const;
-    bool checkVariablesForCycles(CustomPropertyValueMap& customProperties, HashSet<AtomicString>& seenProperties, HashSet<AtomicString>& invalidProperties) const;
-    
-    bool buildParserValueListSubstitutingVariables(CSSParserValueList*, const CustomPropertyValueMap& customProperties) const;
-    bool buildParserValueSubstitutingVariables(CSSParserValue*, const CustomPropertyValueMap& customProperties) const;
-    
 protected:
     CSSValueList(ClassType, ValueListSeparator);
     CSSValueList(const CSSValueList& cloneFrom);
 
 private:
     explicit CSSValueList(ValueListSeparator);
-    explicit CSSValueList(CSSParserValueList&);
 
     Vector<Ref<CSSValue>, 4> m_values;
 };
index 2418ca9..b2e2bb5 100644 (file)
@@ -140,8 +140,13 @@ PassRefPtr<CSSValueList> CSSValuePool::createFontFaceValue(const AtomicString& s
         m_fontFaceValueCache.remove(m_fontFaceValueCache.begin());
 
     RefPtr<CSSValueList>& value = m_fontFaceValueCache.add(string, nullptr).iterator->value;
-    if (!value)
-        value = CSSParser::parseFontFaceValue(string);
+    if (value)
+        return value;
+    
+    RefPtr<CSSValue> result = CSSParser::parseSingleValue(CSSPropertyFontFamily, string);
+    if (!result || !result->isValueList())
+        return value;
+    value = static_pointer_cast<CSSValueList>(result);
     return value;
 }
 
index 4b61f8c..4dcebf0 100644 (file)
@@ -33,6 +33,7 @@
 #include "CSSCustomPropertyValue.h"
 #include "CSSParser.h"
 #include "CSSParserTokenRange.h"
+#include <wtf/text/AtomicStringHash.h>
 #include <wtf/text/StringBuilder.h>
 #include <wtf/text/StringView.h>
 
diff --git a/Source/WebCore/css/CSSVariableDependentValue.h b/Source/WebCore/css/CSSVariableDependentValue.h
deleted file mode 100644 (file)
index 6edefeb..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "CSSPropertyNames.h"
-#include "CSSValueList.h"
-#include <wtf/RefPtr.h>
-
-// FIXME-NEWPARSER: This will be removed in favor of CSSVariableReferenceValue
-namespace WebCore {
-
-class CSSVariableDependentValue final : public CSSValue {
-public:
-    static Ref<CSSVariableDependentValue> create(Ref<CSSValueList>&& valueList, CSSPropertyID propId)
-    {
-        return adoptRef(*new CSSVariableDependentValue(WTFMove(valueList), propId));
-    }
-    
-    String customCSSText() const
-    {
-        if (!m_serialized) {
-            m_serialized = true;
-            m_stringValue = m_valueList->customCSSText();
-        }
-        return m_stringValue;
-    }
-    
-    // FIXME: Should arguably implement equals on all of the CSSParserValues, but CSSValue equivalence
-    // is rarely used, so serialization to compare is probably fine.
-    bool equals(const CSSVariableDependentValue& other) const { return customCSSText() == other.customCSSText(); }
-    
-    CSSPropertyID propertyID() const { return m_propertyID; }
-    
-    CSSValueList& valueList() { return m_valueList.get(); }
-    const CSSValueList& valueList() const { return m_valueList.get(); }
-
-    bool checkVariablesForCycles(const AtomicString& name, CustomPropertyValueMap& customProperties, const HashSet<AtomicString>& seenProperties, HashSet<AtomicString>& invalidProperties);
-
-private:
-    CSSVariableDependentValue(Ref<CSSValueList>&& valueList, CSSPropertyID propId)
-        : CSSValue(VariableDependentClass)
-        , m_valueList(WTFMove(valueList))
-        , m_propertyID(propId)
-    {
-    }
-
-    Ref<CSSValueList> m_valueList;
-    CSSPropertyID m_propertyID;
-    mutable String m_stringValue;
-    mutable bool m_serialized { false };
-};
-
-} // namespace WebCore
-
-SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSVariableDependentValue, isVariableDependentValue())
diff --git a/Source/WebCore/css/CSSVariableValue.cpp b/Source/WebCore/css/CSSVariableValue.cpp
deleted file mode 100644 (file)
index c0bb314..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2015 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "CSSVariableValue.h"
-
-#include "CSSCustomPropertyValue.h"
-#include "CSSParserValues.h"
-#include "CSSValueList.h"
-#include "CSSVariableDependentValue.h"
-#include <wtf/text/StringBuilder.h>
-
-namespace WebCore {
-
-CSSVariableValue::CSSVariableValue(CSSParserVariable* variable)
-    : CSSValue(VariableClass)
-    , m_name(variable->name)
-{
-    if (variable->args)
-        m_fallbackArguments = CSSValueList::createFromParserValueList(*variable->args);
-}
-
-CSSVariableValue::CSSVariableValue(const String& name, PassRefPtr<CSSValueList> fallbackArgs)
-    : CSSValue(VariableClass)
-    , m_name(name)
-    , m_fallbackArguments(fallbackArgs)
-{
-}
-
-String CSSVariableValue::customCSSText() const
-{
-    StringBuilder result;
-    result.append("var(");
-    result.append(m_name);
-    if (m_fallbackArguments) {
-        result.append(", ");
-        result.append(m_fallbackArguments->cssText());
-    }
-    result.append(")");
-    return result.toString();
-}
-
-bool CSSVariableValue::equals(const CSSVariableValue& other) const
-{
-    return m_name == other.m_name && compareCSSValuePtr(m_fallbackArguments, other.m_fallbackArguments);
-}
-
-bool CSSVariableValue::buildParserValueListSubstitutingVariables(CSSParserValueList* resultList, const CustomPropertyValueMap& customProperties) const
-{
-    if (RefPtr<CSSCustomPropertyValue> customPropertyValue = customProperties.get(m_name)) {
-        auto value = customPropertyValue->deprecatedValue();
-        if (value && value->isValueList())
-            return downcast<CSSValueList>(*value).buildParserValueListSubstitutingVariables(resultList, customProperties);
-        if (value && value->isVariableDependentValue())
-            return downcast<CSSVariableDependentValue>(*value).valueList().buildParserValueListSubstitutingVariables(resultList, customProperties);
-    }
-
-    // We failed to substitute the variable. If it has fallback arguments, use those instead.
-    if (!fallbackArguments() || !fallbackArguments()->length())
-        return false;
-    return fallbackArguments()->buildParserValueListSubstitutingVariables(resultList, customProperties);
-}
-
-}
index 997a6fe..21a1201 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "CSSMarkup.h"
 #include "CSSParser.h"
+#include "CSSPropertyParser.h"
 #include "StyleProperties.h"
 #include <wtf/text/StringBuilder.h>
 #include <wtf/text/WTFString.h>
index e6e0f70..91d3d6c 100644 (file)
@@ -30,6 +30,7 @@
 #include "CSSFontFeatureValue.h"
 #include "CSSParser.h"
 #include "CSSUnicodeRangeValue.h"
+#include "CSSValueList.h"
 #include "CSSValuePool.h"
 #include "Document.h"
 #include "FontVariantBuilder.h"
@@ -126,10 +127,8 @@ WeakPtr<FontFace> FontFace::createWeakPtr() const
 
 RefPtr<CSSValue> FontFace::parseString(const String& string, CSSPropertyID propertyID)
 {
-    auto style = MutableStyleProperties::create();
-    if (CSSParser::parseValue(style, propertyID, string, true, HTMLStandardMode, nullptr) == CSSParser::ParseResult::Error)
-        return nullptr;
-    return style->getPropertyCSSValue(propertyID);
+    // FIXME: Should use the Document to get the right parsing mode.
+    return CSSParser::parseFontFaceDescriptor(propertyID, string, HTMLStandardMode);
 }
 
 ExceptionOr<void> FontFace::setFamily(const String& family)
index ec37b3e..674c0ab 100644 (file)
@@ -32,6 +32,7 @@
 #include "CSSDefaultStyleSheets.h"
 #include "CSSImportRule.h"
 #include "CSSMediaRule.h"
+#include "CSSNamespaceRule.h"
 #include "CSSRule.h"
 #include "CSSStyleRule.h"
 #include "CSSStyleSheet.h"
index 329ddd1..e43a6ae 100644 (file)
@@ -122,80 +122,6 @@ static inline bool featureWithZeroOrOne(const String& mediaFeature, const CSSPar
     return mediaFeature == MediaFeatureNames::grid;
 }
 
-static inline bool isFeatureValidWithIdentifier(const AtomicString& mediaFeature, CSSValueID id)
-{
-    if (!id)
-        return false;
-
-    return featureWithValidIdent(mediaFeature);
-}
-
-static inline bool isFeatureValidWithNonNegativeLengthOrNumber(const AtomicString& mediaFeature, const CSSParserValue& value)
-{
-    if (!(CSSPrimitiveValue::isLength(static_cast<CSSPrimitiveValue::UnitTypes>(value.unit)) || value.unit == CSSPrimitiveValue::CSS_NUMBER) || value.fValue < 0)
-        return false;
-
-    return mediaFeature == MediaFeatureNames::height
-        || mediaFeature == MediaFeatureNames::maxHeight
-        || mediaFeature == MediaFeatureNames::minHeight
-        || mediaFeature == MediaFeatureNames::width
-        || mediaFeature == MediaFeatureNames::maxWidth
-        || mediaFeature == MediaFeatureNames::minWidth
-        || mediaFeature == MediaFeatureNames::deviceHeight
-        || mediaFeature == MediaFeatureNames::maxDeviceHeight
-        || mediaFeature == MediaFeatureNames::minDeviceHeight
-        || mediaFeature == MediaFeatureNames::deviceWidth
-        || mediaFeature == MediaFeatureNames::maxDeviceWidth
-        || mediaFeature == MediaFeatureNames::minDeviceWidth;
-}
-
-static inline bool isFeatureValidWithDensity(const AtomicString& mediaFeature, const CSSParserValue& value)
-{
-    if (!CSSPrimitiveValue::isResolution(static_cast<CSSPrimitiveValue::UnitTypes>(value.unit)) || value.fValue <= 0)
-        return false;
-
-    return mediaFeature == MediaFeatureNames::resolution
-        || mediaFeature == MediaFeatureNames::maxResolution
-        || mediaFeature == MediaFeatureNames::minResolution;
-}
-
-static inline bool isFeatureValidWithNonNegativeInteger(const AtomicString& mediaFeature, const CSSParserValue& value)
-{
-    if (!value.isInt || value.fValue < 0)
-        return false;
-
-    return mediaFeature == MediaFeatureNames::color
-        || mediaFeature == MediaFeatureNames::maxColor
-        || mediaFeature == MediaFeatureNames::minColor
-        || mediaFeature == MediaFeatureNames::colorIndex
-        || mediaFeature == MediaFeatureNames::maxColorIndex
-        || mediaFeature == MediaFeatureNames::minColorIndex
-        || mediaFeature == MediaFeatureNames::minMonochrome
-        || mediaFeature == MediaFeatureNames::maxMonochrome;
-}
-
-static inline bool isFeatureValidWithNonNegativeNumber(const AtomicString& mediaFeature, const CSSParserValue& value)
-{
-    if (value.unit != CSSPrimitiveValue::CSS_NUMBER || value.fValue < 0)
-        return false;
-
-    return mediaFeature == MediaFeatureNames::transform2d
-        || mediaFeature == MediaFeatureNames::transform3d
-        || mediaFeature == MediaFeatureNames::transition
-        || mediaFeature == MediaFeatureNames::animation
-        || mediaFeature == MediaFeatureNames::devicePixelRatio
-        || mediaFeature == MediaFeatureNames::maxDevicePixelRatio
-        || mediaFeature == MediaFeatureNames::minDevicePixelRatio;
-}
-
-static inline bool isFeatureValidWithZeroOrOne(const AtomicString& mediaFeature, const CSSParserValue& value)
-{
-    if (!value.isInt || !(value.fValue == 1 || !value.fValue))
-        return false;
-
-    return mediaFeature == MediaFeatureNames::grid;
-}
-
 static inline bool isAspectRatioFeature(const AtomicString& mediaFeature)
 {
     return mediaFeature == MediaFeatureNames::aspectRatio
@@ -238,56 +164,6 @@ static inline bool isFeatureValidWithoutValue(const AtomicString& mediaFeature)
         || mediaFeature == MediaFeatureNames::videoPlayableInline;
 }
 
-static inline bool isFeatureValidWithNumberWithUnit(const AtomicString& mediaFeature, const CSSParserValue& value)
-{
-    return isFeatureValidWithDensity(mediaFeature, value) || isFeatureValidWithNonNegativeLengthOrNumber(mediaFeature, value);
-}
-
-static inline bool isFeatureValidWithNumber(const AtomicString& mediaFeature, const CSSParserValue& value)
-{
-    return isFeatureValidWithNonNegativeInteger(mediaFeature, value) || isFeatureValidWithNonNegativeNumber(mediaFeature, value) || isFeatureValidWithZeroOrOne(mediaFeature, value);
-}
-
-static inline bool isSlash(CSSParserValue& value)
-{
-    return value.unit == CSSParserValue::Operator && value.iValue == '/';
-}
-
-static inline bool isPositiveIntegerValue(CSSParserValue& value)
-{
-    return value.unit == CSSPrimitiveValue::CSS_NUMBER && value.fValue > 0 && value.isInt;
-}
-
-MediaQueryExpression::MediaQueryExpression(const AtomicString& mediaFeature, CSSParserValueList* valueList)
-    : m_mediaFeature(mediaFeature)
-{
-    if (!valueList) {
-        if (isFeatureValidWithoutValue(mediaFeature))
-            m_isValid = true;
-    } else if (valueList->size() == 1) {
-        auto& value = *valueList->valueAt(0);
-        if (isFeatureValidWithIdentifier(mediaFeature, value.id)) {
-            m_value = CSSPrimitiveValue::createIdentifier(value.id);
-            m_isValid = true;
-        } else if (isFeatureValidWithNumberWithUnit(mediaFeature, value) || isFeatureValidWithNonNegativeLengthOrNumber(mediaFeature, value)) {
-            m_value = CSSPrimitiveValue::create(value.fValue, (CSSPrimitiveValue::UnitTypes) value.unit);
-            m_isValid = true;
-        } else if (isFeatureValidWithNumber(mediaFeature, value)) {
-            // FIXME: Can we merge this with the case above?
-            m_value = CSSPrimitiveValue::create(value.fValue, CSSPrimitiveValue::CSS_NUMBER);
-            m_isValid = true;
-        }
-    } else if (valueList->size() == 3 && isAspectRatioFeature(mediaFeature)) {
-        auto& numerator = *valueList->valueAt(0);
-        auto& slash = *valueList->valueAt(1);
-        auto& denominator = *valueList->valueAt(2);
-        if (isPositiveIntegerValue(numerator) && isSlash(slash) && isPositiveIntegerValue(denominator)) {
-            m_value = CSSAspectRatioValue::create(numerator.fValue, denominator.fValue);
-            m_isValid = true;
-        }
-    }
-}
-
 MediaQueryExpression::MediaQueryExpression(const String& feature, const Vector<CSSParserToken, 4>& tokenList)
     : m_mediaFeature(feature.convertToASCIILowercase())
     , m_isValid(false)
index 847e05c..2251e9f 100644 (file)
 
 namespace WebCore {
 
-class CSSParserValueList;
-
 // FIXME: Rename the file to match this class's name.
 class MediaQueryExpression {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    explicit MediaQueryExpression(const AtomicString& mediaFeature = emptyAtom, CSSParserValueList* values = nullptr);
     explicit MediaQueryExpression(const String& mediaFeature, const Vector<CSSParserToken, 4>& tokenList);
 
     const AtomicString& mediaFeature() const;
index 0e20ab4..96ae74f 100644 (file)
@@ -23,7 +23,7 @@
 #include "PropertySetCSSStyleDeclaration.h"
 
 #include "CSSCustomPropertyValue.h"
-#include "CSSParser.h"
+#include "CSSPropertyParser.h"
 #include "CSSRule.h"
 #include "CSSStyleSheet.h"
 #include "CustomElementReactionQueue.h"
@@ -167,7 +167,7 @@ ExceptionOr<void> PropertySetCSSStyleDeclaration::setCssText(const String& text)
     if (!willMutate())
         return { };
 
-    bool changed = m_propertySet->parseDeclaration(text, cssParserContext(), contextStyleSheet());
+    bool changed = m_propertySet->parseDeclaration(text, cssParserContext());
 
     didMutate(changed ? PropertyChanged : NoChanges);
 
@@ -247,7 +247,7 @@ ExceptionOr<void> PropertySetCSSStyleDeclaration::setProperty(const String& prop
 
     bool changed;
     if (propertyID == CSSPropertyCustom)
-        changed = m_propertySet->setCustomProperty(propertyName, value, important, cssParserContext(), contextStyleSheet());
+        changed = m_propertySet->setCustomProperty(propertyName, value, important, cssParserContext());
     else
         changed = m_propertySet->setProperty(propertyID, value, important, cssParserContext(), contextStyleSheet());
 
index 0d3b4fe..7dc1b79 100644 (file)
 
 namespace WebCore {
 
-struct CSSParserString;
-
 struct PseudoClassOrCompatibilityPseudoElement {
     CSSSelector::PseudoClassType pseudoClass;
     CSSSelector::PseudoElementType compatibilityPseudoElement;
 };
 
-PseudoClassOrCompatibilityPseudoElement parsePseudoClassAndCompatibilityElementString(const CSSParserString& pseudoTypeString);
 PseudoClassOrCompatibilityPseudoElement parsePseudoClassAndCompatibilityElementString(const StringView& pseudoTypeString);
 CSSSelector::PseudoElementType parsePseudoElementString(const StringImpl& pseudoTypeString);
 
index a7e05af..ca0e9b3 100644 (file)
@@ -30,7 +30,6 @@
 #include "CSSValueKeywords.h"
 #include "CSSValueList.h"
 #include "CSSValuePool.h"
-#include "CSSVariableDependentValue.h"
 #include "Document.h"
 #include "PropertySetCSSStyleDeclaration.h"
 #include "StylePropertyShorthand.h"
@@ -132,8 +131,6 @@ String StyleProperties::getPropertyValue(CSSPropertyID propertyID) const
         RefPtr<CSSValue> value = getPropertyCSSValueInternal(shorthand.properties()[0]);
         if (!value)
             return String();
-        if (value->isVariableDependentValue())
-            return value->cssText();
         if (value->isPendingSubstitutionValue())
             return downcast<CSSPendingSubstitutionValue>(*value).shorthandValue()->cssText();
     }
@@ -608,14 +605,7 @@ String StyleProperties::borderPropertyValue(CommonValueMode valueMode) const
 
 RefPtr<CSSValue> StyleProperties::getPropertyCSSValue(CSSPropertyID propertyID) const
 {
-    RefPtr<CSSValue> value = getPropertyCSSValueInternal(propertyID);
-    if (value && value->isVariableDependentValue()) {
-        auto& dependentValue = downcast<CSSVariableDependentValue>(*value);
-        if (dependentValue.propertyID() != propertyID)
-            return CSSCustomPropertyValue::createInvalid(); // Have to return special "pending-substitution" value.
-    }
-
-    return value;
+    return getPropertyCSSValueInternal(propertyID);
 }
 
 RefPtr<CSSValue> StyleProperties::getPropertyCSSValueInternal(CSSPropertyID propertyID) const
@@ -749,7 +739,7 @@ bool MutableStyleProperties::setProperty(CSSPropertyID propertyID, const String&
     return setProperty(propertyID, value, important, parserContext);
 }
 
-bool MutableStyleProperties::setCustomProperty(const String& propertyName, const String& value, bool important, CSSParserContext parserContext, StyleSheetContents* contextStyleSheet)
+bool MutableStyleProperties::setCustomProperty(const String& propertyName, const String& value, bool important, CSSParserContext parserContext)
 {
     // Setting the value to an empty string just removes the property in both IE and Gecko.
     // Setting it to null seems to produce less consistent results, but we treat it just the same.
@@ -759,7 +749,7 @@ bool MutableStyleProperties::setCustomProperty(const String& propertyName, const
     parserContext.mode = cssParserMode();
     // When replacing an existing property value, this moves the property to the end of the list.
     // Firefox preserves the position, and MSIE moves the property to the beginning.
-    return CSSParser::parseCustomPropertyValue(*this, propertyName, value, important, parserContext, contextStyleSheet) == CSSParser::ParseResult::Changed;
+    return CSSParser::parseCustomPropertyValue(*this, propertyName, value, important, parserContext) == CSSParser::ParseResult::Changed;
 }
 
 void MutableStyleProperties::setProperty(CSSPropertyID propertyID, RefPtr<CSSValue>&& value, bool important)
@@ -811,7 +801,7 @@ bool MutableStyleProperties::setProperty(CSSPropertyID propertyID, CSSPropertyID
     return setProperty(CSSProperty(propertyID, CSSValuePool::singleton().createIdentifierValue(identifier), important));
 }
 
-bool MutableStyleProperties::parseDeclaration(const String& styleDeclaration, CSSParserContext context, StyleSheetContents* contextStyleSheet)
+bool MutableStyleProperties::parseDeclaration(const String& styleDeclaration, CSSParserContext context)
 {
     auto oldProperties = WTFMove(m_propertyVector);
     m_propertyVector.clear();
@@ -819,7 +809,7 @@ bool MutableStyleProperties::parseDeclaration(const String& styleDeclaration, CS
     context.mode = cssParserMode();
 
     CSSParser parser(context);
-    parser.parseDeclaration(*this, styleDeclaration, 0, contextStyleSheet);
+    parser.parseDeclaration(*this, styleDeclaration);
 
     // We could do better. Just changing property order does not require style invalidation.
     return oldProperties != m_propertyVector;
@@ -868,11 +858,7 @@ String StyleProperties::asText() const
         CSSPropertyID borderFallbackShorthandProperty = CSSPropertyInvalid;
         String value;
         
-        if (property.value() && property.value()->isVariableDependentValue()) {
-            auto& dependentValue = downcast<CSSVariableDependentValue>(*property.value());
-            if (dependentValue.propertyID() != propertyID)
-                shorthandPropertyID = dependentValue.propertyID();
-        } else if (property.value() && property.value()->isPendingSubstitutionValue()) {
+        if (property.value() && property.value()->isPendingSubstitutionValue()) {
             auto& substitutionValue = downcast<CSSPendingSubstitutionValue>(*property.value());
             shorthandPropertyID = substitutionValue.shorthandPropertyId();
             value = substitutionValue.shorthandValue()->cssText();
index 95066ba..0668c9c 100644 (file)
@@ -215,7 +215,7 @@ public:
     void mergeAndOverrideOnConflict(const StyleProperties&);
 
     void clear();
-    bool parseDeclaration(const String& styleDeclaration, CSSParserContext, StyleSheetContents* = nullptr);
+    bool parseDeclaration(const String& styleDeclaration, CSSParserContext);
 
     WEBCORE_EXPORT CSSStyleDeclaration* ensureCSSStyleDeclaration();
     CSSStyleDeclaration* ensureInlineCSSStyleDeclaration(StyledElement* parentElement);
@@ -226,7 +226,7 @@ public:
     Vector<CSSProperty, 4> m_propertyVector;
 
     // Methods for querying and altering CSS custom properties.
-    bool setCustomProperty(const String& propertyName, const String& value, bool important, CSSParserContext, StyleSheetContents* = nullptr);
+    bool setCustomProperty(const String& propertyName, const String& value, bool important, CSSParserContext);
     bool removeCustomProperty(const String& propertyName, String* returnText = nullptr);
 
 private:
index b8955a9..cc04c88 100644 (file)
@@ -41,6 +41,7 @@
 #include "CSSFontSelector.h"
 #include "CSSFontValue.h"
 #include "CSSFunctionValue.h"
+#include "CSSGradientValue.h"
 #include "CSSImageSetValue.h"
 #include "CSSInheritedValue.h"
 #include "CSSInitialValue.h"
@@ -61,7 +62,6 @@
 #include "CSSTimingFunctionValue.h"
 #include "CSSValueList.h"
 #include "CSSValuePool.h"
-#include "CSSVariableDependentValue.h"
 #include "CachedImage.h"
 #include "CachedResourceLoader.h"
 #include "CachedSVGDocument.h"
@@ -1609,13 +1609,8 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value, SelectorChe
     CSSValueID customPropertyValueID = CSSValueInvalid;
     
     if (id == CSSPropertyCustom) {
-        // FIXME-NEWPARSER: Can clean this up once old parser is gone and remove
-        // the deprecatedValue call and the valueToCheckForInheritInitial variable.
         customPropertyValue = &downcast<CSSCustomPropertyValue>(*valueToApply);
-        valueToCheckForInheritInitial = customPropertyValue->deprecatedValue().get();
         customPropertyValueID = customPropertyValue->valueID();
-        if (customPropertyValueID != CSSValueInvalid)
-            valueToCheckForInheritInitial = valueToApply.get();
     }
 
     bool isInherit = state.parentStyle() ? valueToCheckForInheritInitial->isInheritedValue() || customPropertyValueID == CSSValueInherit : false;
index bf1a59c..ed113a6 100644 (file)
@@ -56,7 +56,6 @@ class CSSPrimitiveValue;
 class CSSProperty;
 class CSSStyleSheet;
 class CSSValue;
-class CSSVariableDependentValue;
 class ContainerNode;
 class Document;
 class Element;
index 45493b5..f6f22d1 100644 (file)
@@ -27,6 +27,7 @@
 #include "CSSKeyframeRule.h"
 #include "CSSKeyframesRule.h"
 #include "CSSMediaRule.h"
+#include "CSSNamespaceRule.h"
 #include "CSSPageRule.h"
 #include "CSSStyleRule.h"
 #include "CSSSupportsRule.h"
@@ -184,9 +185,11 @@ RefPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet, CS
         rule = WebKitCSSViewportRule::create(downcast<StyleRuleViewport>(self), parentSheet);
         break;
 #endif
+    case Namespace:
+        rule = CSSNamespaceRule::create(downcast<StyleRuleNamespace>(self), parentSheet);
+        break;
     case Unknown:
     case Charset:
-    case Namespace: // FIXME: Add support for CSSNamespaceRule.
     case Keyframe:
 #if !ENABLE(CSS_REGIONS)
     case Region:
index ca00d3c..941c8b7 100644 (file)
@@ -330,7 +330,7 @@ void StyleSheetContents::parseAuthorStyleSheet(const CachedCSSStyleSheet* cached
     }
 
     CSSParser p(parserContext());
-    p.parseSheet(this, sheetText, TextPosition(), nullptr, true);
+    p.parseSheet(this, sheetText);
 
     if (m_parserContext.needsSiteSpecificQuirks && isStrictParserMode(m_parserContext.mode)) {
         // Work around <https://bugs.webkit.org/show_bug.cgi?id=28350>.
@@ -345,13 +345,8 @@ void StyleSheetContents::parseAuthorStyleSheet(const CachedCSSStyleSheet* cached
 
 bool StyleSheetContents::parseString(const String& sheetText)
 {
-    return parseStringAtPosition(sheetText, TextPosition(), false);
-}
-
-bool StyleSheetContents::parseStringAtPosition(const String& sheetText, const TextPosition& textPosition, bool createdByParser)
-{
     CSSParser p(parserContext());
-    p.parseSheet(this, sheetText, textPosition, nullptr, createdByParser);
+    p.parseSheet(this, sheetText);
     return true;
 }
 
@@ -426,7 +421,7 @@ Document* StyleSheetContents::singleOwnerDocument() const
 
 URL StyleSheetContents::completeURL(const String& url) const
 {
-    return CSSParser::completeURL(m_parserContext, url);
+    return m_parserContext.completeURL(url);
 }
 
 static bool traverseSubresourcesInRules(const Vector<RefPtr<StyleRuleBase>>& rules, const std::function<bool (const CachedResource&)>& handler)
index d791c8e..4f424c9 100644 (file)
@@ -66,7 +66,6 @@ public:
 
     void parseAuthorStyleSheet(const CachedCSSStyleSheet*, const SecurityOrigin*);
     WEBCORE_EXPORT bool parseString(const String&);
-    bool parseStringAtPosition(const String&, const TextPosition&, bool createdByParser);
 
     bool isCacheable() const;
 
index e38aafc..e40072d 100644 (file)
@@ -27,6 +27,7 @@
 #include "WebKitCSSMatrix.h"
 
 #include "CSSParser.h"
+#include "CSSPrimitiveValue.h"
 #include "CSSPropertyNames.h"
 #include "CSSToLengthConversionData.h"
 #include "CSSValueKeywords.h"
index d6fe87a..6f37bdb 100644 (file)
@@ -185,19 +185,6 @@ static inline const SelectorPseudoClassOrCompatibilityPseudoElementEntry* parseP
 """ % longest_keyword)
 
 output_file.write("""
-PseudoClassOrCompatibilityPseudoElement parsePseudoClassAndCompatibilityElementString(const CSSParserString& pseudoTypeString)
-{
-    const SelectorPseudoClassOrCompatibilityPseudoElementEntry* entry;
-    if (pseudoTypeString.is8Bit())
-        entry = parsePseudoClassAndCompatibilityElementString(pseudoTypeString.characters8(), pseudoTypeString.length());
-    else
-        entry = parsePseudoClassAndCompatibilityElementString(pseudoTypeString.characters16(), pseudoTypeString.length());
-
-    if (entry)
-        return entry->pseudoTypes;
-    return { CSSSelector::PseudoClassUnknown, CSSSelector::PseudoElementUnknown };
-}
-
 PseudoClassOrCompatibilityPseudoElement parsePseudoClassAndCompatibilityElementString(const StringView& pseudoTypeString)
 {
     const SelectorPseudoClassOrCompatibilityPseudoElementEntry* entry;
index a9d63c3..73f0cde 100644 (file)
 #include "config.h"
 #include "CSSParser.h"
 
-#include "CSSAnimationTriggerScrollValue.h"
-#include "CSSAspectRatioValue.h"
-#include "CSSBasicShapes.h"
-#include "CSSBorderImage.h"
-#include "CSSBorderImageSliceValue.h"
-#include "CSSCanvasValue.h"
-#include "CSSContentDistributionValue.h"
-#include "CSSCrossfadeValue.h"
-#include "CSSCursorImageValue.h"
-#include "CSSCustomPropertyValue.h"
-#include "CSSFilterImageValue.h"
-#include "CSSFontFaceRule.h"
-#include "CSSFontFaceSrcValue.h"
-#include "CSSFontFeatureValue.h"
-#include "CSSFontValue.h"
-#include "CSSFontVariationValue.h"
-#include "CSSFunctionValue.h"
-#include "CSSGradientValue.h"
-#include "CSSImageSetValue.h"
-#include "CSSImageValue.h"
-#include "CSSInheritedValue.h"
-#include "CSSInitialValue.h"
 #include "CSSKeyframeRule.h"
-#include "CSSKeyframesRule.h"
-#include "CSSLineBoxContainValue.h"
-#include "CSSMediaRule.h"
-#include "CSSNamedImageValue.h"
-#include "CSSPageRule.h"
 #include "CSSParserFastPaths.h"
 #include "CSSParserImpl.h"
-#include "CSSParserObserver.h"
 #include "CSSPendingSubstitutionValue.h"
-#include "CSSPrimitiveValue.h"
-#include "CSSPrimitiveValueMappings.h"
 #include "CSSPropertyParser.h"
-#include "CSSPropertySourceData.h"
-#include "CSSReflectValue.h"
-#include "CSSRevertValue.h"
-#include "CSSSelector.h"
 #include "CSSSelectorParser.h"
-#include "CSSShadowValue.h"
-#include "CSSStyleSheet.h"
 #include "CSSSupportsParser.h"
-#include "CSSTimingFunctionValue.h"
 #include "CSSTokenizer.h"
-#include "CSSUnicodeRangeValue.h"
-#include "CSSUnsetValue.h"
-#include "CSSValueKeywords.h"
-#include "CSSValueList.h"
-#include "CSSValuePool.h"
-#include "CSSVariableDependentValue.h"
+#include "CSSVariableData.h"
 #include "CSSVariableReferenceValue.h"
-#include "Counter.h"
 #include "Document.h"
-#include "FloatConversion.h"
-#include "GridArea.h"
-#include "HTMLOptGroupElement.h"
-#include "HTMLParserIdioms.h"
-#include "HashTools.h"
-#include "MediaList.h"
-#include "MediaQueryExp.h"
+#include "Element.h"
 #include "Page.h"
-#include "PageConsoleClient.h"
-#include "Pair.h"
-#include "Rect.h"
 #include "RenderTheme.h"
 #include "RuntimeEnabledFeatures.h"
-#include "SVGParserUtilities.h"
-#include "SVGPathByteStream.h"
-#include "SVGPathUtilities.h"
-#include "SelectorChecker.h"
-#include "SelectorCheckerTestFunctions.h"
 #include "Settings.h"
-#include "StyleProperties.h"
-#include "StylePropertyShorthand.h"
-#include "StylePropertyShorthandFunctions.h"
+#include "StyleColor.h"
 #include "StyleRule.h"
-#include "StyleRuleImport.h"
 #include "StyleSheetContents.h"
-#include "TextEncoding.h"
-#include "WebKitCSSRegionRule.h"
-#include "WebKitCSSTransformValue.h"
-#include <bitset>
-#include <limits.h>
-#include <wtf/HexNumber.h>
 #include <wtf/NeverDestroyed.h>
-#include <wtf/SetForScope.h>
-#include <wtf/StdLibExtras.h>
-#include <wtf/dtoa.h>
-#include <wtf/text/StringBuffer.h>
 #include <wtf/text/StringBuilder.h>
-#include <wtf/text/StringImpl.h>
-
-#if ENABLE(CSS_GRID_LAYOUT)
-#include "CSSGridAutoRepeatValue.h"
-#include "CSSGridLineNamesValue.h"
-#include "CSSGridTemplateAreasValue.h"
-#endif
-
-#if ENABLE(CSS_SCROLL_SNAP)
-#include "LengthRepeat.h"
-#endif
-
-#if ENABLE(DASHBOARD_SUPPORT)
-#include "DashboardRegion.h"
-#endif
-
-#define YYDEBUG 0
-
-#if YYDEBUG > 0
-extern int cssyydebug;
-#endif
-
-extern int cssyyparse(WebCore::CSSParser*);
 
 using namespace WTF;
 
 namespace WebCore {
 
-const unsigned CSSParser::invalidParsedPropertiesCount = std::numeric_limits<unsigned>::max();
-static const double MAX_SCALE = 1000000;
-
-template<unsigned length> bool equalLettersIgnoringASCIICase(const CSSParserValue& value, const char (&lowercaseLetters)[length])
-{
-    ASSERT(value.unit == CSSPrimitiveValue::CSS_IDENT || value.unit == CSSPrimitiveValue::CSS_STRING);
-    return equalLettersIgnoringASCIICase(value.string, lowercaseLetters);
-}
-
-static bool hasPrefix(const char* string, unsigned length, const char* prefix)
-{
-    for (unsigned i = 0; i < length; ++i) {
-        if (!prefix[i])
-            return true;
-        if (string[i] != prefix[i])
-            return false;
-    }
-    return false;
-}
-
-template<typename... Args>
-static Ref<CSSPrimitiveValue> createPrimitiveValuePair(Args&&... args)
-{
-    return CSSValuePool::singleton().createValue(Pair::create(std::forward<Args>(args)...));
-}
-
-class AnimationParseContext {
-public:
-    AnimationParseContext() = default;
-
-    void commitFirstAnimation()
-    {
-        m_firstAnimationCommitted = true;
-    }
-
-    bool hasCommittedFirstAnimation() const
-    {
-        return m_firstAnimationCommitted;
-    }
-
-    void commitAnimationPropertyKeyword()
-    {
-        m_animationPropertyKeywordAllowed = false;
-    }
-
-    bool animationPropertyKeywordAllowed() const
-    {
-        return m_animationPropertyKeywordAllowed;
-    }
-
-    bool hasSeenAnimationPropertyKeyword() const
-    {
-        return m_hasSeenAnimationPropertyKeyword;
-    }
-
-    void sawAnimationPropertyKeyword()
-    {
-        m_hasSeenAnimationPropertyKeyword = true;
-    }
-
-private:
-    bool m_animationPropertyKeywordAllowed { true };
-    bool m_firstAnimationCommitted { false };
-    bool m_hasSeenAnimationPropertyKeyword { false };
-};
-
 const CSSParserContext& strictCSSParserContext()
 {
     static NeverDestroyed<CSSParserContext> strictContext(HTMLStandardMode);
@@ -251,7 +92,6 @@ CSSParserContext::CSSParserContext(Document& document, const URL& baseURL, const
         textAutosizingEnabled = settings->textAutosizingEnabled();
 #endif
         springTimingFunctionEnabled = settings->springTimingFunctionEnabled();
-        useNewParser = settings->newCSSParserEnabled();
 
 #if ENABLE(VARIATION_FONTS)
         variationFontsEnabled = settings->variationFontsEnabled();
@@ -287,112 +127,15 @@ bool operator==(const CSSParserContext& a, const CSSParserContext& b)
 CSSParser::CSSParser(const CSSParserContext& context)
     : m_context(context)
 {
-#if YYDEBUG > 0
-    cssyydebug = 1;
-#endif
 }
 
 CSSParser::~CSSParser()
 {
 }
 
-template<typename CharacterType> ALWAYS_INLINE static void convertToASCIILowercaseInPlace(CharacterType* characters, unsigned length)
-{
-    for (unsigned i = 0; i < length; ++i)
-        characters[i] = toASCIILower(characters[i]);
-}
-
-void CSSParserString::convertToASCIILowercaseInPlace()
-{
-    if (is8Bit())
-        WebCore::convertToASCIILowercaseInPlace(characters8(), length());
-    else
-        WebCore::convertToASCIILowercaseInPlace(characters16(), length());
-}
-
-void CSSParser::setupParser(const char* prefix, unsigned prefixLength, StringView string, const char* suffix, unsigned suffixLength)
-{
-    ASSERT(!m_context.useNewParser);
-
-    m_parsedTextPrefixLength = prefixLength;
-    unsigned stringLength = string.length();
-    unsigned length = stringLength + m_parsedTextPrefixLength + suffixLength + 1;
-    m_length = length;
-
-    if (!stringLength || string.is8Bit()) {
-        m_dataStart8 = std::make_unique<LChar[]>(length);
-        for (unsigned i = 0; i < m_parsedTextPrefixLength; ++i)
-            m_dataStart8[i] = prefix[i];
-
-        if (stringLength)
-            memcpy(m_dataStart8.get() + m_parsedTextPrefixLength, string.characters8(), stringLength * sizeof(LChar));
-
-        unsigned start = m_parsedTextPrefixLength + stringLength;
-        unsigned end = start + suffixLength;
-        for (unsigned i = start; i < end; i++)
-            m_dataStart8[i] = suffix[i - start];
-
-        m_dataStart8[length - 1] = '\0';
-
-        m_is8BitSource = true;
-        m_currentCharacter8 = m_dataStart8.get();
-        m_currentCharacter16 = nullptr;
-        setTokenStart<LChar>(m_currentCharacter8);
-        m_lexFunc = &CSSParser::realLex<LChar>;
-        return;
-    }
-
-    m_dataStart16 = std::make_unique<UChar[]>(length);
-    for (unsigned i = 0; i < m_parsedTextPrefixLength; ++i)
-        m_dataStart16[i] = prefix[i];
-
-    ASSERT(stringLength);
-    memcpy(m_dataStart16.get() + m_parsedTextPrefixLength, string.characters16(), stringLength * sizeof(UChar));
-
-    unsigned start = m_parsedTextPrefixLength + stringLength;
-    unsigned end = start + suffixLength;
-    for (unsigned i = start; i < end; i++)
-        m_dataStart16[i] = suffix[i - start];
-
-    m_dataStart16[length - 1] = '\0';
-
-    m_is8BitSource = false;
-    m_currentCharacter8 = nullptr;
-    m_currentCharacter16 = m_dataStart16.get();
-    setTokenStart<UChar>(m_currentCharacter16);
-    m_lexFunc = &CSSParser::realLex<UChar>;
-}
-
-// FIXME-NEWPARSER: This API needs to change. It's polluted with Inspector stuff, and that should
-// use the new obverver model instead.
-void CSSParser::parseSheet(StyleSheetContents* sheet, const String& string, const TextPosition& textPosition, RuleSourceDataList* ruleSourceDataResult, bool logErrors)
+void CSSParser::parseSheet(StyleSheetContents* sheet, const String& string)
 {
-    // FIXME-NEWPARSER: It's easier for testing to let the entire UA sheet parse with the old
-    // parser. That way we can still have the default styles look correct while we add in support for
-    // properties.
-    if (m_context.useNewParser)
-        return CSSParserImpl::parseStyleSheet(string, m_context, sheet);
-    
-    setStyleSheet(sheet);
-    m_defaultNamespace = starAtom; // Reset the default namespace.
-    if (ruleSourceDataResult)
-        m_currentRuleDataStack = std::make_unique<RuleSourceDataList>();
-    m_ruleSourceDataResult = ruleSourceDataResult;
-
-    m_logErrors = logErrors && sheet->singleOwnerDocument() && !sheet->baseURL().isEmpty() && sheet->singleOwnerDocument()->page();
-    m_ignoreErrorsInDeclaration = false;
-    m_sheetStartLineNumber = textPosition.m_line.zeroBasedInt();
-    m_sheetStartColumnNumber = textPosition.m_column.zeroBasedInt();
-    m_lineNumber = m_sheetStartLineNumber;
-    m_columnOffsetForLine = 0;
-    setupParser("", string, "");
-    cssyyparse(this);
-    sheet->shrinkToFit();
-    m_currentRuleDataStack.reset();
-    m_ruleSourceDataResult = nullptr;
-    m_rule = nullptr;
-    m_ignoreErrorsInDeclaration = false;
-    m_logErrors = false;
+    return CSSParserImpl::parseStyleSheet(string, m_context, sheet);
 }
 
 void CSSParser::parseSheetForInspector(const CSSParserContext& context, StyleSheetContents* sheet, const String& string, CSSParserObserver& observer)
@@ -400,1143 +143,108 @@ void CSSParser::parseSheetForInspector(const CSSParserContext& context, StyleShe
     return CSSParserImpl::parseStyleSheetForInspector(string, context, sheet, observer);
 }
 
-RefPtr<StyleRuleBase> CSSParser::parseRule(StyleSheetContents* sheet, const String& string)
+RefPtr<StyleRuleBase> CSSParser::parseRule(const CSSParserContext& context, StyleSheetContents* sheet, const String& string)
 {
-    if (m_context.useNewParser)
-        return CSSParserImpl::parseRule(string, m_context, sheet, CSSParserImpl::AllowImportRules);
-    setStyleSheet(sheet);
-    m_allowNamespaceDeclarations = false;
-    setupParser("@-webkit-rule{", string, "} ");
-    cssyyparse(this);
-    return m_rule;
+    return CSSParserImpl::parseRule(string, context, sheet, CSSParserImpl::AllowImportRules);
 }
 
-RefPtr<StyleKeyframe> CSSParser::parseKeyframeRule(StyleSheetContents* sheet, const String& string)
+RefPtr<StyleKeyframe> CSSParser::parseKeyframeRule(const String& string)
 {
-    if (m_context.useNewParser) {
-        RefPtr<StyleRuleBase> keyframe = CSSParserImpl::parseRule(string, m_context, nullptr, CSSParserImpl::KeyframeRules);
-        return downcast<StyleKeyframe>(keyframe.get());
-    }
-
-    setStyleSheet(sheet);
-    setupParser("@-webkit-keyframe-rule{ ", string, "} ");
-    cssyyparse(this);
-    return m_keyframe;
+    RefPtr<StyleRuleBase> keyframe = CSSParserImpl::parseRule(string, m_context, nullptr, CSSParserImpl::KeyframeRules);
+    return downcast<StyleKeyframe>(keyframe.get());
 }
 
 bool CSSParser::parseSupportsCondition(const String& condition)
 {
-    if (m_context.useNewParser) {
-        CSSTokenizer tokenizer(condition);
-        CSSParserTokenRange range = tokenizer.tokenRange();
-        CSSParserImpl parser(m_context);
-        return CSSSupportsParser::supportsCondition(range, parser) == CSSSupportsParser::Supported;
-    }
-
-    m_supportsCondition = false;
-    // can't use { because tokenizer state switches from supports to initial state when it sees { token.
-    // instead insert one " " (which is WHITESPACE in CSSGrammar.y)
-    setupParser("@-webkit-supports-condition ", condition, "} ");
-    cssyyparse(this);
-    return m_supportsCondition;
-}
-
-static inline bool isColorPropertyID(CSSPropertyID propertyId)
-{
-    switch (propertyId) {
-    case CSSPropertyColor:
-    case CSSPropertyBackgroundColor:
-    case CSSPropertyBorderBottomColor:
-    case CSSPropertyBorderLeftColor:
-    case CSSPropertyBorderRightColor:
-    case CSSPropertyBorderTopColor:
-    case CSSPropertyOutlineColor:
-    case CSSPropertyTextLineThroughColor:
-    case CSSPropertyTextOverlineColor:
-    case CSSPropertyTextUnderlineColor:
-    case CSSPropertyWebkitBorderAfterColor:
-    case CSSPropertyWebkitBorderBeforeColor:
-    case CSSPropertyWebkitBorderEndColor:
-    case CSSPropertyWebkitBorderStartColor:
-    case CSSPropertyColumnRuleColor:
-    case CSSPropertyWebkitTextDecorationColor:
-    case CSSPropertyWebkitTextEmphasisColor:
-    case CSSPropertyWebkitTextFillColor:
-    case CSSPropertyWebkitTextStrokeColor:
-        return true;
-    default:
-        return false;
-    }
-}
-
-bool CSSParser::isValidSystemColorValue(CSSValueID valueID)
-{
-    return valueID >= CSSValueAqua && valueID <= CSSValueAppleSystemYellow;
-}
-
-static bool validPrimitiveValueColor(CSSValueID valueID, bool strict = false)
-{
-    return (valueID == CSSValueWebkitText || valueID == CSSValueCurrentcolor || valueID == CSSValueMenu
-        || CSSParser::isValidSystemColorValue(valueID) || valueID == CSSValueAlpha
-        || (valueID >= CSSValueWebkitFocusRingColor && valueID < CSSValueWebkitText && !strict));
-}
-
-static CSSParser::ParseResult parseColorValue(MutableStyleProperties& declaration, CSSPropertyID propertyId, const String& string, bool important, CSSParserMode cssParserMode)
-{
-    ASSERT(!string.isEmpty());
-    bool strict = isStrictParserMode(cssParserMode);
-    if (!isColorPropertyID(propertyId))
-        return CSSParser::ParseResult::Error;
-
-    CSSParserString cssString;
-    cssString.init(string);
-    CSSValueID valueID = cssValueKeywordID(cssString);
-    if (validPrimitiveValueColor(valueID, strict)) {
-        auto value = CSSValuePool::singleton().createIdentifierValue(valueID);
-        return declaration.addParsedProperty(CSSProperty(propertyId, WTFMove(value), important)) ? CSSParser::ParseResult::Changed : CSSParser::ParseResult::Unchanged;
-    }
-    Color color = CSSParser::fastParseColor(string, strict && string[0] != '#');
-    if (!color.isValid())
-        return CSSParser::ParseResult::Error;
-
-    auto value = CSSValuePool::singleton().createColorValue(color);
-    return declaration.addParsedProperty(CSSProperty(propertyId, WTFMove(value), important)) ? CSSParser::ParseResult::Changed : CSSParser::ParseResult::Unchanged;
-}
-
-static inline bool isSimpleLengthPropertyID(CSSPropertyID propertyId, bool& acceptsNegativeNumbers)
-{
-    switch (propertyId) {
-    case CSSPropertyFontSize:
-    case CSSPropertyHeight:
-    case CSSPropertyWidth:
-    case CSSPropertyMinHeight:
-    case CSSPropertyMinWidth:
-    case CSSPropertyPaddingBottom:
-    case CSSPropertyPaddingLeft:
-    case CSSPropertyPaddingRight:
-    case CSSPropertyPaddingTop:
-    case CSSPropertyWebkitLogicalWidth:
-    case CSSPropertyWebkitLogicalHeight:
-    case CSSPropertyWebkitMinLogicalWidth:
-    case CSSPropertyWebkitMinLogicalHeight:
-    case CSSPropertyWebkitPaddingAfter:
-    case CSSPropertyWebkitPaddingBefore:
-    case CSSPropertyWebkitPaddingEnd:
-    case CSSPropertyWebkitPaddingStart:
-#if ENABLE(CSS_GRID_LAYOUT)
-    case CSSPropertyGridColumnGap:
-    case CSSPropertyGridRowGap:
-#endif
-    case CSSPropertyShapeMargin:
-        acceptsNegativeNumbers = false;
-        return true;
-    case CSSPropertyBottom:
-    case CSSPropertyCx:
-    case CSSPropertyCy:
-    case CSSPropertyLeft:
-    case CSSPropertyMarginBottom:
-    case CSSPropertyMarginLeft:
-    case CSSPropertyMarginRight:
-    case CSSPropertyMarginTop:
-    case CSSPropertyR:
-    case CSSPropertyRx:
-    case CSSPropertyRy:
-    case CSSPropertyRight:
-    case CSSPropertyTop:
-    case CSSPropertyWebkitMarginAfter:
-    case CSSPropertyWebkitMarginBefore:
-    case CSSPropertyWebkitMarginEnd:
-    case CSSPropertyWebkitMarginStart:
-    case CSSPropertyX:
-    case CSSPropertyY:
-        acceptsNegativeNumbers = true;
-        return true;
-    default:
-        return false;
-    }
-}
-
-template <typename CharacterType>
-static inline bool parseSimpleLength(const CharacterType* characters, unsigned& length, CSSPrimitiveValue::UnitTypes& unit, double& number)
-{
-    if (length > 2 && (characters[length - 2] | 0x20) == 'p' && (characters[length - 1] | 0x20) == 'x') {
-        length -= 2;
-        unit = CSSPrimitiveValue::CSS_PX;
-    } else if (length > 1 && characters[length - 1] == '%') {
-        length -= 1;
-        unit = CSSPrimitiveValue::CSS_PERCENTAGE;
-    }
-
-    // We rely on charactersToDouble for validation as well. The function
-    // will set "ok" to "false" if the entire passed-in character range does
-    // not represent a double.
-    bool ok;
-    number = charactersToDouble(characters, length, &ok);
-    return ok;
-}
-
-static CSSParser::ParseResult parseSimpleLengthValue(MutableStyleProperties& declaration, CSSPropertyID propertyId, const String& string, bool important, CSSParserMode cssParserMode)
-{
-    ASSERT(!string.isEmpty());
-    bool acceptsNegativeNumbers;
-    if (!isSimpleLengthPropertyID(propertyId, acceptsNegativeNumbers))
-        return CSSParser::ParseResult::Error;
-
-    unsigned length = string.length();
-    double number;
-    CSSPrimitiveValue::UnitTypes unit = CSSPrimitiveValue::CSS_NUMBER;
-
-    if (string.is8Bit()) {
-        if (!parseSimpleLength(string.characters8(), length, unit, number))
-            return CSSParser::ParseResult::Error;
-    } else {
-        if (!parseSimpleLength(string.characters16(), length, unit, number))
-            return CSSParser::ParseResult::Error;
-    }
-
-    if (unit == CSSPrimitiveValue::CSS_NUMBER) {
-        if (number && isStrictParserMode(cssParserMode))
-            return CSSParser::ParseResult::Error;
-        unit = CSSPrimitiveValue::CSS_PX;
-    }
-    if (number < 0 && !acceptsNegativeNumbers)
-        return CSSParser::ParseResult::Error;
-    if (std::isinf(number))
-        return CSSParser::ParseResult::Error;
-
-    auto value = CSSValuePool::singleton().createValue(number, unit);
-    return declaration.addParsedProperty(CSSProperty(propertyId, WTFMove(value), important)) ? CSSParser::ParseResult::Changed : CSSParser::ParseResult::Unchanged;
-}
-
-static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int valueID, const CSSParserContext& parserContext, StyleSheetContents* styleSheetContents)
-{
-    if (!valueID)
-        return false;
-
-    switch (propertyId) {
-    case CSSPropertyBorderCollapse: // collapse | separate | inherit
-        if (valueID == CSSValueCollapse || valueID == CSSValueSeparate)
-            return true;
-        break;
-    case CSSPropertyBorderTopStyle: // <border-style> | inherit
-    case CSSPropertyBorderRightStyle: // Defined as: none | hidden | dotted | dashed |
-    case CSSPropertyBorderBottomStyle: // solid | double | groove | ridge | inset | outset
-    case CSSPropertyBorderLeftStyle:
-    case CSSPropertyWebkitBorderAfterStyle:
-    case CSSPropertyWebkitBorderBeforeStyle:
-    case CSSPropertyWebkitBorderEndStyle:
-    case CSSPropertyWebkitBorderStartStyle:
-    case CSSPropertyColumnRuleStyle:
-        if (valueID >= CSSValueNone && valueID <= CSSValueDouble)
-            return true;
-        break;
-    case CSSPropertyBoxSizing:
-         if (valueID == CSSValueBorderBox || valueID == CSSValueContentBox)
-             return true;
-         break;
-    case CSSPropertyCaptionSide: // top | bottom | left | right | inherit
-        if (valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueTop || valueID == CSSValueBottom)
-            return true;
-        break;
-    case CSSPropertyClear: // none | left | right | both | inherit
-        if (valueID == CSSValueNone || valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueBoth)
-            return true;
-        break;
-    case CSSPropertyDirection: // ltr | rtl | inherit
-        if (valueID == CSSValueLtr || valueID == CSSValueRtl)
-            return true;
-        break;
-    case CSSPropertyDisplay:
-        // inline | block | list-item | inline-block | table |
-        // inline-table | table-row-group | table-header-group | table-footer-group | table-row |
-        // table-column-group | table-column | table-cell | table-caption | -webkit-box | -webkit-inline-box | none | inherit
-        // flex | -webkit-flex | inline-flex | -webkit-inline-flex | grid | inline-grid | contents
-        if ((valueID >= CSSValueInline && valueID <= CSSValueContents) || valueID == CSSValueNone)
-            return true;
-#if ENABLE(CSS_GRID_LAYOUT)
-        if (parserContext.cssGridLayoutEnabled && (valueID == CSSValueGrid || valueID == CSSValueInlineGrid))
-            return true;
-#endif
-        break;
-
-    case CSSPropertyEmptyCells: // show | hide | inherit
-        if (valueID == CSSValueShow || valueID == CSSValueHide)
-            return true;
-        break;
-    case CSSPropertyFloat: // left | right | none | center (for buggy CSS, maps to none)
-        if (valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueNone || valueID == CSSValueCenter)
-            return true;
-        break;
-    case CSSPropertyFontStyle: // normal | italic | oblique | inherit
-        if (valueID == CSSValueNormal || valueID == CSSValueItalic || valueID == CSSValueOblique)
-            return true;
-        break;
-    case CSSPropertyFontStretch:
-        return false;
-    case CSSPropertyImageRendering: // auto | optimizeSpeed | optimizeQuality | -webkit-crisp-edges | -webkit-optimize-contrast | crisp-edges | pixelated
-        // optimizeSpeed and optimizeQuality are deprecated; a user agent must accept them as valid values but must treat them as having the same behavior as pixelated and auto respectively.
-        if (valueID == CSSValueAuto || valueID == CSSValueOptimizespeed || valueID == CSSValueOptimizequality
-            || valueID == CSSValueWebkitCrispEdges || valueID == CSSValueWebkitOptimizeContrast || valueID == CSSValueCrispEdges || valueID == CSSValuePixelated)
-            return true;
-        break;
-    case CSSPropertyListStylePosition: // inside | outside | inherit
-        if (valueID == CSSValueInside || valueID == CSSValueOutside)
-            return true;
-        break;
-    case CSSPropertyListStyleType:
-        // See section CSS_PROP_LIST_STYLE_TYPE of file CSSValueKeywords.in
-        // for the list of supported list-style-types.
-        if ((valueID >= CSSValueDisc && valueID <= CSSValueKatakanaIroha) || valueID == CSSValueNone)
-            return true;
-        break;
-    case CSSPropertyObjectFit:
-        if (valueID == CSSValueFill || valueID == CSSValueContain || valueID == CSSValueCover || valueID == CSSValueNone || valueID == CSSValueScaleDown)
-            return true;
-        break;
-    case CSSPropertyOutlineStyle: // (<border-style> except hidden) | auto | inherit
-        if (valueID == CSSValueAuto || valueID == CSSValueNone || (valueID >= CSSValueInset && valueID <= CSSValueDouble))
-            return true;
-        break;
-    case CSSPropertyOverflowWrap: // normal | break-word
-    case CSSPropertyWordWrap:
-        if (valueID == CSSValueNormal || valueID == CSSValueBreakWord)
-            return true;
-        break;
-#if ENABLE(TOUCH_EVENTS)
-    case CSSPropertyTouchAction: // auto | manipulation
-        if (valueID == CSSValueAuto || valueID == CSSValueManipulation)
-            return true;
-        break;
-#endif
-#if ENABLE(CSS_SCROLL_SNAP)
-    case CSSPropertyWebkitScrollSnapType: // none | mandatory | proximity
-        if (valueID == CSSValueNone || valueID == CSSValueMandatory || valueID == CSSValueProximity)
-            return true;
-        break;
-#endif
-    case CSSPropertyOverflowX: // visible | hidden | scroll | auto  | overlay | inherit
-        if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay)
-            return true;
-        break;
-    case CSSPropertyOverflowY: // visible | hidden | scroll | auto | overlay | inherit | -webkit-paged-x | -webkit-paged-y
-        if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay || valueID == CSSValueWebkitPagedX || valueID == CSSValueWebkitPagedY)
-            return true;
-        break;
-    case CSSPropertyPageBreakAfter: // auto | always | avoid | left | right | inherit
-    case CSSPropertyPageBreakBefore:
-    case CSSPropertyWebkitColumnBreakAfter:
-    case CSSPropertyWebkitColumnBreakBefore:
-        if (valueID == CSSValueAuto || valueID == CSSValueAlways || valueID == CSSValueAvoid || valueID == CSSValueLeft || valueID == CSSValueRight)
-            return true;
-        break;
-    case CSSPropertyPageBreakInside: // avoid | auto | inherit
-    case CSSPropertyWebkitColumnBreakInside:
-        if (valueID == CSSValueAuto || valueID == CSSValueAvoid)
-            return true;
-        break;
-    case CSSPropertyPointerEvents:
-        // none | visiblePainted | visibleFill | visibleStroke | visible |
-        // painted | fill | stroke | auto | all | inherit
-        if (valueID == CSSValueVisible || valueID == CSSValueNone || valueID == CSSValueAll || valueID == CSSValueAuto || (valueID >= CSSValueVisiblepainted && valueID <= CSSValueStroke))
-            return true;
-        break;
-    case CSSPropertyPosition: // static | relative | absolute | fixed | sticky | inherit
-        if (valueID == CSSValueStatic || valueID == CSSValueRelative || valueID == CSSValueAbsolute || valueID == CSSValueFixed || valueID == CSSValueWebkitSticky)
-            return true;
-        break;
-    case CSSPropertyResize: // none | both | horizontal | vertical | auto
-        if (valueID == CSSValueNone || valueID == CSSValueBoth || valueID == CSSValueHorizontal || valueID == CSSValueVertical || valueID == CSSValueAuto)
-            return true;
-        break;
-    case CSSPropertySpeak: // none | normal | spell-out | digits | literal-punctuation | no-punctuation | inherit
-        if (valueID == CSSValueNone || valueID == CSSValueNormal || valueID == CSSValueSpellOut || valueID == CSSValueDigits || valueID == CSSValueLiteralPunctuation || valueID == CSSValueNoPunctuation)
-            return true;
-        break;
-    case CSSPropertyTableLayout: // auto | fixed | inherit
-        if (valueID == CSSValueAuto || valueID == CSSValueFixed)
-            return true;
-        break;
-    case CSSPropertyTextAlign:
-        // left | right | center | justify | -webkit-left | -webkit-right | -webkit-center | -webkit-match-parent
-        // | start | end | inherit | -webkit-auto (converted to start)
-        if ((valueID >= CSSValueWebkitAuto && valueID <= CSSValueWebkitMatchParent) || valueID == CSSValueStart || valueID == CSSValueEnd)
-            return true;
-        break;
-    case CSSPropertyTextLineThroughMode:
-    case CSSPropertyTextOverlineMode:
-    case CSSPropertyTextUnderlineMode:
-        if (valueID == CSSValueContinuous || valueID == CSSValueSkipWhiteSpace)
-            return true;
-        break;
-    case CSSPropertyTextLineThroughStyle:
-    case CSSPropertyTextOverlineStyle:
-    case CSSPropertyTextUnderlineStyle:
-        if (valueID == CSSValueNone || valueID == CSSValueSolid || valueID == CSSValueDouble || valueID == CSSValueDashed || valueID == CSSValueDotDash || valueID == CSSValueDotDotDash || valueID == CSSValueWave)
-            return true;
-        break;
-    case CSSPropertyTextOverflow: // clip | ellipsis
-        if (valueID == CSSValueClip || valueID == CSSValueEllipsis)
-            return true;
-        break;
-    case CSSPropertyTextRendering: // auto | optimizeSpeed | optimizeLegibility | geometricPrecision
-        if (valueID == CSSValueAuto || valueID == CSSValueOptimizespeed || valueID == CSSValueOptimizelegibility || valueID == CSSValueGeometricprecision)
-            return true;
-        break;
-    case CSSPropertyTextTransform: // capitalize | uppercase | lowercase | none | inherit
-        if ((valueID >= CSSValueCapitalize && valueID <= CSSValueLowercase) || valueID == CSSValueNone)
-            return true;
-        break;
-    case CSSPropertyUnicodeBidi:
-        if (valueID == CSSValueNormal || valueID == CSSValueEmbed || valueID == CSSValueBidiOverride || valueID == CSSValueWebkitIsolate
-            || valueID == CSSValueWebkitIsolateOverride || valueID == CSSValueWebkitPlaintext)
-            return true;
-        break;
-    case CSSPropertyVisibility: // visible | hidden | collapse | inherit
-        if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueCollapse)
-            return true;
-        break;
-    case CSSPropertyWebkitAppearance:
-        if ((valueID >= CSSValueCheckbox && valueID <= CSSValueCapsLockIndicator) || valueID == CSSValueNone)
-            return true;
-        break;
-    case CSSPropertyWebkitBackfaceVisibility:
-        if (valueID == CSSValueVisible || valueID == CSSValueHidden)
-            return true;
-        break;
-#if ENABLE(CSS_COMPOSITING)
-    case CSSPropertyMixBlendMode:
-        if (valueID == CSSValueNormal || valueID == CSSValueMultiply || valueID == CSSValueScreen
-            || valueID == CSSValueOverlay || valueID == CSSValueDarken || valueID == CSSValueLighten ||  valueID == CSSValueColorDodge
-            || valueID == CSSValueColorBurn || valueID == CSSValueHardLight || valueID == CSSValueSoftLight || valueID == CSSValueDifference
-            || valueID == CSSValueExclusion || valueID == CSSValuePlusDarker || valueID == CSSValuePlusLighter)
-            return true;
-        break;
-    case CSSPropertyIsolation:
-        if (valueID == CSSValueAuto || valueID == CSSValueIsolate)
-            return true;
-        break;
-#endif
-    case CSSPropertyWebkitBorderFit:
-        if (valueID == CSSValueBorder || valueID == CSSValueLines)
-            return true;
-        break;
-    case CSSPropertyWebkitBoxAlign:
-        if (valueID == CSSValueStretch || valueID == CSSValueStart || valueID == CSSValueEnd || valueID == CSSValueCenter || valueID == CSSValueBaseline)
-            return true;
-        break;
-#if ENABLE(CSS_BOX_DECORATION_BREAK)
-    case CSSPropertyWebkitBoxDecorationBreak:
-         if (valueID == CSSValueClone || valueID == CSSValueSlice)
-             return true;
-         break;
-#endif
-    case CSSPropertyWebkitBoxDirection:
-        if (valueID == CSSValueNormal || valueID == CSSValueReverse)
-            return true;
-        break;
-    case CSSPropertyWebkitBoxLines:
-        if (valueID == CSSValueSingle || valueID == CSSValueMultiple)
-                return true;
-        break;
-    case CSSPropertyWebkitBoxOrient:
-        if (valueID == CSSValueHorizontal || valueID == CSSValueVertical || valueID == CSSValueInlineAxis || valueID == CSSValueBlockAxis)
-            return true;
-        break;
-    case CSSPropertyWebkitBoxPack:
-        if (valueID == CSSValueStart || valueID == CSSValueEnd || valueID == CSSValueCenter || valueID == CSSValueJustify)
-            return true;
-        break;
-#if ENABLE(CURSOR_VISIBILITY)
-    case CSSPropertyWebkitCursorVisibility:
-        if (valueID == CSSValueAuto || valueID == CSSValueAutoHide)
-            return true;
-        break;
-#endif
-    case CSSPropertyWebkitColumnAxis:
-        if (valueID == CSSValueHorizontal || valueID == CSSValueVertical || valueID == CSSValueAuto)
-            return true;
-        break;
-    case CSSPropertyColumnFill:
-        if (valueID == CSSValueAuto || valueID == CSSValueBalance)
-            return true;
-        break;
-    case CSSPropertyWebkitColumnProgression:
-        if (valueID == CSSValueNormal || valueID == CSSValueReverse)
-            return true;
-        break;
-    case CSSPropertyAlignContent:
-        // FIXME: Per CSS alignment, this property should accept an optional <overflow-position>. We should share this parsing code with 'justify-self'.
-        // FIXME: For now, we will do it behind the GRID_LAYOUT compile flag.
-        return valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueSpaceBetween || valueID == CSSValueSpaceAround || valueID == CSSValueStretch;
-    case CSSPropertyAlignItems:
-        // FIXME: Per CSS alignment, this property should accept the same arguments as 'justify-self' so we should share its parsing code.
-        // FIXME: For now, we will do it behind the GRID_LAYOUT compile flag.
-        if (valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueBaseline || valueID == CSSValueStretch)
-            return true;
-        break;
-    case CSSPropertyAlignSelf:
-        // FIXME: Per CSS alignment, this property should accept the same arguments as 'justify-self' so we should share its parsing code.
-        // FIXME: For now, we will do it behind the GRID_LAYOUT compile flag.
-        if (valueID == CSSValueAuto || valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueBaseline || valueID == CSSValueStretch)
-            return true;
-        break;
-    case CSSPropertyFlexDirection:
-        if (valueID == CSSValueRow || valueID == CSSValueRowReverse || valueID == CSSValueColumn || valueID == CSSValueColumnReverse)
-            return true;
-        break;
-    case CSSPropertyFlexWrap:
-        if (valueID == CSSValueNowrap || valueID == CSSValueWrap || valueID == CSSValueWrapReverse)
-             return true;
-        break;
-    case CSSPropertyJustifyContent:
-        // FIXME: Per CSS alignment, this property should accept an optional <overflow-position>. We should share this parsing code with 'justify-self'.
-        // FIXME: For now, we will do it behind the GRID_LAYOUT compile flag.
-        return valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueSpaceBetween || valueID == CSSValueSpaceAround;
-    case CSSPropertyWebkitFontKerning:
-        if (valueID == CSSValueAuto || valueID == CSSValueNormal || valueID == CSSValueNone)
-            return true;
-        break;
-    case CSSPropertyWebkitFontSmoothing:
-        if (valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueAntialiased || valueID == CSSValueSubpixelAntialiased)
-            return true;
-        break;
-    case CSSPropertyWebkitHyphens:
-        if (valueID == CSSValueNone || valueID == CSSValueManual || valueID == CSSValueAuto)
-            return true;
-        break;
-    case CSSPropertyWebkitLineAlign:
-        if (valueID == CSSValueNone || valueID == CSSValueEdges)
-            return true;
-        break;
-    case CSSPropertyWebkitLineBreak: // auto | loose | normal | strict | after-white-space
-        if (valueID == CSSValueAuto || valueID == CSSValueLoose || valueID == CSSValueNormal || valueID == CSSValueStrict || valueID == CSSValueAfterWhiteSpace)
-            return true;
-        break;
-    case CSSPropertyWebkitLineSnap:
-        if (valueID == CSSValueNone || valueID == CSSValueBaseline || valueID == CSSValueContain)
-            return true;
-        break;
-    case CSSPropertyWebkitMarginAfterCollapse:
-    case CSSPropertyWebkitMarginBeforeCollapse:
-    case CSSPropertyWebkitMarginBottomCollapse:
-    case CSSPropertyWebkitMarginTopCollapse:
-        if (valueID == CSSValueCollapse || valueID == CSSValueSeparate || valueID == CSSValueDiscard)
-            return true;
-        break;
-    case CSSPropertyWebkitMarqueeDirection:
-        if (valueID == CSSValueForwards || valueID == CSSValueBackwards || valueID == CSSValueAhead || valueID == CSSValueReverse || valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueDown
-            || valueID == CSSValueUp || valueID == CSSValueAuto)
-            return true;
-        break;
-    case CSSPropertyWebkitMarqueeStyle:
-        if (valueID == CSSValueNone || valueID == CSSValueSlide || valueID == CSSValueScroll || valueID == CSSValueAlternate)
-            return true;
-        break;
-    case CSSPropertyWebkitNbspMode: // normal | space
-        if (valueID == CSSValueNormal || valueID == CSSValueSpace)
-            return true;
-        break;
-#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
-    case CSSPropertyWebkitOverflowScrolling:
-        if (valueID == CSSValueAuto || valueID == CSSValueTouch)
-            return true;
-        break;
-#endif
-    case CSSPropertyWebkitPrintColorAdjust:
-        if (valueID == CSSValueExact || valueID == CSSValueEconomy)
-            return true;
-        break;
-#if ENABLE(CSS_REGIONS)
-    case CSSPropertyWebkitRegionBreakAfter:
-    case CSSPropertyWebkitRegionBreakBefore:
-        if (valueID == CSSValueAuto || valueID == CSSValueAlways || valueID == CSSValueAvoid || valueID == CSSValueLeft || valueID == CSSValueRight)
-            return true;
-        break;
-    case CSSPropertyWebkitRegionBreakInside:
-        if (valueID == CSSValueAuto || valueID == CSSValueAvoid)
-            return true;
-        break;
-    case CSSPropertyWebkitRegionFragment:
-        if (valueID == CSSValueAuto || valueID == CSSValueBreak)
-            return true;
-        break;
-#endif
-    case CSSPropertyWebkitRtlOrdering:
-        if (valueID == CSSValueLogical || valueID == CSSValueVisual)
-            return true;
-        break;
-
-    case CSSPropertyWebkitRubyPosition:
-        if (valueID == CSSValueBefore || valueID == CSSValueAfter || valueID == CSSValueInterCharacter)
-            return true;
-        break;
-
-#if ENABLE(CSS3_TEXT)
-    case CSSPropertyWebkitTextAlignLast:
-        // auto | start | end | left | right | center | justify
-        if ((valueID >= CSSValueLeft && valueID <= CSSValueJustify) || valueID == CSSValueStart || valueID == CSSValueEnd || valueID == CSSValueAuto)
-            return true;
-        break;
-#endif // CSS3_TEXT
-    case CSSPropertyWebkitTextCombine:
-        if (valueID == CSSValueNone || valueID == CSSValueHorizontal)
-            return true;
-        break;
-    case CSSPropertyWebkitTextDecorationStyle:
-        if (valueID == CSSValueSolid || valueID == CSSValueDouble || valueID == CSSValueDotted || valueID == CSSValueDashed || valueID == CSSValueWavy)
-            return true;
-        break;
-#if ENABLE(CSS3_TEXT)
-    case CSSPropertyWebkitTextJustify:
-        // auto | none | inter-word | distribute
-        if (valueID == CSSValueInterWord || valueID == CSSValueDistribute || valueID == CSSValueAuto || valueID == CSSValueNone)
-            return true;
-        break;
-#endif // CSS3_TEXT
-    case CSSPropertyWebkitTextOrientation:
-        if (valueID == CSSValueSideways || valueID == CSSValueSidewaysRight || valueID == CSSValueVerticalRight
-            || valueID == CSSValueMixed || valueID == CSSValueUpright)
-            return true;
-        break;
-    case CSSPropertyWebkitTextSecurity:
-        // disc | circle | square | none | inherit
-        if (valueID == CSSValueDisc || valueID == CSSValueCircle || valueID == CSSValueSquare || valueID == CSSValueNone)
-            return true;
-        break;
-    case CSSPropertyWebkitTextZoom:
-        if (valueID == CSSValueNormal || valueID == CSSValueReset)
-            return true;
-        break;
-#if PLATFORM(IOS)
-    // Apple specific property. These will never be standardized and is purely to
-    // support custom WebKit-based Apple applications.
-    case CSSPropertyWebkitTouchCallout:
-        if (valueID == CSSValueDefault || valueID == CSSValueNone)
-            return true;
-        break;
-#endif
-    case CSSPropertyTransformStyle:
-    case CSSPropertyWebkitTransformStyle:
-        if (valueID == CSSValueFlat || valueID == CSSValuePreserve3d)
-            return true;
-        break;
-    case CSSPropertyWebkitUserDrag: // auto | none | element
-        if (valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueElement)
-            return true;
-        break;
-    case CSSPropertyWebkitUserModify: // read-only | read-write
-        if (valueID == CSSValueReadOnly || valueID == CSSValueReadWrite || valueID == CSSValueReadWritePlaintextOnly) {
-            if (styleSheetContents)
-                styleSheetContents->parserSetUsesStyleBasedEditability();
-            return true;
-        }
-        break;
-    case CSSPropertyWebkitUserSelect: // auto | none | text | all
-        if (valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueText)
-            return true;
-        if (valueID == CSSValueAll) {
-            if (styleSheetContents)
-                styleSheetContents->parserSetUsesStyleBasedEditability();
-            return true;
-        }
-        break;
-    case CSSPropertyWhiteSpace: // normal | pre | nowrap | inherit
-        if (valueID == CSSValueNormal || valueID == CSSValuePre || valueID == CSSValuePreWrap || valueID == CSSValuePreLine || valueID == CSSValueNowrap)
-            return true;
-        break;
-    case CSSPropertyWordBreak: // normal | break-all | keep-all | break-word (this is a custom extension)
-        if (valueID == CSSValueNormal || valueID == CSSValueBreakAll || valueID == CSSValueKeepAll || valueID == CSSValueBreakWord)
-            return true;
-        break;
-#if ENABLE(CSS_TRAILING_WORD)
-    case CSSPropertyAppleTrailingWord: // auto | -apple-partially-balanced
-        if (valueID == CSSValueAuto || valueID == CSSValueWebkitPartiallyBalanced)
-            return true;
-        break;
-#endif
-#if ENABLE(APPLE_PAY)
-    case CSSPropertyApplePayButtonStyle: // white | white-outline | black
-        if (valueID == CSSValueWhite || valueID == CSSValueWhiteOutline || valueID == CSSValueBlack)
-            return true;
-        break;
-    case CSSPropertyApplePayButtonType: // plain | buy | set-up | donate
-        if (valueID == CSSValuePlain || valueID == CSSValueBuy || valueID == CSSValueSetUp || valueID == CSSValueDonate)
-            return true;
-        break;
-#endif
-    case CSSPropertyFontVariantPosition: // normal | sub | super
-        if (valueID == CSSValueNormal || valueID == CSSValueSub || valueID == CSSValueSuper)
-            return true;
-        break;
-    case CSSPropertyFontVariantCaps: // normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps
-        if (valueID == CSSValueNormal || valueID == CSSValueSmallCaps || valueID == CSSValueAllSmallCaps || valueID == CSSValuePetiteCaps || valueID == CSSValueAllPetiteCaps || valueID == CSSValueUnicase || valueID == CSSValueTitlingCaps)
-            return true;
-        break;
-    case CSSPropertyFontVariantAlternates: // We only support the normal and historical-forms values.
-        if (valueID == CSSValueNormal || valueID == CSSValueHistoricalForms)
-            return true;
-        break;
-            
-    case CSSPropertyBreakAfter:
-    case CSSPropertyBreakBefore:
-        // auto | avoid | left | right | recto | verso | column | page | region | avoid-page | avoid-column | avoid-region
-        if (valueID == CSSValueAuto || valueID == CSSValueAvoid || valueID == CSSValueLeft || valueID == CSSValueRight
-            || valueID == CSSValueRecto || valueID == CSSValueVerso || valueID == CSSValueColumn || valueID == CSSValuePage
-            || valueID == CSSValueRegion || valueID == CSSValueAvoidColumn || valueID == CSSValueAvoidPage || valueID == CSSValueAvoidRegion)
-            return true;
-        break;
-    case CSSPropertyBreakInside:
-        // auto | avoid | avoid-page | avoid-column | avoid-region
-        if (valueID == CSSValueAuto || valueID == CSSValueAvoid || valueID == CSSValueAvoidColumn || valueID == CSSValueAvoidPage || valueID == CSSValueAvoidRegion)
-            return true;
-        break;
-    // SVG CSS properties
-    case CSSPropertyAlignmentBaseline:
-        // auto | baseline | before-edge | text-before-edge | middle |
-        // central | after-edge | text-after-edge | ideographic | alphabetic |
-        // hanging | mathematical | inherit
-        if (valueID == CSSValueAuto || valueID == CSSValueBaseline || valueID == CSSValueMiddle || (valueID >= CSSValueBeforeEdge && valueID <= CSSValueMathematical))
-            return true;
-        break;
-    case CSSPropertyBufferedRendering:
-        if (valueID == CSSValueAuto || valueID == CSSValueDynamic || valueID == CSSValueStatic)
-            return true;
-        break;
-    case CSSPropertyClipRule:
-    case CSSPropertyFillRule:
-        if (valueID == CSSValueNonzero || valueID == CSSValueEvenodd)
-            return true;
-        break;
-    case CSSPropertyColorInterpolation:
-    case CSSPropertyColorInterpolationFilters:
-        if (valueID == CSSValueAuto || valueID == CSSValueSrgb || valueID == CSSValueLinearrgb)
-            return true;
-        break;
-    case CSSPropertyColorRendering:
-        if (valueID == CSSValueAuto || valueID == CSSValueOptimizespeed || valueID == CSSValueOptimizequality)
-            return true;
-        break;
-    case CSSPropertyDominantBaseline:
-        // auto | use-script | no-change | reset-size | ideographic |
-        // alphabetic | hanging | mathematical | central | middle |
-        // text-after-edge | text-before-edge | inherit
-        if (valueID == CSSValueAuto || valueID == CSSValueMiddle
-            || (valueID >= CSSValueUseScript && valueID <= CSSValueResetSize)
-            || (valueID >= CSSValueCentral && valueID <= CSSValueMathematical))
-            return true;
-        break;
-    case CSSPropertyMaskType:
-        if (valueID == CSSValueLuminance || valueID == CSSValueAlpha)
-            return true;
-        break;
-    case CSSPropertyShapeRendering:
-        if (valueID == CSSValueAuto || valueID == CSSValueOptimizespeed || valueID == CSSValueCrispedges || valueID == CSSValueGeometricprecision)
-            return true;
-        break;
-    case CSSPropertyStrokeLinecap:
-        if (valueID == CSSValueButt || valueID == CSSValueRound || valueID == CSSValueSquare)
-            return true;
-        break;
-    case CSSPropertyStrokeLinejoin:
-        if (valueID == CSSValueMiter || valueID == CSSValueRound || valueID == CSSValueBevel)
-            return true;
-        break;
-    case CSSPropertyTextAnchor:
-        if (valueID == CSSValueStart || valueID == CSSValueMiddle || valueID == CSSValueEnd)
-            return true;
-        break;
-    case CSSPropertyVectorEffect:
-        if (valueID == CSSValueNone || valueID == CSSValueNonScalingStroke)
-            return true;
-        break;
-    case CSSPropertyWritingMode:
-        if ((valueID >= CSSValueHorizontalTb && valueID <= CSSValueHorizontalBt)
-            || valueID == CSSValueLrTb || valueID == CSSValueRlTb || valueID == CSSValueTbRl
-            || valueID == CSSValueLr || valueID == CSSValueRl || valueID == CSSValueTb)
-            return true;
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-        return false;
-    }
-#if !ENABLE(CSS_GRID_LAYOUT)
-    UNUSED_PARAM(parserContext);
-#endif
-    return false;
-}
-
-static bool isUniversalKeyword(const String& string)
-{
-    // These keywords can be used for all properties.
-    return equalLettersIgnoringASCIICase(string, "initial")
-        || equalLettersIgnoringASCIICase(string, "inherit")
-        || equalLettersIgnoringASCIICase(string, "unset")
-        || equalLettersIgnoringASCIICase(string, "revert");
+    CSSTokenizer tokenizer(condition);
+    CSSParserTokenRange range = tokenizer.tokenRange();
+    CSSParserImpl parser(m_context);
+    return CSSSupportsParser::supportsCondition(range, parser) == CSSSupportsParser::Supported;
 }
 
-static bool isKeywordPropertyID(CSSPropertyID propertyID)
+Color CSSParser::parseColor(const String& string, bool strict)
 {
-    switch (propertyID) {
-    case CSSPropertyPageBreakAfter:
-    case CSSPropertyPageBreakBefore:
-    case CSSPropertyPageBreakInside:
-    case CSSPropertyWebkitColumnBreakAfter:
-    case CSSPropertyWebkitColumnBreakBefore:
-    case CSSPropertyWebkitColumnBreakInside:
-#if ENABLE(CSS_REGIONS)
-    case CSSPropertyWebkitRegionBreakAfter:
-    case CSSPropertyWebkitRegionBreakBefore:
-    case CSSPropertyWebkitRegionBreakInside:
-#endif
-        return true;
-    default:
-        break;
-    }
+    if (string.isEmpty())
+        return Color();
     
-    return CSSParserFastPaths::isKeywordPropertyID(propertyID);
-}
-
-static CSSParser::ParseResult parseKeywordValue(MutableStyleProperties& declaration, CSSPropertyID propertyId, const String& string, bool important, const CSSParserContext& parserContext, StyleSheetContents* styleSheetContents)
-{
-    ASSERT(!string.isEmpty());
-
-    if (!isKeywordPropertyID(propertyId)) {
-        if (!isUniversalKeyword(string))
-            return CSSParser::ParseResult::Error;
-
-        // Don't try to parse initial/inherit/unset/revert shorthands; return an error so the caller will use the full CSS parser.
-        if (shorthandForProperty(propertyId).length())
-            return CSSParser::ParseResult::Error;
-    }
-
-    CSSParserString cssString;
-    cssString.init(string);
-    CSSValueID valueID = cssValueKeywordID(cssString);
-
-    if (!valueID)
-        return CSSParser::ParseResult::Error;
-
-    RefPtr<CSSValue> value;
-    if (valueID == CSSValueInherit)
-        value = CSSValuePool::singleton().createInheritedValue();
-    else if (valueID == CSSValueInitial)
-        value = CSSValuePool::singleton().createExplicitInitialValue();
-    else if (valueID == CSSValueUnset)
-        value = CSSValuePool::singleton().createUnsetValue();
-    else if (valueID == CSSValueRevert)
-        value = CSSValuePool::singleton().createRevertValue();
-    else if (isValidKeywordPropertyAndValue(propertyId, valueID, parserContext, styleSheetContents))
-        value = CSSValuePool::singleton().createIdentifierValue(valueID);
-    else
-        return CSSParser::ParseResult::Error;
-
-    return declaration.addParsedProperty(CSSProperty(propertyId, value.releaseNonNull(), important)) ? CSSParser::ParseResult::Changed : CSSParser::ParseResult::Unchanged;
-}
-
-template <typename CharacterType>
-static bool parseTransformTranslateArguments(WebKitCSSTransformValue& transformValue, CharacterType* characters, unsigned length, unsigned start, unsigned expectedCount)
-{
-    auto& cssValuePool = CSSValuePool::singleton();
-    while (expectedCount) {
-        size_t end = WTF::find(characters, length, expectedCount == 1 ? ')' : ',', start);
-        if (end == notFound || (expectedCount == 1 && end != length - 1))
-            return false;
-        unsigned argumentLength = end - start;
-        CSSPrimitiveValue::UnitTypes unit = CSSPrimitiveValue::CSS_NUMBER;
-        double number;
-        if (!parseSimpleLength(characters + start, argumentLength, unit, number))
-            return false;
-        if (unit != CSSPrimitiveValue::CSS_PX && (number || unit != CSSPrimitiveValue::CSS_NUMBER))
-            return false;
-        transformValue.append(cssValuePool.createValue(number, CSSPrimitiveValue::CSS_PX));
-        start = end + 1;
-        --expectedCount;
-    }
-    return true;
+    // Try named colors first.
+    Color namedColor { string };
+    if (namedColor.isValid())
+        return namedColor;
+    
+    // Try the fast path to parse hex and rgb.
+    RefPtr<CSSValue> value = CSSParserFastPaths::parseColor(string, strict ? HTMLStandardMode : HTMLQuirksMode);
+    
+    // If that fails, try the full parser.
+    if (!value)
+        value = parseSingleValue(CSSPropertyColor, string, strictCSSParserContext());
+    if (!value || !value->isPrimitiveValue())
+        return Color();
+    const auto& primitiveValue = downcast<CSSPrimitiveValue>(*value);
+    if (!primitiveValue.isRGBColor())
+        return Color();
+    return primitiveValue.color();
 }
 
-static CSSParser::ParseResult parseTranslateTransformValue(MutableStyleProperties& properties, CSSPropertyID propertyID, const String& string, bool important)
+Color CSSParser::parseSystemColor(const String& string, Document* document)
 {
-    if (propertyID != CSSPropertyTransform)
-        return CSSParser::ParseResult::Error;
-
-    static const unsigned shortestValidTransformStringLength = 12;
-    static const unsigned likelyMultipartTransformStringLengthCutoff = 32;
-    if (string.length() < shortestValidTransformStringLength || string.length() > likelyMultipartTransformStringLengthCutoff)
-        return CSSParser::ParseResult::Error;
-
-    if (!string.startsWith("translate", false))
-        return CSSParser::ParseResult::Error;
-
-    UChar c9 = toASCIILower(string[9]);
-    UChar c10 = toASCIILower(string[10]);
-
-    WebKitCSSTransformValue::TransformOperationType transformType;
-    unsigned expectedArgumentCount = 1;
-    unsigned argumentStart = 11;
-    if (c9 == 'x' && c10 == '(')
-        transformType = WebKitCSSTransformValue::TranslateXTransformOperation;
-    else if (c9 == 'y' && c10 == '(')
-        transformType = WebKitCSSTransformValue::TranslateYTransformOperation;
-    else if (c9 == 'z' && c10 == '(')
-        transformType = WebKitCSSTransformValue::TranslateZTransformOperation;
-    else if (c9 == '(') {
-        transformType = WebKitCSSTransformValue::TranslateTransformOperation;
-        expectedArgumentCount = 2;
-        argumentStart = 10;
-    } else if (c9 == '3' && c10 == 'd' && string[11] == '(') {
-        transformType = WebKitCSSTransformValue::Translate3DTransformOperation;
-        expectedArgumentCount = 3;
-        argumentStart = 12;
-    } else
-        return CSSParser::ParseResult::Error;
-
-    auto transformValue = WebKitCSSTransformValue::create(transformType);
-    bool success;
-    if (string.is8Bit())
-        success = parseTransformTranslateArguments(transformValue, string.characters8(), string.length(), argumentStart, expectedArgumentCount);
-    else
-        success = parseTransformTranslateArguments(transformValue, string.characters16(), string.length(), argumentStart, expectedArgumentCount);
-    if (!success)
-        return CSSParser::ParseResult::Error;
-
-    auto result = CSSValueList::createSpaceSeparated();
-    result->append(WTFMove(transformValue));
-    return properties.addParsedProperty(CSSProperty(CSSPropertyTransform, WTFMove(result), important)) ? CSSParser::ParseResult::Changed : CSSParser::ParseResult::Unchanged;
+    if (!document || !document->page())
+        return Color();
+    
+    CSSValueID id = cssValueKeywordID(string);
+    if (!StyleColor::isSystemColor(id))
+        return Color();
+    
+    return document->page()->theme().systemColor(id);
 }
 
-RefPtr<CSSValueList> CSSParser::parseFontFaceValue(const AtomicString& string)
+RefPtr<CSSValue> CSSParser::parseSingleValue(CSSPropertyID propertyID, const String& string, const CSSParserContext& context)
 {
     if (string.isEmpty())
         return nullptr;
-
-    auto valueList = CSSValueList::createCommaSeparated();
-
-    Vector<String> familyNames;
-    string.string().split(',', true, familyNames);
-
-    auto& cssValuePool = CSSValuePool::singleton();
-    for (auto& familyName : familyNames) {
-        String stripped = stripLeadingAndTrailingHTMLSpaces(familyName);
-        if (stripped.isEmpty())
-            return nullptr;
-
-        RefPtr<CSSValue> value;
-        for (auto propertyID : { CSSValueSerif, CSSValueSansSerif, CSSValueCursive, CSSValueFantasy, CSSValueMonospace, CSSValueWebkitBody }) {
-            if (equalIgnoringASCIICase(stripped, getValueName(propertyID))) {
-                value = cssValuePool.createIdentifierValue(propertyID);
-                break;
-            }
-        }
-        if (!value)
-            value = cssValuePool.createFontFamilyValue(stripped);
-        valueList->append(value.releaseNonNull());
-    }
-
-    return WTFMove(valueList);
+    if (RefPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(propertyID, string, context.mode, nullptr))
+        return value;
+    CSSTokenizer tokenizer(string);
+    return CSSPropertyParser::parseSingleValue(propertyID, tokenizer.tokenRange(), context, nullptr);
 }
 
 CSSParser::ParseResult CSSParser::parseValue(MutableStyleProperties& declaration, CSSPropertyID propertyID, const String& string, bool important, const CSSParserContext& context, StyleSheetContents* contextStyleSheet)
 {
     ASSERT(!string.isEmpty());
-    if (context.useNewParser) {
-        RefPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(propertyID, string, context.mode, contextStyleSheet);
-        if (value)
-            return declaration.addParsedProperty(CSSProperty(propertyID, WTFMove(value), important)) ? CSSParser::ParseResult::Changed : CSSParser::ParseResult::Unchanged;
-    } else {
-        // FIXME-NEWPARSER: Remove all this code when the old parser goes away.
-        CSSParser::ParseResult result = parseSimpleLengthValue(declaration, propertyID, string, important, context.mode);
-        if (result != ParseResult::Error)
-            return result;
-
-        result = parseColorValue(declaration, propertyID, string, important,  context.mode);
-        if (result != ParseResult::Error)
-            return result;
-
-        result = parseKeywordValue(declaration, propertyID, string, important, context, contextStyleSheet);
-        if (result != ParseResult::Error)
-            return result;
-
-        result = parseTranslateTransformValue(declaration, propertyID, string, important);
-        if (result != ParseResult::Error)
-            return result;
-    }
-
-    CSSParser parser(context);
-    return parser.parseValue(declaration, propertyID, string, important, contextStyleSheet);
-}
-
-CSSParser::ParseResult CSSParser::parseCustomPropertyValue(MutableStyleProperties& declaration, const AtomicString& propertyName, const String& string, bool important, const CSSParserContext& context, StyleSheetContents* contextStyleSheet)
-{
-    if (context.useNewParser)
-        return CSSParserImpl::parseCustomPropertyValue(&declaration, propertyName, string, important, context);
+    RefPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(propertyID, string, context.mode, contextStyleSheet);
+    if (value)
+        return declaration.addParsedProperty(CSSProperty(propertyID, WTFMove(value), important)) ? CSSParser::ParseResult::Changed : CSSParser::ParseResult::Unchanged;
 
     CSSParser parser(context);
-    parser.setCustomPropertyName(propertyName);
-    return parser.parseValue(declaration, CSSPropertyCustom, string, important, contextStyleSheet);
-}
-
-CSSParser::ParseResult CSSParser::parseValue(MutableStyleProperties& declaration, CSSPropertyID propertyID, const String& string, bool important, StyleSheetContents* contextStyleSheet)
-{
-    if (m_context.useNewParser)
-        return CSSParserImpl::parseValue(&declaration, propertyID, string, important, m_context);
-
-    setStyleSheet(contextStyleSheet);
-
-    setupParser("@-webkit-value{", string, "} ");
-
-    m_id = propertyID;
-    m_important = important;
-
-    cssyyparse(this);
-
-    m_rule = nullptr;
-
-    ParseResult result = ParseResult::Error;
-
-    if (!m_parsedProperties.isEmpty()) {
-        result = declaration.addParsedProperties(m_parsedProperties) ? ParseResult::Changed : ParseResult::Unchanged;
-        clearProperties();
-    }
-
-    return result;
-}
-
-Color CSSParser::parseColor(const String& string, bool strict)
-{
-    if (string.isEmpty())
-        return Color();
-
-    // First try creating a color specified by name, rgba(), rgb() or "#" syntax.
-    Color color = fastParseColor(string, strict);
-    if (color.isValid())
-        return color;
-
-    CSSParser parser(HTMLStandardMode);
-
-    // In case the fast-path parser didn't understand the color, try the full parser.
-    if (!parser.parseColorFromString(string))
-        return Color();
-
-    CSSValue& value = *parser.m_parsedProperties.first().value();
-    if (!is<CSSPrimitiveValue>(value))
-        return Color();
-
-    CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(value);
-    if (!primitiveValue.isRGBColor())
-        return Color();
-
-    return primitiveValue.color();
+    return parser.parseValue(declaration, propertyID, string, important);
 }
 
-bool CSSParser::parseColorFromString(const String& string)
+CSSParser::ParseResult CSSParser::parseCustomPropertyValue(MutableStyleProperties& declaration, const AtomicString& propertyName, const String& string, bool important, const CSSParserContext& context)
 {
-    setupParser("@-webkit-decls{color:", string, "} ");
-    cssyyparse(this);
-    m_rule = nullptr;
-
-    return !m_parsedProperties.isEmpty() && m_parsedProperties.first().id() == CSSPropertyColor;
+    return CSSParserImpl::parseCustomPropertyValue(&declaration, propertyName, string, important, context);
 }
 
-Color CSSParser::parseSystemColor(const String& string, Document* document)
+CSSParser::ParseResult CSSParser::parseValue(MutableStyleProperties& declaration, CSSPropertyID propertyID, const String& string, bool important)
 {
-    if (!document || !document->page())
-        return Color();
-
-    CSSParserString cssColor;
-    cssColor.init(string);
-    CSSValueID id = cssValueKeywordID(cssColor);
-    if (!validPrimitiveValueColor(id))
-        return Color();
-
-    return document->page()->theme().systemColor(id);
+    return CSSParserImpl::parseValue(&declaration, propertyID, string, important, m_context);
 }
 
 void CSSParser::parseSelector(const String& string, CSSSelectorList& selectorList)
 {
-    if (m_context.useNewParser) {
-        CSSTokenizer tokenizer(string);
-        selectorList = CSSSelectorParser::parseSelector(tokenizer.tokenRange(), m_context, nullptr);
-        return;
-    }
-
-    m_selectorListForParseSelector = &selectorList;
-    
-    setupParser("@-webkit-selector{", string, "}");
-
-    cssyyparse(this);
-
-    m_selectorListForParseSelector = nullptr;
+    CSSTokenizer tokenizer(string);
+    selectorList = CSSSelectorParser::parseSelector(tokenizer.tokenRange(), m_context, nullptr);
 }
 
 Ref<ImmutableStyleProperties> CSSParser::parseInlineStyleDeclaration(const String& string, Element* element)
 {
     CSSParserContext context(element->document());
     context.mode = strictToCSSParserMode(element->isHTMLElement() && !element->document().inQuirksMode());
-
-    if (context.useNewParser)
-        return CSSParserImpl::parseInlineStyleDeclaration(string, element);
-
-    return CSSParser(context).parseDeclarationDeprecated(string, nullptr);
-}
-
-Ref<ImmutableStyleProperties> CSSParser::parseDeclarationDeprecated(const String& string, StyleSheetContents* contextStyleSheet)
-{
-    ASSERT(!m_context.useNewParser);
-    
-    setStyleSheet(contextStyleSheet);
-
-    setupParser("@-webkit-decls{", string, "} ");
-    cssyyparse(this);
-    m_rule = nullptr;
-
-    Ref<ImmutableStyleProperties> style = createStyleProperties();
-    clearProperties();
-    return style;
+    return CSSParserImpl::parseInlineStyleDeclaration(string, element);
 }
 
-
-bool CSSParser::parseDeclaration(MutableStyleProperties& declaration, const String& string, RefPtr<CSSRuleSourceData>&& ruleSourceData, StyleSheetContents* contextStyleSheet)
+bool CSSParser::parseDeclaration(MutableStyleProperties& declaration, const String& string)
 {
-    if (m_context.useNewParser)
-        return CSSParserImpl::parseDeclarationList(&declaration, string, m_context);
-
-    // Length of the "@-webkit-decls{" prefix.
-    static const unsigned prefixLength = 15;
-
-    setStyleSheet(contextStyleSheet);
-
-    if (ruleSourceData) {
-        m_currentRuleDataStack = std::make_unique<RuleSourceDataList>();
-        m_currentRuleDataStack->append(*ruleSourceData);
-    }
-
-    setupParser("@-webkit-decls{", string, "} ");
-    cssyyparse(this);
-    m_rule = nullptr;
-
-    bool ok = false;
-    if (!m_parsedProperties.isEmpty()) {
-        ok = true;
-        declaration.addParsedProperties(m_parsedProperties);
-        clearProperties();
-    }
-
-    if (ruleSourceData) {
-        ASSERT(m_currentRuleDataStack->size() == 1);
-        ruleSourceData->ruleBodyRange.start = 0;
-        ruleSourceData->ruleBodyRange.end = string.length();
-        for (size_t i = 0, size = ruleSourceData->styleSourceData->propertyData.size(); i < size; ++i) {
-            CSSPropertySourceData& propertyData = ruleSourceData->styleSourceData->propertyData.at(i);
-            propertyData.range.start -= prefixLength;
-            propertyData.range.end -= prefixLength;
-        }
-
-        fixUnparsedPropertyRanges(*ruleSourceData);
-        m_currentRuleDataStack.reset();
-    }
-
-    return ok;
+    return CSSParserImpl::parseDeclarationList(&declaration, string, m_context);
 }
 
 void CSSParser::parseDeclarationForInspector(const CSSParserContext& context, const String& string, CSSParserObserver& observer)
@@ -1544,322 +252,8 @@ void CSSParser::parseDeclarationForInspector(const CSSParserContext& context, co
     CSSParserImpl::parseDeclarationListForInspector(string, context, observer);
 }
 
-static inline void filterProperties(bool important, const ParsedPropertyVector& input, Vector<CSSProperty, 256>& output, size_t& unusedEntries, std::bitset<numCSSProperties>& seenProperties, HashSet<AtomicString>& seenCustomProperties)
+RefPtr<CSSValue> CSSParser::parseValueWithVariableReferences(CSSPropertyID propID, const CSSValue& value, const CustomPropertyValueMap& customProperties, TextDirection direction, WritingMode writingMode)
 {
-    // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found.
-    for (int i = input.size() - 1; i >= 0; --i) {
-        const CSSProperty& property = input[i];
-        if (property.isImportant() != important)
-            continue;
-        
-        if (property.id() == CSSPropertyCustom) {
-            if (property.value()) {
-                auto& name = downcast<CSSCustomPropertyValue>(*property.value()).name();
-                if (!seenCustomProperties.add(name).isNewEntry)
-                    continue;
-                output[--unusedEntries] = property;
-            }
-            continue;
-        }
-
-        const unsigned propertyIDIndex = property.id() - firstCSSProperty;
-        ASSERT(propertyIDIndex < seenProperties.size());
-        if (seenProperties[propertyIDIndex])
-            continue;
-        seenProperties.set(propertyIDIndex);
-        output[--unusedEntries] = property;
-    }
-}
-
-Ref<ImmutableStyleProperties> CSSParser::createStyleProperties()
-{
-    std::bitset<numCSSProperties> seenProperties;
-    size_t unusedEntries = m_parsedProperties.size();
-    Vector<CSSProperty, 256> results(unusedEntries);
-
-    // Important properties have higher priority, so add them first. Duplicate definitions can then be ignored when found.
-    HashSet<AtomicString> seenCustomProperties;
-    filterProperties(true, m_parsedProperties, results, unusedEntries, seenProperties, seenCustomProperties);
-    filterProperties(false, m_parsedProperties, results, unusedEntries, seenProperties, seenCustomProperties);
-    if (unusedEntries)
-        results.remove(0, unusedEntries);
-
-    return ImmutableStyleProperties::create(results.data(), results.size(), m_context.mode);
-}
-
-void CSSParser::addProperty(CSSPropertyID propId, RefPtr<CSSValue>&& value, bool important, bool implicit)
-{
-    // This property doesn't belong to a shorthand or is a CSS variable (which will be resolved later).
-    if (!m_currentShorthand) {
-        m_parsedProperties.append(CSSProperty(propId, WTFMove(value), important, false, CSSPropertyInvalid, m_implicitShorthand || implicit));
-        return;
-    }
-
-    auto shorthands = matchingShorthandsForLonghand(propId);
-    if (shorthands.size() == 1)
-        m_parsedProperties.append(CSSProperty(propId, WTFMove(value), important, true, CSSPropertyInvalid, m_implicitShorthand || implicit));
-    else
-        m_parsedProperties.append(CSSProperty(propId, WTFMove(value), important, true, indexOfShorthandForLonghand(m_currentShorthand, shorthands), m_implicitShorthand || implicit));
-}
-
-void CSSParser::rollbackLastProperties(int num)
-{
-    ASSERT(num >= 0);
-    ASSERT(m_parsedProperties.size() >= static_cast<unsigned>(num));
-    m_parsedProperties.shrink(m_parsedProperties.size() - num);
-}
-
-void CSSParser::clearProperties()
-{
-    m_parsedProperties.clear();
-    m_numParsedPropertiesBeforeMarginBox = invalidParsedPropertiesCount;
-}
-
-URL CSSParser::completeURL(const CSSParserContext& context, const String& url)
-{
-    return context.completeURL(url);
-}
-
-URL CSSParser::completeURL(const String& url) const
-{
-    return m_context.completeURL(url);
-}
-
-bool CSSParser::validateCalculationUnit(ValueWithCalculation& valueWithCalculation, Units unitFlags)
-{
-    bool mustBeNonNegative = unitFlags & FNonNeg;
-
-    RefPtr<CSSCalcValue> calculation;
-    if (valueWithCalculation.calculation()) {
-        // The calculation value was already parsed so we reuse it. However, we may need to update its range.
-        calculation = valueWithCalculation.calculation();
-        calculation->setPermittedValueRange(mustBeNonNegative ? ValueRangeNonNegative : ValueRangeAll);
-    } else {
-        valueWithCalculation.setCalculation(parseCalculation(valueWithCalculation, mustBeNonNegative ? ValueRangeNonNegative : ValueRangeAll));
-        calculation = valueWithCalculation.calculation();
-        if (!calculation)
-            return false;
-    }
-
-    bool isValid = false;
-    switch (calculation->category()) {
-    case CalcNumber:
-        isValid = (unitFlags & FNumber);
-        if (!isValid && (unitFlags & FInteger) && calculation->isInt())
-            isValid = true;
-        if (!isValid && (unitFlags & FPositiveInteger) && calculation->isInt() && calculation->isPositive())
-            isValid = true;
-        break;
-    case CalcLength:
-        isValid = (unitFlags & FLength);
-        break;
-    case CalcPercent:
-        isValid = (unitFlags & FPercent);
-        break;
-    case CalcPercentLength:
-        isValid = (unitFlags & FPercent) && (unitFlags & FLength);
-        break;
-    case CalcPercentNumber:
-        isValid = (unitFlags & FPercent) && (unitFlags & FNumber);
-        break;
-    case CalcAngle:
-        isValid = (unitFlags & FAngle);
-        break;
-    case CalcTime:
-        isValid = (unitFlags & FTime);
-        break;
-    case CalcFrequency:
-        isValid = (unitFlags & FFrequency);
-        break;
-    case CalcOther:
-        break;
-    }
-
-    return isValid;
-}
-
-inline bool CSSParser::shouldAcceptUnitLessValues(CSSParserValue& value, Units unitFlags, CSSParserMode cssParserMode)
-{
-    // Qirks mode and svg presentation attributes accept unit less values.
-    return (unitFlags & (FLength | FAngle | FTime)) && (!value.fValue || cssParserMode == HTMLQuirksMode || cssParserMode == SVGAttributeMode);
-}
-
-bool CSSParser::validateUnit(ValueWithCalculation& valueWithCalculation, Units unitFlags, CSSParserMode cssParserMode)
-{
-    if (isCalculation(valueWithCalculation))
-        return validateCalculationUnit(valueWithCalculation, unitFlags);
-        
-    bool b = false;
-    switch (valueWithCalculation.value().unit) {
-    case CSSPrimitiveValue::CSS_NUMBER:
-        b = (unitFlags & FNumber);
-        if (!b && shouldAcceptUnitLessValues(valueWithCalculation, unitFlags, cssParserMode)) {
-            valueWithCalculation.value().unit = (unitFlags & FLength) ? CSSPrimitiveValue::CSS_PX :
-                          ((unitFlags & FAngle) ? CSSPrimitiveValue::CSS_DEG : CSSPrimitiveValue::CSS_MS);
-            b = true;
-        }
-        if (!b && (unitFlags & FInteger) && valueWithCalculation.value().isInt)
-            b = true;
-        if (!b && (unitFlags & FPositiveInteger) && valueWithCalculation.value().isInt && valueWithCalculation.value().fValue > 0)
-            b = true;
-        break;
-    case CSSPrimitiveValue::CSS_PERCENTAGE:
-        b = (unitFlags & FPercent);
-        break;
-    case CSSParserValue::Q_EMS:
-    case CSSPrimitiveValue::CSS_EMS:
-    case CSSPrimitiveValue::CSS_REMS:
-    case CSSPrimitiveValue::CSS_CHS:
-    case CSSPrimitiveValue::CSS_EXS:
-    case CSSPrimitiveValue::CSS_PX:
-    case CSSPrimitiveValue::CSS_CM:
-    case CSSPrimitiveValue::CSS_MM:
-    case CSSPrimitiveValue::CSS_IN:
-    case CSSPrimitiveValue::CSS_PT:
-    case CSSPrimitiveValue::CSS_PC:
-    case CSSPrimitiveValue::CSS_VW:
-    case CSSPrimitiveValue::CSS_VH:
-    case CSSPrimitiveValue::CSS_VMIN:
-    case CSSPrimitiveValue::CSS_VMAX:
-        b = (unitFlags & FLength);
-        break;
-    case CSSPrimitiveValue::CSS_MS:
-    case CSSPrimitiveValue::CSS_S:
-        b = (unitFlags & FTime);
-        break;
-    case CSSPrimitiveValue::CSS_DEG:
-    case CSSPrimitiveValue::CSS_RAD:
-    case CSSPrimitiveValue::CSS_GRAD:
-    case CSSPrimitiveValue::CSS_TURN:
-        b = (unitFlags & FAngle);
-        break;
-#if ENABLE(CSS_IMAGE_RESOLUTION) || ENABLE(RESOLUTION_MEDIA_QUERY)
-    case CSSPrimitiveValue::CSS_DPPX:
-    case CSSPrimitiveValue::CSS_DPI:
-    case CSSPrimitiveValue::CSS_DPCM:
-        b = (unitFlags & FResolution);
-        break;
-#endif
-    case CSSPrimitiveValue::CSS_HZ:
-    case CSSPrimitiveValue::CSS_KHZ:
-    case CSSPrimitiveValue::CSS_DIMENSION:
-    default:
-        break;
-    }
-    if (b && unitFlags & FNonNeg && valueWithCalculation.value().fValue < 0)
-        b = false;
-    if (b && std::isinf(valueWithCalculation.value().fValue))
-        b = false;
-    return b;
-}
-
-inline Ref<CSSPrimitiveValue> CSSParser::createPrimitiveNumericValue(ValueWithCalculation& valueWithCalculation)
-{
-    if (valueWithCalculation.calculation())
-        return CSSPrimitiveValue::create(valueWithCalculation.calculation());
-
-    CSSParserValue& value = valueWithCalculation;
-#if ENABLE(CSS_IMAGE_RESOLUTION) || ENABLE(RESOLUTION_MEDIA_QUERY)
-    ASSERT((value.unit >= CSSPrimitiveValue::CSS_NUMBER && value.unit <= CSSPrimitiveValue::CSS_KHZ)
-        || (value.unit >= CSSPrimitiveValue::CSS_TURN && value.unit <= CSSPrimitiveValue::CSS_CHS)
-        || (value.unit >= CSSPrimitiveValue::CSS_VW && value.unit <= CSSPrimitiveValue::CSS_VMAX)
-        || (value.unit >= CSSPrimitiveValue::CSS_DPPX && value.unit <= CSSPrimitiveValue::CSS_DPCM));
-#else
-    ASSERT((value.unit >= CSSPrimitiveValue::CSS_NUMBER && value.unit <= CSSPrimitiveValue::CSS_KHZ)
-        || (value.unit >= CSSPrimitiveValue::CSS_TURN && value.unit <= CSSPrimitiveValue::CSS_CHS)
-        || (value.unit >= CSSPrimitiveValue::CSS_VW && value.unit <= CSSPrimitiveValue::CSS_VMAX));
-#endif
-    return CSSValuePool::singleton().createValue(value.fValue, static_cast<CSSPrimitiveValue::UnitTypes>(value.unit));
-}
-
-inline Ref<CSSPrimitiveValue> CSSParser::createPrimitiveStringValue(CSSParserValue& value)
-{
-    ASSERT(value.unit == CSSPrimitiveValue::CSS_STRING || value.unit == CSSPrimitiveValue::CSS_IDENT);
-    return CSSValuePool::singleton().createValue(value.string, CSSPrimitiveValue::CSS_STRING);
-}
-
-static inline bool isComma(CSSParserValue* value)
-{ 
-    return value && value->unit == CSSParserValue::Operator && value->iValue == ','; 
-}
-
-static inline bool isForwardSlashOperator(CSSParserValue& value)
-{
-    return value.unit == CSSParserValue::Operator && value.iValue == '/';
-}
-
-bool CSSParser::isValidSize(ValueWithCalculation& valueWithCalculation)
-{
-    int id = valueWithCalculation.value().id;
-    if (id == CSSValueIntrinsic || id == CSSValueMinIntrinsic || id == CSSValueWebkitMinContent || id == CSSValueWebkitMaxContent || id ==