Bug 532686 - formfill: unable to use the file picker from imageshack.us [r=mark.finkle]
authorVivien Nicolas <21@vingtetun.org>
Wed, 09 Dec 2009 03:15:39 -0500
changeset 65897 ca9809d6d5f2e8b8fe884469827d37343ac0f1da
parent 65896 44b44310d65886a30bd404176ced6f430420cbde
child 65898 e4f92c53ef4b026a8da45f0ab4907990bc3acde9
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmark
bugs532686
Bug 532686 - formfill: unable to use the file picker from imageshack.us [r=mark.finkle]
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -1122,20 +1122,20 @@ var FormHelper = {
 
     if (aElement.getAttribute("role") == "button" && aElement.hasAttribute("tabindex"))
       return this._isElementVisible(aElement);
 
     if (this._isValidSelectElement(aElement) || aElement instanceof HTMLTextAreaElement)
       return this._isElementVisible(aElement);
     
     if (aElement instanceof HTMLInputElement) {
-      let ignoreInputElements = ["checkbox", "radio", "hidden", "reset", "button", "image"];
+      let ignoreInputElements = ["checkbox", "radio", "hidden", "reset", "button"];
       let isValidElement = (ignoreInputElements.indexOf(aElement.type) == -1);
       if (!isValidElement)
-       return false;
+        return false;
  
       return this._isElementVisible(aElement);
     }
 
     return false;
   },
 
   _isValidSelectElement: function(aElement) {
@@ -1313,18 +1313,24 @@ var FormHelper = {
 
     let elRect = this._getRectForElement(aElement);
     let zoomRect = Browser._getZoomRectForPoint(elRect.center().x, elRect.y, zoomLevel);
 
     Browser.setVisibleRect(zoomRect);
   },
 
   canShowUIFor: function(aElement) {
-    return (this._isValidElement(aElement) && 
-            !(aElement instanceof HTMLInputElement && aElement.type == "submit"));
+    // Some forms elements are valid in the sense that we want the Form
+    // Assistant to stop on it, but we don't want it to display when
+    // the user clicks on it
+    let formExceptions = ["submit", "image", "file"];
+    if (aElement instanceof HTMLInputElement && formExceptions.indexOf(aElement.type) != -1)
+      return false;    
+
+    return this._isValidElement(aElement);
   }
 };
 
 function SelectWrapper(aControl) {
   this._control = aControl.wrappedJSObject || aControl;
 }
 
 SelectWrapper.prototype = {