rem: var drb = document.getElementById("downloadsRetentionBox"); var drp = document.getElementById("downloadsRetentionPolicy"); drp.removeAttribute("hidden"); document.documentElement.removeChild(drp); drb.appendChild(drp); 
context: function Startup() {  var cookiesEnabled = document.getElementById("enableCookies").checked;  updateBroadcaster(!cookiesEnabled);  var globalHistory = Components.classes["@mozilla.org/browser/global-history;1"].getService(Components.interfaces.nsIBrowserHistory);  document.getElementById("history").setAttribute("cleardisabled", globalHistory.count == 0);    // Initially disable the cookies clear button if there are no saved cookies  var cookieMgr = Components.classes["@mozilla.org/cookiemanager;1"].getService();  cookieMgr = cookieMgr.QueryInterface(Components.interfaces.nsICookieManager);  var e = cookieMgr.enumerator;  document.getElementById("cookies").setAttribute("cleardisabled", !e.hasMoreElements());  // Initially disable the password clear button if there are no saved passwords  var passwdMgr = Components.classes["@mozilla.org/passwordmanager;1"].getService();  passwdMgr = passwdMgr.QueryInterface(Components.interfaces.nsIPasswordManager);  e = passwdMgr.enumerator;  document.getElementById("passwords").setAttribute("cleardisabled", !e.hasMoreElements());  // Initially disable the downloads clear button if there the downloads list is empty  try {    e = PrivacyPanel.getDownloads();    var hasDownloads = e.hasMoreElements();  }  catch (e) {    hasDownloads = false;  }  document.getElementById("downloads").setAttribute("cleardisabled", !hasDownloads);    // Initially disable the form history clear button if the history is empty  var formHistory = Components.classes["@mozilla.org/satchel/form-history;1"]                              .getService(Components.interfaces.nsIFormHistory);  document.getElementById("formfill").setAttribute("cleardisabled", formHistory.rowCount == 0);    var categories = document.getElementById("privacyCategories");  categories.addEventListener("clear", PrivacyPanel.clear, false);    // XXXben - we do this because of a bug with the download retention window menulist.   // The bug is that when the Options dialog opens, or you switch from another panel to  // this panel, style is incompletely resolved on the menulist's display area anonymous  // content - it is resolved on the all a/c subcomponents *except* menulist-label (the  // text nodes)... and (as a result, I think) when style is resolved later as the menulist  // goes from visbility: collapse to being visible, the menulist-label has the wrong parent  // style context which causes the style context parent checking to complain heartily. The  // symptom is that the menulist is not initialized with the currently selected value from  // preferences. I suspect this is related to the fact that the menulist is inserted into  // an XBL insertion point, as this problem does not occur when the menulist is placed outside  // the bound element. dbaron is helping me with this with a reduced test case, but in   // the meantime, I'm working around this bug by placing the menulist outside the bound element  // until it is completely initialized and then scooting it in, which is what this code does.   var drb = document.getElementById("downloadsRetentionBox");  var drp = document.getElementById("downloadsRetentionPolicy");  drp.removeAttribute("hidden");  document.documentElement.removeChild(drp);  drb.appendChild(drp);}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/5baebbbb4040b2abaa0eb284b8d96ebaa8da88b7/pref-privacy.js/clean/browser/components/prefwindow/content/pref-privacy.js