| 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 15 matching lines...) Expand all Loading... |
| 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 "core/css/CSSPrimitiveValue.h" | 35 #include "core/css/CSSPrimitiveValue.h" |
| 36 #include "platform/geometry/DoubleSize.h" | |
| 37 #include "wtf/Allocator.h" | 36 #include "wtf/Allocator.h" |
| 38 #include "wtf/Assertions.h" | 37 #include "wtf/Assertions.h" |
| 39 #include "wtf/MathExtras.h" | 38 #include "wtf/MathExtras.h" |
| 40 #include <limits> | 39 #include <limits> |
| 41 | 40 |
| 42 namespace blink { | 41 namespace blink { |
| 43 | 42 |
| 44 class ComputedStyle; | 43 class ComputedStyle; |
| 45 class LayoutView; | 44 class LayoutView; |
| 46 class Font; | 45 class Font; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 62 float ch() const; | 61 float ch() const; |
| 63 private: | 62 private: |
| 64 float m_em; | 63 float m_em; |
| 65 float m_rem; | 64 float m_rem; |
| 66 const Font* m_font; | 65 const Font* m_font; |
| 67 }; | 66 }; |
| 68 | 67 |
| 69 class ViewportSize { | 68 class ViewportSize { |
| 70 DISALLOW_NEW(); | 69 DISALLOW_NEW(); |
| 71 public: | 70 public: |
| 72 ViewportSize() { } | 71 ViewportSize() : m_width(0), m_height(0) { } |
| 73 ViewportSize(double width, double height) : m_size(width, height) { } | 72 ViewportSize(double width, double height) : m_width(width), m_height(hei
ght) { } |
| 74 explicit ViewportSize(const LayoutView*); | 73 explicit ViewportSize(const LayoutView*); |
| 75 | 74 |
| 76 double width() const { return m_size.width(); } | 75 double width() const { return m_width; } |
| 77 double height() const { return m_size.height(); } | 76 double height() const { return m_height; } |
| 78 private: | 77 private: |
| 79 DoubleSize m_size; | 78 double m_width; |
| 79 double m_height; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 CSSToLengthConversionData() { } | 82 CSSToLengthConversionData() { } |
| 83 CSSToLengthConversionData(const ComputedStyle*, const FontSizes&, const View
portSize&, float zoom); | 83 CSSToLengthConversionData(const ComputedStyle*, const FontSizes&, const View
portSize&, float zoom); |
| 84 CSSToLengthConversionData(const ComputedStyle* currStyle, const ComputedStyl
e* rootStyle, const LayoutView*, float zoom); | 84 CSSToLengthConversionData(const ComputedStyle* currStyle, const ComputedStyl
e* rootStyle, const LayoutView*, float zoom); |
| 85 | 85 |
| 86 float zoom() const { return m_zoom; } | 86 float zoom() const { return m_zoom; } |
| 87 | 87 |
| 88 float emFontSize() const { return m_fontSizes.em(); } | 88 float emFontSize() const { return m_fontSizes.em(); } |
| 89 float remFontSize() const; | 89 float remFontSize() const; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 113 private: | 113 private: |
| 114 const ComputedStyle* m_style; | 114 const ComputedStyle* m_style; |
| 115 FontSizes m_fontSizes; | 115 FontSizes m_fontSizes; |
| 116 ViewportSize m_viewportSize; | 116 ViewportSize m_viewportSize; |
| 117 float m_zoom; | 117 float m_zoom; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } // namespace blink | 120 } // namespace blink |
| 121 | 121 |
| 122 #endif | 122 #endif |
| OLD | NEW |