ASSERTION FAILED: leftCategory != CalcOther && rightCategory != CalcOther
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 May 2014 17:08:43 +0000 (17:08 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 May 2014 17:08:43 +0000 (17:08 +0000)
commit8a6d59f526f196a9541bc56ba3c5890ad149f584
tree60e93594af19a07fd83c8a3a55b9ff49d884664e
parentf779296db7d462b476c7b724cd852357db88407b
ASSERTION FAILED: leftCategory != CalcOther && rightCategory != CalcOther
in WebCore::CSSCalcBinaryOperation::createSimplified
https://bugs.webkit.org/show_bug.cgi?id=132870

Source/WebCore:
According to the standard, calc() should be able to handle angle, time
and frequency values as well: http://www.w3.org/TR/css3-values/#calc

Patch by Martin Hodovan <mhodovan.u-szeged@partner.samsung.com> on 2014-05-13
Reviewed by Darin Adler.

Test: fast/css/calc-with-angle-time-frequency.html

* css/CSSCalculationValue.cpp:
(WebCore::unitCategory):
(WebCore::CSSCalcPrimitiveValue::createCalcExpression):
(WebCore::CSSCalcPrimitiveValue::computeLengthPx):
(WebCore::CSSCalcPrimitiveValue::addSubtractResult):
(WebCore::CSSCalcPrimitiveValue::determineCategory):
(WebCore::CSSCalcBinaryOperation::primitiveType)
* css/CSSCalculationValue.h: extending CalculationCategory
* css/CSSParser.cpp:
(WebCore::CSSParser::validCalculationUnit):
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::primitiveType):

LayoutTests:
Added test contains calc() expressions with angle, time and frequency values,
covering all the newly introduced unit types, each of which used to fail.

Patch by Martin Hodovan <mhodovan.u-szeged@partner.samsung.com> on 2014-05-13
Reviewed by Darin Adler.

* fast/css/calc-with-angle-time-frequency-expected.txt: Added.
* fast/css/calc-with-angle-time-frequency.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/calc-with-angle-time-frequency-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/calc-with-angle-time-frequency.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSCalculationValue.cpp
Source/WebCore/css/CSSCalculationValue.h
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPrimitiveValue.cpp