Index: Source/core/css/CSSToLengthConversionData.h |
diff --git a/Source/core/css/CSSToLengthConversionData.h b/Source/core/css/CSSToLengthConversionData.h |
index 975be5f212204717a2f5cbd80fc673695973677c..f110b23d5da744179957a060f7d69f179df17811 100644 |
--- a/Source/core/css/CSSToLengthConversionData.h |
+++ b/Source/core/css/CSSToLengthConversionData.h |
@@ -37,41 +37,38 @@ |
namespace WebCore { |
class RenderStyle; |
+class RenderView; |
class CSSToLengthConversionData { |
public: |
- CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, float zoom, bool computingFontSize = false) |
- : m_style(style) |
- , m_rootStyle(rootStyle) |
- , m_zoom(zoom) |
- , m_useEffectiveZoom(false) |
- , m_computingFontSize(computingFontSize) |
- { |
- ASSERT(zoom > 0); |
- } |
- CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, bool computingFontSize = false) |
- : m_style(style) |
- , m_rootStyle(rootStyle) |
- , m_useEffectiveZoom(true) |
- , m_computingFontSize(computingFontSize) |
- { |
- } |
+ CSSToLengthConversionData(const RenderStyle* currStyle, const RenderStyle* rootStyle, const RenderView*, float zoom, bool computingFontSize = false); |
+ CSSToLengthConversionData(const RenderStyle* currStyle, const RenderStyle* rootStyle, const RenderView*, bool computingFontSize = false); |
+ CSSToLengthConversionData(const RenderStyle* currStyle, const RenderStyle* rootStyle, float viewportWidth, float viewportHeight, float zoom, bool computingFontSize = false); |
+ |
const RenderStyle& style() const { return *m_style; } |
const RenderStyle& rootStyle() const { return *m_rootStyle; } |
float zoom() const; |
bool computingFontSize() const { return m_computingFontSize; } |
+ // Accessing these marks the style as having viewport units |
+ double viewportWidthPercent() const; |
+ double viewportHeightPercent() const; |
+ double viewportMinPercent() const; |
+ double viewportMaxPercent() const; |
+ |
void setStyle(const RenderStyle* style) { m_style = style; } |
void setRootStyle(const RenderStyle* rootStyle) { m_rootStyle = rootStyle; } |
CSSToLengthConversionData copyWithAdjustedZoom(float newZoom) const |
{ |
- return CSSToLengthConversionData(m_style, m_rootStyle, newZoom, m_computingFontSize); |
+ return CSSToLengthConversionData(m_style, m_rootStyle, m_viewportWidth, m_viewportHeight, newZoom, m_computingFontSize); |
} |
private: |
const RenderStyle* m_style; |
const RenderStyle* m_rootStyle; |
+ float m_viewportWidth; |
+ float m_viewportHeight; |
float m_zoom; |
bool m_useEffectiveZoom; |
bool m_computingFontSize; |