Index: third_party/WebKit/Source/core/layout/LayoutMenuList.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp b/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp |
index 9b7d92eaadc11706d8ac0ddef4a270d23067ea36..23fbc0ca04998e6d7621efd43dd6426f345ad3e5 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp |
@@ -163,18 +163,14 @@ void LayoutMenuList::updateOptionsWidth() const |
String text = option->textIndentedToRespectGroupLabel(); |
const ComputedStyle* itemStyle = option->computedStyle() ? option->computedStyle() : style(); |
applyTextTransform(itemStyle, text, ' '); |
- TextRun textRun = constructTextRun(itemStyle->font(), text, *itemStyle); |
- |
- maxOptionWidth = std::max(maxOptionWidth, computeTextWidth(textRun, *itemStyle)); |
+ // We apply SELECT's style, not OPTION's style because m_optionsWidth is |
+ // used to determine intrinsic width of the menulist box. |
+ TextRun textRun = constructTextRun(style()->font(), text, *style()); |
+ maxOptionWidth = std::max(maxOptionWidth, style()->font().width(textRun)); |
} |
m_optionsWidth = static_cast<int>(ceilf(maxOptionWidth)); |
} |
-float LayoutMenuList::computeTextWidth(const TextRun& textRun, const ComputedStyle& computedStyle) const |
-{ |
- return computedStyle.font().width(textRun); |
-} |
- |
void LayoutMenuList::updateFromElement() |
{ |
HTMLSelectElement* select = selectElement(); |