Bug 664925 - Don't set NSZeroSize to say that a given control size isn't available. r=mstange
☠☠ backed out by ea1856ff64d1 ☠ ☠
authorMounir Lamouri <mounir.lamouri@gmail.com>
Mon, 20 Jun 2011 19:02:42 +0200
changeset 71403 64b58e1da898dc8f3f91ffe16cb66f10ed5ba669
parent 71402 e8f3a7dd12b8b7af173bd1a0a58cf4a3663671ae
child 71404 ed017393232149ea9ef15aaab8741390445639c8
push idunknown
push userunknown
push dateunknown
reviewersmstange
bugs664925, 665571
milestone7.0a1
Bug 664925 - Don't set NSZeroSize to say that a given control size isn't available. r=mstange Actually, we should patch DrawCellWithSnapping to ignore sizes set to NSZeroSize, see bug 665571.
widget/reftests/664925.xhtml
widget/reftests/reftest.list
widget/src/cocoa/nsNativeThemeCocoa.mm
new file mode 100644
--- /dev/null
+++ b/widget/reftests/664925.xhtml
@@ -0,0 +1,1 @@
+<html xmlns="http://www.w3.org/1999/xhtml"><div><td style="-moz-appearance: progressbar;"></td></div></html>
--- a/widget/reftests/reftest.list
+++ b/widget/reftests/reftest.list
@@ -1,2 +1,3 @@
 skip-if(!cocoaWidget) != 507947.html about:blank
 == progressbar-fallback-default-style.html progressbar-fallback-default-style-ref.html
+load 664925.xhtml
--- a/widget/src/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/src/cocoa/nsNativeThemeCocoa.mm
@@ -1138,17 +1138,20 @@ nsNativeThemeCocoa::DrawFrame(CGContextR
 }
 
 static const CellRenderSettings progressSettings[2][2] = {
   // Vertical progress bar.
   {
     // Determined settings.
     {
       {
-        NSZeroSize, // mini
+        // TODO: for the moment, DrawCellWithSnapping doesn't handle NSZeroSize
+        // values in this array so we have to use negative values until
+        // bug 665571 is fixed.
+        NSMakeSize(-5, -5), // mini
         NSMakeSize(10, 0), // small
         NSMakeSize(16, 0)  // regular
       },
       {
         NSZeroSize, NSZeroSize, NSZeroSize
       },
       {
         { // Leopard
@@ -1156,17 +1159,20 @@ static const CellRenderSettings progress
           {1, 1, 1, 1},     // small
           {1, 1, 1, 1}      // regular
         }
       }
     },
     // There is no horizontal margin in regular undetermined size.
     {
       {
-        NSZeroSize, // mini
+        // TODO: for the moment, DrawCellWithSnapping doesn't handle NSZeroSize
+        // values in this array so we have to use negative values until
+        // bug 665571 is fixed.
+        NSMakeSize(-5, -5), // mini
         NSMakeSize(10, 0), // small
         NSMakeSize(16, 0)  // regular
       },
       {
         NSZeroSize, NSZeroSize, NSZeroSize
       },
       {
         { // Leopard