Bug 869050 - Update anonid and classname for tristate-menulist. r=unfocused
authorHenrik Skupin <hskupin@mozilla.com>
Tue, 07 May 2013 09:35:23 +0200
changeset 142051 74212adbe30644e11f828b32c97f23abd34e363a
parent 142050 920cea554b7fbf848819e814869e20fb9cf24a19
child 142052 3b562fd6d65310a83ed7acd6835e29e2defeb69d
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersunfocused
bugs869050
milestone23.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 869050 - Update anonid and classname for tristate-menulist. r=unfocused
toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/content/extensions.xml
toolkit/mozapps/extensions/content/extensions.xul
toolkit/mozapps/extensions/test/browser/browser_CTP_plugins.js
--- a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
+++ b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
@@ -91,17 +91,17 @@
 <!ENTITY cmd.disableTheme.label               "Stop Wearing Theme">
 <!ENTITY cmd.disableTheme.accesskey           "W">
 <!ENTITY cmd.askToActivate.label              "Ask to Activate">
 <!ENTITY cmd.askToActivate.tooltip            "Ask to use this add-on each time">
 <!ENTITY cmd.alwaysActivate.label             "Always Activate">
 <!ENTITY cmd.alwaysActivate.tooltip           "Always use this add-on">
 <!ENTITY cmd.neverActivate.label              "Never Activate">
 <!ENTITY cmd.neverActivate.tooltip            "Never use this add-on">
-<!ENTITY cmd.tristateMenu.tooltip             "Change when this add-on runs">
+<!ENTITY cmd.stateMenu.tooltip                "Change when this add-on runs">
 <!ENTITY cmd.installAddon.label               "Install">
 <!ENTITY cmd.installAddon.accesskey           "I">
 <!ENTITY cmd.uninstallAddon.label             "Remove">
 <!ENTITY cmd.uninstallAddon.accesskey         "R">
 <!ENTITY cmd.showPreferencesWin.label         "Options">
 <!ENTITY cmd.showPreferencesWin.tooltip       "Change this add-on's options">
 <!ENTITY cmd.showPreferencesUnix.label        "Preferences">
 <!ENTITY cmd.showPreferencesUnix.tooltip      "Change this add-on's preferences">
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -2892,17 +2892,17 @@ var gDetailView = {
         errorLink.value = gStrings.ext.GetStringFromName("details.notification.vulnerableNoUpdate.link");
         errorLink.href = this._addon.blocklistURL;
         errorLink.hidden = false;
       } else {
         this.node.removeAttribute("notification");
       }
     }
 
-    let menulist = document.getElementById("detail-tristate-menulist");
+    let menulist = document.getElementById("detail-state-menulist");
     let addonType = AddonManager.addonTypes[this._addon.type];
     if (addonType.flags & AddonManager.TYPE_SUPPORTS_ASK_TO_ACTIVATE &&
         (hasPermission(this._addon, "ask_to_activate") ||
          hasPermission(this._addon, "enable") ||
          hasPermission(this._addon, "disable"))) {
       let askItem = document.getElementById("detail-ask-to-activate-menuitem");
       let alwaysItem = document.getElementById("detail-always-activate-menuitem");
       let neverItem = document.getElementById("detail-never-activate-menuitem");
--- a/toolkit/mozapps/extensions/content/extensions.xml
+++ b/toolkit/mozapps/extensions/content/extensions.xml
@@ -871,19 +871,19 @@
                             label="&cmd.enableAddon.label;"
                             oncommand="document.getBindingParent(this).userDisabled = false;"/>
                 <xul:button anonid="disable-btn" class="addon-control disable"
                             label="&cmd.disableAddon.label;"
                             oncommand="document.getBindingParent(this).userDisabled = true;"/>
                 <xul:button anonid="remove-btn" class="addon-control remove"
                             label="&cmd.uninstallAddon.label;"
                             oncommand="document.getBindingParent(this).uninstall();"/>
-                <xul:menulist anonid="tristate-menulist"
-                              class="addon-control"
-                              tooltiptext="&cmd.tristateMenu.tooltip;">
+                <xul:menulist anonid="state-menulist"
+                              class="addon-control state"
+                              tooltiptext="&cmd.stateMenu.tooltip;">
                   <xul:menupopup>
                     <xul:menuitem anonid="ask-to-activate-menuitem"
                                   class="addon-control"
                                   label="&cmd.askToActivate.label;"
                                   tooltiptext="&cmd.askToActivate.tooltip;"
                                   oncommand="document.getBindingParent(this).userDisabled = AddonManager.STATE_ASK_TO_ACTIVATE;"/>
                     <xul:menuitem anonid="always-activate-menuitem"
                                   class="addon-control"
@@ -974,19 +974,19 @@
       <field name="_dateUpdated">
         document.getAnonymousElementByAttribute(this, "anonid",
                                                 "date-updated");
       </field>
       <field name="_description">
         document.getAnonymousElementByAttribute(this, "anonid",
                                                 "description");
       </field>
-      <field name="_tristateMenulist">
+      <field name="_stateMenulist">
         document.getAnonymousElementByAttribute(this, "anonid",
-                                                "tristate-menulist");
+                                                "state-menulist");
       </field>
       <field name="_askToActivateMenuitem">
         document.getAnonymousElementByAttribute(this, "anonid",
                                                 "ask-to-activate-menuitem");
       </field>
       <field name="_alwaysActivateMenuitem">
         document.getAnonymousElementByAttribute(this, "anonid",
                                                 "always-activate-menuitem");
