Crash when setting 'flex' CSS property to 'calc(2 * 3) calc(2 * 3)'
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Dec 2014 19:15:33 +0000 (19:15 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Dec 2014 19:15:33 +0000 (19:15 +0000)
commit6e067bb862298992aedb513703d864c3659e3745
tree6eceb4395b5b9de6d728fd34744b67ca58694f89
parenta3afe24edf631c5965fb9c7e8b8802fdf890b6c4
Crash when setting 'flex' CSS property to 'calc(2 * 3) calc(2 * 3)'
https://bugs.webkit.org/show_bug.cgi?id=139162

Reviewed by Darin Adler.

Source/WebCore:

Add support for calculated values in 'flex' CSS property.
Previously, those did not work in release builds, and were hitting
an assertion in debug builds.

Test: fast/css/flex-calculated-value.html

* css/CSSParser.cpp:
(WebCore::CSSParser::validCalculationUnit):
Do not call RefPtr::release() as we are not interested in the return
value. Assign nullptr to the member instead.

(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFillPositionComponent):
(WebCore::CSSParser::parseCubicBezierTimingFunctionValue):
(WebCore::CSSParser::parseFontWeight):
(WebCore::CSSParser::parsedDouble):
(WebCore::CSSParser::colorIntFromValue):
(WebCore::CSSParser::parseColorParameters):
(WebCore::CSSParser::parseHSLParameters):
(WebCore::CSSParser::parseFlex):
* css/CSSParser.h:

LayoutTests:

Add layout test for calculated value support for 'flex' CSS property.

* fast/css/flex-calculated-value-expected.txt: Added.
* fast/css/flex-calculated-value.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/flex-calculated-value-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/flex-calculated-value.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h