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 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 | 1247 |
1248 bool ComputedStyle::setFontDescription(const FontDescription& v) | 1248 bool ComputedStyle::setFontDescription(const FontDescription& v) |
1249 { | 1249 { |
1250 if (inherited->font.fontDescription() != v) { | 1250 if (inherited->font.fontDescription() != v) { |
1251 inherited.access()->font = Font(v); | 1251 inherited.access()->font = Font(v); |
1252 return true; | 1252 return true; |
1253 } | 1253 } |
1254 return false; | 1254 return false; |
1255 } | 1255 } |
1256 | 1256 |
| 1257 void ComputedStyle::setFont(const Font& font) |
| 1258 { |
| 1259 inherited.access()->font = font; |
| 1260 } |
| 1261 |
1257 const Length& ComputedStyle::specifiedLineHeight() const { return inherited->lin
e_height; } | 1262 const Length& ComputedStyle::specifiedLineHeight() const { return inherited->lin
e_height; } |
1258 Length ComputedStyle::lineHeight() const | 1263 Length ComputedStyle::lineHeight() const |
1259 { | 1264 { |
1260 const Length& lh = inherited->line_height; | 1265 const Length& lh = inherited->line_height; |
1261 // Unlike fontDescription().computedSize() and hence fontSize(), this is | 1266 // Unlike fontDescription().computedSize() and hence fontSize(), this is |
1262 // recalculated on demand as we only store the specified line height. | 1267 // recalculated on demand as we only store the specified line height. |
1263 // FIXME: Should consider scaling the fixed part of any calc expressions | 1268 // FIXME: Should consider scaling the fixed part of any calc expressions |
1264 // too, though this involves messily poking into CalcExpressionLength. | 1269 // too, though this involves messily poking into CalcExpressionLength. |
1265 float multiplier = textAutosizingMultiplier(); | 1270 float multiplier = textAutosizingMultiplier(); |
1266 if (multiplier > 1 && lh.isFixed()) | 1271 if (multiplier > 1 && lh.isFixed()) |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1760 } | 1765 } |
1761 | 1766 |
1762 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) | 1767 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) |
1763 { | 1768 { |
1764 setEmptyState(other.emptyState()); | 1769 setEmptyState(other.emptyState()); |
1765 if (other.hasExplicitlyInheritedProperties()) | 1770 if (other.hasExplicitlyInheritedProperties()) |
1766 setHasExplicitlyInheritedProperties(); | 1771 setHasExplicitlyInheritedProperties(); |
1767 } | 1772 } |
1768 | 1773 |
1769 } // namespace blink | 1774 } // namespace blink |
OLD | NEW |