OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
| 4 * All rights reserved. |
4 * | 5 * |
5 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
8 * 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. |
9 * | 10 * |
10 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 14 * Library General Public License for more details. |
(...skipping 24 matching lines...) Expand all Loading... |
38 STATIC_ONLY(FontSize); | 39 STATIC_ONLY(FontSize); |
39 | 40 |
40 public: | 41 public: |
41 static float getComputedSizeFromSpecifiedSize( | 42 static float getComputedSizeFromSpecifiedSize( |
42 const Document*, | 43 const Document*, |
43 float zoomFactor, | 44 float zoomFactor, |
44 bool isAbsoluteSize, | 45 bool isAbsoluteSize, |
45 float specifiedSize, | 46 float specifiedSize, |
46 ESmartMinimumForFontSize = UseSmartMinimumForFontSize); | 47 ESmartMinimumForFontSize = UseSmartMinimumForFontSize); |
47 | 48 |
48 // Given a CSS keyword in the range (xx-small to -webkit-xxx-large), this func
tion returns | 49 // Given a CSS keyword in the range (xx-small to -webkit-xxx-large), this |
| 50 // function returns |
49 // values from '1' to '8'. | 51 // values from '1' to '8'. |
50 static unsigned keywordSize(CSSValueID valueID) { | 52 static unsigned keywordSize(CSSValueID valueID) { |
51 ASSERT(isValidValueID(valueID)); | 53 ASSERT(isValidValueID(valueID)); |
52 return valueID - CSSValueXxSmall + 1; | 54 return valueID - CSSValueXxSmall + 1; |
53 } | 55 } |
54 | 56 |
55 static bool isValidValueID(CSSValueID valueID) { | 57 static bool isValidValueID(CSSValueID valueID) { |
56 return valueID >= CSSValueXxSmall && valueID <= CSSValueWebkitXxxLarge; | 58 return valueID >= CSSValueXxSmall && valueID <= CSSValueWebkitXxxLarge; |
57 } | 59 } |
58 | 60 |
59 static CSSValueID initialValueID() { return CSSValueMedium; } | 61 static CSSValueID initialValueID() { return CSSValueMedium; } |
60 static unsigned initialKeywordSize() { return keywordSize(initialValueID()); } | 62 static unsigned initialKeywordSize() { return keywordSize(initialValueID()); } |
61 | 63 |
62 // Given a keyword size in the range (1 to 8), this function will return | 64 // Given a keyword size in the range (1 to 8), this function will return |
63 // the correct font size scaled relative to the user's default (4). | 65 // the correct font size scaled relative to the user's default (4). |
64 static float fontSizeForKeyword(const Document*, | 66 static float fontSizeForKeyword(const Document*, |
65 unsigned keyword, | 67 unsigned keyword, |
66 bool isMonospace); | 68 bool isMonospace); |
67 | 69 |
68 // Given a font size in pixel, this function will return legacy font size betw
een 1 and 7. | 70 // Given a font size in pixel, this function will return legacy font size |
| 71 // between 1 and 7. |
69 static int legacyFontSize(const Document*, | 72 static int legacyFontSize(const Document*, |
70 int pixelFontSize, | 73 int pixelFontSize, |
71 bool isMonospace); | 74 bool isMonospace); |
72 }; | 75 }; |
73 | 76 |
74 } // namespace blink | 77 } // namespace blink |
75 | 78 |
76 #endif // FontSize_h | 79 #endif // FontSize_h |
OLD | NEW |