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

Unified Diff: Source/core/rendering/style/RenderStyle.h

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: actually fix zoom handling 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/rendering/style/RenderStyle.h
diff --git a/Source/core/rendering/style/RenderStyle.h b/Source/core/rendering/style/RenderStyle.h
index f405b951fbef534a8da92bcaf2b2b8a1565d003e..1f5b6f947c82f74511c4ff6c7d2a9866e9d16c55 100644
--- a/Source/core/rendering/style/RenderStyle.h
+++ b/Source/core/rendering/style/RenderStyle.h
@@ -257,6 +257,10 @@ protected:
unsigned firstChildState : 1;
unsigned lastChildState : 1;
+ // This is set if we used viewport units when resolving a length.
+ // It is mutable so we can pass around const RenderStyles to resolve lengths.
+ mutable unsigned hasViewportUnits : 1;
+
bool affectedByFocus() const { return _affectedByFocus; }
void setAffectedByFocus(bool value) { _affectedByFocus = value; }
bool affectedByHover() const { return _affectedByHover; }
@@ -274,7 +278,7 @@ protected:
unsigned _affectedByDrag : 1;
unsigned _isLink : 1;
// If you add more style bits here, you will also need to update RenderStyle::copyNonInheritedFrom()
- // 60 bits
+ // 63 bits
esprehn 2013/12/18 01:03:55 Is the +3 a mistake, or did you count and was the
Timothy Loh 2013/12/18 01:54:43 Yep, the previous count was incorrect. I also move
} noninherited_flags;
// !END SYNC!
@@ -321,6 +325,7 @@ protected:
noninherited_flags.emptyState = false;
noninherited_flags.firstChildState = false;
noninherited_flags.lastChildState = false;
+ noninherited_flags.hasViewportUnits = false;
noninherited_flags.setAffectedByFocus(false);
noninherited_flags.setAffectedByHover(false);
noninherited_flags.setAffectedByActive(false);
@@ -362,6 +367,9 @@ public:
const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); }
+ void setHasViewportUnits(bool hasViewportUnits = true) const { noninherited_flags.hasViewportUnits = hasViewportUnits; }
+ bool hasViewportUnits() const { return noninherited_flags.hasViewportUnits; }
+
void setVariable(const AtomicString& name, const String& value) { rareInheritedData.access()->m_variables.access()->setVariable(name, value); }
const HashMap<AtomicString, String>* variables() { return &(rareInheritedData->m_variables->m_data); }
@@ -572,7 +580,7 @@ public:
Length specifiedLineHeight() const;
Length lineHeight() const;
- int computedLineHeight(RenderView* = 0) const;
+ int computedLineHeight() const;
EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_flags._white_space); }
static bool autoWrap(EWhiteSpace ws)
@@ -1019,7 +1027,7 @@ public:
setBorderRadius(LengthSize(Length(s.width(), Fixed), Length(s.height(), Fixed)));
}
- RoundedRect getRoundedBorderFor(const LayoutRect& borderRect, RenderView* = 0, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
+ RoundedRect getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect,

Powered by Google App Engine
This is Rietveld 408576698