Title: [119987] trunk/Source/WebCore
Revision
119987
Author
[email protected]
Date
2012-06-11 11:13:57 -0700 (Mon, 11 Jun 2012)

Log Message

[Chromium] Theme updates for Android in menu list rendering and selection backgrounds
https://bugs.webkit.org/show_bug.cgi?id=88775

Reviewed by Adam Barth.

For Chrome on Android, use the width of the scrollbar down arrow instead
of the scrollbar's width for determining the arrow padding to apply for
menu list rendering, as WebKit isn't drawing a scrollbar (thus width=0).

Furthermore, change the default active selection background color to be
equal to the tap highlighting color.

These changes should be covered by existing layout tests.

* rendering/RenderThemeChromiumAndroid.cpp:
(WebCore::RenderThemeChromiumAndroid::menuListArrowPadding):
(WebCore): Retrieve the scrollbar down arrow's size via PlatformSupport.
* rendering/RenderThemeChromiumAndroid.h: Override the menuListArrowPadding
    and platformActiveSelectionBackgroundColor methods, and add a static
    static RGBA32 color for the default active selection bg color.
* rendering/RenderThemeChromiumSkia.cpp:
(WebCore::RenderThemeChromiumSkia::menuListArrowPadding): Default to
    the scrollbar thickness, not changing behavior for non-Android.
(WebCore::RenderThemeChromiumSkia::menuListInternalPadding): Instead
    of polling the scrollbar thickness, call menuListArrowPadding().
* rendering/RenderThemeChromiumSkia.h:
(RenderThemeChromiumSkia): Add the menuListArrowPadding() as a protected method.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (119986 => 119987)


--- trunk/Source/WebCore/ChangeLog	2012-06-11 17:39:41 UTC (rev 119986)
+++ trunk/Source/WebCore/ChangeLog	2012-06-11 18:13:57 UTC (rev 119987)
@@ -1,3 +1,33 @@
+2012-06-11  Peter Beverloo  <[email protected]>
+
+        [Chromium] Theme updates for Android in menu list rendering and selection backgrounds
+        https://bugs.webkit.org/show_bug.cgi?id=88775
+
+        Reviewed by Adam Barth.
+
+        For Chrome on Android, use the width of the scrollbar down arrow instead
+        of the scrollbar's width for determining the arrow padding to apply for
+        menu list rendering, as WebKit isn't drawing a scrollbar (thus width=0).
+
+        Furthermore, change the default active selection background color to be
+        equal to the tap highlighting color.
+
+        These changes should be covered by existing layout tests.
+
+        * rendering/RenderThemeChromiumAndroid.cpp:
+        (WebCore::RenderThemeChromiumAndroid::menuListArrowPadding):
+        (WebCore): Retrieve the scrollbar down arrow's size via PlatformSupport.
+        * rendering/RenderThemeChromiumAndroid.h: Override the menuListArrowPadding
+            and platformActiveSelectionBackgroundColor methods, and add a static
+            static RGBA32 color for the default active selection bg color.
+        * rendering/RenderThemeChromiumSkia.cpp:
+        (WebCore::RenderThemeChromiumSkia::menuListArrowPadding): Default to
+            the scrollbar thickness, not changing behavior for non-Android.
+        (WebCore::RenderThemeChromiumSkia::menuListInternalPadding): Instead
+            of polling the scrollbar thickness, call menuListArrowPadding().
+        * rendering/RenderThemeChromiumSkia.h: 
+        (RenderThemeChromiumSkia): Add the menuListArrowPadding() as a protected method.
+
 2012-06-11  David Barr  <[email protected]>
 
         Add css3-images image-resolution (dppx only)

Modified: trunk/Source/WebCore/rendering/RenderThemeChromiumAndroid.cpp (119986 => 119987)


--- trunk/Source/WebCore/rendering/RenderThemeChromiumAndroid.cpp	2012-06-11 17:39:41 UTC (rev 119986)
+++ trunk/Source/WebCore/rendering/RenderThemeChromiumAndroid.cpp	2012-06-11 18:13:57 UTC (rev 119987)
@@ -99,4 +99,12 @@
 #endif
 }
 
+int RenderThemeChromiumAndroid::menuListArrowPadding() const
+{
+    // We cannot use the scrollbar thickness here, as it's width is 0 on Android.
+    // Instead, use the width of the scrollbar down arrow.
+    IntSize scrollbarSize = PlatformSupport::getThemePartSize(PlatformSupport::PartScrollbarDownArrow);
+    return scrollbarSize.width();
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/rendering/RenderThemeChromiumAndroid.h (119986 => 119987)


--- trunk/Source/WebCore/rendering/RenderThemeChromiumAndroid.h	2012-06-11 17:39:41 UTC (rev 119986)
+++ trunk/Source/WebCore/rendering/RenderThemeChromiumAndroid.h	2012-06-11 18:13:57 UTC (rev 119987)
@@ -41,7 +41,7 @@
 
     virtual bool delegatesMenuListRendering() const OVERRIDE { return true; }
 
-    virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE;
 
 #if ENABLE(VIDEO)
     virtual String extraMediaControlsStyleSheet() OVERRIDE;
@@ -54,10 +54,19 @@
     }
 #endif
 
+    virtual Color platformActiveSelectionBackgroundColor() const OVERRIDE
+    {
+        return RenderThemeChromiumAndroid::defaultActiveSelectionBackgroundColor;
+    }
+
+protected:
+    virtual int menuListArrowPadding() const OVERRIDE;
+
 private:
     virtual ~RenderThemeChromiumAndroid();
 
     static const RGBA32 defaultTapHighlightColor = 0x6633b5e5;
+    static const RGBA32 defaultActiveSelectionBackgroundColor = 0x6633b5e5;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.cpp (119986 => 119987)


--- trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.cpp	2012-06-11 17:39:41 UTC (rev 119986)
+++ trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.cpp	2012-06-11 18:13:57 UTC (rev 119987)
@@ -519,6 +519,11 @@
     return RenderTheme::caretBlinkInterval();
 }
 
+int RenderThemeChromiumSkia::menuListArrowPadding() const
+{
+    return ScrollbarTheme::theme()->scrollbarThickness();
+}
+
 // static
 void RenderThemeChromiumSkia::setSizeIfAuto(RenderStyle* style, const IntSize& size)
 {
@@ -541,7 +546,7 @@
     // we don't draw a button, so don't reserve space for it.
     const int barType = style->direction() == LTR ? RightPadding : LeftPadding;
     if (paddingType == barType && style->appearance() != NoControlPart)
-        padding += ScrollbarTheme::theme()->scrollbarThickness();
+        padding += menuListArrowPadding();
 
     return padding;
 }

Modified: trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.h (119986 => 119987)


--- trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.h	2012-06-11 17:39:41 UTC (rev 119986)
+++ trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.h	2012-06-11 18:13:57 UTC (rev 119987)
@@ -146,6 +146,8 @@
 
         virtual double caretBlinkIntervalInternal() const;
 
+        virtual int menuListArrowPadding() const;
+
         static void setSizeIfAuto(RenderStyle*, const IntSize&);
 
 #if ENABLE(PROGRESS_TAG)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to