- Fix for <rdar://problem/
4768591> REGRESSION: List box selection color should just be a darker version of regular selection color
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItemForeground):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::activeListBoxSelectionBackgroundColor):
(WebCore::RenderTheme::activeListBoxSelectionForegroundColor):
(WebCore::RenderTheme::inactiveListBoxSelectionBackgroundColor):
(WebCore::RenderTheme::inactiveListBoxSelectionForegroundColor):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::activeListBoxSelectionBackgroundColor):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17028
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-13 Adele Peterson <adele@apple.com>
+
+ Reviewed by Maciej.
+
+ - Fix for <rdar://problem/4768591> REGRESSION: List box selection color should just be a darker version of regular selection color
+
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::paintItemForeground):
+ * rendering/RenderTheme.cpp:
+ (WebCore::RenderTheme::activeListBoxSelectionBackgroundColor):
+ (WebCore::RenderTheme::activeListBoxSelectionForegroundColor):
+ (WebCore::RenderTheme::inactiveListBoxSelectionBackgroundColor):
+ (WebCore::RenderTheme::inactiveListBoxSelectionForegroundColor):
+ * rendering/RenderThemeMac.h:
+ * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::activeListBoxSelectionBackgroundColor):
+
2006-10-13 Rob Buis <buis@kde.org>
Reviewed by Mitz.
if (element->hasTagName(optionTag) && static_cast<HTMLOptionElement*>(element)->selected()) {
if (document()->frame()->isActive() && document()->focusNode() == node())
textColor = theme()->activeListBoxSelectionForegroundColor();
- /*
- FIXME: Decide what the desired behavior is for inactive foreground color.
- For example, disabled items have a dark grey foreground color defined in CSS.
- If we don't honor that, the selected disabled items will have a weird black-on-grey look.
- else
+ // Honor the foreground color for disabled items
+ else if (!element->disabled())
textColor = theme()->inactiveListBoxSelectionForegroundColor();
- */
}
Color RenderTheme::activeListBoxSelectionBackgroundColor() const
{
- return Color(56, 117, 215);
+ return activeSelectionBackgroundColor();
}
Color RenderTheme::activeListBoxSelectionForegroundColor() const
{
+ // Use a white color by default if the platform theme doesn't define anything.
return Color(255, 255, 255);
}
Color RenderTheme::inactiveListBoxSelectionBackgroundColor() const
{
- return Color(212, 212, 212);
+ return inactiveSelectionBackgroundColor();
}
Color RenderTheme::inactiveListBoxSelectionForegroundColor() const
{
+ // Use a black color by default if the platform theme doesn't define anything.
return Color(0, 0, 0);
}
virtual Color platformActiveSelectionBackgroundColor() const;
virtual Color platformInactiveSelectionBackgroundColor() const;
+ virtual Color activeListBoxSelectionBackgroundColor() const;
// System fonts.
virtual void systemFont(int propId, FontDescription&) const;
return Color((int)(255 * [color redComponent]), (int)(255 * [color greenComponent]), (int)(255 * [color blueComponent]));
}
+Color RenderThemeMac::activeListBoxSelectionBackgroundColor() const
+{
+ NSColor* color = [[NSColor alternateSelectedControlColor] colorUsingColorSpaceName:NSDeviceRGBColorSpace];
+ return Color((int)(255 * [color redComponent]), (int)(255 * [color greenComponent]), (int)(255 * [color blueComponent]));
+}
+
void RenderThemeMac::systemFont(int propId, FontDescription& fontDescription) const
{
static FontDescription systemFont;