Changeset 237262 in webkit


Ignore:
Timestamp:
Oct 18, 2018 1:02:49 PM (6 years ago)
Author:
Wenson Hsieh
Message:

[GTK] fast/css/pseudo-visited-background-color-on-input.html is failing since r237425
https://bugs.webkit.org/show_bug.cgi?id=190712

Reviewed by Tim Horton.

Ensure that color inputs are enabled by default on GTK, and that color inputs have a -webkit-appearance of
color-well by default. Fixes fast/css/pseudo-visited-background-color-on-input.html on GTK.

  • page/RuntimeEnabledFeatures.cpp:

(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):

  • rendering/RenderTheme.cpp:

(WebCore::RenderTheme::colorInputStyleSheet const):

  • rendering/RenderTheme.h:

(WebCore::RenderTheme::platformUsesColorWellAppearance const):
(WebCore::RenderTheme::platformColorInputStyleSheet const): Deleted.

Replace this with a platform hook that determines whether we want to use -webkit-appearance: color-well; by
default for inputs of type color. For now, only iOS overrides this to return false; in the future, we should
support -webkit-appearance: color-well; on iOS, and remove this platform hook entirely.

  • rendering/RenderThemeIOS.h:
  • rendering/RenderThemeMac.h:
  • rendering/RenderThemeMac.mm:

(WebCore::RenderThemeMac::platformColorInputStyleSheet const): Deleted.

Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r237261 r237262  
     12018-10-18  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [GTK] fast/css/pseudo-visited-background-color-on-input.html is failing since r237425
     4        https://bugs.webkit.org/show_bug.cgi?id=190712
     5
     6        Reviewed by Tim Horton.
     7
     8        Ensure that color inputs are enabled by default on GTK, and that color inputs have a `-webkit-appearance` of
     9        `color-well` by default. Fixes fast/css/pseudo-visited-background-color-on-input.html on GTK.
     10
     11        * page/RuntimeEnabledFeatures.cpp:
     12        (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
     13        * rendering/RenderTheme.cpp:
     14        (WebCore::RenderTheme::colorInputStyleSheet const):
     15        * rendering/RenderTheme.h:
     16        (WebCore::RenderTheme::platformUsesColorWellAppearance const):
     17        (WebCore::RenderTheme::platformColorInputStyleSheet const): Deleted.
     18
     19        Replace this with a platform hook that determines whether we want to use `-webkit-appearance: color-well;` by
     20        default for inputs of type color. For now, only iOS overrides this to return false; in the future, we should
     21        support `-webkit-appearance: color-well;` on iOS, and remove this platform hook entirely.
     22
     23        * rendering/RenderThemeIOS.h:
     24        * rendering/RenderThemeMac.h:
     25        * rendering/RenderThemeMac.mm:
     26        (WebCore::RenderThemeMac::platformColorInputStyleSheet const): Deleted.
     27
    1282018-10-18  Youenn Fablet  <youenn@apple.com>
    229
  • trunk/Source/WebCore/page/RuntimeEnabledFeatures.cpp

    r233119 r237262  
    4747    m_isWebSocketEnabled = false;
    4848#endif
     49#if PLATFORM(GTK) && ENABLE(INPUT_TYPE_COLOR)
     50    m_isInputTypeColorEnabled = true;
     51#endif
    4952}
    5053
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r237245 r237262  
    10401040{
    10411041    ASSERT(RuntimeEnabledFeatures::sharedFeatures().inputTypeColorEnabled());
    1042     return makeString(platformColorInputStyleSheet(), " input[type=\"color\"] { width: 44px; height: 23px; outline: none; }"_s);
     1042    auto colorWellAppearanceStyle = emptyString();
     1043    if (platformUsesColorWellAppearance())
     1044        colorWellAppearanceStyle = "-webkit-appearance: color-well; "_s;
     1045    return makeString("input[type=\"color\"] { "_s, WTFMove(colorWellAppearanceStyle), "width: 44px; height: 23px; outline: none; }"_s);
    10431046}
    10441047
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r237245 r237262  
    351351
    352352#if ENABLE(INPUT_TYPE_COLOR)
    353     virtual String platformColorInputStyleSheet() const { return { }; }
     353    virtual bool platformUsesColorWellAppearance() const { return true; }
    354354#endif
    355355
  • trunk/Source/WebCore/rendering/RenderThemeIOS.h

    r235380 r237262  
    146146#endif
    147147
     148#if ENABLE(INPUT_TYPE_COLOR)
     149    bool platformUsesColorWellAppearance() const final
     150    {
     151        // FIXME: Support -webkit-appearance: color-well; for drawing color inputs on iOS.
     152        return false;
     153    }
     154#endif
     155
    148156    const Color& shadowColor() const;
    149157    FloatRect addRoundedBorderClip(const RenderObject& box, GraphicsContext&, const IntRect&);
  • trunk/Source/WebCore/rendering/RenderThemeMac.h

    r237245 r237262  
    120120#endif
    121121
    122 #if ENABLE(INPUT_TYPE_COLOR)
    123     String platformColorInputStyleSheet() const final;
    124 #endif
    125 
    126122    bool paintTextField(const RenderObject&, const PaintInfo&, const FloatRect&) final;
    127123    void adjustTextFieldStyle(StyleResolver&, RenderStyle&, const Element*) const final;
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r237245 r237262  
    339339
    340340    RenderTheme::purgeCaches();
    341 }
    342 
    343 String RenderThemeMac::platformColorInputStyleSheet() const
    344 {
    345     return "input[type=\"color\"] { -webkit-appearance: color-well; }"_s;
    346341}
    347342
Note: See TracChangeset for help on using the changeset viewer.