diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-24 04:11:19 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-24 04:11:19 +0000 |
commit | 8cc128a2c582144ea298b08c53fde46ef3f8ecc3 (patch) | |
tree | 7368ddcd744b662d4df8e988d1a67f7b0c28d778 | |
parent | d32379bfd04488c613e8aa76c4dc960144a32581 (diff) | |
download | chromium_src-8cc128a2c582144ea298b08c53fde46ef3f8ecc3.zip chromium_src-8cc128a2c582144ea298b08c53fde46ef3f8ecc3.tar.gz chromium_src-8cc128a2c582144ea298b08c53fde46ef3f8ecc3.tar.bz2 |
Progress on form button metrics.
We are very very close to matching Windows metrics for buttons.
- Sort RenderThemeGtk.h declarations in the same
order as RenderThemeWin.h
- Sort RenderThemeGtk.cpp implementations in the
same order as declared in the header.
- Put all internal static helpers together.
- Merge in some comments and code from RenderThemeWin.
- Drop incorrect button style methods, when really we want
the default behavior instead.
- Use 11px Times New Roman for the layout test mode
system font.
- Switch to Mist as the default layout test theme.
This matches Windows much better, with square
buttons, etc.
- Sort the font list in test_shell_gtk.
Review URL: http://codereview.chromium.org/11390
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5920 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/port/platform/chromium/RenderThemeGtk.cpp | 400 | ||||
-rw-r--r-- | webkit/port/platform/chromium/RenderThemeGtk.h | 59 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_gtk.cc | 12 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_main.cc | 2 |
4 files changed, 242 insertions, 231 deletions
diff --git a/webkit/port/platform/chromium/RenderThemeGtk.cpp b/webkit/port/platform/chromium/RenderThemeGtk.cpp index ac5408d..3da24b0 100644 --- a/webkit/port/platform/chromium/RenderThemeGtk.cpp +++ b/webkit/port/platform/chromium/RenderThemeGtk.cpp @@ -24,6 +24,7 @@ #include "RenderThemeGtk.h" #include "AffineTransform.h" +#include "ChromiumBridge.h" #include "CSSValueKeywords.h" #include "GraphicsContext.h" #include "NotImplemented.h" @@ -41,20 +42,6 @@ static Color makeColor(const GdkColor& c) return Color(makeRGB(c.red >> 8, c.green >> 8, c.blue >> 8)); } -RenderTheme* theme() -{ - static RenderThemeGtk gtkTheme; - return >kTheme; -} - -RenderThemeGtk::RenderThemeGtk() - : m_gtkWindow(0) - , m_gtkContainer(0) - , m_gtkEntry(0) - , m_gtkTreeView(0) -{ -} - static bool supportsFocus(ControlPart appearance) { switch (appearance) { @@ -72,25 +59,6 @@ static bool supportsFocus(ControlPart appearance) } } -bool RenderThemeGtk::supportsFocusRing(const RenderStyle* style) const -{ - return supportsFocus(style->appearance()); -} - -bool RenderThemeGtk::controlSupportsTints(const RenderObject* o) const -{ - return isEnabled(o); -} - -int RenderThemeGtk::baselinePosition(const RenderObject* o) const -{ - // FIXME: This strategy is possibly incorrect for the GTK+ port. - if (o->style()->appearance() == CheckboxPart|| - o->style()->appearance() == RadioPart) - return o->marginTop() + o->height() - 2; - return RenderTheme::baselinePosition(o); -} - static GtkTextDirection gtkTextDirection(TextDirection direction) { switch (direction) { @@ -190,16 +158,6 @@ static bool paintMozWidget(RenderTheme* theme, GtkThemeWidgetType type, RenderOb return r; } -static void setButtonPadding(RenderStyle* style) -{ - // FIXME: This looks incorrect. - const int padding = 8; - style->setPaddingLeft(Length(padding, Fixed)); - style->setPaddingRight(Length(padding, Fixed)); - style->setPaddingTop(Length(padding / 2, Fixed)); - style->setPaddingBottom(Length(padding / 2, Fixed)); -} - static void setToggleSize(RenderStyle* style, ControlPart appearance) { // The width and height are both specified, so we shouldn't change them. @@ -232,135 +190,31 @@ static void setToggleSize(RenderStyle* style, ControlPart appearance) style->setHeight(Length(length, Fixed)); } -void RenderThemeGtk::setCheckboxSize(RenderStyle* style) const -{ - setToggleSize(style, RadioPart); -} - -bool RenderThemeGtk::paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) -{ - return paintMozWidget(this, MOZ_GTK_CHECKBUTTON, o, i, rect); -} - -void RenderThemeGtk::setRadioSize(RenderStyle* style) const -{ - setToggleSize(style, RadioPart); -} - -bool RenderThemeGtk::paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) -{ - return paintMozWidget(this, MOZ_GTK_RADIOBUTTON, o, i, rect); -} - -void RenderThemeGtk::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, WebCore::Element* e) const -{ - // FIXME: Is this condition necessary? - if (style->appearance() == PushButtonPart) { - style->resetBorder(); - style->setHeight(Length(Auto)); - style->setWhiteSpace(PRE); - setButtonPadding(style); - } else { - // FIXME: This should not be hard-coded. - style->setMinHeight(Length(14, Fixed)); - style->resetBorderTop(); - style->resetBorderBottom(); - } -} - -bool RenderThemeGtk::paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) -{ - return paintMozWidget(this, MOZ_GTK_BUTTON, o, i, rect); -} - -void RenderThemeGtk::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, WebCore::Element* e) const -{ - style->resetBorder(); - style->resetPadding(); - style->setHeight(Length(Auto)); - style->setWhiteSpace(PRE); - adjustMozStyle(style, MOZ_GTK_DROPDOWN); -} - -bool RenderThemeGtk::paintMenuList(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) -{ - return paintMozWidget(this, MOZ_GTK_DROPDOWN, o, i, rect); -} - -void RenderThemeGtk::adjustTextFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const -{ - style->resetBorder(); - style->resetPadding(); - style->setHeight(Length(Auto)); - style->setWhiteSpace(PRE); - adjustMozStyle(style, MOZ_GTK_ENTRY); -} - -bool RenderThemeGtk::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) -{ - return paintMozWidget(this, MOZ_GTK_ENTRY, o, i, rect); -} - -void RenderThemeGtk::adjustTextAreaStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const -{ - adjustTextFieldStyle(selector, style, e); -} - -bool RenderThemeGtk::paintTextArea(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) -{ - return paintTextField(o, i, r); -} - -void RenderThemeGtk::adjustSearchFieldResultsButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const -{ - adjustSearchFieldCancelButtonStyle(selector, style, e); -} - -bool RenderThemeGtk::paintSearchFieldResultsButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) -{ - return paintMozWidget(this, MOZ_GTK_DROPDOWN_ARROW, o, i, rect); -} - -void RenderThemeGtk::adjustSearchFieldResultsDecorationStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const -{ - style->resetBorder(); - style->resetPadding(); - - // FIXME: This should not be hard-coded. - IntSize size = IntSize(14, 14); - style->setWidth(Length(size.width(), Fixed)); - style->setHeight(Length(size.height(), Fixed)); -} - -bool RenderThemeGtk::paintSearchFieldResultsDecoration(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) +static void gtkStyleSetCallback(GtkWidget* widget, GtkStyle* previous, RenderTheme* renderTheme) { - return paintMozWidget(this, MOZ_GTK_CHECKMENUITEM, o, i, rect); + // FIXME: Make sure this function doesn't get called many times for a single GTK+ style change signal. + renderTheme->platformColorsDidChange(); } -void RenderThemeGtk::adjustSearchFieldCancelButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const -{ - style->resetBorder(); - style->resetPadding(); - - // FIXME: This should not be hard-coded. - IntSize size = IntSize(14, 14); - style->setWidth(Length(size.width(), Fixed)); - style->setHeight(Length(size.height(), Fixed)); -} -bool RenderThemeGtk::paintSearchFieldCancelButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) +// Implement WebCore::theme() for getting the global RenderTheme. +RenderTheme* theme() { - return paintMozWidget(this, MOZ_GTK_CHECKMENUITEM, o, i, rect); + static RenderThemeGtk gtkTheme; + return >kTheme; } -void RenderThemeGtk::adjustSearchFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const +RenderThemeGtk::RenderThemeGtk() + : m_gtkWindow(0) + , m_gtkContainer(0) + , m_gtkEntry(0) + , m_gtkTreeView(0) { - adjustTextFieldStyle(selector, style, e); } -bool RenderThemeGtk::paintSearchField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) +bool RenderThemeGtk::supportsFocusRing(const RenderStyle* style) const { - return paintTextField(o, i, rect); + return supportsFocus(style->appearance()); } Color RenderThemeGtk::platformActiveSelectionBackgroundColor() const @@ -387,32 +241,13 @@ Color RenderThemeGtk::platformInactiveSelectionForegroundColor() const return makeColor(widget->style->text[GTK_STATE_ACTIVE]); } -Color RenderThemeGtk::activeListBoxSelectionBackgroundColor() const -{ - GtkWidget* widget = gtkTreeView(); - return makeColor(widget->style->base[GTK_STATE_SELECTED]); -} - -Color RenderThemeGtk::inactiveListBoxSelectionBackgroundColor() const -{ - GtkWidget* widget = gtkTreeView(); - return makeColor(widget->style->base[GTK_STATE_ACTIVE]); -} - -Color RenderThemeGtk::activeListBoxSelectionForegroundColor() const -{ - GtkWidget* widget = gtkTreeView(); - return makeColor(widget->style->text[GTK_STATE_SELECTED]); -} - -Color RenderThemeGtk::inactiveListBoxSelectionForegroundColor() const -{ - GtkWidget* widget = gtkTreeView(); - return makeColor(widget->style->text[GTK_STATE_ACTIVE]); -} - double RenderThemeGtk::caretBlinkFrequency() const { + // Disable the blinking caret in layout test mode, as it introduces + // a race condition for the pixel tests. http://b/1198440 + if (ChromiumBridge::layoutTestMode()) + return 0; + GtkSettings* settings = gtk_settings_get_default(); gboolean shouldBlink; @@ -464,10 +299,21 @@ void RenderThemeGtk::systemFont(int propId, Document*, FontDescription& fontDesc } // Only update if we can determine the right size. if (pixelscale && size) { - fontDescription.firstFamily().setFamily( - pango_font_description_get_family(pangoFontDesc)); - fontDescription.setSpecifiedSize((float)size * pixelscale); + // NOTE(deanm): Windows hardcodes to Lucida Grande when in + // layout test mode, but this is a mac font so really it + // falls back on Times New Roman. + if (ChromiumBridge::layoutTestMode()) { + fontDescription.firstFamily().setFamily("Times New Roman"); + fontDescription.setSpecifiedSize(11); + } else { + fontDescription.firstFamily().setFamily( + pango_font_description_get_family(pangoFontDesc)); + fontDescription.setSpecifiedSize((float)size * pixelscale); + } fontDescription.setIsAbsoluteSize(true); + fontDescription.setGenericFamily(FontDescription::NoFamily); + fontDescription.setWeight(FontWeightNormal); + fontDescription.setItalic(false); } break; } @@ -496,23 +342,166 @@ void RenderThemeGtk::systemFont(int propId, Document*, FontDescription& fontDesc } } -static void gtkStyleSetCallback(GtkWidget* widget, GtkStyle* previous, RenderTheme* renderTheme) +bool RenderThemeGtk::paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) { - // FIXME: Make sure this function doesn't get called many times for a single GTK+ style change signal. - renderTheme->platformColorsDidChange(); + return paintMozWidget(this, MOZ_GTK_CHECKBUTTON, o, i, rect); } -GtkContainer* RenderThemeGtk::gtkContainer() const +void RenderThemeGtk::setCheckboxSize(RenderStyle* style) const { - if (m_gtkContainer) - return m_gtkContainer; + setToggleSize(style, RadioPart); +} - m_gtkWindow = gtk_window_new(GTK_WINDOW_POPUP); - m_gtkContainer = GTK_CONTAINER(gtk_fixed_new()); - gtk_container_add(GTK_CONTAINER(m_gtkWindow), GTK_WIDGET(m_gtkContainer)); - gtk_widget_realize(m_gtkWindow); +bool RenderThemeGtk::paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) +{ + return paintMozWidget(this, MOZ_GTK_RADIOBUTTON, o, i, rect); +} - return m_gtkContainer; +void RenderThemeGtk::setRadioSize(RenderStyle* style) const +{ + setToggleSize(style, RadioPart); +} + +bool RenderThemeGtk::paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) +{ + return paintMozWidget(this, MOZ_GTK_BUTTON, o, i, rect); +} + +void RenderThemeGtk::adjustTextFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const +{ + style->resetBorder(); + style->resetPadding(); + style->setHeight(Length(Auto)); + style->setWhiteSpace(PRE); + adjustMozStyle(style, MOZ_GTK_ENTRY); +} + +bool RenderThemeGtk::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) +{ + return paintMozWidget(this, MOZ_GTK_ENTRY, o, i, rect); +} + +void RenderThemeGtk::adjustTextAreaStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const +{ + adjustTextFieldStyle(selector, style, e); +} + +bool RenderThemeGtk::paintTextArea(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) +{ + return paintTextField(o, i, r); +} + +bool RenderThemeGtk::paintSearchField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) +{ + return paintTextField(o, i, rect); +} + +bool RenderThemeGtk::paintSearchFieldResultsDecoration(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) +{ + return paintMozWidget(this, MOZ_GTK_CHECKMENUITEM, o, i, rect); +} + +bool RenderThemeGtk::paintSearchFieldResultsButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) +{ + return paintMozWidget(this, MOZ_GTK_DROPDOWN_ARROW, o, i, rect); +} + +bool RenderThemeGtk::paintSearchFieldCancelButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) +{ + return paintMozWidget(this, MOZ_GTK_CHECKMENUITEM, o, i, rect); +} + +void RenderThemeGtk::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, WebCore::Element* e) const +{ + style->resetBorder(); + style->resetPadding(); + style->setHeight(Length(Auto)); + style->setWhiteSpace(PRE); + adjustMozStyle(style, MOZ_GTK_DROPDOWN); +} + +bool RenderThemeGtk::paintMenuList(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect) +{ + return paintMozWidget(this, MOZ_GTK_DROPDOWN, o, i, rect); +} + +void RenderThemeGtk::adjustButtonInnerStyle(RenderStyle* style) const +{ + // This inner padding matches Firefox. + style->setPaddingTop(Length(1, Fixed)); + style->setPaddingRight(Length(3, Fixed)); + style->setPaddingBottom(Length(1, Fixed)); + style->setPaddingLeft(Length(3, Fixed)); +} + +void RenderThemeGtk::adjustSearchFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const +{ + adjustTextFieldStyle(selector, style, e); +} + +void RenderThemeGtk::adjustSearchFieldCancelButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const +{ + style->resetBorder(); + style->resetPadding(); + + // FIXME: This should not be hard-coded. + IntSize size = IntSize(14, 14); + style->setWidth(Length(size.width(), Fixed)); + style->setHeight(Length(size.height(), Fixed)); +} + +void RenderThemeGtk::adjustSearchFieldResultsDecorationStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const +{ + style->resetBorder(); + style->resetPadding(); + + // FIXME: This should not be hard-coded. + IntSize size = IntSize(14, 14); + style->setWidth(Length(size.width(), Fixed)); + style->setHeight(Length(size.height(), Fixed)); +} + +void RenderThemeGtk::adjustSearchFieldResultsButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const +{ + adjustSearchFieldCancelButtonStyle(selector, style, e); +} + +bool RenderThemeGtk::controlSupportsTints(const RenderObject* o) const +{ + return isEnabled(o); +} + +int RenderThemeGtk::baselinePosition(const RenderObject* o) const +{ + // FIXME: This strategy is possibly incorrect for the GTK+ port. + if (o->style()->appearance() == CheckboxPart|| + o->style()->appearance() == RadioPart) + return o->marginTop() + o->height() - 2; + return RenderTheme::baselinePosition(o); +} + +Color RenderThemeGtk::activeListBoxSelectionBackgroundColor() const +{ + GtkWidget* widget = gtkTreeView(); + return makeColor(widget->style->base[GTK_STATE_SELECTED]); +} + +Color RenderThemeGtk::activeListBoxSelectionForegroundColor() const +{ + GtkWidget* widget = gtkTreeView(); + return makeColor(widget->style->text[GTK_STATE_SELECTED]); +} + +Color RenderThemeGtk::inactiveListBoxSelectionBackgroundColor() const +{ + GtkWidget* widget = gtkTreeView(); + return makeColor(widget->style->base[GTK_STATE_ACTIVE]); +} + +Color RenderThemeGtk::inactiveListBoxSelectionForegroundColor() const +{ + GtkWidget* widget = gtkTreeView(); + return makeColor(widget->style->text[GTK_STATE_ACTIVE]); } GtkWidget* RenderThemeGtk::gtkEntry() const @@ -541,4 +530,17 @@ GtkWidget* RenderThemeGtk::gtkTreeView() const return m_gtkTreeView; } +GtkContainer* RenderThemeGtk::gtkContainer() const +{ + if (m_gtkContainer) + return m_gtkContainer; + + m_gtkWindow = gtk_window_new(GTK_WINDOW_POPUP); + m_gtkContainer = GTK_CONTAINER(gtk_fixed_new()); + gtk_container_add(GTK_CONTAINER(m_gtkWindow), GTK_WIDGET(m_gtkContainer)); + gtk_widget_realize(m_gtkWindow); + + return m_gtkContainer; } + +} // namespace WebCore diff --git a/webkit/port/platform/chromium/RenderThemeGtk.h b/webkit/port/platform/chromium/RenderThemeGtk.h index 39247b3..2f69d48 100644 --- a/webkit/port/platform/chromium/RenderThemeGtk.h +++ b/webkit/port/platform/chromium/RenderThemeGtk.h @@ -37,6 +37,7 @@ namespace WebCore { class RenderThemeGtk : public RenderTheme { public: RenderThemeGtk(); + ~RenderThemeGtk() { } // A method asking if the theme's controls actually care about redrawing when hovered. virtual bool supportsHover(const RenderStyle*) const { return true; } @@ -44,29 +45,12 @@ public: // A method asking if the theme is able to draw the focus ring. virtual bool supportsFocusRing(const RenderStyle*) const; - // A method asking if the control changes its tint when the window has focus or not. - virtual bool controlSupportsTints(const RenderObject*) const; - - // A general method asking if any control tinting is supported at all. - virtual bool supportsControlTints() const { return true; } - - // A method to obtain the baseline position for a "leaf" control. This will only be used if a baseline - // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of - // controls that need to do this. - virtual int baselinePosition(const RenderObject*) const; - // The platform selection color. virtual Color platformActiveSelectionBackgroundColor() const; virtual Color platformInactiveSelectionBackgroundColor() const; virtual Color platformActiveSelectionForegroundColor() const; virtual Color platformInactiveSelectionForegroundColor() const; - // List Box selection color - virtual Color activeListBoxSelectionBackgroundColor() const; - virtual Color activeListBoxSelectionForegroundColor() const; - virtual Color inactiveListBoxSelectionBackgroundColor() const; - virtual Color inactiveListBoxSelectionForegroundColor() const; - virtual double caretBlinkFrequency() const; // System fonts. @@ -78,7 +62,6 @@ public: virtual bool paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r); virtual void setRadioSize(RenderStyle* style) const; - virtual void adjustButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const; virtual bool paintButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); virtual void adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const; @@ -87,21 +70,47 @@ public: virtual void adjustTextAreaStyle(CSSStyleSelector*, RenderStyle*, Element*) const; virtual bool paintTextArea(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); + virtual bool paintSearchField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); + + virtual bool paintSearchFieldResultsDecoration(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); + virtual bool paintSearchFieldResultsButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); + virtual bool paintSearchFieldCancelButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); + + // MenuList refers to an unstyled menulist (meaning a menulist without + // background-color or border set) and MenuListButton refers to a styled + // menulist (a menulist with background-color or border set). They have + // this distinction to support showing aqua style themes whenever they + // possibly can, which is something we don't want to replicate. + // + // In short, we either go down the MenuList code path or the MenuListButton + // codepath. We never go down both. And in both cases, they render the + // entire menulist. virtual void adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const; virtual bool paintMenuList(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); - virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const; - virtual bool paintSearchFieldResultsDecoration(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); + virtual void adjustButtonInnerStyle(RenderStyle* style) const; virtual void adjustSearchFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const; - virtual bool paintSearchField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); - + virtual void adjustSearchFieldCancelButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const; + virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const; virtual void adjustSearchFieldResultsButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const; - virtual bool paintSearchFieldResultsButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); - virtual void adjustSearchFieldCancelButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const; - virtual bool paintSearchFieldCancelButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); + // A method asking if the control changes its tint when the window has focus or not. + virtual bool controlSupportsTints(const RenderObject*) const; + // A general method asking if any control tinting is supported at all. + virtual bool supportsControlTints() const { return true; } + + // A method to obtain the baseline position for a "leaf" control. This will only be used if a baseline + // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of + // controls that need to do this. + virtual int baselinePosition(const RenderObject*) const; + + // List Box selection color + virtual Color activeListBoxSelectionBackgroundColor() const; + virtual Color activeListBoxSelectionForegroundColor() const; + virtual Color inactiveListBoxSelectionBackgroundColor() const; + virtual Color inactiveListBoxSelectionForegroundColor() const; private: /* diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc index 4776a79..52cf2a0 100644 --- a/webkit/tools/test_shell/test_shell_gtk.cc +++ b/webkit/tools/test_shell/test_shell_gtk.cc @@ -78,19 +78,19 @@ void TestShell::InitializeTestShell(bool interactive) { static const char *const fonts[] = { "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf", "/usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf", - "/usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf", "/usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf", + "/usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf", + "/usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf", + "/usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf", "/usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf", - "/usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf", "/usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf", "/usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf", + "/usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf", + "/usr/share/fonts/truetype/msttcorefonts/Impact.ttf", "/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf", "/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf", - "/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf", "/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf", - "/usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf", - "/usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf", - "/usr/share/fonts/truetype/msttcorefonts/Impact.ttf", + "/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf", NULL }; for (size_t i = 0; fonts[i]; ++i) { diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc index 9d619ef..42e16fb 100644 --- a/webkit/tools/test_shell/test_shell_main.cc +++ b/webkit/tools/test_shell/test_shell_main.cc @@ -186,7 +186,7 @@ int main(int argc, char* argv[]) { // 1) currently don't support GTK themes that use the GDK drawing APIs, and // 2) need to use a unified theme for layout tests anyway. g_object_set(gtk_settings_get_default(), - "gtk-theme-name", "ClearlooksClassic", + "gtk-theme-name", "Mist", NULL); #endif } |