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

Unified Diff: Source/core/style/ComputedStyle.cpp

Issue 1016863002: Fix integer overflow in ComputedStyle::computedLineHeight (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add tests Created 5 years, 9 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/style/ComputedStyle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/style/ComputedStyle.cpp
diff --git a/Source/core/style/ComputedStyle.cpp b/Source/core/style/ComputedStyle.cpp
index be6750a2d58f368f365364f44fa3add27163e796..4ede387d2de0e580e5efa93a618e94142974b64f 100644
--- a/Source/core/style/ComputedStyle.cpp
+++ b/Source/core/style/ComputedStyle.cpp
@@ -1245,7 +1245,7 @@ Length ComputedStyle::lineHeight() const
void ComputedStyle::setLineHeight(const Length& specifiedLineHeight) { SET_VAR(inherited, line_height, specifiedLineHeight); }
-int ComputedStyle::computedLineHeight() const
+LayoutUnit ComputedStyle::computedLineHeight() const
{
const Length& lh = lineHeight();
@@ -1256,7 +1256,7 @@ int ComputedStyle::computedLineHeight() const
if (lh.isPercent())
return minimumValueForLength(lh, fontSize());
- return lh.value();
+ return truncf(lh.value());
Bem Jones-Bey (adobe) 2015/04/02 21:53:14 Why do we have to explicitly truncf here? Does the
}
void ComputedStyle::setWordSpacing(float wordSpacing)
« no previous file with comments | « Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698