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

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: rename browser zoom to page zoom Created 6 years, 12 months 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
« no previous file with comments | « Source/core/css/CSSPrimitiveValueMappings.h ('k') | Source/core/css/CSSToLengthConversionData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « Source/core/css/CSSPrimitiveValueMappings.h ('k') | Source/core/css/CSSToLengthConversionData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698