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 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1231 | 1231 |
1232 bool ComputedStyle::setFontDescription(const FontDescription& v) | 1232 bool ComputedStyle::setFontDescription(const FontDescription& v) |
1233 { | 1233 { |
1234 if (inherited->font.fontDescription() != v) { | 1234 if (inherited->font.fontDescription() != v) { |
1235 inherited.access()->font = Font(v); | 1235 inherited.access()->font = Font(v); |
1236 return true; | 1236 return true; |
1237 } | 1237 } |
1238 return false; | 1238 return false; |
1239 } | 1239 } |
1240 | 1240 |
| 1241 void ComputedStyle::setFont(const Font& font) |
| 1242 { |
| 1243 inherited.access()->font = font; |
| 1244 } |
| 1245 |
1241 const Length& ComputedStyle::specifiedLineHeight() const { return inherited->lin
e_height; } | 1246 const Length& ComputedStyle::specifiedLineHeight() const { return inherited->lin
e_height; } |
1242 Length ComputedStyle::lineHeight() const | 1247 Length ComputedStyle::lineHeight() const |
1243 { | 1248 { |
1244 const Length& lh = inherited->line_height; | 1249 const Length& lh = inherited->line_height; |
1245 // Unlike fontDescription().computedSize() and hence fontSize(), this is | 1250 // Unlike fontDescription().computedSize() and hence fontSize(), this is |
1246 // recalculated on demand as we only store the specified line height. | 1251 // recalculated on demand as we only store the specified line height. |
1247 // FIXME: Should consider scaling the fixed part of any calc expressions | 1252 // FIXME: Should consider scaling the fixed part of any calc expressions |
1248 // too, though this involves messily poking into CalcExpressionLength. | 1253 // too, though this involves messily poking into CalcExpressionLength. |
1249 float multiplier = textAutosizingMultiplier(); | 1254 float multiplier = textAutosizingMultiplier(); |
1250 if (multiplier > 1 && lh.isFixed()) | 1255 if (multiplier > 1 && lh.isFixed()) |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1744 } | 1749 } |
1745 | 1750 |
1746 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) | 1751 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) |
1747 { | 1752 { |
1748 setEmptyState(other.emptyState()); | 1753 setEmptyState(other.emptyState()); |
1749 if (other.hasExplicitlyInheritedProperties()) | 1754 if (other.hasExplicitlyInheritedProperties()) |
1750 setHasExplicitlyInheritedProperties(); | 1755 setHasExplicitlyInheritedProperties(); |
1751 } | 1756 } |
1752 | 1757 |
1753 } // namespace blink | 1758 } // namespace blink |
OLD | NEW |