Commit 5d5175c6 authored by akling@apple.com's avatar akling@apple.com

RenderMenuList computes the width of its longest option twice.

<http://webkit.org/b/119046>
<rdar://problem/14534679>

Reviewed by Darin Adler.

Rename the RenderMenuList::m_optionsChanged flag to m_needsOptionsWidthUpdate,
and make sure it gets cleared after we do a width computation in response to font changes.

* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::styleDidChange):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153094 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 48fa4212
2013-07-24 Andreas Kling <akling@apple.com>
RenderMenuList computes the width of its longest option twice.
<http://webkit.org/b/119046>
<rdar://problem/14534679>
Reviewed by Darin Adler.
Rename the RenderMenuList::m_optionsChanged flag to m_needsOptionsWidthUpdate,
and make sure it gets cleared after we do a width computation in response to font changes.
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::styleDidChange):
2013-07-24 Zan Dobersek <zdobersek@igalia.com>
Make KURL::hasPath private
......@@ -57,7 +57,7 @@ RenderMenuList::RenderMenuList(Element* element)
: RenderFlexibleBox(element)
, m_buttonText(0)
, m_innerBlock(0)
, m_optionsChanged(true)
, m_needsOptionsWidthUpdate(true)
, m_optionsWidth(0)
, m_lastActiveIndex(-1)
, m_popupIsVisible(false)
......@@ -165,8 +165,10 @@ void RenderMenuList::styleDidChange(StyleDifference diff, const RenderStyle* old
adjustInnerStyle();
bool fontChanged = !oldStyle || oldStyle->font() != style()->font();
if (fontChanged)
if (fontChanged) {
updateOptionsWidth();
m_needsOptionsWidthUpdate = false;
}
}
void RenderMenuList::updateOptionsWidth()
......@@ -206,9 +208,9 @@ void RenderMenuList::updateOptionsWidth()
void RenderMenuList::updateFromElement()
{
if (m_optionsChanged) {
if (m_needsOptionsWidthUpdate) {
updateOptionsWidth();
m_optionsChanged = false;
m_needsOptionsWidthUpdate = false;
}
if (m_popupIsVisible)
......
......@@ -51,7 +51,7 @@ public:
void showPopup();
void hidePopup();
void setOptionsChanged(bool changed) { m_optionsChanged = changed; }
void setOptionsChanged(bool changed) { m_needsOptionsWidthUpdate = changed; }
void didSetSelectedIndex(int listIndex);
......@@ -137,7 +137,7 @@ private:
RenderText* m_buttonText;
RenderBlock* m_innerBlock;
bool m_optionsChanged;
bool m_needsOptionsWidthUpdate;
int m_optionsWidth;
int m_lastActiveIndex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment