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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 2793193004: Remove mutable from ComputedStyle by const_cast. (Closed)
Patch Set: Created 3 years, 8 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
Index: third_party/WebKit/Source/core/style/ComputedStyle.h
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index 4171b16e7a4bc408b2630bd5f5f19370e0967c8b..11004e5edc775ac8ef7bf8746e1a0be03d5f0f0d 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -231,12 +231,9 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
return !(*this == other);
}
- // This is set if we used viewport units when resolving a length.
- // It is mutable so we can pass around const ComputedStyles to resolve
- // lengths.
- mutable unsigned m_hasViewportUnits : 1;
-
- mutable unsigned m_hasRemUnits : 1;
+ // These are set if we used viewport or rem units when resolving a length.
+ unsigned m_hasViewportUnits : 1;
+ unsigned m_hasRemUnits : 1;
// If you add more style bits here, you will also need to update
// ComputedStyle::copyNonInheritedFromCached() 68 bits
@@ -2348,12 +2345,12 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
bool hasViewportUnits() const {
return m_nonInheritedData.m_hasViewportUnits;
}
- void setHasViewportUnits(bool hasViewportUnits = true) const {
+ void setHasViewportUnits(bool hasViewportUnits = true) {
m_nonInheritedData.m_hasViewportUnits = hasViewportUnits;
}
bool hasRemUnits() const { return m_nonInheritedData.m_hasRemUnits; }
- void setHasRemUnits() const { m_nonInheritedData.m_hasRemUnits = true; }
+ void setHasRemUnits() { m_nonInheritedData.m_hasRemUnits = true; }
bool emptyState() const { return m_emptyState; }
void setEmptyState(bool b) {

Powered by Google App Engine
This is Rietveld 408576698