| 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" |
| 36 #include "wtf/Allocator.h" | 37 #include "wtf/Allocator.h" |
| 37 #include "wtf/Assertions.h" | 38 #include "wtf/Assertions.h" |
| 38 #include "wtf/MathExtras.h" | 39 #include "wtf/MathExtras.h" |
| 39 #include <limits> | 40 #include <limits> |
| 40 | 41 |
| 41 namespace blink { | 42 namespace blink { |
| 42 | 43 |
| 43 class ComputedStyle; | 44 class ComputedStyle; |
| 44 class LayoutView; | 45 class LayoutView; |
| 45 class Font; | 46 class Font; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 61 float ch() const; | 62 float ch() const; |
| 62 private: | 63 private: |
| 63 float m_em; | 64 float m_em; |
| 64 float m_rem; | 65 float m_rem; |
| 65 const Font* m_font; | 66 const Font* m_font; |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 class ViewportSize { | 69 class ViewportSize { |
| 69 DISALLOW_NEW(); | 70 DISALLOW_NEW(); |
| 70 public: | 71 public: |
| 71 ViewportSize() : m_width(0), m_height(0) { } | 72 ViewportSize() { } |
| 72 ViewportSize(double width, double height) : m_width(width), m_height(hei
ght) { } | 73 ViewportSize(double width, double height) : m_size(width, height) { } |
| 73 explicit ViewportSize(const LayoutView*); | 74 explicit ViewportSize(const LayoutView*); |
| 74 | 75 |
| 75 double width() const { return m_width; } | 76 double width() const { return m_size.width(); } |
| 76 double height() const { return m_height; } | 77 double height() const { return m_size.height(); } |
| 77 private: | 78 private: |
| 78 double m_width; | 79 DoubleSize m_size; |
| 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 |