| 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 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 { | 931 { |
| 932 FontSelector* currentFontSelector = font().fontSelector(); | 932 FontSelector* currentFontSelector = font().fontSelector(); |
| 933 FontDescription desc(fontDescription()); | 933 FontDescription desc(fontDescription()); |
| 934 desc.setLetterSpacing(letterSpacing); | 934 desc.setLetterSpacing(letterSpacing); |
| 935 setFontDescription(desc); | 935 setFontDescription(desc); |
| 936 font().update(currentFontSelector); | 936 font().update(currentFontSelector); |
| 937 } | 937 } |
| 938 | 938 |
| 939 void RenderStyle::setFontSize(float size) | 939 void RenderStyle::setFontSize(float size) |
| 940 { | 940 { |
| 941 // size must be specifiedSize if Text Autosizing is enabled, but computedSiz
e if text | |
| 942 // zoom is enabled (if neither is enabled it's irrelevant as they're probabl
y the same). | |
| 943 | |
| 944 ASSERT(std::isfinite(size)); | 941 ASSERT(std::isfinite(size)); |
| 945 if (!std::isfinite(size) || size < 0) | 942 if (!std::isfinite(size) || size < 0) |
| 946 size = 0; | 943 size = 0; |
| 947 else | 944 else |
| 948 size = std::min(maximumAllowedFontSize, size); | 945 size = std::min(maximumAllowedFontSize, size); |
| 949 | 946 |
| 950 FontSelector* currentFontSelector = font().fontSelector(); | 947 FontSelector* currentFontSelector = font().fontSelector(); |
| 951 FontDescription desc(fontDescription()); | 948 FontDescription desc(fontDescription()); |
| 952 desc.setSpecifiedSize(size); | 949 desc.setSpecifiedSize(size); |
| 953 desc.setComputedSize(size); | 950 desc.setComputedSize(size); |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 // right | 1313 // right |
| 1317 radiiSum = radii.topRight().height() + radii.bottomRight().height(); | 1314 radiiSum = radii.topRight().height() + radii.bottomRight().height(); |
| 1318 if (radiiSum > rect.height()) | 1315 if (radiiSum > rect.height()) |
| 1319 factor = std::min(rect.height() / radiiSum, factor); | 1316 factor = std::min(rect.height() / radiiSum, factor); |
| 1320 | 1317 |
| 1321 ASSERT(factor <= 1); | 1318 ASSERT(factor <= 1); |
| 1322 return factor; | 1319 return factor; |
| 1323 } | 1320 } |
| 1324 | 1321 |
| 1325 } // namespace blink | 1322 } // namespace blink |
| OLD | NEW |