2008-11-10 David Hyatt <hyatt@apple.com>
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Nov 2008 19:18:26 +0000 (19:18 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Nov 2008 19:18:26 +0000 (19:18 +0000)
        Disable the Aqua look for menu lists when full page zoom is turned on.  Because the control is buggy
        when scaling and because it's impossible to paint into an offscreen bitmap without completely rewriting
        how we draw the control on Mac, our only real option for now is to just switch to our styled look when zoomed.

        Reviewed by Adam Roben

        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::isControlStyled):

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

LayoutTests/platform/mac/transforms/2d/zoom-menulist-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/transforms/2d/zoom-menulist-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/transforms/2d/zoom-menulist-expected.txt [new file with mode: 0644]
LayoutTests/transforms/2d/zoom-menulist.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderThemeMac.mm

diff --git a/LayoutTests/platform/mac/transforms/2d/zoom-menulist-expected.checksum b/LayoutTests/platform/mac/transforms/2d/zoom-menulist-expected.checksum
new file mode 100644 (file)
index 0000000..1a01a08
--- /dev/null
@@ -0,0 +1 @@
+3119a24a6ec1b632c617f7decb4a10c4
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/transforms/2d/zoom-menulist-expected.png b/LayoutTests/platform/mac/transforms/2d/zoom-menulist-expected.png
new file mode 100644 (file)
index 0000000..a2988f0
Binary files /dev/null and b/LayoutTests/platform/mac/transforms/2d/zoom-menulist-expected.png differ
diff --git a/LayoutTests/platform/mac/transforms/2d/zoom-menulist-expected.txt b/LayoutTests/platform/mac/transforms/2d/zoom-menulist-expected.txt
new file mode 100644 (file)
index 0000000..0670ded
--- /dev/null
@@ -0,0 +1,14 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {H1} at (0,0) size 784x37
+        RenderText {#text} at (0,0) size 272x37
+          text run at (0,0) width 272: "Zooming Menu List"
+      RenderBlock (anonymous) at (0,58) size 784x66
+        RenderMenuList {SELECT} at (6,6) size 185x54 [bgcolor=#FFFFFF] [border: (3px solid #000000)]
+          RenderBlock (anonymous) at (3,3) size 179x48
+            RenderText at (24,3) size 65x39
+              text run at (24,3) width 65: "One"
+        RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/transforms/2d/zoom-menulist.html b/LayoutTests/transforms/2d/zoom-menulist.html
new file mode 100644 (file)
index 0000000..a2ca619
--- /dev/null
@@ -0,0 +1,5 @@
+<html>
+<body>
+<h1>Zooming Menu List</h1>
+
+<select style="zoom:3"><option>One<option>Two<option>Three<Option>Four</select>
index 5ff57a6..10dad47 100644 (file)
@@ -1,3 +1,14 @@
+2008-11-10  David Hyatt  <hyatt@apple.com>
+
+        Disable the Aqua look for menu lists when full page zoom is turned on.  Because the control is buggy
+        when scaling and because it's impossible to paint into an offscreen bitmap without completely rewriting
+        how we draw the control on Mac, our only real option for now is to just switch to our styled look when zoomed.
+
+        Reviewed by Adam Roben
+
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::isControlStyled):
+
 2008-11-11  Darin Adler  <darin@apple.com>
 
         Reviewed by Dan Bernstein.
index 699b74a..f04ef1b 100644 (file)
@@ -416,6 +416,14 @@ bool RenderThemeMac::isControlStyled(const RenderStyle* style, const BorderData&
 {
     if (style->appearance() == TextFieldPart || style->appearance() == TextAreaPart || style->appearance() == ListboxPart)
         return style->border() != border;
+        
+    // FIXME: This is horrible, but there is not much else that can be done.  Menu lists cannot draw properly when
+    // scaled.  They can't really draw properly when transformed either.  We can't detect the transform case at style
+    // adjustment time so that will just have to stay broken.  We can however detect that we're zooming.  If zooming
+    // is in effect we treat it like the control is styled.
+    if (style->appearance() == MenulistPart && style->effectiveZoom() != 1.0f)
+        return true;
+
     return RenderTheme::isControlStyled(style, border, background, backgroundColor);
 }