Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(575)

Unified Diff: Source/core/css/CSSToLengthConversionData.h

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: fix compile on mac Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/css/CSSToLengthConversionData.h
diff --git a/Source/core/css/CSSToLengthConversionData.h b/Source/core/css/CSSToLengthConversionData.h
index 975be5f212204717a2f5cbd80fc673695973677c..dffb91690ed90d23278e42dd8792c29cd4e491b1 100644
--- a/Source/core/css/CSSToLengthConversionData.h
+++ b/Source/core/css/CSSToLengthConversionData.h
@@ -37,21 +37,24 @@
namespace WebCore {
class RenderStyle;
+class RenderView;
class CSSToLengthConversionData {
public:
- CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, float zoom, bool computingFontSize = false)
+ CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, const RenderView* renderView, float zoom, bool computingFontSize = false)
: m_style(style)
, m_rootStyle(rootStyle)
+ , m_renderView(renderView)
, m_zoom(zoom)
, m_useEffectiveZoom(false)
, m_computingFontSize(computingFontSize)
{
ASSERT(zoom > 0);
}
- CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, bool computingFontSize = false)
+ CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, const RenderView* renderView, bool computingFontSize = false)
: m_style(style)
, m_rootStyle(rootStyle)
+ , m_renderView(renderView)
, m_useEffectiveZoom(true)
, m_computingFontSize(computingFontSize)
{
@@ -61,17 +64,24 @@ public:
float zoom() const;
bool computingFontSize() const { return m_computingFontSize; }
+ // Accessing these marks the style as having viewport units
johnme 2013/12/18 12:04:15 Do any other accessors mutate the object like this
Timothy Loh 2013/12/23 06:28:16 I could move marking the style out into the conver
+ 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_renderView, newZoom, m_computingFontSize);
}
private:
const RenderStyle* m_style;
const RenderStyle* m_rootStyle;
+ const RenderView* m_renderView;
float m_zoom;
bool m_useEffectiveZoom;
bool m_computingFontSize;

Powered by Google App Engine
This is Rietveld 408576698