Changeset 232913 in webkit


Ignore:
Timestamp:
Jun 17, 2018 8:47:39 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK] Correct behavior for dark themes
https://bugs.webkit.org/show_bug.cgi?id=186219

Source/WebCore:

Patch by Carlos Eduardo Ramalho <cadubentzen@gmail.com> on 2018-06-17
Reviewed by Michael Catanzaro.

Override RenderThemeGtk::isControlStyled() to not style
text inputs if color is set different than default.

No new tests. Manual theme test and existing layout tests already cover it.

  • rendering/RenderThemeGtk.cpp:

(WebCore::RenderThemeGtk::isControlStyled const):

  • rendering/RenderThemeGtk.h:

LayoutTests:

Update expectations in reftests expected to fail due to not
styling text inputs with GTK when color is different than default color.

Patch by Carlos Eduardo Ramalho <cadubentzen@gmail.com> on 2018-06-17
Reviewed by Michael Catanzaro.

  • platform/gtk/TestExpectations:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r232903 r232913  
     12018-06-17  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
     2
     3        [GTK] Correct behavior for dark themes
     4        https://bugs.webkit.org/show_bug.cgi?id=186219
     5
     6        Update expectations in reftests expected to fail due to not
     7        styling text inputs with GTK when color is different than default color.
     8
     9        Reviewed by Michael Catanzaro.
     10
     11        * platform/gtk/TestExpectations:
     12
    1132018-06-16  Brendan McLoughlin  <brendan@bocoup.com>
    214
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r232895 r232913  
    11681168webkit.org/b/181659 fast/canvas/webgl/simulated-vertexAttrib0-invalid-indicies.html [ Skip ]
    11691169
     1170# When text input colors are set we do not style with GTK, so these reftests will fail
     1171webkit.org/b/186219 fast/forms/input-placeholder-text-indent.html [ ImageOnlyFailure ]
     1172webkit.org/b/186219 fast/forms/password-placeholder-text-security.html [ ImageOnlyFailure ]
     1173webkit.org/b/186219 fast/forms/placeholder-with-positioned-element.html [ ImageOnlyFailure ]
     1174webkit.org/b/186219 fast/forms/textarea-placeholder-wrapping.html [ ImageOnlyFailure ]
     1175
    11701176#////////////////////////////////////////////////////////////////////////////////////////
    11711177# End of Expected failures.
  • trunk/Source/WebCore/ChangeLog

    r232911 r232913  
     12018-06-17  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
     2
     3        [GTK] Correct behavior for dark themes
     4        https://bugs.webkit.org/show_bug.cgi?id=186219
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Override RenderThemeGtk::isControlStyled() to not style
     9        text inputs if color is set different than default.
     10
     11        No new tests. Manual theme test and existing layout tests already cover it.
     12
     13        * rendering/RenderThemeGtk.cpp:
     14        (WebCore::RenderThemeGtk::isControlStyled const):
     15        * rendering/RenderThemeGtk.h:
     16
    1172018-06-12  Darin Adler  <darin@apple.com>
    218
  • trunk/Source/WebCore/rendering/RenderThemeGtk.cpp

    r232486 r232913  
    925925}
    926926
     927bool RenderThemeGtk::isControlStyled(const RenderStyle& style, const BorderData& border, const FillLayer& background, const Color& backgroundColor) const
     928{
     929    // To avoid rendering issues with dark themes, if text input elements have color styling, we don't style them with GTK.
     930    if ((style.appearance() == TextFieldPart || style.appearance() == TextAreaPart || style.appearance() == SearchFieldPart) && style.color() != RenderStyle::initialColor())
     931        return true;
     932
     933    return RenderTheme::isControlStyled(style, border, background, backgroundColor);
     934}
     935
    927936#if GTK_CHECK_VERSION(3, 20, 0)
    928937
  • trunk/Source/WebCore/rendering/RenderThemeGtk.h

    r232486 r232913  
    169169#endif
    170170
     171    bool isControlStyled(const RenderStyle&, const BorderData&, const FillLayer&, const Color&) const override;
     172
    171173    Seconds animationRepeatIntervalForProgressBar(RenderProgress&) const override;
    172174    Seconds animationDurationForProgressBar(RenderProgress&) const override;
Note: See TracChangeset for help on using the changeset viewer.