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

Side by Side 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: Remove unrelated change Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/shapes/shape-outside-floats/shape-outside-line-height-crash2-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 { 1249 {
1250 const Length& lh = lineHeight(); 1250 const Length& lh = lineHeight();
1251 1251
1252 // Negative value means the line height is not set. Use the font's built-in spacing. 1252 // Negative value means the line height is not set. Use the font's built-in spacing.
1253 if (lh.isNegative()) 1253 if (lh.isNegative())
1254 return fontMetrics().lineSpacing(); 1254 return fontMetrics().lineSpacing();
1255 1255
1256 if (lh.isPercent()) 1256 if (lh.isPercent())
1257 return minimumValueForLength(lh, fontSize()); 1257 return minimumValueForLength(lh, fontSize());
1258 1258
1259 return lh.value(); 1259 return LayoutUnit(lh.value());
leviw_travelin_and_unemployed 2015/04/09 23:29:16 I'd just use max(lh.value(), LayoutUnit::max()). T
1260 } 1260 }
1261 1261
1262 void ComputedStyle::setWordSpacing(float wordSpacing) 1262 void ComputedStyle::setWordSpacing(float wordSpacing)
1263 { 1263 {
1264 FontSelector* currentFontSelector = font().fontSelector(); 1264 FontSelector* currentFontSelector = font().fontSelector();
1265 FontDescription desc(fontDescription()); 1265 FontDescription desc(fontDescription());
1266 desc.setWordSpacing(wordSpacing); 1266 desc.setWordSpacing(wordSpacing);
1267 setFontDescription(desc); 1267 setFontDescription(desc);
1268 font().update(currentFontSelector); 1268 font().update(currentFontSelector);
1269 } 1269 }
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 horizontal || includeLogicalRightEdge); 1722 horizontal || includeLogicalRightEdge);
1723 1723
1724 edges[BSLeft] = BorderEdge(borderLeftWidth(), 1724 edges[BSLeft] = BorderEdge(borderLeftWidth(),
1725 visitedDependentColor(CSSPropertyBorderLeftColor), 1725 visitedDependentColor(CSSPropertyBorderLeftColor),
1726 borderLeftStyle(), 1726 borderLeftStyle(),
1727 borderLeftIsTransparent(), 1727 borderLeftIsTransparent(),
1728 !horizontal || includeLogicalLeftEdge); 1728 !horizontal || includeLogicalLeftEdge);
1729 } 1729 }
1730 1730
1731 } // namespace blink 1731 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/shapes/shape-outside-floats/shape-outside-line-height-crash2-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698