2011-02-23 Ojan Vafai <ojan@chromium.org>
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Feb 2011 04:21:56 +0000 (04:21 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Feb 2011 04:21:56 +0000 (04:21 +0000)
        Reviewed by Tony Chang.

        autocomplete=off prevents refilling form fields on back/forward navigation
        https://bugs.webkit.org/show_bug.cgi?id=47463

        I haven't actually run this patch due to the difficulty of getting
        a bugzilla instance running. It's simple enough code that I'm not too worried
        about it.

        * committers-autocomplete.js:

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

Websites/bugs.webkit.org/ChangeLog
Websites/bugs.webkit.org/committers-autocomplete.js

index f285d7b..3e526ac 100644 (file)
@@ -1,3 +1,16 @@
+2011-02-23  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by Tony Chang.
+
+        autocomplete=off prevents refilling form fields on back/forward navigation
+        https://bugs.webkit.org/show_bug.cgi?id=47463
+
+        I haven't actually run this patch due to the difficulty of getting
+        a bugzilla instance running. It's simple enough code that I'm not too worried
+        about it.
+
+        * committers-autocomplete.js:
+
 2011-02-21  Ojan Vafai  <ojan@chromium.org>
 
         Reviewed by Adam Barth.
 2011-02-21  Ojan Vafai  <ojan@chromium.org>
 
         Reviewed by Adam Barth.
index ea947a4..8d071aa 100644 (file)
@@ -371,6 +371,7 @@ WebKitCommitters = (function() {
 
         if (!getMenu()) {
             createMenu(m_focusedInput.name);
 
         if (!getMenu()) {
             createMenu(m_focusedInput.name);
+            // Turn off autocomplete to avoid showing the browser's dropdown menu.
             m_focusedInput.setAttribute('autocomplete', 'off');
             m_focusedInput.addEventListener('keyup', handleKeyUp, false);
             m_focusedInput.addEventListener('keydown', handleKeyDown, false);
             m_focusedInput.setAttribute('autocomplete', 'off');
             m_focusedInput.addEventListener('keyup', handleKeyUp, false);
             m_focusedInput.addEventListener('keydown', handleKeyDown, false);
@@ -379,6 +380,10 @@ WebKitCommitters = (function() {
                 m_prefix = null;
                 m_selectedIndex = 0;
             }, false);
                 m_prefix = null;
                 m_selectedIndex = 0;
             }, false);
+            // Turn on autocomplete on submit to avoid breaking autofill on back/forward navigation.
+            m_focusedInput.form.addEventListener("submit", function() {
+                m_focusedInput.setAttribute("autocomplete", "on");
+            }, false);
         }
         
         updateMenu();
         }
         
         updateMenu();