CSS3 calc(): handle non-negative values
https://bugs.webkit.org/show_bug.cgi?id=79188
Reviewed by Daniel Bates.
Source/WebCore:
Some CSS properties (e.g. padding) are required to be non-negative. These
are now restricted to the correct range.
Tests: css3/calc/negative-padding-expected.html
css3/calc/negative-padding.html
* css/CSSCalculationValue.cpp:
(WebCore):
(WebCore::CSSCalcValue::clampToPermittedRange): Added
(WebCore::CSSCalcValue::doubleValue):
(WebCore::CSSCalcValue::isNegative): Added
(WebCore::CSSCalcValue::computeLengthPx):
(WebCore::CSSCalcValue::create):
* css/CSSCalculationValue.h:
(CSSCalcValue):
(WebCore::CSSCalcValue::CSSCalcValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::validCalculationUnit):
(WebCore::CSSParser::parseCalculation):
* css/CSSParser.h:
* platform/CalculationValue.h:
LayoutTests:
* css3/calc/negative-padding-expected.html: Added.
* css3/calc/negative-padding.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108750
268f45cc-cd09-0410-ab3c-
d52691b4dbfc