Backout bug 669345 and bug 669390 for leaking
authorBlair McBride <bmcbride@mozilla.com>
Tue, 09 Aug 2011 18:45:26 +1200
changeset 73960 51d7ece2bb10ca02b538ab7bb8b20a82b7d7f54e
parent 73958 10987bba3dd6f5bfb8a2b300682c23c58f474b4a
child 73961 f356bab9216412cdeafd040856fd8362e4a2e7fa
push id93
push userbmcbride@mozilla.com
push dateTue, 09 Aug 2011 06:47:53 +0000
treeherderfx-team@f356bab92164 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs669345, 669390
milestone8.0a1
Backout bug 669345 and bug 669390 for leaking
mobile/chrome/content/browser.css
mobile/chrome/content/browser.xul
toolkit/mozapps/extensions/content/extensions.css
toolkit/mozapps/extensions/content/setting.xml
toolkit/mozapps/extensions/test/browser/Makefile.in
toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js
toolkit/mozapps/extensions/test/browser/more_options.xul
toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
toolkit/themes/pinstripe/mozapps/extensions/extensions.css
toolkit/themes/winstripe/mozapps/extensions/extensions.css
--- a/mobile/chrome/content/browser.css
+++ b/mobile/chrome/content/browser.css
@@ -54,21 +54,16 @@ setting[type="color"] {
   -moz-binding: url("chrome://mozapps/content/extensions/setting.xml#setting-color");
 }
 
 setting[type="file"],
 setting[type="directory"] {
   -moz-binding: url("chrome://mozapps/content/extensions/setting.xml#setting-path");
 }
 
-setting[type="radio"],
-setting[type="menulist"] {
-  -moz-binding: url("chrome://mozapps/content/extensions/setting.xml#setting-multi");
-}
-
 #browsers > notificationbox {
   -moz-binding: url("chrome://browser/content/notification.xml#stacked-notificationbox");
   overflow: -moz-hidden-unscrollable;
 }
 
 notification {
     -moz-binding: url("chrome://browser/content/notification.xml#notification");
 }
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -429,24 +429,24 @@
 #ifdef MOZ_OFFICIAL_BRANDING
 # these two point to the same page, this just matters for what shows up in the
 # URL bar
                             oncommand="BrowserUI.newTab('about:firefox', Browser.selectedTab);"/>
 #else
                             oncommand="BrowserUI.newTab('about:fennec', Browser.selectedTab);"/>
 #endif
                   </setting>
-                  <setting id="prefs-uilanguage" title="&language.title;" type="menulist">
+                  <setting id="prefs-uilanguage" title="&language.title;" type="control">
                     <menulist id="prefs-languages" oncommand="PreferencesView.updateLocale();">
                       <menupopup>
                         <menuitem id="prefs-languages-auto" label="&language.auto;" value="auto"/>
                       </menupopup>
                     </menulist>
                   </setting>
-                  <setting id="prefs-homepage" title="&homepage.title;" type="menulist">
+                  <setting id="prefs-homepage" title="&homepage.title;" type="control">
                     <menulist id="prefs-homepage-options" oncommand="PreferencesView.updateHomePage();">
                       <menupopup onpopupshowing="PreferencesView.updateHomePageList();">
                         <menuitem id="prefs-homepage-default" label="&homepage.default;" value="default"/>
                         <menuitem id="prefs-homepage-none" label="&homepage.none;" value="none"/>
                         <menuitem id="prefs-homepage-currentpage" label="&homepage.currentpage;" value="currentpage"/>
                       </menupopup>
                     </menulist>
                   </setting>
--- a/toolkit/mozapps/extensions/content/extensions.css
+++ b/toolkit/mozapps/extensions/content/extensions.css
@@ -128,22 +128,16 @@ setting[type="color"] {
 }
 
 setting[type="file"],
 setting[type="directory"] {
   display: -moz-grid-line;
   -moz-binding: url("chrome://mozapps/content/extensions/setting.xml#setting-path");
 }
 
-setting[type="radio"],
-setting[type="menulist"] {
-  display: -moz-grid-line;
-  -moz-binding: url("chrome://mozapps/content/extensions/setting.xml#setting-multi");
-}
-
 #addonitem-popup > menuitem[disabled="true"] {
   display: none;
 }
 
 #addonitem-popup[addontype="theme"] > #menuitem_enableItem,
 #addonitem-popup[addontype="theme"] > #menuitem_disableItem,
 #addonitem-popup:not([addontype="theme"]) > #menuitem_enableTheme,
 #addonitem-popup:not([addontype="theme"]) > #menuitem_disableTheme {
