Title: [187095] trunk/Source/WebCore
Revision
187095
Author
[email protected]
Date
2015-07-20 22:33:50 -0700 (Mon, 20 Jul 2015)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (187094 => 187095)


--- trunk/Source/WebCore/ChangeLog	2015-07-21 05:27:58 UTC (rev 187094)
+++ trunk/Source/WebCore/ChangeLog	2015-07-21 05:33:50 UTC (rev 187095)
@@ -1,3 +1,34 @@
+2015-07-20  Carlos Garcia Campos  <[email protected]>
+
+        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  <[email protected]>
 
         [CoordinatedGraphics] CoordinatedGraphicsLayer::setContentsToImage() should avoid scheduling unnecessary flushes

Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (187094 => 187095)


--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp	2015-07-21 05:27:58 UTC (rev 187094)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp	2015-07-21 05:33:50 UTC (rev 187095)
@@ -150,10 +150,7 @@
 {
     // 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()

Modified: trunk/Source/WebCore/platform/efl/RenderThemeEfl.h (187094 => 187095)


--- trunk/Source/WebCore/platform/efl/RenderThemeEfl.h	2015-07-21 05:27:58 UTC (rev 187094)
+++ trunk/Source/WebCore/platform/efl/RenderThemeEfl.h	2015-07-21 05:33:50 UTC (rev 187095)
@@ -175,7 +175,6 @@
 #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;

Modified: trunk/Source/WebCore/rendering/RenderTheme.h (187094 => 187095)


--- trunk/Source/WebCore/rendering/RenderTheme.h	2015-07-21 05:27:58 UTC (rev 187094)
+++ trunk/Source/WebCore/rendering/RenderTheme.h	2015-07-21 05:33:50 UTC (rev 187095)
@@ -228,7 +228,6 @@
     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;
 

Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.h (187094 => 187095)


--- trunk/Source/WebCore/rendering/RenderThemeIOS.h	2015-07-21 05:27:58 UTC (rev 187094)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.h	2015-07-21 05:33:50 UTC (rev 187095)
@@ -102,7 +102,6 @@
     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;
 

Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (187094 => 187095)


--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2015-07-21 05:27:58 UTC (rev 187094)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2015-07-21 05:33:50 UTC (rev 187095)
@@ -1073,11 +1073,6 @@
     return Color::transparent;
 }
 
-bool RenderThemeIOS::shouldShowPlaceholderWhenFocused() const
-{
-    return true;
-}
-
 bool RenderThemeIOS::shouldHaveSpinButton(HTMLInputElement&) const
 {
     return false;

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.h (187094 => 187095)


--- trunk/Source/WebCore/rendering/RenderThemeMac.h	2015-07-21 05:27:58 UTC (rev 187094)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.h	2015-07-21 05:33:50 UTC (rev 187095)
@@ -162,7 +162,6 @@
     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;

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (187094 => 187095)


--- trunk/Source/WebCore/rendering/RenderThemeMac.mm	2015-07-21 05:27:58 UTC (rev 187094)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm	2015-07-21 05:33:50 UTC (rev 187095)
@@ -1936,11 +1936,6 @@
     }
 }
 
-bool RenderThemeMac::shouldShowPlaceholderWhenFocused() const
-{
-    return true;
-}
-
 bool RenderThemeMac::shouldHaveCapsLockIndicator(HTMLInputElement& element) const
 {
     return element.isPasswordField();

Modified: trunk/Source/WebCore/rendering/RenderThemeSafari.h (187094 => 187095)


--- trunk/Source/WebCore/rendering/RenderThemeSafari.h	2015-07-21 05:27:58 UTC (rev 187094)
+++ trunk/Source/WebCore/rendering/RenderThemeSafari.h	2015-07-21 05:33:50 UTC (rev 187095)
@@ -140,8 +140,6 @@
     virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&) override;
 #endif
 
-    virtual bool shouldShowPlaceholderWhenFocused() const { return true; }
-
 private:
     RenderThemeSafari();
     virtual ~RenderThemeSafari();

Modified: trunk/Source/WebCore/rendering/RenderThemeWin.h (187094 => 187095)


--- trunk/Source/WebCore/rendering/RenderThemeWin.h	2015-07-21 05:27:58 UTC (rev 187094)
+++ trunk/Source/WebCore/rendering/RenderThemeWin.h	2015-07-21 05:33:50 UTC (rev 187095)
@@ -134,8 +134,6 @@
     virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&) override;
 #endif
 
-    virtual bool shouldShowPlaceholderWhenFocused() const override { return true; }
-
 private:
     enum ControlSubPart {
         None,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to