@@ -1283,26 +1283,26 @@
                this.hasPermission("enable") ||
                this.hasPermission("disable"))) {
             this._enableBtn.disabled = true;
             this._disableBtn.disabled = true;
             this._askToActivateMenuitem.disabled = !this.hasPermission("ask_to_activate");
             this._alwaysActivateMenuitem.disabled = !this.hasPermission("enable");
             this._neverActivateMenuitem.disabled = !this.hasPermission("disable");
             if (this.mAddon.userDisabled === true) {
-              this._tristateMenulist.selectedItem = this._neverActivateMenuitem;
+              this._stateMenulist.selectedItem = this._neverActivateMenuitem;
             } else if (this.mAddon.userDisabled == AddonManager.STATE_ASK_TO_ACTIVATE) {
-              this._tristateMenulist.selectedItem = this._askToActivateMenuitem;
+              this._stateMenulist.selectedItem = this._askToActivateMenuitem;
             } else {
-              this._tristateMenulist.selectedItem = this._alwaysActivateMenuitem;
+              this._stateMenulist.selectedItem = this._alwaysActivateMenuitem;
             }
-            this._tristateMenulist.selectedItem.disabled = false;
-            this._tristateMenulist.disabled = false;
+            this._stateMenulist.selectedItem.disabled = false;
+            this._stateMenulist.disabled = false;
           } else {
-            this._tristateMenulist.disabled = true;
+            this._stateMenulist.disabled = true;
             if (this.hasPermission("enable")) {
               this._enableBtn.hidden = false;
               let tooltip = gViewController.commands["cmd_enableItem"]
                                            .getTooltip(this.mAddon);
               this._enableBtn.setAttribute("tooltiptext", tooltip);
             } else {
               this._enableBtn.hidden = true;
             }
--- a/toolkit/mozapps/extensions/content/extensions.xul
+++ b/toolkit/mozapps/extensions/content/extensions.xul
@@ -617,19 +617,19 @@
                             accesskey="&cmd.uninstallAddon.accesskey;"
                             command="cmd_uninstallItem"/>
                     <button id="detail-purchase-btn" class="addon-control purchase"
                             command="cmd_purchaseItem"/>
                     <button id="detail-install-btn" class="addon-control install"
                             label="&cmd.installAddon.label;"
                             accesskey="&cmd.installAddon.accesskey;"
                             command="cmd_installItem"/>
-                    <menulist id="detail-tristate-menulist"
+                    <menulist id="detail-state-menulist"
                               crop="none" sizetopopup="always"
-                              tooltiptext="&cmd.tristateMenu.tooltip;">
+                              tooltiptext="&cmd.stateMenu.tooltip;">
                       <menupopup>
                         <menuitem id="detail-ask-to-activate-menuitem"
                                   class="addon-control"
                                   label="&cmd.askToActivate.label;"
                                   tooltiptext="&cmd.askToActivate.tooltip;"
                                   command="cmd_askToActivateItem"/>
                         <menuitem id="detail-always-activate-menuitem"
                                   class="addon-control"
--- a/toolkit/mozapps/extensions/test/browser/browser_CTP_plugins.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_CTP_plugins.js
@@ -33,34 +33,34 @@ function part2(aPlugins) {
 
 function part3(aTestPlugin) {
   let pluginEl = get_addon_element(gManagerWindow, gTestPluginId);
   pluginEl.parentNode.ensureElementIsVisible(pluginEl);
   let enableButton = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "enable-btn");
   is_element_hidden(enableButton, "part3: enable button should not be visible");
   let disableButton = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "enable-btn");
   is_element_hidden(disableButton, "part3: disable button should not be visible");
-  let menu = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "tristate-menulist");
-  is_element_visible(menu, "part3: tristate menu should be visible");
+  let menu = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "state-menulist");
+  is_element_visible(menu, "part3: state menu should be visible");
   let askToActivateItem = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "ask-to-activate-menuitem");
