Remove RenderTheme::shouldShowPlaceholderWhenFocused()
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Jul 2015 05:33:50 +0000 (05:33 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Jul 2015 05:33:50 +0000 (05:33 +0000)
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187095 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/platform/efl/RenderThemeEfl.h
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeIOS.h
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebCore/rendering/RenderThemeMac.h
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderThemeSafari.h
Source/WebCore/rendering/RenderThemeWin.h

index 2048a0b..6d52315 100644 (file)
@@ -1,3 +1,34 @@
+2015-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        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:
+
 2015-07-20  Zan Dobersek  <zdobersek@igalia.com>
 
         [CoordinatedGraphics] CoordinatedGraphicsLayer::setContentsToImage() should avoid scheduling unnecessary flushes
index 77c7313..534a0e1 100644 (file)
@@ -150,10 +150,7 @@ bool HTMLTextFormControlElement::placeholderShouldBeVisible() const
 {
     // This function is used by the style resolver to match the :placeholder-shown pseudo class.
     // Since it is used for styling, it must not use any value depending on the style.
-    return supportsPlaceholder()
-        && isEmptyValue()
-        && !isPlaceholderEmpty()
-        && (document().focusedElement() != this || (document().page()->theme().shouldShowPlaceholderWhenFocused()));
+    return supportsPlaceholder() && isEmptyValue() && !isPlaceholderEmpty();
 }
 
 void HTMLTextFormControlElement::updatePlaceholderVisibility()
index 7063626..4f26749 100644 (file)
@@ -175,7 +175,6 @@ public:
 #if ENABLE(VIDEO_TRACK)
     virtual bool supportsClosedCaptioning() const override { return true; }
 #endif
-    virtual bool shouldShowPlaceholderWhenFocused() const override { return true; }
 
     void setThemePath(const String&);
     String themePath() const;
index 92246f5..01cb8dc 100644 (file)
@@ -228,7 +228,6 @@ public:
     void paintSliderTicks(const RenderObject&, const PaintInfo&, const IntRect&);
 #endif
 
-    virtual bool shouldShowPlaceholderWhenFocused() const { return false; }
     virtual bool shouldHaveSpinButton(HTMLInputElement&) const;
     virtual bool shouldHaveCapsLockIndicator(HTMLInputElement&) const;
 
index a44b750..dc04e3e 100644 (file)
@@ -102,7 +102,6 @@ protected:
     virtual Color platformTapHighlightColor() const override { return 0x4D1A1A1A; }
 #endif
 
-    virtual bool shouldShowPlaceholderWhenFocused() const override;
     virtual bool shouldHaveSpinButton(HTMLInputElement&) const override;
     virtual bool shouldHaveCapsLockIndicator(HTMLInputElement&) const override;
 
index 5448f63..ea10a81 100644 (file)
@@ -1073,11 +1073,6 @@ Color RenderThemeIOS::platformInactiveSelectionBackgroundColor() const
     return Color::transparent;
 }
 
-bool RenderThemeIOS::shouldShowPlaceholderWhenFocused() const
-{
-    return true;
-}
-
 bool RenderThemeIOS::shouldHaveSpinButton(HTMLInputElement&) const
 {
     return false;
index e05b87a..f89e3a2 100644 (file)
@@ -162,7 +162,6 @@ protected:
     virtual bool supportsClosedCaptioning() const override { return true; }
 #endif
 
-    virtual bool shouldShowPlaceholderWhenFocused() const override;
     virtual bool shouldHaveCapsLockIndicator(HTMLInputElement&) const override;
 
     virtual bool paintSnapshottedPluginOverlay(const RenderObject&, const PaintInfo&, const IntRect&) override;
index 06e235f..4795ac8 100644 (file)
@@ -1936,11 +1936,6 @@ void RenderThemeMac::adjustSliderThumbSize(RenderStyle& style, Element*) const
     }
 }
 
-bool RenderThemeMac::shouldShowPlaceholderWhenFocused() const
-{
-    return true;
-}
-
 bool RenderThemeMac::shouldHaveCapsLockIndicator(HTMLInputElement& element) const
 {
     return element.isPasswordField();
index b2800b8..60f1207 100644 (file)
@@ -140,8 +140,6 @@ protected:
     virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&) override;
 #endif
 
-    virtual bool shouldShowPlaceholderWhenFocused() const { return true; }
-
 private:
     RenderThemeSafari();
     virtual ~RenderThemeSafari();
index 379b1dd..a0394ff 100644 (file)
@@ -134,8 +134,6 @@ public:
     virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&) override;
 #endif
 
-    virtual bool shouldShowPlaceholderWhenFocused() const override { return true; }
-
 private:
     enum ControlSubPart {
         None,