[CSS Parser] Get CSSPropertyParserHelpers.cpp compiling
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Sep 2016 20:24:23 +0000 (20:24 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Sep 2016 20:24:23 +0000 (20:24 +0000)
commitc2ee952251965e27afde79fc7d17836829763611
treeed9e77a0b29b4784a79e5ddbaa08e293bad77948
parent0b84271f4ccba8ce63b8a20f4f8be152056d7511
[CSS Parser] Get CSSPropertyParserHelpers.cpp compiling
https://bugs.webkit.org/show_bug.cgi?id=162078

Reviewed by Dean Jackson.

Source/WebCore:

* css/CSSCalculationValue.cpp:
(WebCore::hasDoubleValue):
(WebCore::checkDepthAndIndex):
(WebCore::CSSCalcExpressionNodeParser::parseCalc):
(WebCore::CSSCalcExpressionNodeParser::operatorValue):
(WebCore::CSSCalcExpressionNodeParser::parseValue):
(WebCore::CSSCalcExpressionNodeParser::parseValueTerm):
(WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
(WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
(WebCore::CSSCalcExpressionNodeParser::parseValueExpression):
(WebCore::checkDepthAndIndexDeprecated):
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueTerm):
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueMultiplicativeExpression):
(WebCore::CSSCalcExpressionNodeParserDeprecated::parseAdditiveValueExpression):
(WebCore::CSSCalcValue::create):
* css/CSSCalculationValue.h:
(WebCore::CSSCalcValue::createCalculationValue):
(WebCore::CSSCalcValue::setPermittedValueRange):
Switch off the permitted calc value range enum, since we can just use the identical ValueRange enum.
Deprecate the CSSParserValueList-based parser by renaming it, and add a new parser that operates
on tokens.

* css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::isStringType):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
(WebCore::CSSPrimitiveValue::equals):
(WebCore::CSSPrimitiveValue::buildParserValue):
* css/CSSPrimitiveValue.h:
Add support for CSS_QUIRKY_EMS as a unit type. This will let us eliminate the extra m_isQuirkValue boolean
eventually.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::validateCalculationUnit):
(WebCore::CSSParser::parseCalculation):
* css/parser/CSSParser.h:
Switch to ValueRange.

* css/parser/CSSParserIdioms.cpp:
(WebCore::completeURL):
* css/parser/CSSParserIdioms.h:
Make the URL completion function from CSSParser.cpp available to all.

* css/parser/CSSParserMode.h:
(WebCore::isUnitLessValueParsingEnabledForMode):
(WebCore::isUnitLessLengthParsingEnabledForMode): Deleted.
Rename this to value, since for now we're not supporting Blink's UserUnits. This means we need to support
unitless parsing for times and angles in addition to lengths, making the name of the function inappropriate.

* css/parser/CSSParserToken.cpp:
(WebCore::cssPrimitiveValueUnitFromTrie):
Turn quirky ems support back on.

* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserValue::createCSSValue):
Support quirky ems.

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeValue):
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
(WebCore::CSSPropertyParserHelpers::consumeInteger):
(WebCore::CSSPropertyParserHelpers::consumePositiveInteger):
(WebCore::CSSPropertyParserHelpers::consumeNumber):
(WebCore::CSSPropertyParserHelpers::shouldAcceptUnitlessValue):
(WebCore::CSSPropertyParserHelpers::consumeLength):
(WebCore::CSSPropertyParserHelpers::consumePercent):
(WebCore::CSSPropertyParserHelpers::canConsumeCalcValue):
(WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
(WebCore::CSSPropertyParserHelpers::consumeAngle):
(WebCore::CSSPropertyParserHelpers::consumeTime):
(WebCore::CSSPropertyParserHelpers::consumeIdent):
(WebCore::CSSPropertyParserHelpers::consumeIdentRange):
(WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
(WebCore::CSSPropertyParserHelpers::consumeString):
(WebCore::CSSPropertyParserHelpers::consumeUrl):
(WebCore::CSSPropertyParserHelpers::parseRGBParameters):
(WebCore::CSSPropertyParserHelpers::parseHSLParameters):
(WebCore::CSSPropertyParserHelpers::consumeColor):
(WebCore::CSSPropertyParserHelpers::consumePositionComponent):
(WebCore::CSSPropertyParserHelpers::positionFromOneValue):
(WebCore::CSSPropertyParserHelpers::positionFromTwoValues):
(WebCore::CSSPropertyParserHelpers::createPrimitiveValuePair):
(WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues):
(WebCore::CSSPropertyParserHelpers::consumePosition):
(WebCore::CSSPropertyParserHelpers::consumeOneOrTwoValuedPosition):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientStopColor):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
(WebCore::CSSPropertyParserHelpers::consumeImageOrNone):
(WebCore::CSSPropertyParserHelpers::consumeCrossFade):
(WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
(WebCore::CSSPropertyParserHelpers::consumeImage):
* css/parser/CSSPropertyParserHelpers.h:
(WebCore::CSSPropertyParserHelpers::isCSSWideKeyword):
Lots of changes here. The most important is switching over to RefPtrs and Refs where appropriate, with the
requisite WTFMoves. Unit types also have to be converted back to our values, and unitless parsing has
to work with consumeTime and consumeAngle.

* platform/CalculationValue.cpp:
(WebCore::CalculationValue::create):
* platform/CalculationValue.h:
(WebCore::CalculationValue::CalculationValue):
Use ValueRange.

* platform/graphics/Color.cpp:
(WebCore::Color::parseHexColor):
(WebCore::Color::Color):
* platform/graphics/Color.h:
Add a StringView-based parseHexColor function.

* rendering/style/BasicShapes.cpp:
(WebCore::BasicShapeCenterCoordinate::updateComputedLength):
Use ValueRange

Tools:

* TestWebKitAPI/Tests/WebCore/CalculationValue.cpp:
(TestWebKitAPI::createTestValue):
Convert to ValueRange.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSCalculationValue.cpp
Source/WebCore/css/CSSCalculationValue.h
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSPrimitiveValue.h
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/css/parser/CSSParser.cpp
Source/WebCore/css/parser/CSSParser.h
Source/WebCore/css/parser/CSSParserIdioms.cpp
Source/WebCore/css/parser/CSSParserIdioms.h
Source/WebCore/css/parser/CSSParserMode.h
Source/WebCore/css/parser/CSSParserToken.cpp
Source/WebCore/css/parser/CSSParserValues.cpp
Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
Source/WebCore/css/parser/CSSPropertyParserHelpers.h
Source/WebCore/platform/CalculationValue.cpp
Source/WebCore/platform/CalculationValue.h
Source/WebCore/platform/Length.cpp
Source/WebCore/platform/graphics/Color.cpp
Source/WebCore/platform/graphics/Color.h
Source/WebCore/rendering/style/BasicShapes.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/CalculationValue.cpp