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

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: Release parsedCalculation Created 5 years, 11 months 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 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;
« 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