summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormhodovan.u-szeged@partner.samsung.com <mhodovan.u-szeged@partner.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>2014-06-27 18:55:46 +0000
committerKonstantin Tokarev <annulen@yandex.ru>2016-09-27 07:16:55 +0000
commit502b4a55ac778d036a33c32fec51eecbbc73e1a9 (patch)
tree00830cefb6ea678fe11d27a7e1ed54d9e4117dd9
parentac20ee9ffda40fd1c1714ec3a000bbf27c3eee33 (diff)
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 <allan.jensen@qt.io>
-rw-r--r--Source/WebCore/css/CSSCalculationValue.cpp4
1 files 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;
}