| Index: third_party/WebKit/Source/core/layout/LayoutListBox.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutListBox.cpp b/third_party/WebKit/Source/core/layout/LayoutListBox.cpp
|
| index 2a845529173207526f7e0f30b9fe2232b4345ff3..0854713e223d6358b97a0efa1d6147058fb5f4e9 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutListBox.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutListBox.cpp
|
| @@ -79,17 +79,24 @@ LayoutUnit LayoutListBox::itemHeight() const
|
| HTMLSelectElement* select = selectElement();
|
| if (!select)
|
| return LayoutUnit();
|
| - Element* baseItem = ElementTraversal::firstChild(*select);
|
| - if (!baseItem)
|
| - return defaultItemHeight();
|
| - if (isHTMLOptGroupElement(baseItem))
|
| - baseItem = &toHTMLOptGroupElement(baseItem)->optGroupLabelElement();
|
| - else if (!isHTMLOptionElement(baseItem))
|
| - return defaultItemHeight();
|
| - LayoutObject* baseItemLayoutObject = baseItem->layoutObject();
|
| - if (!baseItemLayoutObject || !baseItemLayoutObject->isBox())
|
| +
|
| + const auto& items = select->listItems();
|
| + if (items.isEmpty())
|
| return defaultItemHeight();
|
| - return toLayoutBox(baseItemLayoutObject)->size().height();
|
| +
|
| + LayoutUnit maxHeight;
|
| + for (Element* element : items) {
|
| + if (isHTMLOptGroupElement(element))
|
| + element = &toHTMLOptGroupElement(element)->optGroupLabelElement();
|
| + LayoutObject* layoutObject = element->layoutObject();
|
| + LayoutUnit itemHeight;
|
| + if (layoutObject && layoutObject->isBox())
|
| + itemHeight = toLayoutBox(layoutObject)->size().height();
|
| + else
|
| + itemHeight = defaultItemHeight();
|
| + maxHeight = std::max(maxHeight, itemHeight);
|
| + }
|
| + return maxHeight;
|
| }
|
|
|
| void LayoutListBox::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
|
|
|