Changeset 187095 in webkit


Ignore:
Timestamp:
Jul 20, 2015 10:33:50 PM (9 years ago)
Author:
Carlos Garcia Campos
Message:

Remove RenderTheme::shouldShowPlaceholderWhenFocused()
https://bugs.webkit.org/show_bug.cgi?id=147104

Reviewed by Martin Robinson.

GTK+ is the only port that returns false in
shouldShowPlaceholderWhenFocused(). That's inconsistent with all
other browsers that show the placeholder text even for focused
entries in all platforms. We should change the GTK+ port
behaviour, but that would leave all implementations of
shouldShowPlaceholderWhenFocused returning true, so let's just
remove it.

  • html/HTMLTextFormControlElement.cpp:

(WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible):
Do not consider whether the entry is focused or not.

  • platform/efl/RenderThemeEfl.h:
  • rendering/RenderTheme.h:

(WebCore::RenderTheme::shouldShowPlaceholderWhenFocused): Deleted.

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

(WebCore::RenderThemeIOS::shouldShowPlaceholderWhenFocused): Deleted.

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

(WebCore::RenderThemeMac::shouldShowPlaceholderWhenFocused): Deleted.

  • rendering/RenderThemeSafari.h:

(WebCore::RenderThemeSafari::shouldShowPlaceholderWhenFocused): Deleted.

  • rendering/RenderThemeWin.h:
Location:
trunk/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r187088 r187095  
     12015-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Remove RenderTheme::shouldShowPlaceholderWhenFocused()
     4        https://bugs.webkit.org/show_bug.cgi?id=147104
     5
     6        Reviewed by Martin Robinson.
     7
     8        GTK+ is the only port that returns false in
     9        shouldShowPlaceholderWhenFocused(). That's inconsistent with all
     10        other browsers that show the placeholder text even for focused
     11        entries in all platforms. We should change the GTK+ port
     12        behaviour, but that would leave all implementations of
     13        shouldShowPlaceholderWhenFocused returning true, so let's just
     14        remove it.
     15
     16        * html/HTMLTextFormControlElement.cpp:
     17        (WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible):
     18        Do not consider whether the entry is focused or not.
     19        * platform/efl/RenderThemeEfl.h:
     20        * rendering/RenderTheme.h:
     21        (WebCore::RenderTheme::shouldShowPlaceholderWhenFocused): Deleted.
     22        * rendering/RenderThemeIOS.h:
     23        * rendering/RenderThemeIOS.mm:
     24        (WebCore::RenderThemeIOS::shouldShowPlaceholderWhenFocused): Deleted.
     25        * rendering/RenderThemeMac.h:
     26        * rendering/RenderThemeMac.mm:
     27        (WebCore::RenderThemeMac::shouldShowPlaceholderWhenFocused): Deleted.
     28        * rendering/RenderThemeSafari.h:
     29        (WebCore::RenderThemeSafari::shouldShowPlaceholderWhenFocused): Deleted.
     30        * rendering/RenderThemeWin.h:
     31
    1322015-07-20  Zan Dobersek  <zdobersek@igalia.com>
    233
  • trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp

    r186256 r187095  
    151151    // This function is used by the style resolver to match the :placeholder-shown pseudo class.
    152152    // Since it is used for styling, it must not use any value depending on the style.
    153     return supportsPlaceholder()
    154         && isEmptyValue()
    155         && !isPlaceholderEmpty()
    156         && (document().focusedElement() != this || (document().page()->theme().shouldShowPlaceholderWhenFocused()));
     153    return supportsPlaceholder() && isEmptyValue() && !isPlaceholderEmpty();
    157154}
    158155
  • trunk/Source/WebCore/platform/efl/RenderThemeEfl.h

    r186829 r187095  
    176176    virtual bool supportsClosedCaptioning() const override { return true; }
    177177#endif
    178     virtual bool shouldShowPlaceholderWhenFocused() const override { return true; }
    179178
    180179    void setThemePath(const String&);
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r185481 r187095  
    229229#endif
    230230
    231     virtual bool shouldShowPlaceholderWhenFocused() const { return false; }
    232231    virtual bool shouldHaveSpinButton(HTMLInputElement&) const;
    233232    virtual bool shouldHaveCapsLockIndicator(HTMLInputElement&) const;
  • trunk/Source/WebCore/rendering/RenderThemeIOS.h

    r184147 r187095  
    103103#endif
    104104
    105     virtual bool shouldShowPlaceholderWhenFocused() const override;
    106105    virtual bool shouldHaveSpinButton(HTMLInputElement&) const override;
    107106    virtual bool shouldHaveCapsLockIndicator(HTMLInputElement&) const override;
  • trunk/Source/WebCore/rendering/RenderThemeIOS.mm

    r185934 r187095  
    10741074}
    10751075
    1076 bool RenderThemeIOS::shouldShowPlaceholderWhenFocused() const
    1077 {
    1078     return true;
    1079 }
    1080 
    10811076bool RenderThemeIOS::shouldHaveSpinButton(HTMLInputElement&) const
    10821077{
  • trunk/Source/WebCore/rendering/RenderThemeMac.h

    r185481 r187095  
    163163#endif
    164164
    165     virtual bool shouldShowPlaceholderWhenFocused() const override;
    166165    virtual bool shouldHaveCapsLockIndicator(HTMLInputElement&) const override;
    167166
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r186858 r187095  
    19371937}
    19381938
    1939 bool RenderThemeMac::shouldShowPlaceholderWhenFocused() const
    1940 {
    1941     return true;
    1942 }
    1943 
    19441939bool RenderThemeMac::shouldHaveCapsLockIndicator(HTMLInputElement& element) const
    19451940{
  • trunk/Source/WebCore/rendering/RenderThemeSafari.h

    r184147 r187095  
    141141#endif
    142142
    143     virtual bool shouldShowPlaceholderWhenFocused() const { return true; }
    144 
    145143private:
    146144    RenderThemeSafari();
  • trunk/Source/WebCore/rendering/RenderThemeWin.h

    r187022 r187095  
    135135#endif
    136136
    137     virtual bool shouldShowPlaceholderWhenFocused() const override { return true; }
    138 
    139137private:
    140138    enum ControlSubPart {
Note: See TracChangeset for help on using the changeset viewer.