-  is(menu.selectedItem, askToActivateItem, "part3: tristate menu should have 'Ask To Activate' selected");
+  is(menu.selectedItem, askToActivateItem, "part3: state menu should have 'Ask To Activate' selected");
 
   gBrowser.selectedTab = gBrowser.addTab();
   gPluginBrowser = gBrowser.selectedBrowser;
   gPluginBrowser.addEventListener("PluginBindingAttached", part4, true, true);
   gPluginBrowser.contentWindow.location = gHttpTestRoot + "plugin_test.html";
 }
 
 function part4() {
   ok(PopupNotifications.getNotification("click-to-play-plugins", gPluginBrowser), "part4: should have a click-to-play notification");
   gPluginBrowser.removeEventListener("PluginBindingAttached", part4);
   gBrowser.removeCurrentTab();
 
   let pluginEl = get_addon_element(gManagerWindow, gTestPluginId);
-  let menu = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "tristate-menulist");
+  let menu = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "state-menulist");
   let alwaysActivateItem = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "always-activate-menuitem");
   menu.selectedItem = alwaysActivateItem;
   alwaysActivateItem.doCommand();
   gBrowser.selectedTab = gBrowser.addTab();
   gPluginBrowser = gBrowser.selectedBrowser;
   gPluginBrowser.addEventListener("load", part5, true);
   gPluginBrowser.contentWindow.location = gHttpTestRoot + "plugin_test.html";
 }
@@ -77,17 +77,17 @@ function part6() {
   let testPlugin = gPluginBrowser.contentDocument.getElementById("test");
   ok(testPlugin, "part6: should have a plugin element in the page");
   let objLoadingContent = testPlugin.QueryInterface(Ci.nsIObjectLoadingContent);
   ok(objLoadingContent.activated, "part6: plugin should be activated");
   gPluginBrowser.removeEventListener("load", part5);
   gBrowser.removeCurrentTab();
 
   let pluginEl = get_addon_element(gManagerWindow, gTestPluginId);
-  let menu = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "tristate-menulist");
+  let menu = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "state-menulist");
   let neverActivateItem = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "never-activate-menuitem");
   menu.selectedItem = neverActivateItem;
   neverActivateItem.doCommand();
   gBrowser.selectedTab = gBrowser.addTab();
   gPluginBrowser = gBrowser.selectedBrowser;
   gPluginBrowser.addEventListener("PluginBindingAttached", part7, true, true);
   gPluginBrowser.contentWindow.location = gHttpTestRoot + "plugin_test.html";
 }