--- a/toolkit/mozapps/extensions/content/setting.xml
+++ b/toolkit/mozapps/extensions/content/setting.xml
@@ -17,17 +17,16 @@
    - The Initial Developer of the Original Code is
    - Mozilla Corporation.
    - Portions created by the Initial Developer are Copyright (C) 2008
    - the Initial Developer. All Rights Reserved.
    -
    - Contributor(s):
    -   Daniel Brooks <db48x@yahoo.com>
    -   Mark Finkle <mfinkle@mozilla.com>
-   -   Geoff Lankow <geoff@darktrojan.net>
    -
    - Alternatively, the contents of this file may be used under the terms of
    - either the GNU General Public License Version 2 or later (the "GPL"), or
    - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    - in which case the provisions of the GPL or the LGPL are applicable instead
    - of those above. If you wish to allow use of your version of this file only
    - under the terms of either the GPL or the LGPL, and not to allow others to
    - use your version of this file under the terms of the MPL, indicate your
@@ -307,17 +306,17 @@
     <content>
       <xul:vbox class="setting-label">
         <xul:label class="preferences-title" xbl:inherits="value=title" crop="end" flex="1"/>
         <xul:label class="preferences-description" xbl:inherits="value=desc" crop="end" flex="1">
           <children/>
         </xul:label>
       </xul:vbox>
       <xul:hbox anonid="input-container" class="setting-input">
-        <children includes="button"/>
+        <children includes="button|menulist"/>
       </xul:hbox>
     </content>
   </binding>
 
   <binding id="setting-string" extends="chrome://mozapps/content/extensions/setting.xml#setting-base">
     <content>
       <xul:vbox class="setting-label">
         <xul:label class="preferences-title" xbl:inherits="value=title" crop="end" flex="1"/>
@@ -467,77 +466,9 @@
             } catch (e) {}
           }
           return this.input.value = label;
        ]]>
         </setter>
       </property>
     </implementation>
   </binding>
-
-  <binding id="setting-multi" extends="chrome://mozapps/content/extensions/setting.xml#setting-base">
-    <content>
-      <xul:vbox class="setting-label">
-        <xul:label class="preferences-title" xbl:inherits="value=title" crop="end" flex="1"/>
-        <xul:label class="preferences-description" xbl:inherits="value=desc" crop="end" flex="1">
-          <children/>
-        </xul:label>
-      </xul:vbox>
-      <xul:hbox class="setting-input">
-        <children include="radiogroup,menulist" />
-      </xul:hbox>
-    </content>
-
-    <implementation>
-      <constructor>
-        <![CDATA[
-          let self = this;
-          this.control.addEventListener("command", this.valueToPreference.bind(this), false);
-        ]]>
-      </constructor>
-
-      <method name="valueFromPreference">
-        <body>
-        <![CDATA[
-          let val;
-          switch (Services.prefs.getPrefType(this.pref)) {
-            case Ci.nsIPrefBranch.PREF_STRING:
-              val = Services.prefs.getCharPref(this.pref);
-              break;
-            case Ci.nsIPrefBranch.PREF_INT:
-              val = Services.prefs.getIntPref(this.pref);
-              break;
-            case Ci.nsIPrefBranch.PREF_BOOL:
-              val = Services.prefs.getBoolPref(this.pref).toString();
-              break;
-            default:
-              return;
-          }
-
-          for (let i = 0; i < this.control.itemCount; i++) {
-            if (this.control.getItemAtIndex(i).value == val) {
-              this.control.selectedIndex = i;
-              break;
-            }
-          }
-        ]]>
-        </body>
-      </method>
-
-      <method name="valueToPreference">
-        <body>
-        <![CDATA[
-          // We might not have a pref already set, so we guess the type from the value attribute
-          let val = this.control.selectedItem.value;
-          if (val == "true" || val == "false")
-            Services.prefs.setBoolPref(this.pref, val == "true");
-          else if (/^-?\d+$/.test(val))
-            Services.prefs.setIntPref(this.pref, val);
-          else
-            Services.prefs.setCharPref(this.pref, val);
-        ]]>
-        </body>
-      </method>
-
-      <field name="control">this.getElementsByTagName(this.getAttribute("type") == "radio" ? "radiogroup" : "menulist")[0];</field>
-    </implementation>
-  </binding>
 </bindings>
