| 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 23 matching lines...) Expand all Loading... |
| 34 #include "wtf/Assertions.h" | 34 #include "wtf/Assertions.h" |
| 35 #include "wtf/Noncopyable.h" | 35 #include "wtf/Noncopyable.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class RenderStyle; | 39 class RenderStyle; |
| 40 class RenderView; | 40 class RenderView; |
| 41 | 41 |
| 42 class CSSToLengthConversionData { | 42 class CSSToLengthConversionData { |
| 43 public: | 43 public: |
| 44 CSSToLengthConversionData(const RenderStyle* currStyle, const RenderStyle* r
ootStyle, const RenderView*, float zoom, bool computingFontSize = false); | |
| 45 CSSToLengthConversionData(const RenderStyle* currStyle, const RenderStyle* r
ootStyle, const RenderView*, bool computingFontSize = false); | 44 CSSToLengthConversionData(const RenderStyle* currStyle, const RenderStyle* r
ootStyle, const RenderView*, bool computingFontSize = false); |
| 46 CSSToLengthConversionData(const RenderStyle* currStyle, const RenderStyle* r
ootStyle, float viewportWidth, float viewportHeight, float zoom, bool computingF
ontSize = false); | |
| 47 | 45 |
| 48 const RenderStyle& style() const { return *m_style; } | 46 const RenderStyle& style() const { return *m_style; } |
| 49 const RenderStyle* rootStyle() const { return m_rootStyle; } | 47 const RenderStyle* rootStyle() const { return m_rootStyle; } |
| 50 float zoom() const; | |
| 51 bool computingFontSize() const { return m_computingFontSize; } | 48 bool computingFontSize() const { return m_computingFontSize; } |
| 52 | 49 |
| 53 // Accessing these marks the style as having viewport units | 50 // Accessing these marks the style as having viewport units |
| 54 double viewportWidthPercent() const; | 51 double viewportWidthPercent() const; |
| 55 double viewportHeightPercent() const; | 52 double viewportHeightPercent() const; |
| 56 double viewportMinPercent() const; | 53 double viewportMinPercent() const; |
| 57 double viewportMaxPercent() const; | 54 double viewportMaxPercent() const; |
| 58 | 55 |
| 59 void setStyle(const RenderStyle* style) { m_style = style; } | 56 void setStyle(const RenderStyle* style) { m_style = style; } |
| 60 void setRootStyle(const RenderStyle* rootStyle) { m_rootStyle = rootStyle; } | 57 void setRootStyle(const RenderStyle* rootStyle) { m_rootStyle = rootStyle; } |
| 61 | 58 |
| 62 CSSToLengthConversionData copyWithAdjustedZoom(float newZoom) const | |
| 63 { | |
| 64 return CSSToLengthConversionData(m_style, m_rootStyle, m_viewportWidth,
m_viewportHeight, newZoom, m_computingFontSize); | |
| 65 } | |
| 66 | |
| 67 private: | 59 private: |
| 68 const RenderStyle* m_style; | 60 const RenderStyle* m_style; |
| 69 const RenderStyle* m_rootStyle; | 61 const RenderStyle* m_rootStyle; |
| 70 float m_viewportWidth; | 62 float m_viewportWidth; |
| 71 float m_viewportHeight; | 63 float m_viewportHeight; |
| 72 float m_zoom; | |
| 73 bool m_useEffectiveZoom; | |
| 74 bool m_computingFontSize; | 64 bool m_computingFontSize; |
| 75 }; | 65 }; |
| 76 | 66 |
| 77 } // namespace blink | 67 } // namespace blink |
| 78 | 68 |
| 79 #endif | 69 #endif |
| OLD | NEW |