Changeset 70391 in webkit


Ignore:
Timestamp:
Oct 23, 2010 8:29:38 AM (14 years ago)
Author:
Martin Robinson
Message:

2010-10-23 Martin Robinson <mrobinson@igalia.com>

Reviewed by Xan Lopez.

[GTK] Menu list buttons do react properly to CSS styling
https://bugs.webkit.org/show_bug.cgi?id=48099

Rebaseline menu list button tests and add pixel results. There
are still issues with padding around separators, but these will
be fixed in a further patch.

  • platform/gtk/editing/selection/select-box-expected.txt:
  • platform/gtk/fast/forms/menulist-clip-expected.checksum: Added.
  • platform/gtk/fast/forms/menulist-clip-expected.png: Added.
  • platform/gtk/fast/forms/menulist-clip-expected.txt: Added.
  • platform/gtk/fast/forms/menulist-deselect-update-expected.checksum: Added.
  • platform/gtk/fast/forms/menulist-deselect-update-expected.png: Added.
  • platform/gtk/fast/forms/menulist-deselect-update-expected.txt: Added.
  • platform/gtk/fast/forms/menulist-narrow-width-expected.checksum: Added.
  • platform/gtk/fast/forms/menulist-narrow-width-expected.png: Added.
  • platform/gtk/fast/forms/menulist-narrow-width-expected.txt: Added.
  • platform/gtk/fast/forms/menulist-no-overflow-expected.checksum: Added.
  • platform/gtk/fast/forms/menulist-no-overflow-expected.png: Added.
  • platform/gtk/fast/forms/menulist-no-overflow-expected.txt: Added.
  • platform/gtk/fast/forms/menulist-option-wrap-expected.checksum: Added.
  • platform/gtk/fast/forms/menulist-option-wrap-expected.png: Added.
  • platform/gtk/fast/forms/menulist-option-wrap-expected.txt: Added.
  • platform/gtk/fast/forms/menulist-restrict-line-height-expected.checksum: Added.
  • platform/gtk/fast/forms/menulist-restrict-line-height-expected.png: Added.
  • platform/gtk/fast/forms/menulist-restrict-line-height-expected.txt: Added.
  • platform/gtk/fast/forms/menulist-separator-painting-expected.checksum: Added.
  • platform/gtk/fast/forms/menulist-separator-painting-expected.png: Added.
  • platform/gtk/fast/forms/menulist-separator-painting-expected.txt: Added.
  • platform/gtk/fast/forms/menulist-style-color-expected.checksum: Added.
  • platform/gtk/fast/forms/menulist-style-color-expected.png: Added.
  • platform/gtk/fast/forms/menulist-style-color-expected.txt: Added.
  • platform/gtk/fast/forms/menulist-width-change-expected.checksum: Added.
  • platform/gtk/fast/forms/menulist-width-change-expected.png: Added.
  • platform/gtk/fast/forms/menulist-width-change-expected.txt: Added.

2010-10-23 Martin Robinson <mrobinson@igalia.com>

Reviewed by Xan Lopez.

[GTK] Menu list buttons do react properly to CSS styling
https://bugs.webkit.org/show_bug.cgi?id=48099

Correct the way that menu list buttons get their necessary padding from
GTK+. Instead of resetting the padding to these values, return them via
the popupInternalPadding* methods. Add implementations for *MenuListButton*
methods.

  • platform/gtk/RenderThemeGtk.cpp: (WebCore::getComboBoxPadding): Added. (WebCore::RenderThemeGtk::popupInternalPaddingLeft): Added. (WebCore::RenderThemeGtk::popupInternalPaddingRight): Added. (WebCore::RenderThemeGtk::popupInternalPaddingTop): Added. (WebCore::RenderThemeGtk::popupInternalPaddingBottom): Added. (WebCore::RenderThemeGtk::adjustMenuListStyle): Do not reset CSS properties, instead rely on the poupInternalPadding* methods. (WebCore::RenderThemeGtk::adjustMenuListButtonStyle): Added. (WebCore::RenderThemeGtk::paintMenuListButton): Added.
  • platform/gtk/RenderThemeGtk.h: Added new method declarations.
