Closed
Bug 89576
Opened 24 years ago
Closed 21 years ago
Widget state manager should save current page data before OK callback
Categories
(SeaMonkey :: Preferences, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.7alpha
People
(Reporter: neil, Assigned: neil)
Details
(Whiteboard: [need info])
Attachments
(1 file, 2 obsolete files)
4.50 KB,
patch
|
caillon
:
review+
alecf
:
superreview+
|
Details | Diff | Splinter Review |
Many pref windows register OK callbacks. Some blindly call
document.getElementById while other wiser codes fall back on the wsm page data.
If the wsm could be relied upon to save the page data when OK was clicked then
all pref panels could retrieve their data in a consistent manner. Unfortunately
the wsm saves the page data after calling the OK callbacks...
Assignee | ||
Comment 1•24 years ago
|
||
Assignee | ||
Updated•24 years ago
|
Assignee | ||
Comment 3•23 years ago
|
||
Ben, if you're not going to review this can you suggest another name? Thanks.
Comment 4•23 years ago
|
||
Neil, at first glance your suggestion seems reasonable, but the FE code isn't
really my area. One thing that comes to mind is this...
The way it works right now the OK callbacks could potentially validate the page
data before the WSM saved it. With your change this data would be saved before
the callbacks could have a chance to valdidate it.
Eddy, do you have any thoughts on the potential impact of this change?
Good point about the validation. I don't see any WSM handled pref panels that
do validation at this point.
I don't see any problems with the patch. However, shouldn't the few panels that
use an OK handler and use the getElementById calls be changed to be consistent?
Another thing that needs to be done is documenting the preferred usage for
nsPrefWindow and WSM. I'm working on this (on and off) and hope to have a rough
cut fairly soon.
Neil, would you be interested in helping with this task?
Assignee | ||
Comment 6•23 years ago
|
||
In reply to Brian Nesse's question, the WSM saves data across page switches.
If the page data validates then it will need to be saved anyway.
If the page data does not validate then it will still be saved on the next switch.
Only if the page validates will the WSM write the saved data to your preferences.
I will see if I can find all the pages that use validation.
Comment 7•23 years ago
|
||
Attachment #41405 -
Flags: review+
Updated•23 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0
Assignee | ||
Comment 8•23 years ago
|
||
These files currently install an OK callback:
pref-advanced.xul
pref-appearance.xul
pref-fonts.js
pref-history.xul
pref-winhooks.xul
pref-mailnewsOverlay.js
Note that pref-mailnewsOverlay.js gets it wrong!
Updated•23 years ago
|
Priority: -- → P3
Assignee | ||
Comment 10•23 years ago
|
||
nsPrefWindow.js: move callbacks to after page data save
pref-appearance.xul: always get pref value from page data
pref-fonts.js: don't save page data manually
pref-history.xul: always get pref value from page data
pref-winhooks.js: don't save page data manually
pref-contentpacks.xul: always get pref value from page data
pref-mailnewsOverlay.js: fix bug by getting pref value from page data
Attachment #41405 -
Attachment is obsolete: true
Comment 11•23 years ago
|
||
Can you explain what your latest patch does?
Assignee | ||
Comment 12•23 years ago
|
||
Ben, the problem is obtaining page values during the OK callback, as the current
page may not be loaded. Three pref panels try to get the values from the current
page and fall back on the saved data. Two pref panels manually save the page
data anyway. One pref panel just gets it wrong. The idea of my patch is to save
the current page data before calling the OK callbacks, thus simplifying data access.
Updated•23 years ago
|
Target Milestone: mozilla0.9.8 → mozilla0.9.9
Updated•23 years ago
|
Target Milestone: mozilla0.9.9 → mozilla1.0
Comment 13•23 years ago
|
||
Comment on attachment 60475 [details] [diff] [review]
also fix "bugs" in ok handlers
sr=blake, but please test well
Attachment #60475 -
Flags: superreview+
Comment 14•23 years ago
|
||
Actually, I take that back. Maybe. The point of the ok callbacks before the
data save is presumably so that panels can do any necessary validation or
canonification before saving. I do agree that we need a cleaner solution so
each panel doesn't have to hack to get the right value, but I'm not sure this is it.
Assignee | ||
Comment 15•23 years ago
|
||
Blake, the idea is that I use the same save routine as if you change page, so
that the page can always assume that it's not the current page.
Comment 16•23 years ago
|
||
ADT triage team needs info: what bad things happen to the user that would
require fixing this for MachV?
Whiteboard: [need info]
Comment 17•23 years ago
|
||
None.
Assignee | ||
Comment 18•23 years ago
|
||
Even pref-mailnewsOverlay.js has his own hack now :-)
Updated•23 years ago
|
Target Milestone: mozilla1.0 → mozilla1.1
Assignee | ||
Comment 20•21 years ago
|
||
So, there are now only three issues with OK handlers left:
pref-contentpacks.xul still tries to query the current document
pref-fonts.js and pref-winhooks.js try to save the data twice
(this is quite slow in the case of pref-fonts.js)
FYI attachment 41405 [details] [diff] [review] got checked in by timeless as part of another patch.
Attachment #60475 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #136197 -
Flags: superreview?(alecf)
Attachment #136197 -
Flags: review?(caillon)
Comment 21•21 years ago
|
||
Comment on attachment 136197 [details] [diff] [review]
Updated for bitrot ;-)
wow, those were some ugly hacks. good riddens!
sr=alecf
Attachment #136197 -
Flags: superreview?(alecf) → superreview+
Comment 22•21 years ago
|
||
Comment on attachment 136197 [details] [diff] [review]
Updated for bitrot ;-)
spiffy. r=caillon
Attachment #136197 -
Flags: review?(caillon) → review+
Assignee | ||
Comment 23•21 years ago
|
||
Unless anyone has a dire need to save a few milliseconds this can wait :-)
Assignee: bugs → neil.parkwaycc.co.uk
Status: ASSIGNED → NEW
Target Milestone: mozilla1.1alpha → mozilla1.7alpha
Assignee | ||
Comment 24•21 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 25•21 years ago
|
||
this checkin caused Bug #235058
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•