Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(531)

Unified Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 787073006: Fix number handling in accumulatePixelsAndPercent. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix the previous fail. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/css3/calc/calc-with-percent-and-number-in-line-height-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index 165e2fae20692bdad55995ee43b2dfad5aa252c7..4c07dc937ff62549dbaa65a3c2c50ef080f2b713 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -4684,6 +4684,10 @@ 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;
alancutter (OOO until 2018) 2014/12/31 03:38:08 You should release() m_parsedCalulation here if it
if (validPrimitive && (!m_valueList->next() || inShorthand()))
addProperty(CSSPropertyLineHeight, parseValidPrimitive(id, value), important);
return validPrimitive;
« no previous file with comments | « LayoutTests/css3/calc/calc-with-percent-and-number-in-line-height-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698