Closed Bug 134441 Opened 23 years ago Closed 23 years ago

Scripts & Windows pref panel loses checkmarks the second time viewing it

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: nallen, Assigned: caillon)

References

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

Build 2002032916 Win2k. Go to Edit -> Prefs -> Advanced -> Scripts & Windows Under "Allow webpages to" make sure at least one box is checked (I have Change Images, Create or Change Cookies, and Read Cookies checked). Click on one of the other categories (such as Cache). Click on Scripts & Windows. Under "Allow webpages to" all boxes are unchecked. If a permission was disabled, leaving it checked or unchecked works correctly. If a permission was enabled, leaving it checked or unchecked both leave the permission enabled. Once this problem occurs, you have to close the prefs dialog and reopen to remove these permissions.
Marking regression as this works in 0322. Tree conversion fallout?
Keywords: regression
ack. Can you check if the js console has any errors?
I'm seeing this on linux trunk build #2002033015. confirming. os -> all
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
nothing on js console.
Nothing on js console. Telling Venkman to stop on errors gets no hits. Telling Venkman to stop on exceptions doing the above sequence of steps gives: Exception [XPComponent] [class: XPCWrappedNative_NoHelper] {0} thrown from function anonymous(aPrefType=string:"bool", aPrefString=string:"pref.browser.homepage.disable_button.current_page", aDefaultFlag=void:void) in <chrome://communicator/content/pref/nsPrefWindow.js> line 137. Stopped for thrown exception. $[0] = [XPComponent] [class: XPCWrappedNative_NoHelper] {0} function anonymous(aPrefType=string:"bool", aPrefString=string:"pref.browser.homepage.disable_button.current_page", aDefaultFlag=void:void) in <chrome://communicator/content/pref/nsPrefWindow.js> line 137 135: { 136: case "bool": 137: return !aDefaultFlag ? pref.GetBoolPref( aPrefString ) : pref.GetDefaultBoolPref( aPrefString ); 138: case "int": 139: return !aDefaultFlag ? pref.GetIntPref( aPrefString ) : pref.GetDefaultIntPref( aPrefString ); Continuing from thrown exception. Exception [XPComponent] [class: XPCWrappedNative_NoHelper] {0} thrown from function anonymous(aPrefType=string:"bool", aPrefString=string:"pref.browser.homepage.disable_button.select_file", aDefaultFlag=void:void) in <chrome://communicator/content/pref/nsPrefWindow.js> line 137. Stopped for thrown exception. $[0] = [XPComponent] [class: XPCWrappedNative_NoHelper] {0} function anonymous(aPrefType=string:"bool", aPrefString=string:"pref.browser.homepage.disable_button.select_file", aDefaultFlag=void:void) in <chrome://communicator/content/pref/nsPrefWindow.js> line 137 135: { 136: case "bool": 137: return !aDefaultFlag ? pref.GetBoolPref( aPrefString ) : pref.GetDefaultBoolPref( aPrefString ); 138: case "int": 139: return !aDefaultFlag ? pref.GetIntPref( aPrefString ) : pref.GetDefaultIntPref( aPrefString ); Continuing from thrown exception. Exception [XPComponent] [class: XPCWrappedNative_NoHelper] {0} thrown from function getPrefValueForCheckbox (prefName=string:"capability.policy.default.HTMLImageElement.src") in <chrome://communicator/content/pref/pref-scripts.js> line 74. Stopped for thrown exception. $[0] = [XPComponent] [class: XPCWrappedNative_NoHelper] {0} function getPrefValueForCheckbox (prefName=string:"capability.policy.default.HTMLImageElement.src") in <chrome://communicator/content/pref/pref-scripts.js> line 74 072: 073: try { 074: prefValue = pref.GetCharPref(prefName); 075: 076: if(prefValue != "allAccess" && prefValue != "sameOrigin"){ Continuing from thrown exception. Exception [XPComponent] [class: XPCWrappedNative_NoHelper] {0} thrown from function getPrefValueForCheckbox (prefName=string:"capability.policy.default.HTMLDocument.cookie.get") in <chrome://communicator/content/pref/pref-scripts.js> line 74. Stopped for thrown exception. $[0] = [XPComponent] [class: XPCWrappedNative_NoHelper] {0} function getPrefValueForCheckbox (prefName=string:"capability.policy.default.HTMLDocument.cookie.get") in <chrome://communicator/content/pref/pref-scripts.js> line 74 072: 073: try { 074: prefValue = pref.GetCharPref(prefName); 075: 076: if(prefValue != "allAccess" && prefValue != "sameOrigin"){ Continuing from thrown exception. Exception [XPComponent] [class: XPCWrappedNative_NoHelper] {0} thrown from function getPrefValueForCheckbox (prefName=string:"capability.policy.default.HTMLDocument.cookie.set") in <chrome://communicator/content/pref/pref-scripts.js> line 74. Stopped for thrown exception. $[0] = [XPComponent] [class: XPCWrappedNative_NoHelper] {0} function getPrefValueForCheckbox (prefName=string:"capability.policy.default.HTMLDocument.cookie.set") in <chrome://communicator/content/pref/pref-scripts.js> line 74 072: 073: try { 074: prefValue = pref.GetCharPref(prefName); 075: 076: if(prefValue != "allAccess" && prefValue != "sameOrigin"){ Continuing from thrown exception. Exception [XPComponent] [class: XPCWrappedNative_NoHelper] {0} thrown from function anonymous(aPrefType=string:"bool", aPrefString=string:"pref.advanced.cache.disable_button.clear_memory", aDefaultFlag=void:void) in <chrome://communicator/content/pref/nsPrefWindow.js> line 137. Stopped for thrown exception. $[0] = [XPComponent] [class: XPCWrappedNative_NoHelper] {0} function anonymous(aPrefType=string:"bool", aPrefString=string:"pref.advanced.cache.disable_button.clear_memory", aDefaultFlag=void:void) in <chrome://communicator/content/pref/nsPrefWindow.js> line 137 135: { 136: case "bool": 137: return !aDefaultFlag ? pref.GetBoolPref( aPrefString ) : pref.GetDefaultBoolPref( aPrefString ); 138: case "int": 139: return !aDefaultFlag ? pref.GetIntPref( aPrefString ) : pref.GetDefaultIntPref( aPrefString ); Continuing from thrown exception. Exception [XPComponent] [class: XPCWrappedNative_NoHelper] {0} thrown from function anonymous(aPrefType=string:"bool", aPrefString=string:"pref.advanced.cache.disable_button.clear_disk", aDefaultFlag=void:void) in <chrome://communicator/content/pref/nsPrefWindow.js> line 137. Stopped for thrown exception. $[0] = [XPComponent] [class: XPCWrappedNative_NoHelper] {0} function anonymous(aPrefType=string:"bool", aPrefString=string:"pref.advanced.cache.disable_button.clear_disk", aDefaultFlag=void:void) in <chrome://communicator/content/pref/nsPrefWindow.js> line 137 135: { 136: case "bool": 137: return !aDefaultFlag ? pref.GetBoolPref( aPrefString ) : pref.GetDefaultBoolPref( aPrefString ); 138: case "int": 139: return !aDefaultFlag ? pref.GetIntPref( aPrefString ) : pref.GetDefaultIntPref( aPrefString ); Continuing from thrown exception. In particular, no exceptions are thrown when going back to the Scripts & Windows display the second time.
-> hewitt, nsbeta1
Assignee: jaggernaut → hewitt
Keywords: mozilla1.0, nsbeta1
can you check other panels to see if this happens as well?
I couldn't find any other pref panels that were losing their settings.
*** Bug 134981 has been marked as a duplicate of this bug. ***
Nav triage team: nsbeta1-
Keywords: nsbeta1nsbeta1-
If Netscape is shipping this panel (which I'm told is true) then this panel should work correctly. As it stands right now, if a user switches away from the panel and returns, they are (erroneously) told that they have disabled all of the options to allow windows to open/resize windows, use cookies, etc.
Keywords: nsbeta1-nsbeta1
in order to fix this, its not skin related as modern theme has same issue, so I think this rules out the css code, and Advanced > System panel has the same exact checkboxes, and looks like it repaints just fine.. so we need to look at the code that is attached to that and compare it with the scripts & windows code. Which should give us a clue here why it is funky. It appears that there is no dataloss going on here.
*** Bug 135969 has been marked as a duplicate of this bug. ***
To Clarify for non-windows users, The panel Dennis is talking about is where you can associate mozilla with various extentions under windows.
*** Bug 136377 has been marked as a duplicate of this bug. ***
nsbeta1- per Nav triage team. helpwanted, ->1.0.1
Keywords: nsbeta1helpwanted, nsbeta1-
Target Milestone: --- → mozilla1.0.1
*** Bug 137214 has been marked as a duplicate of this bug. ***
Taking bug. I'm working on a fix.
Assignee: hewitt → caillon
Keywords: helpwanted
Status: NEW → ASSIGNED
Hardware: PC → All
Target Milestone: mozilla1.0.1 → mozilla1.0
Attached patch Proposed patch v1.0 (obsolete) — Splinter Review
Okay there were a few problems here. We were setting the checked state depending on whether the checkbox has changed state since we first loaded the panel. The problem there is that we didn't cache the initial state, so we would uncheck all items which were not changed since first load and checking all items which did change. Of course, we didn't even get that far because we were looking at the wrong thing. So in the end, we were setting our checked states to a null variable, which translates to false (not checked). This patch fixes all that, plus some highly annoying nits I had in the file, including opening braces on the same line as the function declaration (yuck).
Attached patch Patch v1.0.1 (obsolete) — Splinter Review
Oops, remember to save next time before diffing.
Attachment #79054 - Attachment is obsolete: true
Comment on attachment 79056 [details] [diff] [review] Patch v1.0.1 Needs some work: - function getCheckboxValue(name){ - if ("onCheckboxCheck" in window) - return document.getElementById(name).checked; - - return data[name].checked; + function getPrefValueFromCheckbox(name) + { + return !document.getElementById(name).checked; } First, you should add a comment about the negating Second, and more important, your new function, getPrefValueFromCheckbox(), does not check if the loaded panel is the scripts panel. If it isn't (user changes values, goes to another panel, then presses OK), you'll get a js error. See the function you removed for how I solved that. Other than that, everything looks fine
Attachment #79056 - Flags: needs-work+
Attached patch Patch v2.0Splinter Review
Better version of a patch. It seems we were getting the right thing, just that when we changed from a <checkbox> to a <listitem type="checkbox"> the wsm was not picking up the .checked property on the data object and that made it appear as if we were getting the wrong thing.
Attachment #79056 - Attachment is obsolete: true
*** Bug 137492 has been marked as a duplicate of this bug. ***
Comment on attachment 79208 [details] [diff] [review] Patch v2.0 r=hewitt
Attachment #79208 - Flags: review+
Comment on attachment 79208 [details] [diff] [review] Patch v2.0 r=hewitt
*** Bug 137774 has been marked as a duplicate of this bug. ***
Summary: Scripts & Windows prefs incorrectly repainted → Scripts & Windows pref panel loses checkmarks the second time viewing it
Checked in on trunk and branch. Fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
It's not totally fixed yet! I'm still seeing a cosmetic problem on Build 2002-04-16 (1.0 branch) on WinNT. The checkmarks disappear but are not saved as "unchecked", i.e. if you press OK, then go back, they're still checkmarked.
It was checked in today and you're using a build from yesterday. Think about it :)
adding fixed1.0.0 keyword (branch resolution). This bug has comments saying it was fixed on the 1.0 branch and a bonsai checkin comment that agrees. To verify the bug has been fixed on the 1.0 branch please replace the fixed1.0.0 keyword with verified1.0.0.
Keywords: fixed1.0.0
*** Bug 134651 has been marked as a duplicate of this bug. ***
verified1.0.0 on branch build 2002050306.
v This has long been fixed.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: