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 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1300 | 1300 |
1301 return lh; | 1301 return lh; |
1302 } | 1302 } |
1303 | 1303 |
1304 void ComputedStyle::setLineHeight(const Length& specifiedLineHeight) { SET_VAR(i
nherited, line_height, specifiedLineHeight); } | 1304 void ComputedStyle::setLineHeight(const Length& specifiedLineHeight) { SET_VAR(i
nherited, line_height, specifiedLineHeight); } |
1305 | 1305 |
1306 int ComputedStyle::computedLineHeight() const | 1306 int ComputedStyle::computedLineHeight() const |
1307 { | 1307 { |
1308 const Length& lh = lineHeight(); | 1308 const Length& lh = lineHeight(); |
1309 | 1309 |
1310 // Negative value means the line height is not set. Use the font's built-in
spacing. | 1310 // Negative value means the line height is not set. Use the font's built-in |
1311 if (lh.isNegative()) | 1311 // spacing, if avalible. |
| 1312 if (lh.isNegative() && font().primaryFont()) |
1312 return fontMetrics().lineSpacing(); | 1313 return fontMetrics().lineSpacing(); |
1313 | 1314 |
1314 if (lh.hasPercent()) | 1315 if (lh.hasPercent()) |
1315 return minimumValueForLength(lh, fontSize()); | 1316 return minimumValueForLength(lh, fontSize()); |
1316 | 1317 |
1317 return std::min(lh.value(), LayoutUnit::max().toFloat()); | 1318 return std::min(lh.value(), LayoutUnit::max().toFloat()); |
1318 } | 1319 } |
1319 | 1320 |
1320 void ComputedStyle::setWordSpacing(float wordSpacing) | 1321 void ComputedStyle::setWordSpacing(float wordSpacing) |
1321 { | 1322 { |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1798 } | 1799 } |
1799 | 1800 |
1800 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) | 1801 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) |
1801 { | 1802 { |
1802 setEmptyState(other.emptyState()); | 1803 setEmptyState(other.emptyState()); |
1803 if (other.hasExplicitlyInheritedProperties()) | 1804 if (other.hasExplicitlyInheritedProperties()) |
1804 setHasExplicitlyInheritedProperties(); | 1805 setHasExplicitlyInheritedProperties(); |
1805 } | 1806 } |
1806 | 1807 |
1807 } // namespace blink | 1808 } // namespace blink |
OLD | NEW |