Location:
trunk
Files:
27 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70385 r70391  
     12010-10-23  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Xan Lopez.
     4
     5        [GTK] Menu list buttons do react properly to CSS styling
     6        https://bugs.webkit.org/show_bug.cgi?id=48099
     7
     8        Rebaseline menu list button tests and add pixel results. There
     9        are still issues with padding around separators, but these will
     10        be fixed in a further patch.
     11
     12        * platform/gtk/editing/selection/select-box-expected.txt:
     13        * platform/gtk/fast/forms/menulist-clip-expected.checksum: Added.
     14        * platform/gtk/fast/forms/menulist-clip-expected.png: Added.
     15        * platform/gtk/fast/forms/menulist-clip-expected.txt: Added.
     16        * platform/gtk/fast/forms/menulist-deselect-update-expected.checksum: Added.
     17        * platform/gtk/fast/forms/menulist-deselect-update-expected.png: Added.
     18        * platform/gtk/fast/forms/menulist-deselect-update-expected.txt: Added.
     19        * platform/gtk/fast/forms/menulist-narrow-width-expected.checksum: Added.
     20        * platform/gtk/fast/forms/menulist-narrow-width-expected.png: Added.
     21        * platform/gtk/fast/forms/menulist-narrow-width-expected.txt: Added.
     22        * platform/gtk/fast/forms/menulist-no-overflow-expected.checksum: Added.
     23        * platform/gtk/fast/forms/menulist-no-overflow-expected.png: Added.
     24        * platform/gtk/fast/forms/menulist-no-overflow-expected.txt: Added.
     25        * platform/gtk/fast/forms/menulist-option-wrap-expected.checksum: Added.
     26        * platform/gtk/fast/forms/menulist-option-wrap-expected.png: Added.
     27        * platform/gtk/fast/forms/menulist-option-wrap-expected.txt: Added.
     28        * platform/gtk/fast/forms/menulist-restrict-line-height-expected.checksum: Added.
     29        * platform/gtk/fast/forms/menulist-restrict-line-height-expected.png: Added.
     30        * platform/gtk/fast/forms/menulist-restrict-line-height-expected.txt: Added.
     31        * platform/gtk/fast/forms/menulist-separator-painting-expected.checksum: Added.
     32        * platform/gtk/fast/forms/menulist-separator-painting-expected.png: Added.
     33        * platform/gtk/fast/forms/menulist-separator-painting-expected.txt: Added.
     34        * platform/gtk/fast/forms/menulist-style-color-expected.checksum: Added.
     35        * platform/gtk/fast/forms/menulist-style-color-expected.png: Added.
     36        * platform/gtk/fast/forms/menulist-style-color-expected.txt: Added.
     37        * platform/gtk/fast/forms/menulist-width-change-expected.checksum: Added.
     38        * platform/gtk/fast/forms/menulist-width-change-expected.png: Added.
     39        * platform/gtk/fast/forms/menulist-width-change-expected.txt: Added.
     40
    1412010-10-23  Sheriff Bot  <webkit.review.bot@gmail.com>
    242
  • trunk/LayoutTests/platform/gtk/editing/selection/select-box-expected.txt

    r69818 r70391  
    1212          RenderText {#text} at (0,5) size 68x19
    1313            text run at (0,5) width 68: "select box: "
    14           RenderMenuList {SELECT} at (70,2) size 32x25 [bgcolor=#FFFFFF]
    15             RenderBlock (anonymous) at (3,3) size 9x19
    16               RenderText at (0,0) size 9x19
    17                 text run at (0,0) width 9: "1"
     14          RenderMenuList {SELECT} at (70,2) size 32x25 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     15            RenderBlock (anonymous) at (1,1) size 30x23
     16              RenderText at (2,2) size 9x19
     17                text run at (2,2) width 9: "1"
    1818          RenderText {#text} at (104,5) size 64x19
    1919            text run at (104,5) width 64: " the end ..."
  • trunk/WebCore/ChangeLog

    r70389 r70391  
     12010-10-23  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Xan Lopez.
     4
     5        [GTK] Menu list buttons do react properly to CSS styling
     6        https://bugs.webkit.org/show_bug.cgi?id=48099
     7
     8        Correct the way that menu list buttons get their necessary padding from
     9        GTK+. Instead of resetting the padding to these values, return them via
     10        the popupInternalPadding* methods. Add implementations for *MenuListButton*
     11        methods.
     12
     13        * platform/gtk/RenderThemeGtk.cpp:
     14        (WebCore::getComboBoxPadding): Added.
     15        (WebCore::RenderThemeGtk::popupInternalPaddingLeft): Added.
     16        (WebCore::RenderThemeGtk::popupInternalPaddingRight): Added.
     17        (WebCore::RenderThemeGtk::popupInternalPaddingTop): Added.
     18        (WebCore::RenderThemeGtk::popupInternalPaddingBottom): Added.
     19        (WebCore::RenderThemeGtk::adjustMenuListStyle): Do not reset CSS
     20        properties, instead rely on the poupInternalPadding* methods.
     21        (WebCore::RenderThemeGtk::adjustMenuListButtonStyle): Added.
     22        (WebCore::RenderThemeGtk::paintMenuListButton): Added.
     23        * platform/gtk/RenderThemeGtk.h: Added new method declarations.
     24
    1252010-10-23  Patrick Gansterer  <paroga@webkit.org>
    226
  • trunk/WebCore/platform/gtk/RenderThemeGtk.cpp

    r70143 r70391  
    451451}
    452452
    453 void RenderThemeGtk::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, WebCore::Element* e) const
    454 {
    455     style->resetBorder();
    456     style->resetPadding();
    457     style->setHeight(Length(Auto));
    458     style->setWhiteSpace(PRE);
    459     adjustMozillaStyle(this, style, MOZ_GTK_DROPDOWN);
     453static void getComboBoxPadding(RenderStyle* style, int& left, int& top, int& right, int& bottom)
     454{
     455    // If this menu list button isn't drawn using the native theme, we
     456    // don't add any extra padding beyond what WebCore already uses.
     457    if (style->appearance() == NoControlPart)
     458        return;
     459    moz_gtk_get_widget_border(MOZ_GTK_DROPDOWN, &left, &top, &right, &bottom,
     460                              gtkTextDirection(style->direction()), TRUE);
     461}
     462
     463int RenderThemeGtk::popupInternalPaddingLeft(RenderStyle* style) const
     464{
     465    int left = 0, top = 0, right = 0, bottom = 0;
     466    getComboBoxPadding(style, left, top, right, bottom);
     467    return left;
     468}
     469
     470int RenderThemeGtk::popupInternalPaddingRight(RenderStyle* style) const
     471{
     472    int left = 0, top = 0, right = 0, bottom = 0;
     473    getComboBoxPadding(style, left, top, right, bottom);
     474    return right;
     475}
     476
     477int RenderThemeGtk::popupInternalPaddingTop(RenderStyle* style) const
     478{
     479    int left = 0, top = 0, right = 0, bottom = 0;
     480    getComboBoxPadding(style, left, top, right, bottom);
     481    return top;
     482}
     483
     484int RenderThemeGtk::popupInternalPaddingBottom(RenderStyle* style) const
     485{
     486    int left = 0, top = 0, right = 0, bottom = 0;
     487    getComboBoxPadding(style, left, top, right, bottom);
     488    return bottom;
     489}
     490
     491void RenderThemeGtk::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
     492{
     493    // The tests check explicitly that select menu buttons ignore line height.
     494    style->setLineHeight(RenderStyle::initialLineHeight());
     495
     496    // We cannot give a proper rendering when border radius is active, unfortunately.
     497    style->resetBorderRadius();
     498}
     499
     500void RenderThemeGtk::adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
     501{
     502    adjustMenuListStyle(selector, style, e);
    460503}
    461504
     
    463506{
    464507    return paintRenderObject(MOZ_GTK_DROPDOWN, o, i.context, rect);
     508}
     509
     510bool RenderThemeGtk::paintMenuListButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     511{
     512    return paintMenuList(object, info, rect);
    465513}
    466514
  • trunk/WebCore/platform/gtk/RenderThemeGtk.h

    r66540 r70391  
    66 * Copyright (C) 2007 Holger Hans Peter Freyther
    77 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
    8  * Copyright (C) 2009 Kenneth Rohde Christiansen
     8 * Copyright (C) 2010 Igalia S.L.
    99 * All rights reserved.
    1010 *
     
    103103    virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
    104104
     105    int popupInternalPaddingLeft(RenderStyle*) const;
     106    int popupInternalPaddingRight(RenderStyle*) const;
     107    int popupInternalPaddingTop(RenderStyle*) const;
     108    int popupInternalPaddingBottom(RenderStyle*) const;
     109
     110    // The Mac port differentiates between the "menu list" and the "menu list button."
     111    // The former is used when a menu list button has been styled. This is used to ensure
     112    // Aqua themed controls whenever possible. We always want to use GTK+ theming, so
     113    // we don't maintain this differentiation.
    105114    virtual void adjustMenuListStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
     115    virtual void adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element* e) const;
    106116    virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
     117    virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
    107118
    108119    virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
Note: See TracChangeset for help on using the changeset viewer.