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. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
4 * All rights reserved. | 4 * 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const Document*, | 43 const Document*, |
44 float zoomFactor, | 44 float zoomFactor, |
45 bool isAbsoluteSize, | 45 bool isAbsoluteSize, |
46 float specifiedSize, | 46 float specifiedSize, |
47 ApplyMinimumFontSize = ApplyMinimumForFontSize); | 47 ApplyMinimumFontSize = ApplyMinimumForFontSize); |
48 | 48 |
49 // Given a CSS keyword in the range (xx-small to -webkit-xxx-large), this | 49 // Given a CSS keyword in the range (xx-small to -webkit-xxx-large), this |
50 // function returns | 50 // function returns |
51 // values from '1' to '8'. | 51 // values from '1' to '8'. |
52 static unsigned keywordSize(CSSValueID valueID) { | 52 static unsigned keywordSize(CSSValueID valueID) { |
53 ASSERT(isValidValueID(valueID)); | 53 DCHECK(isValidValueID(valueID)); |
54 return valueID - CSSValueXxSmall + 1; | 54 return valueID - CSSValueXxSmall + 1; |
55 } | 55 } |
56 | 56 |
57 static bool isValidValueID(CSSValueID valueID) { | 57 static bool isValidValueID(CSSValueID valueID) { |
58 return valueID >= CSSValueXxSmall && valueID <= CSSValueWebkitXxxLarge; | 58 return valueID >= CSSValueXxSmall && valueID <= CSSValueWebkitXxxLarge; |
59 } | 59 } |
60 | 60 |
61 static CSSValueID initialValueID() { return CSSValueMedium; } | 61 static CSSValueID initialValueID() { return CSSValueMedium; } |
62 static unsigned initialKeywordSize() { return keywordSize(initialValueID()); } | 62 static unsigned initialKeywordSize() { return keywordSize(initialValueID()); } |
63 | 63 |
64 // 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 |
65 // 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). |
66 static float fontSizeForKeyword(const Document*, | 66 static float fontSizeForKeyword(const Document*, |
67 unsigned keyword, | 67 unsigned keyword, |
68 bool isMonospace); | 68 bool isMonospace); |
69 | 69 |
70 // Given a font size in pixel, this function will return legacy font size | 70 // Given a font size in pixel, this function will return legacy font size |
71 // between 1 and 7. | 71 // between 1 and 7. |
72 static int legacyFontSize(const Document*, | 72 static int legacyFontSize(const Document*, |
73 int pixelFontSize, | 73 int pixelFontSize, |
74 bool isMonospace); | 74 bool isMonospace); |
75 }; | 75 }; |
76 | 76 |
77 } // namespace blink | 77 } // namespace blink |
78 | 78 |
79 #endif // FontSize_h | 79 #endif // FontSize_h |
OLD | NEW |