Bug 741831 - Readonly text inputs can trigger form autocomplete popups. r+a=mfinkle
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Sun, 22 Apr 2012 09:58:29 -0700
changeset 92098 6c8fe1624a6bd82758e6e38344ddedd35bd9d376
parent 92097 1f4f4d6466b67ef525444e82ea2ca596cee98c12
child 92099 e2af0b79da44efb6b6256109944974889e83d3f0
push id8549
push usermleibovic@mozilla.com
push dateSun, 22 Apr 2012 16:58:42 +0000
treeherdermozilla-inbound@6c8fe1624a6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs741831
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 741831 - Readonly text inputs can trigger form autocomplete popups. r+a=mfinkle
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3063,17 +3063,17 @@ var FormAssistant = {
         let selectedDocument = BrowserApp.selectedBrowser.contentDocument;
         if (target == selectedDocument || target.ownerDocument == selectedDocument)
           this._invalidSubmit = false;
     }
   },
 
   // We only want to show autocomplete suggestions for certain elements
   _isAutoComplete: function _isAutoComplete(aElement) {
-    if (!(aElement instanceof HTMLInputElement) ||
+    if (!(aElement instanceof HTMLInputElement) || aElement.readOnly ||
         (aElement.getAttribute("type") == "password") ||
         (aElement.hasAttribute("autocomplete") &&
          aElement.getAttribute("autocomplete").toLowerCase() == "off"))
       return false;
 
     return true;
   },