From bf6ecfcb5449a2daeaa1b224e587db319be8a4e5 Mon Sep 17 00:00:00 2001 From: "ben%bengoodger.com" Date: Mon, 4 Aug 2003 22:41:57 +0000 Subject: [PATCH] The Mother Of All Download Landings, Phase I http://bugzilla.mozilla.org/show_bug.cgi?id=214259 Firebird Download System Upgrades. components/prefwindow/content/pref-privacy.xul components/prefwindow/content/pref-privacy.js components/prefwindow/locale/pref-privacy.dtd - Download Manager Options (UI only, no code yet) --- .../prefwindow/content/pref-privacy.js | 22 ++++++++++++++++++- .../prefwindow/content/pref-privacy.xul | 16 +++++++++++++- .../prefwindow/locale/pref-privacy.dtd | 6 ++++- 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/browser/components/prefwindow/content/pref-privacy.js b/browser/components/prefwindow/content/pref-privacy.js index 3ef41ba515a..4df947428ac 100644 --- a/browser/components/prefwindow/content/pref-privacy.js +++ b/browser/components/prefwindow/content/pref-privacy.js @@ -38,7 +38,8 @@ var _elementIDs = ["histDay", "browserCacheDiskCache", "enableCookies", "enableCookiesForOriginatingSiteOnly", "enableCookiesForCurrentSessionOnly", - "enableCookiesButAskFirst", "enableFormFill", "enablePasswords"]; + "enableCookiesButAskFirst", "enableFormFill", "enablePasswords", + "downloadsRetentionPolicy"]; function Startup() { var cookiesEnabled = document.getElementById("enableCookies").checked; @@ -78,6 +79,25 @@ function Startup() { 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); } function unload() diff --git a/browser/components/prefwindow/content/pref-privacy.xul b/browser/components/prefwindow/content/pref-privacy.xul index ec652163fb3..87236e756b4 100644 --- a/browser/components/prefwindow/content/pref-privacy.xul +++ b/browser/components/prefwindow/content/pref-privacy.xul @@ -88,7 +88,11 @@ &downloadsDescription.label; - + + + &downloadsRetentionPolicy.label; + + @@ -137,5 +141,15 @@