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

Unified Diff: third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp

Issue 2793193004: Remove mutable from ComputedStyle by const_cast. (Closed)
Patch Set: Address comments 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp b/third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp
index 89cb90a38f7a8dbf7942d291036f8dc52b4c3c5f..6792d1b4f4cd6ca4b3b63a2393890e2266929dc0 100644
--- a/third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp
+++ b/third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp
@@ -98,24 +98,27 @@ CSSToLengthConversionData::CSSToLengthConversionData(
zoom) {}
double CSSToLengthConversionData::viewportWidthPercent() const {
- m_style->setHasViewportUnits();
+ // FIXME: Remove m_style from this class. Plumb viewport and rem unit
+ // information through as output parameters on functions involved in length
+ // resolution.
+ const_cast<ComputedStyle*>(m_style)->setHasViewportUnits();
return m_viewportSize.width() / 100;
}
double CSSToLengthConversionData::viewportHeightPercent() const {
- m_style->setHasViewportUnits();
+ const_cast<ComputedStyle*>(m_style)->setHasViewportUnits();
return m_viewportSize.height() / 100;
}
double CSSToLengthConversionData::viewportMinPercent() const {
- m_style->setHasViewportUnits();
+ const_cast<ComputedStyle*>(m_style)->setHasViewportUnits();
return std::min(m_viewportSize.width(), m_viewportSize.height()) / 100;
}
double CSSToLengthConversionData::viewportMaxPercent() const {
- m_style->setHasViewportUnits();
+ const_cast<ComputedStyle*>(m_style)->setHasViewportUnits();
return std::max(m_viewportSize.width(), m_viewportSize.height()) / 100;
}
float CSSToLengthConversionData::remFontSize() const {
- m_style->setHasRemUnits();
+ const_cast<ComputedStyle*>(m_style)->setHasRemUnits();
return m_fontSizes.rem();
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698