Bug 1209766 - Update validation message before showing notification. r=khuey
authorStone Shih <sshih@mozilla.com>
Wed, 09 Mar 2016 12:34:08 +0800
changeset 288555 bbaa07377c478859182fdc9aef2f29f515084adb
parent 288554 74282731c3d1dfcdbe182b7ba0919f408df2bf33
child 288556 5863b88e10ccca0eef175a14b160fa30fd851d2a
push id73452
push userryanvm@gmail.com
push dateMon, 14 Mar 2016 15:53:03 +0000
treeherdermozilla-inbound@bbaa07377c47 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1209766
milestone48.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 1209766 - Update validation message before showing notification. r=khuey
browser/modules/FormSubmitObserver.jsm
--- a/browser/modules/FormSubmitObserver.jsm
+++ b/browser/modules/FormSubmitObserver.jsm
@@ -113,27 +113,28 @@ FormSubmitObserver.prototype =
     let element = aInvalidElements.queryElementAt(0, Ci.nsISupports);
     if (!(element instanceof HTMLInputElement ||
           element instanceof HTMLTextAreaElement ||
           element instanceof HTMLSelectElement ||
           element instanceof HTMLButtonElement)) {
       return;
     }
 
+    // Update validation message before showing notification
+    this._validationMessage = element.validationMessage;
+
     // Don't connect up to the same element more than once.
     if (this._element == element) {
       this._showPopup(element);
       return;
     }
     this._element = element;
 
     element.focus();
 
-    this._validationMessage = element.validationMessage;
-
     // Watch for input changes which may change the validation message.
     element.addEventListener("input", this, false);
 
     // Watch for focus changes so we can disconnect our listeners and
     // hide the popup.
     element.addEventListener("blur", this, false);
 
     this._showPopup(element);