@@ -109,20 +109,20 @@ function part7() {
   wait_for_view_load(gManagerWindow, part8);
 }
 
 function part8() {
   let enableButton = gManagerWindow.document.getElementById("detail-enable-btn");
   is_element_hidden(enableButton, "part8: detail enable button should be hidden");
   let disableButton = gManagerWindow.document.getElementById("detail-disable-btn");
   is_element_hidden(disableButton, "part8: detail disable button should be hidden");
-  let menu = gManagerWindow.document.getElementById("detail-tristate-menulist");
-  is_element_visible(menu, "part8: detail tristate menu should be visible");
-  let neverActivateItem = gManagerWindow.document.getElementById("detail-never-activate-menuitem")
-  is(menu.selectedItem, neverActivateItem, "part8: tristate menu should have 'Never Activate' selected");
+  let menu = gManagerWindow.document.getElementById("detail-state-menulist");
+  is_element_visible(menu, "part8: detail state menu should be visible");
+  let neverActivateItem = gManagerWindow.document.getElementById("detail-never-activate-menuitem");
+  is(menu.selectedItem, neverActivateItem, "part8: state menu should have 'Never Activate' selected");
 
   let alwaysActivateItem = gManagerWindow.document.getElementById("detail-always-activate-menuitem");
   menu.selectedItem = alwaysActivateItem;
   alwaysActivateItem.doCommand();
   gBrowser.selectedTab = gBrowser.addTab();
   gPluginBrowser = gBrowser.selectedBrowser;
   gPluginBrowser.addEventListener("load", part9, true);
   gPluginBrowser.contentWindow.location = gHttpTestRoot + "plugin_test.html";
@@ -139,18 +139,18 @@ function part9() {
 function part10() {
   let testPlugin = gPluginBrowser.contentDocument.getElementById("test");
   ok(testPlugin, "part10: should have a plugin element in the page");
   let objLoadingContent = testPlugin.QueryInterface(Ci.nsIObjectLoadingContent);
   ok(objLoadingContent.activated, "part10: plugin should be activated");
   gPluginBrowser.removeEventListener("load", part9);
   gBrowser.removeCurrentTab();
 
-  let menu = gManagerWindow.document.getElementById("detail-tristate-menulist");
-  let askToActivateItem = gManagerWindow.document.getElementById("detail-ask-to-activate-menuitem")
+  let menu = gManagerWindow.document.getElementById("detail-state-menulist");
+  let askToActivateItem = gManagerWindow.document.getElementById("detail-ask-to-activate-menuitem");
   menu.selectedItem = askToActivateItem;
   askToActivateItem.doCommand();
   gBrowser.selectedTab = gBrowser.addTab();
   gPluginBrowser = gBrowser.selectedBrowser;
   gPluginBrowser.addEventListener("PluginBindingAttached", part11, true, true);
   gPluginBrowser.contentWindow.location = gHttpTestRoot + "plugin_test.html";
 }
 
@@ -165,27 +165,27 @@ function part11() {
     open_manager("addons://list/plugin", part12);
   });
 }
 
 function part12(aWindow) {
   gManagerWindow = aWindow;
   let pluginEl = get_addon_element(gManagerWindow, gTestPluginId);
   pluginEl.parentNode.ensureElementIsVisible(pluginEl);
-  let menu = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "tristate-menulist");
-  is_element_hidden(menu, "part12: tristate menu should be hidden");
+  let menu = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "state-menulist");
+  is_element_hidden(menu, "part12: state menu should be hidden");
 
   let details = gManagerWindow.document.getAnonymousElementByAttribute(pluginEl, "anonid", "details-btn");
   EventUtils.synthesizeMouseAtCenter(details, {}, gManagerWindow);
   wait_for_view_load(gManagerWindow, part13);
 }
 
 function part13() {
-  let menu = gManagerWindow.document.getElementById("detail-tristate-menulist");
-  is_element_hidden(menu, "part13: detail tristate menu should be hidden");
+  let menu = gManagerWindow.document.getElementById("detail-state-menulist");
+  is_element_hidden(menu, "part13: detail state menu should be hidden");
 
   let pluginTag = getTestPluginTag();
   pluginTag.blocklisted = false;
   run_next_test();
 }
 
 function end_test() {
   Services.prefs.clearUserPref("plugins.click_to_play");