Index: Source/core/rendering/RenderListBox.cpp |
diff --git a/Source/core/rendering/RenderListBox.cpp b/Source/core/rendering/RenderListBox.cpp |
index 8918b0a8200027dea27a8e0d1087c181f9235315..7dab3aefec7d40f2bca622b10d3577be1b8fa482 100644 |
--- a/Source/core/rendering/RenderListBox.cpp |
+++ b/Source/core/rendering/RenderListBox.cpp |
@@ -426,7 +426,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint& |
applyTextTransform(style(), itemText, ' '); |
Color textColor = element->renderStyle() ? resolveColor(element->renderStyle(), CSSPropertyColor) : resolveColor(CSSPropertyColor); |
- if (isOptionElement && toHTMLOptionElement(*element).selected()) { |
+ if (isOptionElement && ((toHTMLOptionElement(*element).selected() && select->suggestedIndex() < 0) || listIndex == select->suggestedIndex())) { |
if (frame()->selection().isFocusedAndActive() && document().focusedElement() == node()) |
textColor = RenderTheme::theme().activeListBoxSelectionForegroundColor(); |
// Honor the foreground color for disabled items |
@@ -460,7 +460,7 @@ void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint& |
HTMLElement* element = listItems[listIndex]; |
Color backColor; |
- if (isHTMLOptionElement(*element) && toHTMLOptionElement(*element).selected()) { |
+ if (isHTMLOptionElement(*element) && ((toHTMLOptionElement(*element).selected() && selectElement()->suggestedIndex() < 0) || listIndex == selectElement()->suggestedIndex())) { |
if (frame()->selection().isFocusedAndActive() && document().focusedElement() == node()) |
backColor = RenderTheme::theme().activeListBoxSelectionBackgroundColor(); |
else |