Index: compact_forms.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/compact_forms/compact_forms.js,v
retrieving revision 1.6.2.3
diff -u -p -r1.6.2.3 compact_forms.js
--- compact_forms.js	9 Jan 2011 05:39:55 -0000	1.6.2.3
+++ compact_forms.js	9 Jan 2011 05:48:49 -0000
@@ -22,8 +22,11 @@ $.fn.compactForm = function (stars, colo
       if (!$field.length || !$field.is('input:text,input:password,textarea')) {
         return;
       }
+      // Store the initial field value, in case the browser is going to
+      // automatically fill it in upon focus.
+      var initial_value = $field.val();
 
-      if ($field.val() != '') {
+      if (initial_value != '') {
         // Firefox doesn't like .hide() here for some reason.
         $label.css('display', 'none');
       }
@@ -46,7 +49,13 @@ $.fn.compactForm = function (stars, colo
       }
 
       $field.focus(function () {
-        if ($field.val() === '') {
+        // Some browsers (e.g., Firefox) are automatically inserting a stored
+        // username and password into login forms. In case the password field is
+        // manually emptied afterwards, and the user jumps back to the username
+        // field (without changing it), and forth to the password field, then
+        // the browser automatically re-inserts the password again. Therefore,
+        // we also need to test against the initial field value.
+        if ($field.val() === initial_value || $field.val() === '') {
           $label.fadeOut('fast');
         }
       });
