OLD | NEW |
---|---|
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 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1238 // too, though this involves messily poking into CalcExpressionLength. | 1238 // too, though this involves messily poking into CalcExpressionLength. |
1239 float multiplier = textAutosizingMultiplier(); | 1239 float multiplier = textAutosizingMultiplier(); |
1240 if (multiplier > 1 && lh.isFixed()) | 1240 if (multiplier > 1 && lh.isFixed()) |
1241 return Length(TextAutosizer::computeAutosizedFontSize(lh.value(), multip lier), Fixed); | 1241 return Length(TextAutosizer::computeAutosizedFontSize(lh.value(), multip lier), Fixed); |
1242 | 1242 |
1243 return lh; | 1243 return lh; |
1244 } | 1244 } |
1245 | 1245 |
1246 void ComputedStyle::setLineHeight(const Length& specifiedLineHeight) { SET_VAR(i nherited, line_height, specifiedLineHeight); } | 1246 void ComputedStyle::setLineHeight(const Length& specifiedLineHeight) { SET_VAR(i nherited, line_height, specifiedLineHeight); } |
1247 | 1247 |
1248 int ComputedStyle::computedLineHeight() const | 1248 LayoutUnit ComputedStyle::computedLineHeight() const |
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 truncf(lh.value()); |
Bem Jones-Bey (adobe)
2015/04/02 21:53:14
Why do we have to explicitly truncf here? Does the
| |
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 Loading... | |
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 |
OLD | NEW |