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

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

Issue 633643003: Enable float source size (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed merge issue Created 6 years, 2 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 | « Source/core/css/parser/SizesCalcParser.h ('k') | Source/core/css/parser/SizesCalcParserTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/SizesCalcParser.cpp
diff --git a/Source/core/css/parser/SizesCalcParser.cpp b/Source/core/css/parser/SizesCalcParser.cpp
index 3a7272ff50383b950dccb6d18687638e5c0db31d..7265554e0d10d5e55c05a9b51f9c6930bcb01b82 100644
--- a/Source/core/css/parser/SizesCalcParser.cpp
+++ b/Source/core/css/parser/SizesCalcParser.cpp
@@ -18,7 +18,7 @@ SizesCalcParser::SizesCalcParser(MediaQueryTokenIterator start, MediaQueryTokenI
m_isValid = calcToReversePolishNotation(start, end) && calculate();
}
-unsigned SizesCalcParser::result() const
+float SizesCalcParser::result() const
{
ASSERT(m_isValid);
return m_result;
@@ -212,7 +212,7 @@ bool SizesCalcParser::calculate()
}
}
if (stack.size() == 1 && stack.last().isLength) {
- m_result = clampTo<unsigned>(stack.last().value);
+ m_result = std::max(clampTo<float>(stack.last().value), (float)0.0);
return true;
}
return false;
« no previous file with comments | « Source/core/css/parser/SizesCalcParser.h ('k') | Source/core/css/parser/SizesCalcParserTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698