Index: third_party/WebKit/Source/core/layout/LayoutMenuList.h |
diff --git a/third_party/WebKit/Source/core/layout/LayoutMenuList.h b/third_party/WebKit/Source/core/layout/LayoutMenuList.h |
index f31cccedcfb71560be0be32eacbd59a67656aed7..70688355430ce255c90d4f14f17b0c8f67b097f0 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutMenuList.h |
+++ b/third_party/WebKit/Source/core/layout/LayoutMenuList.h |
@@ -39,7 +39,7 @@ public: |
~LayoutMenuList() override; |
HTMLSelectElement* selectElement() const; |
- void setOptionsChanged(bool changed) { m_optionsChanged = changed; } |
+ void setOptionsChanged(bool); |
void didSetSelectedIndex(int optionIndex); |
String text() const; |
@@ -81,10 +81,9 @@ private: |
void adjustInnerStyle(); |
void setText(const String&); |
void setTextFromOption(int optionIndex); |
- void updateOptionsHeightWidth(); |
+ void updateOptionsHeightWidth() const; |
float computeTextHeight(const TextRun&, const ComputedStyle&) const; |
float computeTextWidth(const TextRun&, const ComputedStyle&) const; |
- void updateText(); |
void setIndexToSelectOnCancel(int listIndex); |
void didUpdateActiveOption(int optionIndex); |
@@ -92,11 +91,13 @@ private: |
LayoutText* m_buttonText; |
LayoutBlock* m_innerBlock; |
- bool m_optionsChanged : 1; |
+ mutable bool m_optionsChanged : 1; |
bool m_isEmpty : 1; |
bool m_hasUpdatedActiveOption : 1; |
- int m_optionsHeight; |
- int m_optionsWidth; |
+ // m_optionsHeight and m_optionsWidth are calculated and cached on demand. |
+ // updateOptionsHeightWidth() should be called before reading them. |
+ mutable int m_optionsHeight; |
+ mutable int m_optionsWidth; |
int m_lastActiveIndex; |