--- a/toolkit/mozapps/extensions/test/browser/Makefile.in
+++ b/toolkit/mozapps/extensions/test/browser/Makefile.in
@@ -114,17 +114,16 @@ include $(DEPTH)/config/autoconf.mk
   browser_updatessl.rdf^headers^ \
   browser_install.rdf \
   browser_install.rdf^headers^ \
   browser_install.xml \
   browser_install1_3.xpi \
   browser_eula.xml \
   browser_purchase.xml \
   discovery.html \
-  more_options.xul \
   options.xul \
   redirect.sjs \
   releaseNotes.xhtml \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
 libs:: $(_MAIN_TEST_FILES)
--- a/toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js
@@ -37,23 +37,16 @@ function test() {
 
   gProvider.createAddons([{
     id: "inlinesettings2@tests.mozilla.org",
     name: "Inline Settings (Regular)",
     version: "1",
     optionsURL: CHROMEROOT + "options.xul",
     optionsType: AddonManager.OPTIONS_TYPE_INLINE
   },{
-    id: "inlinesettings3@tests.mozilla.org",
-    name: "Inline Settings (More Options)",
-    description: "Tests for option types introduced after Mozilla 7.0",
-    version: "1",
-    optionsURL: CHROMEROOT + "more_options.xul",
-    optionsType: AddonManager.OPTIONS_TYPE_INLINE
-  },{
     id: "noninlinesettings@tests.mozilla.org",
     name: "Non-Inline Settings",
     version: "1",
     optionsURL: CHROMEROOT + "addon_prefs.xul"
   }]);
 
   installAddon(function () {
     open_manager("addons://list/extension", function(aWindow) {
@@ -72,20 +65,16 @@ function end_test() {
 
   Services.prefs.clearUserPref("extensions.inlinesettings1.bool");
   Services.prefs.clearUserPref("extensions.inlinesettings1.boolint");
   Services.prefs.clearUserPref("extensions.inlinesettings1.integer");
   Services.prefs.clearUserPref("extensions.inlinesettings1.string");
   Services.prefs.clearUserPref("extensions.inlinesettings1.color");
   Services.prefs.clearUserPref("extensions.inlinesettings1.file");
   Services.prefs.clearUserPref("extensions.inlinesettings1.directory");
-  Services.prefs.clearUserPref("extensions.inlinesettings3.radioBool");
-  Services.prefs.clearUserPref("extensions.inlinesettings3.radioInt");
-  Services.prefs.clearUserPref("extensions.inlinesettings3.radioString");
-  Services.prefs.clearUserPref("extensions.inlinesettings3.menulist");
 
   close_manager(gManagerWindow, function() {
     AddonManager.getAddonByID("inlinesettings1@tests.mozilla.org", function(aAddon) {
       aAddon.uninstall();
       finish();
     });
   });
 }
@@ -261,82 +250,16 @@ add_test(function() {
       button = gManagerWindow.document.getElementById("detail-prefs-btn");
       is_element_hidden(button, "Preferences button should not be visible");
 
       gCategoryUtilities.openType("extension", run_next_test);
     }
   });
 });
 
-// Tests for the setting.xml bindings introduced after Mozilla 7
-add_test(function() {
-  var addon = get_addon_element(gManagerWindow, "inlinesettings3@tests.mozilla.org");
-  addon.parentNode.ensureElementIsVisible(addon);
-
-  var button = gManagerWindow.document.getAnonymousElementByAttribute(addon, "anonid", "preferences-btn");
-  EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
-
-  wait_for_view_load(gManagerWindow, function() {
-    is(observer.lastData, "inlinesettings3@tests.mozilla.org", "Observer notification should have fired");
-
-    var grid = gManagerWindow.document.getElementById("detail-grid");
-    var settings = grid.querySelectorAll("rows > setting");
-    is(settings.length, 4, "Grid should have settings children");
-
-    // Force bindings to apply
-    settings[0].clientTop;
-
-    ok(settings[0].hasAttribute("first-row"), "First visible row should have first-row attribute");
-    Services.prefs.setBoolPref("extensions.inlinesettings3.radioBool", false);
-    var radios = settings[0].getElementsByTagName("radio");
-    isnot(radios[0].selected, true, "Correct radio button should be selected");
-    is(radios[1].selected, true, "Correct radio button should be selected");
-    EventUtils.synthesizeMouseAtCenter(radios[0], { clickCount: 1 }, gManagerWindow);
-    is(Services.prefs.getBoolPref("extensions.inlinesettings3.radioBool"), true, "Radio pref should have been updated");
-    EventUtils.synthesizeMouseAtCenter(radios[1], { clickCount: 1 }, gManagerWindow);
-    is(Services.prefs.getBoolPref("extensions.inlinesettings3.radioBool"), false, "Radio pref should have been updated");
-
-    ok(!settings[1].hasAttribute("first-row"), "Not the first row");
-    Services.prefs.setIntPref("extensions.inlinesettings3.radioInt", 5);
-    var radios = settings[1].getElementsByTagName("radio");
-    isnot(radios[0].selected, true, "Correct radio button should be selected");
-    is(radios[1].selected, true, "Correct radio button should be selected");
-    isnot(radios[2].selected, true, "Correct radio button should be selected");
-    EventUtils.synthesizeMouseAtCenter(radios[0], { clickCount: 1 }, gManagerWindow);
-    is(Services.prefs.getIntPref("extensions.inlinesettings3.radioInt"), 4, "Radio pref should have been updated");
-    EventUtils.synthesizeMouseAtCenter(radios[2], { clickCount: 1 }, gManagerWindow);
-    is(Services.prefs.getIntPref("extensions.inlinesettings3.radioInt"), 6, "Radio pref should have been updated");
-
-    ok(!settings[2].hasAttribute("first-row"), "Not the first row");
-    Services.prefs.setCharPref("extensions.inlinesettings3.radioString", "juliet");
-    var radios = settings[2].getElementsByTagName("radio");
-    isnot(radios[0].selected, true, "Correct radio button should be selected");
-    is(radios[1].selected, true, "Correct radio button should be selected");
-    isnot(radios[2].selected, true, "Correct radio button should be selected");
-    EventUtils.synthesizeMouseAtCenter(radios[0], { clickCount: 1 }, gManagerWindow);
-    is(Services.prefs.getCharPref("extensions.inlinesettings3.radioString"), "india", "Radio pref should have been updated");
-    EventUtils.synthesizeMouseAtCenter(radios[2], { clickCount: 1 }, gManagerWindow);
-    is(Services.prefs.getCharPref("extensions.inlinesettings3.radioString"), "kilo", "Radio pref should have been updated");
-
-    ok(!settings[3].hasAttribute("first-row"), "Not the first row");
-    Services.prefs.setIntPref("extensions.inlinesettings3.menulist", 8);
-    var input = settings[3].firstElementChild;
-    is(input.value, "8", "Menulist should have initial value");
-    input.focus();
-    EventUtils.synthesizeKey("n", {}, gManagerWindow);
-    is(input.value, "9", "Menulist should have updated value");
-    is(Services.prefs.getIntPref("extensions.inlinesettings3.menulist"), 9, "Menulist pref should have been updated");
-
-    button = gManagerWindow.document.getElementById("detail-prefs-btn");
-    is_element_hidden(button, "Preferences button should not be visible");
-
-    gCategoryUtilities.openType("extension", run_next_test);
-  });
-});
-
 // Addon with inline preferences as optionsURL
 add_test(function() {
   var addon = get_addon_element(gManagerWindow, "inlinesettings2@tests.mozilla.org");
   addon.parentNode.ensureElementIsVisible(addon);
 
   var button = gManagerWindow.document.getAnonymousElementByAttribute(addon, "anonid", "preferences-btn");
   EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
 
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/more_options.xul
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" ?>
-<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <setting pref="extensions.inlinesettings3.radioBool" type="radio" title="Radio">
-    <radiogroup>
-      <radio label="Delta" value="true" />
-      <radio label="Echo" value="false" />
-    </radiogroup>
-  </setting>
-  <setting pref="extensions.inlinesettings3.radioInt" type="radio" title="Radio">
-    <radiogroup>
-      <radio label="Foxtrot" value="4" />
-      <radio label="Golf" value="5" />
-      <radio label="Hotel" value="6" />
-    </radiogroup>
-  </setting>
-  <setting pref="extensions.inlinesettings3.radioString" type="radio" title="Radio">
-    <radiogroup>
-      <radio label="India" value="india" />
-      <radio label="Juliet" value="juliet" />
-      <radio label="Kilo" value="kilo" />
-    </radiogroup>
-  </setting>
-  <setting pref="extensions.inlinesettings3.menulist" type="menulist" title="Menulist">
-    <menulist sizetopopup="always">
-      <menupopup>
-        <menuitem label="Lima" value="7" />
-        <menuitem label="Mike" value="8" />
-        <menuitem label="November" value="9" />
-      </menupopup>
-    </menulist>
-  </setting>
-</vbox>
--- a/toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
@@ -746,20 +746,16 @@ menulist { /* Fixes some styling inconsi
   margin: 1px 5px 2px 5px;
 }
 
 colorpicker[type="button"] { /* Fixes some styling inconsistencies */
   height: 29px;
   margin: 1px 5px 2px 5px;
 }
 
-setting[type="radio"] > radiogroup {
-  -moz-box-orient: horizontal;
-}
-
 /*** creator ***/
 
 .creator > label {
   -moz-margin-start: 0;
   -moz-margin-end: 0;
 }
 
 .creator > .text-link {
--- a/toolkit/themes/pinstripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/pinstripe/mozapps/extensions/extensions.css
@@ -1079,47 +1079,43 @@ setting[type="string"] > .setting-input 
   margin: 12px;
 }
 
 
 /*** buttons ***/
 
 .addon-control,
 setting:not([type="integer"]) button,
-setting[type="menulist"] menulist,
+setting[type="control"] menulist,
 setting[type="color"] colorpicker[type="button"] {
   -moz-appearance: none;
   padding: 1px 4px;
   min-width: 60px;
   border-radius: 3px;
   border: 1px solid rgba(60,73,97,0.5);
   box-shadow: inset 0 1px rgba(255,255,255,0.25), 0 1px rgba(255,255,255,0.25);
   background-image: -moz-linear-gradient(rgba(255,255,255,0.45), rgba(255,255,255,0.2));
   background-clip: padding-box;
   color: #252F3B;
   text-shadow: @loweredShadow@;
 }
 
-setting[type="radio"] > radiogroup {
-  -moz-box-orient: horizontal;
-}
-
 .addon-control[disabled="true"] {
   display: none;
 }
 
 setting[type="color"] colorpicker[type="button"] {
   margin: 1px 5px 2px 5px;
   padding: 3px;
   height: 25px;
 }
 
 .addon-control:active:hover,
 setting:not([type="integer"]) button:active:hover,
-setting[type="menulist"] menulist:active:hover,
+setting[type="control"] menulist:active:hover,
 setting[type="color"] colorpicker[type="button"]:active:hover {
   box-shadow: inset 0 1px 3px rgba(0,0,0,.2), 0 1px rgba(255,255,255,0.25);
   background-image: -moz-linear-gradient(rgba(45,54,71,0.3), rgba(45,54,71,0.1));
   border-color: rgba(60,73,97,0.7);
 }
 
 .button-link {
   -moz-appearance: none;
--- a/toolkit/themes/winstripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/winstripe/mozapps/extensions/extensions.css
@@ -1080,17 +1080,17 @@ menulist { /* Fixes some styling inconsi
   margin: 12px;
 }
 
 
 /*** buttons ***/
 
 .addon-control,
 setting:not([type="integer"]) button,
-setting[type="menulist"] menulist,
+setting[type="control"] menulist,
 setting[type="color"] colorpicker[type="button"] {
   -moz-appearance: none;
   color: black;
   padding: 0 5px;
   background: -moz-linear-gradient(rgba(251, 252, 253, 0.95), rgba(246, 247, 248, 0) 49%, 
                                    rgba(211, 212, 213, 0.45) 51%, rgba(225, 226, 229, 0.3));
   background-clip: padding-box;
   border-radius: 3px;
@@ -1103,32 +1103,28 @@ setting[type="color"] colorpicker[type="
 setting[type="color"] colorpicker[type="button"] {
   margin: 1px 5px 2px 5px;
   padding: 3px;
   height: 25px;
 }
 
 .addon-control:active:hover,
 setting:not([type="integer"]) button:active:hover,
-setting[type="menulist"] menulist:active:hover,
+setting[type="control"] menulist:active:hover,
 setting[type="color"] colorpicker[type="button"]:active:hover {
   background-color: rgba(61, 76, 92, 0.2);
   border-color: rgba(39, 53, 68, 0.5);
   box-shadow: 0 0 3px 1px rgba(39, 53, 68, 0.2) inset;
 }
 
 .addon-control > .button-box,
 setting:not([type="integer"]) button > .button-box {
   padding: 1px;
 }
 
-setting[type="radio"] > radiogroup {
-  -moz-box-orient: horizontal;
-}
-
 .addon-control[disabled="true"] {
   display: none;
 }
 
 .button-link {
   -moz-appearance: none;
   background: transparent;
   border: none;