Bug 779076 - Calling gFormSubmitObserver.panelIsOpen() causes layout flushes (Port Bug 752486). r=neil
authorEkanan Ketunuti <ananuti@gmail.com>
Wed, 01 Aug 2012 08:42:03 +0700
changeset 13183 9f49374d967839afba1d460def969ebc0571ba1d
parent 13182 5ab0c167661f058353b3b681cb226980652941e1
child 13184 7d005aa5bd49e3d59ed7640cddfe998110eb37d1
push idunknown
push userunknown
push dateunknown
reviewersneil
bugs779076, 752486
Bug 779076 - Calling gFormSubmitObserver.panelIsOpen() causes layout flushes (Port Bug 752486). r=neil
suite/browser/navigator.js
suite/browser/nsBrowserStatusHandler.js
--- a/suite/browser/navigator.js
+++ b/suite/browser/navigator.js
@@ -110,22 +110,16 @@ const gFormSubmitObserver = {
 
   panel: null,
 
   init: function()
   {
     this.panel = document.getElementById("invalid-form-popup");
   },
 
-  panelIsOpen: function()
-  {
-    return this.panel && this.panel.state != "hiding" &&
-           this.panel.state != "closed";
-  },
-
   notifyInvalidSubmit: function (aFormElement, aInvalidElements)
   {
     // We are going to handle invalid form submission attempt by focusing the
     // first invalid element and show the corresponding validation message in a
     // panel attached to the element.
     if (!aInvalidElements.length) {
       return;
     }
--- a/suite/browser/nsBrowserStatusHandler.js
+++ b/suite/browser/nsBrowserStatusHandler.js
@@ -297,17 +297,17 @@ nsBrowserStatusHandler.prototype =
            document.tooltipNode = null;
            break;
          }
        }
      }
    }
 
     // Hide the form invalid popup.
-    if (gFormSubmitObserver.panelIsOpen()) {
+    if (gFormSubmitObserver.panel) {
       gFormSubmitObserver.panel.hidePopup();
     }
 
     // XXX temporary hack for bug 104532.
     // Depends heavily on setOverLink implementation
     if (!aRequest)
       this.status = this.jsStatus = this.jsDefaultStatus = "";