[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

darin at apple.com darin at apple.com
Wed Dec 22 13:50:02 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit cef22f3fbb043adcbb5a85945fa6cc0d12b0333d
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 28 00:40:07 2010 +0000

    2010-09-27  Darin Adler  <darin at apple.com>
    
            Reviewed by Dan Bernstein.
    
            REGRESSION (r68054): Buttons no longer render at correct sizes
            https://bugs.webkit.org/show_bug.cgi?id=46513
    
            Test: fast/forms/input-button-sizes.html
    
            The setUpButtonCell function was running only once, but needed to run every time
            through the button function.
    
            * platform/mac/ThemeMac.mm:
            (WebCore::leakButtonCell): Added. Separate one-time initialization code.
            (WebCore::setUpButtonCell): Removed the first-time initialization part of this function.
            (WebCore::button): Merged the three functions back into one.
    2010-09-27  Darin Adler  <darin at apple.com>
    
            Reviewed by Dan Bernstein.
    
            REGRESSION (r68054): Buttons no longer render at correct sizes
            https://bugs.webkit.org/show_bug.cgi?id=46513
    
            * fast/forms/input-button-sizes.html: Copied from LayoutTests/fast/forms/button-sizes.html.
            Turned into a distinct test of <input type=button>; old test was for <button>.
    
            * platform/mac/fast/forms/input-button-sizes-expected.checksum: Added.
            * platform/mac/fast/forms/input-button-sizes-expected.png: Added.
            * platform/mac/fast/forms/input-button-sizes-expected.txt: Added.
    
            * platform/mac/fast/forms/disabled-select-change-index-expected.checksum: Added.
            * platform/mac/fast/forms/disabled-select-change-index-expected.png: Added.
            * platform/mac/fast/forms/file-input-disabled-expected.checksum: Added.
            * platform/mac/fast/forms/file-input-disabled-expected.png: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68459 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 54019af..679cf86 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,22 @@
+2010-09-27  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        REGRESSION (r68054): Buttons no longer render at correct sizes
+        https://bugs.webkit.org/show_bug.cgi?id=46513
+
+        * fast/forms/input-button-sizes.html: Copied from LayoutTests/fast/forms/button-sizes.html.
+        Turned into a distinct test of <input type=button>; old test was for <button>.
+
+        * platform/mac/fast/forms/input-button-sizes-expected.checksum: Added.
+        * platform/mac/fast/forms/input-button-sizes-expected.png: Added.
+        * platform/mac/fast/forms/input-button-sizes-expected.txt: Added.
+
+        * platform/mac/fast/forms/disabled-select-change-index-expected.checksum: Added.
+        * platform/mac/fast/forms/disabled-select-change-index-expected.png: Added.
+        * platform/mac/fast/forms/file-input-disabled-expected.checksum: Added.
+        * platform/mac/fast/forms/file-input-disabled-expected.png: Added.
+
 2010-09-27  Zhenyao Mo  <zmo at google.com>
 
         Unreviewed, fix a typo.
diff --git a/LayoutTests/fast/forms/input-button-sizes.html b/LayoutTests/fast/forms/input-button-sizes.html
new file mode 100644
index 0000000..8f481b7
--- /dev/null
+++ b/LayoutTests/fast/forms/input-button-sizes.html
@@ -0,0 +1,17 @@
+<input type="button" style="font-size:5px" value="Test Button">
+<input type="button" style="font-size:6px" value="Test Button">
+<input type="button" style="font-size:7px" value="Test Button">
+<input type="button" style="font-size:8px" value="Test Button">
+<input type="button" style="font-size:9px" value="Test Button">
+<input type="button" style="font-size:10px" value="Test Button">
+<input type="button" style="font-size:11px" value="Test Button">
+<input type="button" style="font-size:12px" value="Test Button">
+<input type="button" style="font-size:13px" value="Test Button">
+<input type="button" style="font-size:14px" value="Test Button">
+<input type="button" style="font-size:15px" value="Test Button">
+<input type="button" style="font-size:16px" value="Test Button">
+<input type="button" style="font-size:17px" value="Test Button">
+<input type="button" style="font-size:18px" value="Test Button">
+<input type="button" style="font-size:19px" value="Test Button">
+<input type="button" style="font-size:20px" value="Test Button">
+<input type="button" style="font-size:21px" value="Test Button">
diff --git a/LayoutTests/platform/mac/fast/forms/disabled-select-change-index-expected.checksum b/LayoutTests/platform/mac/fast/forms/disabled-select-change-index-expected.checksum
new file mode 100644
index 0000000..d382442
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/forms/disabled-select-change-index-expected.checksum
@@ -0,0 +1 @@
+a9a046866e2cffc5e9e3e8da3e77f4ac
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/forms/disabled-select-change-index-expected.png b/LayoutTests/platform/mac/fast/forms/disabled-select-change-index-expected.png
new file mode 100644
index 0000000..7923a1a
Binary files /dev/null and b/LayoutTests/platform/mac/fast/forms/disabled-select-change-index-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/forms/file-input-disabled-expected.checksum b/LayoutTests/platform/mac/fast/forms/file-input-disabled-expected.checksum
new file mode 100644
index 0000000..98173be
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/forms/file-input-disabled-expected.checksum
@@ -0,0 +1 @@
+ef1e9a5c29d824bb05632646ad278a4c
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/forms/file-input-disabled-expected.png b/LayoutTests/platform/mac/fast/forms/file-input-disabled-expected.png
new file mode 100644
index 0000000..105c737
Binary files /dev/null and b/LayoutTests/platform/mac/fast/forms/file-input-disabled-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/forms/input-button-sizes-expected.checksum b/LayoutTests/platform/mac/fast/forms/input-button-sizes-expected.checksum
new file mode 100644
index 0000000..5f1bd6e
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/forms/input-button-sizes-expected.checksum
@@ -0,0 +1 @@
+d1df48f3a7e4ab5d742528ea8f22042f
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/forms/input-button-sizes-expected.png b/LayoutTests/platform/mac/fast/forms/input-button-sizes-expected.png
new file mode 100644
index 0000000..8604c8d
Binary files /dev/null and b/LayoutTests/platform/mac/fast/forms/input-button-sizes-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/forms/input-button-sizes-expected.txt b/LayoutTests/platform/mac/fast/forms/input-button-sizes-expected.txt
new file mode 100644
index 0000000..182fa18
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/forms/input-button-sizes-expected.txt
@@ -0,0 +1,106 @@
+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
+      RenderButton {INPUT} at (0,4) size 67x15 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 51x11
+          RenderText at (0,0) size 51x11
+            text run at (0,0) width 51: "Test Button"
+      RenderText {#text} at (67,1) size 4x18
+        text run at (67,1) width 4: " "
+      RenderButton {INPUT} at (71,4) size 67x15 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 51x11
+          RenderText at (0,0) size 51x11
+            text run at (0,0) width 51: "Test Button"
+      RenderText {#text} at (138,1) size 4x18
+        text run at (138,1) width 4: " "
+      RenderButton {INPUT} at (142,4) size 67x15 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 51x11
+          RenderText at (0,0) size 51x11
+            text run at (0,0) width 51: "Test Button"
+      RenderText {#text} at (209,1) size 4x18
+        text run at (209,1) width 4: " "
+      RenderButton {INPUT} at (213,4) size 67x15 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 51x11
+          RenderText at (0,0) size 51x11
+            text run at (0,0) width 51: "Test Button"
+      RenderText {#text} at (280,1) size 4x18
+        text run at (280,1) width 4: " "
+      RenderButton {INPUT} at (284,4) size 67x15 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 51x11
+          RenderText at (0,0) size 51x11
+            text run at (0,0) width 51: "Test Button"
+      RenderText {#text} at (351,1) size 4x18
+        text run at (351,1) width 4: " "
+      RenderButton {INPUT} at (355,4) size 67x15 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 51x11
+          RenderText at (0,0) size 51x11
+            text run at (0,0) width 51: "Test Button"
+      RenderText {#text} at (422,1) size 4x18
+        text run at (422,1) width 4: " "
+      RenderButton {INPUT} at (428,2) size 77x18 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 61x13
+          RenderText at (0,0) size 61x13
+            text run at (0,0) width 61: "Test Button"
+      RenderText {#text} at (507,1) size 4x18
+        text run at (507,1) width 4: " "
+      RenderButton {INPUT} at (513,2) size 77x18 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 61x13
+          RenderText at (0,0) size 61x13
+            text run at (0,0) width 61: "Test Button"
+      RenderText {#text} at (592,1) size 4x18
+        text run at (592,1) width 4: " "
+      RenderButton {INPUT} at (598,2) size 77x18 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 61x13
+          RenderText at (0,0) size 61x13
+            text run at (0,0) width 61: "Test Button"
+      RenderText {#text} at (677,1) size 4x18
+        text run at (677,1) width 4: " "
+      RenderButton {INPUT} at (683,2) size 77x18 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 61x13
+          RenderText at (0,0) size 61x13
+            text run at (0,0) width 61: "Test Button"
+      RenderText {#text} at (762,1) size 4x18
+        text run at (762,1) width 4: " "
+      RenderButton {INPUT} at (2,26) size 77x18 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 61x13
+          RenderText at (0,0) size 61x13
+            text run at (0,0) width 61: "Test Button"
+      RenderText {#text} at (81,25) size 4x18
+        text run at (81,25) width 4: " "
+      RenderButton {INPUT} at (87,24) size 89x21 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 73x16
+          RenderText at (0,0) size 73x16
+            text run at (0,0) width 73: "Test Button"
+      RenderText {#text} at (178,25) size 4x18
+        text run at (178,25) width 4: " "
+      RenderButton {INPUT} at (184,24) size 89x21 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 73x16
+          RenderText at (0,0) size 73x16
+            text run at (0,0) width 73: "Test Button"
+      RenderText {#text} at (275,25) size 4x18
+        text run at (275,25) width 4: " "
+      RenderButton {INPUT} at (281,24) size 89x21 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 73x16
+          RenderText at (0,0) size 73x16
+            text run at (0,0) width 73: "Test Button"
+      RenderText {#text} at (372,25) size 4x18
+        text run at (372,25) width 4: " "
+      RenderButton {INPUT} at (378,24) size 89x21 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 73x16
+          RenderText at (0,0) size 73x16
+            text run at (0,0) width 73: "Test Button"
+      RenderText {#text} at (469,25) size 4x18
+        text run at (469,25) width 4: " "
+      RenderButton {INPUT} at (475,24) size 89x21 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 73x16
+          RenderText at (0,0) size 73x16
+            text run at (0,0) width 73: "Test Button"
+      RenderText {#text} at (566,25) size 4x18
+        text run at (566,25) width 4: " "
+      RenderButton {INPUT} at (572,24) size 89x21 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 73x16
+          RenderText at (0,0) size 73x16
+            text run at (0,0) width 73: "Test Button"
+      RenderText {#text} at (0,0) size 0x0
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b9d811f..644b86d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-09-27  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        REGRESSION (r68054): Buttons no longer render at correct sizes
+        https://bugs.webkit.org/show_bug.cgi?id=46513
+
+        Test: fast/forms/input-button-sizes.html
+
+        The setUpButtonCell function was running only once, but needed to run every time
+        through the button function.
+
+        * platform/mac/ThemeMac.mm:
+        (WebCore::leakButtonCell): Added. Separate one-time initialization code.
+        (WebCore::setUpButtonCell): Removed the first-time initialization part of this function.
+        (WebCore::button): Merged the three functions back into one.
+
 2010-09-27  Victoria Kirst  <vrk at google.com>
 
         Reviewed by James Robinson.
diff --git a/WebCore/platform/mac/ThemeMac.mm b/WebCore/platform/mac/ThemeMac.mm
index 61f2481..75cbd36 100644
--- a/WebCore/platform/mac/ThemeMac.mm
+++ b/WebCore/platform/mac/ThemeMac.mm
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -375,54 +375,53 @@ static const int* buttonMargins(NSControlSize controlSize)
     return margins[controlSize];
 }
 
-static NSButtonCell *setUpButtonCell(NSButtonCell *buttonCell, ControlPart part, ControlStates states, const IntRect& zoomedRect, float zoomFactor)
+enum ButtonCellType { NormalButtonCell, DefaultButtonCell };
+
+static NSButtonCell *leakButtonCell(ButtonCellType type)
 {
-    if (!buttonCell) {
-        buttonCell = [[NSButtonCell alloc] init];
-        [buttonCell setTitle:nil];
-        [buttonCell setButtonType:NSMomentaryPushInButton];
-        if (states & DefaultState)
-            [buttonCell setKeyEquivalent:@"\r"];
-    }
+    NSButtonCell *cell = [[NSButtonCell alloc] init];
+    [cell setTitle:nil];
+    [cell setButtonType:NSMomentaryPushInButton];
+    if (type == DefaultButtonCell)
+        [cell setKeyEquivalent:@"\r"];
+    return cell;
+}
 
+static void setUpButtonCell(NSButtonCell *cell, ControlPart part, ControlStates states, const IntRect& zoomedRect, float zoomFactor)
+{
     // Set the control size based off the rectangle we're painting into.
     const IntSize* sizes = buttonSizes();
 #if ENABLE(DATALIST)
     if (part == ListButtonPart) {
-        [buttonCell setBezelStyle:NSRoundedDisclosureBezelStyle];
+        [cell setBezelStyle:NSRoundedDisclosureBezelStyle];
         sizes = listButtonSizes();
     } else
 #endif
     if (part == SquareButtonPart || zoomedRect.height() > buttonSizes()[NSRegularControlSize].height() * zoomFactor) {
         // Use the square button
-        if ([buttonCell bezelStyle] != NSShadowlessSquareBezelStyle)
-            [buttonCell setBezelStyle:NSShadowlessSquareBezelStyle];
-    } else if ([buttonCell bezelStyle] != NSRoundedBezelStyle)
-        [buttonCell setBezelStyle:NSRoundedBezelStyle];
+        if ([cell bezelStyle] != NSShadowlessSquareBezelStyle)
+            [cell setBezelStyle:NSShadowlessSquareBezelStyle];
+    } else if ([cell bezelStyle] != NSRoundedBezelStyle)
+        [cell setBezelStyle:NSRoundedBezelStyle];
 
-    setControlSize(buttonCell, sizes, zoomedRect.size(), zoomFactor);
+    setControlSize(cell, sizes, zoomedRect.size(), zoomFactor);
 
     // Update the various states we respond to.
-    updateStates(buttonCell, states);
-
-    return buttonCell;
-}
-    
-static NSButtonCell *nonDefaultButton(ControlPart part, ControlStates states, const IntRect& zoomedRect, float zoomFactor)
-{
-    static NSButtonCell *cell = setUpButtonCell(cell, part, states, zoomedRect, zoomFactor);    
-    return cell;
-}
-
-static NSButtonCell *defaultButton(ControlPart part, ControlStates states, const IntRect& zoomedRect, float zoomFactor)
-{
-    static NSButtonCell *cell = setUpButtonCell(cell, part, states, zoomedRect, zoomFactor);    
-    return cell;
+    updateStates(cell, states);
 }
 
 static NSButtonCell *button(ControlPart part, ControlStates states, const IntRect& zoomedRect, float zoomFactor)
 {
-    return ((states & DefaultState) ? nonDefaultButton : defaultButton)(part, states, zoomedRect, zoomFactor);
+    NSButtonCell *cell;
+    if (states & DefaultState) {
+        static NSButtonCell *defaultCell = leakButtonCell(DefaultButtonCell);
+        cell = defaultCell;
+    } else {
+        static NSButtonCell *normalCell = leakButtonCell(NormalButtonCell);
+        cell = normalCell;
+    }
+    setUpButtonCell(cell, part, states, zoomedRect, zoomFactor);    
+    return cell;
 }
 
 static void paintButton(ControlPart part, ControlStates states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list