OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef CSSToLengthConversionData_h | 31 #ifndef CSSToLengthConversionData_h |
32 #define CSSToLengthConversionData_h | 32 #define CSSToLengthConversionData_h |
33 | 33 |
34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
| 35 #include "wtf/Allocator.h" |
35 #include "wtf/Assertions.h" | 36 #include "wtf/Assertions.h" |
36 #include "wtf/MathExtras.h" | 37 #include "wtf/MathExtras.h" |
37 #include <limits> | 38 #include <limits> |
38 | 39 |
39 namespace blink { | 40 namespace blink { |
40 | 41 |
41 class ComputedStyle; | 42 class ComputedStyle; |
42 class LayoutView; | 43 class LayoutView; |
43 class Font; | 44 class Font; |
44 | 45 |
45 class CORE_EXPORT CSSToLengthConversionData { | 46 class CORE_EXPORT CSSToLengthConversionData { |
| 47 DISALLOW_ALLOCATION(); |
46 public: | 48 public: |
47 | 49 |
48 class FontSizes { | 50 class FontSizes { |
| 51 DISALLOW_ALLOCATION(); |
49 public: | 52 public: |
50 FontSizes() : m_em(0), m_rem(0), m_font(nullptr) { } | 53 FontSizes() : m_em(0), m_rem(0), m_font(nullptr) { } |
51 FontSizes(float em, float rem, const Font*); | 54 FontSizes(float em, float rem, const Font*); |
52 FontSizes(const ComputedStyle*, const ComputedStyle* rootStyle); | 55 FontSizes(const ComputedStyle*, const ComputedStyle* rootStyle); |
53 | 56 |
54 float em() const { return m_em; } | 57 float em() const { return m_em; } |
55 float rem() const { return m_rem; } | 58 float rem() const { return m_rem; } |
56 float ex() const; | 59 float ex() const; |
57 float ch() const; | 60 float ch() const; |
58 private: | 61 private: |
59 float m_em; | 62 float m_em; |
60 float m_rem; | 63 float m_rem; |
61 const Font* m_font; | 64 const Font* m_font; |
62 }; | 65 }; |
63 | 66 |
64 class ViewportSize { | 67 class ViewportSize { |
| 68 DISALLOW_ALLOCATION(); |
65 public: | 69 public: |
66 ViewportSize() : m_width(0), m_height(0) { } | 70 ViewportSize() : m_width(0), m_height(0) { } |
67 ViewportSize(double width, double height) : m_width(width), m_height(hei
ght) { } | 71 ViewportSize(double width, double height) : m_width(width), m_height(hei
ght) { } |
68 explicit ViewportSize(const LayoutView*); | 72 explicit ViewportSize(const LayoutView*); |
69 | 73 |
70 double width() const { return m_width; } | 74 double width() const { return m_width; } |
71 double height() const { return m_height; } | 75 double height() const { return m_height; } |
72 private: | 76 private: |
73 double m_width; | 77 double m_width; |
74 double m_height; | 78 double m_height; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 private: | 110 private: |
107 const ComputedStyle* m_style; | 111 const ComputedStyle* m_style; |
108 FontSizes m_fontSizes; | 112 FontSizes m_fontSizes; |
109 ViewportSize m_viewportSize; | 113 ViewportSize m_viewportSize; |
110 float m_zoom; | 114 float m_zoom; |
111 }; | 115 }; |
112 | 116 |
113 } // namespace blink | 117 } // namespace blink |
114 | 118 |
115 #endif | 119 #endif |
OLD | NEW |