Bug 1283384 - (1/2) Rename form validation anchor to make it more generic draft
authorScott Wu <scottcwwu@gmail.com>
Thu, 22 Sep 2016 00:35:31 +0800
changeset 416178 76221f426ff5435d06a67fc7530afc6dfecd480c
parent 410073 9a464d26c24a1d2b9707dc8e5ef0d37e183b8722
child 416179 325d9d1183a315017050daa3f9bbf6b829b46a59
push id30053
push userbmo:scwwu@mozilla.com
push dateWed, 21 Sep 2016 16:44:54 +0000
bugs1283384
milestone51.0a1
Bug 1283384 - (1/2) Rename form validation anchor to make it more generic MozReview-Commit-ID: 1cSjXUiBTAC
browser/base/content/browser.css
browser/base/content/tabbrowser.xml
browser/modules/FormValidationHandler.jsm
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -766,17 +766,17 @@ html|*#fullscreen-exit-button {
 .notification-anchor-icon:not([showing]) {
   display: none;
 }
 
 #invalid-form-popup > description {
   max-width: 280px;
 }
 
-.form-validation-anchor {
+.form-anchor {
   /* should occupy space but not be visible */
   opacity: 0;
   visibility: hidden;
   pointer-events: none;
   -moz-stack-sizing: ignore;
 }
 
 #addon-progress-notification {
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -134,29 +134,29 @@
           for (var i = 0; i < this.tabs.length; i++) {
             if (!this.tabs[i].pinned)
               break;
           }
           return i;
         ]]></getter>
       </property>
 
-      <property name="formValidationAnchor" readonly="true">
+      <property name="formAnchor" readonly="true">
         <getter><![CDATA[
-        if (this.mCurrentTab._formValidationAnchor) {
-          return this.mCurrentTab._formValidationAnchor;
+        if (this.mCurrentTab._formAnchor) {
+          return this.mCurrentTab._formAnchor;
         }
         let stack = this.mCurrentBrowser.parentNode;
-        // Create an anchor for the form validation popup
+        // Create an anchor for the form popup
         const NS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-        let formValidationAnchor = document.createElementNS(NS_XUL, "hbox");
-        formValidationAnchor.className = "form-validation-anchor";
-        formValidationAnchor.hidden = true;
-        stack.appendChild(formValidationAnchor);
-        return this.mCurrentTab._formValidationAnchor = formValidationAnchor;
+        let formAnchor = document.createElementNS(NS_XUL, "hbox");
+        formAnchor.className = "form-anchor";
+        formAnchor.hidden = true;
+        stack.appendChild(formAnchor);
+        return this.mCurrentTab._formAnchor = formAnchor;
         ]]></getter>
       </property>
 
       <method name="isFindBarInitialized">
         <parameter name="aTab"/>
         <body><![CDATA[
           return (aTab || this.selectedTab)._findBar != undefined;
         ]]></body>
--- a/browser/modules/FormValidationHandler.jsm
+++ b/browser/modules/FormValidationHandler.jsm
@@ -117,17 +117,17 @@ var FormValidationHandler =
    */
   _showPopup: function (aWindow, aPanelData) {
     let previouslyShown = !!this._panel;
     this._panel = aWindow.document.getElementById("invalid-form-popup");
     this._panel.firstChild.textContent = aPanelData.message;
     this._panel.hidden = false;
 
     let tabBrowser = aWindow.gBrowser;
-    this._anchor = tabBrowser.formValidationAnchor;
+    this._anchor = tabBrowser.formAnchor;
     this._anchor.left = aPanelData.contentRect.left;
     this._anchor.top = aPanelData.contentRect.top;
     this._anchor.width = aPanelData.contentRect.width;
     this._anchor.height = aPanelData.contentRect.height;
     this._anchor.hidden = false;
 
     // Display the panel if it isn't already visible.
     if (!previouslyShown) {