Index: Source/core/css/parser/CSSPropertyParser.cpp |
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp |
index 3e50cab7bcf86ea4fc864aea921a173b5e2021de..c2b46a7a18b31b8dbcf0d0c46b5e277b38a53699 100644 |
--- a/Source/core/css/parser/CSSPropertyParser.cpp |
+++ b/Source/core/css/parser/CSSPropertyParser.cpp |
@@ -4684,6 +4684,12 @@ bool CSSPropertyParser::parseLineHeight(bool important) |
validPrimitive = true; |
else |
validPrimitive = (!id && validUnit(value, FNumber | FLength | FPercent | FNonNeg)); |
+ // The line-height property can accept both percents and numbers but additive opertaions are |
+ // not permitted on them in calc() expressions. |
+ if (m_parsedCalculation && m_parsedCalculation->category() == CalcPercentNumber) { |
+ validPrimitive = false; |
+ m_parsedCalculation.release(); |
+ } |
if (validPrimitive && (!m_valueList->next() || inShorthand())) |
addProperty(CSSPropertyLineHeight, parseValidPrimitive(id, value), important); |
return validPrimitive; |