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

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: rebased.. 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)
esprehn 2013/12/04 06:02:28 Reference?
: 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)
esprehn 2013/12/04 06:02:28 This should probably be a reference.
: 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
+ 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;
esprehn 2013/12/04 06:02:28 const RenverView& ? I don't think we can get here
Timothy Loh 2013/12/04 07:17:39 I think this is currently null in three places: -
float m_zoom;
bool m_useEffectiveZoom;
bool m_computingFontSize;

Powered by Google App Engine
This is Rietveld 408576698