### Eclipse Workspace Patch 1.0
#P cap
Index: sites/all/modules/compact_forms/compact_forms.js
===================================================================
--- sites/all/modules/compact_forms/compact_forms.js	(revision 6476)
+++ sites/all/modules/compact_forms/compact_forms.js	(working copy)
@@ -2,6 +2,8 @@
 
 (function ($) {
 
+Drupal.compactForms = {};
+
 /**
  * Compact Forms jQuery plugin.
  */
@@ -16,9 +18,14 @@
       if ($field.attr('type') != 'text' && $field.attr('type') != 'password') {
         return;
       }
+      var $default_value = $field.val();
+      if ($default_value != '') {
+          $label.hide();
+      }      
 
       if ($field.val() != '') {
-        $label.fadeOut(1);
+        // Firefox doesn't like .hide() here for some reason.
+        $label.css('display', 'none');
       }
 
       $label.parent().addClass('compact-form-wrapper');
@@ -34,32 +41,71 @@
 
       if (colons === 0) {
         var lbl = $label.html();
-        lbl = lbl.replace(/:/,' ');
+        lbl = lbl.replace(/:/, ' ');
         $label.html(lbl);
       }
 
       $field.focus(function () {
-        if($(this).val() === '') {
-          $label.fadeOut('fast');
+    	if($field.val() === $default_value || $field	.val() === '') {
+          $label.css('display', 'none');
         }
       });
 
       $field.blur(function () {
-        if($(this).val() === '') {
-          $label.fadeIn('slow');
+    	if ($field.val() === '') {
+    	  if ($.browser.msie) {
+            $label.css('display', '');
+          }
+          else {
+            $label.fadeIn('fast');
+		  }
         }
       });
+      
+	  // Chrome adds passwords after page load, so we need to track changes.
+	  $field.change(function () {
+	    if ($field != document.activeElement) {
+	      if ($field.val() === '') {
+	        $label.fadeIn('fast');
+	      }
+	      else {
+	        $label.css('display', 'none');
+	      }
+	    }
+	  });
+  
     });
   });
 };
 
+/**
+ * Attach compact forms behavior to all enabled forms upon page load.
+ */
 Drupal.behaviors.compactForms = function (context) {
   if (!Drupal.settings || !Drupal.settings.compactForms) {
     return;
   }
-  $.each(Drupal.settings.compactForms.forms, function () {
-    $('#' + this, context).compactForm(Drupal.settings.compactForms.stars, Drupal.settings.compactForms.colons);
-  });
+  $('#' + Drupal.settings.compactForms.forms.join(',#'), context).compactForm(Drupal.settings.compactForms.stars, Drupal.settings.compactForms.colons);
+  // Safari adds passwords without triggering any event after page load.
+  // We therefore need to wait a bit and then check for field values.
+  if ($.browser.safari) {
+    setTimeout(Drupal.compactForms.fixSafari, 200);
+  }
 };
 
-})(jQuery);
+/**
+ * Checks for field values and hides the corresponding label if non-empty.
+ *
+ * @todo Convert $.fn.compactForm to always use a function like this.
+ */
+Drupal.compactForms.fixSafari = function () {
+  $('label.compact-form-label').each(function () {
+    var $label = $(this);
+    var context = this.form;
+    if ($('#' + $label.attr('for'), context).val() != '') {
+      $label.css('display', 'none');
+    }
+  });
+}
+
+})(jQuery);
\ No newline at end of file
