[Chromium] Show placeholder even if the element is focused
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2011 21:55:41 +0000 (21:55 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2011 21:55:41 +0000 (21:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=73629

Reviewed by Hajime Morita.

No new tests. Need to update some existing placeholder tests.

* rendering/RenderThemeChromiumMac.h: Add shouldShowPlaceholderWhenFocused().
* rendering/RenderThemeChromiumMac.mm:
(WebCore::RenderThemeChromiumMac::shouldShowPlaceholderWhenFocused):
Returns true.
* rendering/RenderThemeChromiumSkia.cpp:
(WebCore::RenderThemeChromiumSkia::shouldShowPlaceholderWhenFocused): ditto.
* rendering/RenderThemeChromiumSkia.h: Add shouldShowPlaceholderWhenFocused().

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderThemeChromiumMac.h
Source/WebCore/rendering/RenderThemeChromiumMac.mm
Source/WebCore/rendering/RenderThemeChromiumSkia.cpp
Source/WebCore/rendering/RenderThemeChromiumSkia.h

index b6c7173..19e4fba 100644 (file)
@@ -1,5 +1,22 @@
 2011-12-02  Kent Tamura  <tkent@chromium.org>
 
+        [Chromium] Show placeholder even if the element is focused
+        https://bugs.webkit.org/show_bug.cgi?id=73629
+
+        Reviewed by Hajime Morita.
+
+        No new tests. Need to update some existing placeholder tests.
+
+        * rendering/RenderThemeChromiumMac.h: Add shouldShowPlaceholderWhenFocused().
+        * rendering/RenderThemeChromiumMac.mm:
+        (WebCore::RenderThemeChromiumMac::shouldShowPlaceholderWhenFocused):
+        Returns true.
+        * rendering/RenderThemeChromiumSkia.cpp:
+        (WebCore::RenderThemeChromiumSkia::shouldShowPlaceholderWhenFocused): ditto.
+        * rendering/RenderThemeChromiumSkia.h: Add shouldShowPlaceholderWhenFocused().
+
+2011-12-02  Kent Tamura  <tkent@chromium.org>
+
         [Lion][Windows] Both of placeholder and input text are shown in <input type=number>
         https://bugs.webkit.org/show_bug.cgi?id=73615
 
index 15d885b..87d02c0 100644 (file)
@@ -57,9 +57,11 @@ protected:
 
     virtual int popupInternalPaddingLeft(RenderStyle*) const;
     virtual int popupInternalPaddingRight(RenderStyle*) const;
+
 private:
     virtual void updateActiveState(NSCell*, const RenderObject*);
     virtual String extraDefaultStyleSheet();
+    virtual bool shouldShowPlaceholderWhenFocused() const OVERRIDE;
 };
 
 } // namespace WebCore
index 6024254..11bbafe 100644 (file)
@@ -120,6 +120,11 @@ void RenderThemeChromiumMac::updateActiveState(NSCell* cell, const RenderObject*
         [cell setControlTint:tint];
 }
 
+bool RenderThemeChromiumMac::shouldShowPlaceholderWhenFocused() const
+{
+    return true;
+}
+
 #if ENABLE(VIDEO)
 
 void RenderThemeChromiumMac::adjustMediaSliderThumbSize(RenderStyle* style) const
index 3f3c6ae..030ac35 100644 (file)
@@ -540,6 +540,11 @@ int RenderThemeChromiumSkia::menuListInternalPadding(RenderStyle* style, int pad
     return padding;
 }
 
+bool RenderThemeChromiumSkia::shouldShowPlaceholderWhenFocused() const
+{
+    return true;
+}
+
 #if ENABLE(PROGRESS_TAG)
 
 //
index 0c998b3..d0dd424 100644 (file)
@@ -151,11 +151,13 @@ class RenderThemeChromiumSkia : public RenderTheme {
         IntRect progressValueRectFor(RenderProgress*, const IntRect&) const;
 #endif
 
-    private:
-        int menuListInternalPadding(RenderStyle*, int paddingType) const;
-        bool paintMediaButtonInternal(GraphicsContext*, const IntRect&, Image*);
-        IntRect convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, IntRect partRect, const IntRect& localOffset) const;
-    };
+private:
+    virtual bool shouldShowPlaceholderWhenFocused() const OVERRIDE;
+
+    int menuListInternalPadding(RenderStyle*, int paddingType) const;
+    bool paintMediaButtonInternal(GraphicsContext*, const IntRect&, Image*);
+    IntRect convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, IntRect partRect, const IntRect& localOffset) const;
+};
 
 } // namespace WebCore