CSS3 calc: embed calc expressions in CSSPrimitiveValue
https://bugs.webkit.org/show_bug.cgi?id=78446
Source/WebCore:
Reviewed by Ojan Vafai.
Adds calc expressions to CSSPrimitiveValue. This enables simple (ie no mixing of
percents with numbers/lengths) expressions to be evaluated on most properties.
Tests: css3/calc/block-mask-overlay-image-outset-expected.html
css3/calc/css3-radial-gradients-expected.html
css3/calc/gradient-color-stops-expected.html
* css/CSSCalculationValue.cpp:
(WebCore::CSSCalcValue::computeLengthPx):
(WebCore):
(WebCore::CSSCalcPrimitiveValue::doubleValue):
(CSSCalcPrimitiveValue):
(WebCore::CSSCalcPrimitiveValue::computeLengthPx):
(CSSCalcBinaryOperation):
(WebCore::CSSCalcBinaryOperation::computeLengthPx):
* css/CSSCalculationValue.h:
(CSSCalcExpressionNode):
(CSSCalcValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::createPrimitiveNumericValue):
(WebCore::CSSParser::parseValidPrimitive):
* css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::CSSPrimitiveValue::primitiveType):
(WebCore::CSSPrimitiveValue::init):
(WebCore):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::computeLengthDouble):
(WebCore::CSSPrimitiveValue::getDoubleValue):
(WebCore::CSSPrimitiveValue::getDoubleValueInternal):
(WebCore::CSSPrimitiveValue::customCssText):
* css/CSSPrimitiveValue.h:
(WebCore):
(WebCore::CSSPrimitiveValue::isLength):
(WebCore::CSSPrimitiveValue::isNumber):
(WebCore::CSSPrimitiveValue::isPercentage):
(WebCore::CSSPrimitiveValue::isPx):
(WebCore::CSSPrimitiveValue::isCalculated):
(WebCore::CSSPrimitiveValue::isCalculatedPercentageNumber):
(WebCore::CSSPrimitiveValue::isCalculatedPercentageLength):
(CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::getValue):
(WebCore::CSSPrimitiveValue::cssCalcValue):
* css/CSSStyleApplyProperty.cpp:
(WebCore::ApplyPropertyBorderRadius::applyValue):
LayoutTests:
Reviewed by Ojan Vafai.
* css3/calc/block-mask-overlay-image-outset-expected.html: Renamed from LayoutTests/css3/calc/block-mask-overlay-image-outset-expected-mismatch.html.
* css3/calc/border-expected.txt:
* css3/calc/calc-errors-expected.txt:
* css3/calc/css3-radial-gradients-expected.html: Renamed from LayoutTests/css3/calc/css3-radial-gradients-expected-mismatch.html.
* css3/calc/font-expected.txt:
* css3/calc/font-monospace-expected.txt:
* css3/calc/font-size-expected.txt:
* css3/calc/font-size-fractional-expected.txt:
* css3/calc/getComputedStyle-margin-percentage-expected.txt:
* css3/calc/gradient-color-stops-expected.html: Renamed from LayoutTests/css3/calc/gradient-color-stops-expected-mismatch.html.
* css3/calc/line-height-expected.txt:
* css3/calc/margin-expected.txt:
* css3/calc/padding-expected.txt:
* css3/calc/simple-calcs-expected.txt:
* css3/calc/table-border-spacing-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107688
268f45cc-cd09-0410-ab3c-
d52691b4dbfc