From 502b4a55ac778d036a33c32fec51eecbbc73e1a9 Mon Sep 17 00:00:00 2001 From: "mhodovan.u-szeged@partner.samsung.com" Date: Fri, 27 Jun 2014 18:55:46 +0000 Subject: REGRESSION (r168685): css calc() expression fails https://bugs.webkit.org/show_bug.cgi?id=134059 Source/WebCore: The expression 'calc((100% - 20px) / 3' did not work properly after r168685, because primitiveType() function in CSSCalculationValue.cpp has handled CalcPercentLength and CalcPercentNumber categories as if they were angles. The patch fixes this incorrect behavior. Reviewed by Simon Fraser. Test: fast/css/calc-percentage-pixel.html * css/CSSCalculationValue.cpp: LayoutTests: Added test demonstrates that expressions like 'calc((100% - 20px) / 3' work correctly again. Reviewed by Simon Fraser. * fast/css/calc-percentage-pixel-expected.html: Added. * fast/css/calc-percentage-pixel.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170544 268f45cc-cd09-0410-ab3c-d52691b4dbfc Change-Id: I2cebbb43b511c8c3634c55a97598d362ae0a1ab3 Reviewed-by: Allan Sandfeld Jensen --- Source/WebCore/css/CSSCalculationValue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/WebCore/css/CSSCalculationValue.cpp b/Source/WebCore/css/CSSCalculationValue.cpp index 60fd22adf..b7072e5e4 100644 --- a/Source/WebCore/css/CSSCalculationValue.cpp +++ b/Source/WebCore/css/CSSCalculationValue.cpp @@ -551,14 +551,14 @@ public: case CalcVariable: return CSSPrimitiveValue::CSS_VARIABLE_NAME; #endif - case CalcPercentLength: - case CalcPercentNumber: case CalcAngle: return CSSPrimitiveValue::CSS_DEG; case CalcTime: return CSSPrimitiveValue::CSS_MS; case CalcFrequency: return CSSPrimitiveValue::CSS_HZ; + case CalcPercentLength: + case CalcPercentNumber: case CalcOther: return CSSPrimitiveValue::CSS_UNKNOWN; } -- cgit v1.2.1