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 12 matching lines...) Expand all Loading... |
23 #ifndef FontSize_h | 23 #ifndef FontSize_h |
24 #define FontSize_h | 24 #define FontSize_h |
25 | 25 |
26 #include "core/CSSValueKeywords.h" | 26 #include "core/CSSValueKeywords.h" |
27 #include "wtf/Allocator.h" | 27 #include "wtf/Allocator.h" |
28 | 28 |
29 namespace blink { | 29 namespace blink { |
30 | 30 |
31 class Document; | 31 class Document; |
32 | 32 |
33 enum ESmartMinimumForFontSize { | 33 enum ApplyMinimumFontSize { |
34 DoNotUseSmartMinimumForFontSize, | 34 DoNotApplyMinimumForFontSize, |
35 UseSmartMinimumForFontSize | 35 ApplyMinimumForFontSize |
36 }; | 36 }; |
37 | 37 |
38 class FontSize { | 38 class FontSize { |
39 STATIC_ONLY(FontSize); | 39 STATIC_ONLY(FontSize); |
40 | 40 |
41 public: | 41 public: |
42 static float getComputedSizeFromSpecifiedSize( | 42 static float getComputedSizeFromSpecifiedSize( |
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 ESmartMinimumForFontSize = UseSmartMinimumForFontSize); | 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 ASSERT(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) { |
(...skipping 12 matching lines...) Expand all Loading... |
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 |