Closed
Bug 451025
Opened 16 years ago
Closed 13 years ago
<preference> element needs to be usable even outside of a <prefpane> element
Categories
(Toolkit :: Preferences, defect)
Toolkit
Preferences
Tracking
()
RESOLVED
FIXED
People
(Reporter: db48x, Assigned: db48x)
References
(Depends on 1 open bug)
Details
Attachments
(2 files, 6 obsolete files)
6.00 KB,
patch
|
Details | Diff | Splinter Review | |
2.06 KB,
patch
|
Gavin
:
review+
|
Details | Diff | Splinter Review |
There might already be a bug on this, but I can't find it.
This is a regression from when the <preference> element was first introduced quite a while back (for FF1.5, as I recall). Not all apps that use preferences will include a separate dialog box with <prefpane>s in it as a user interface for modifying those prefs. Fennec is one example, and an app I wrote while with MDG is another.
Assignee | ||
Comment 1•16 years ago
|
||
Attachment #335257 -
Flags: review?
Assignee | ||
Comment 2•16 years ago
|
||
forgot to update the patch before attaching it
Attachment #335257 -
Attachment is obsolete: true
Attachment #335258 -
Flags: review?
Attachment #335257 -
Flags: review?
Assignee | ||
Comment 3•16 years ago
|
||
Comment on attachment 335258 [details] [diff] [review]
451025-2.diff
patch is incomplete
Attachment #335258 -
Flags: review?
Assignee | ||
Comment 4•16 years ago
|
||
Attachment #335258 -
Attachment is obsolete: true
Assignee | ||
Updated•16 years ago
|
Attachment #335557 -
Flags: review?(benjamin)
Updated•16 years ago
|
Attachment #335557 -
Flags: review?(benjamin) → review?(enndeakin)
Comment 5•16 years ago
|
||
Would be nice to get some tests for this (see e.g. http://mxr.mozilla.org/seamonkey/source/toolkit/content/tests/chrome/test_preferences.xul ).
Assignee | ||
Comment 6•16 years ago
|
||
good point, I'll see what I can come up with
Comment 7•16 years ago
|
||
Comment on attachment 335557 [details] [diff] [review]
451025-3w.diff
Don't remove properties that are defined for elements and are listed in the documentation.
Why do we need a separate new element here? Can't we just put all of the functionality in the <preferences> element directly?
Assignee | ||
Comment 8•16 years ago
|
||
Attachment #335557 -
Attachment is obsolete: true
Attachment #336099 -
Flags: review?(enndeakin)
Attachment #335557 -
Flags: review?(enndeakin)
Assignee | ||
Comment 9•16 years ago
|
||
(In reply to comment #7)
> (From update of attachment 335557 [details] [diff] [review])
> Don't remove properties that are defined for elements and are listed in the
> documentation.
Done.
> Why do we need a separate new element here? Can't we just put all of the
> functionality in the <preferences> element directly?
Because it needs to listen for change events from the input controls (textboxes, checkboxes, etc) which means it needs to be an ancestor of those controls. Merging the prefmanager tag with the preferences tag would that everyone using these features would need to update their code, moving all of their input controls underneath their preferences tags.
Comment 10•16 years ago
|
||
(In reply to comment #9)
> Because it needs to listen for change events from the input controls
> (textboxes, checkboxes, etc) which means it needs to be an ancestor of those
> controls.
Why can't it just use an event listener?
Assignee | ||
Comment 11•16 years ago
|
||
xbl destructors are never called, so it would never get a chance to remove the listener.
Comment 12•16 years ago
|
||
With a few minor errors fixed, the following already works just fine:
<prefpane>
<preferences>
<preference id="browser.startup.homepage"
name="browser.startup.homepage" type="wstring"/>
</preferences>
<textbox id="textbox" preference="browser.startup.homepage"/>
</prefpane>
It seems like we can just use <prefpane> here rather than using a new element.
Assignee | ||
Comment 13•16 years ago
|
||
No, I can't. The prefpane binding inserts a bunch of UI stuff that are specific to one particular app's preferences window in addition to handling the preferences attribtue. By splitting the prefpane into two elements, (called "prefpane" and "prefmanager") you can get the latter without having to swallow the former.
Comment 14•16 years ago
|
||
I'm not following. I can understand the prefwindow binding, but I don't see anything of note in the prefpane binding. There are a couple of properties and methods that might not be used, but I don't see an issue there.
Assignee | ||
Comment 15•16 years ago
|
||
erm. on looking at the file again, I see that you're right. I need to reexamine the symptoms to see exactly how to fix the prefpane binding. In the mean time, however, could I get a review on the change to the preference element? We need that at least for Fennec A1. That's just the second patch.
Assignee | ||
Updated•16 years ago
|
Attachment #335258 -
Attachment is obsolete: false
Assignee | ||
Comment 16•16 years ago
|
||
fix a good review commend from Gavin.
Attachment #335258 -
Attachment is obsolete: true
Attachment #342205 -
Flags: review?
Comment 17•16 years ago
|
||
Comment on attachment 342205 [details] [diff] [review]
451025-2.1.diff
>diff -r b222f6e972b3 toolkit/content/widgets/preferences.xml
>+ <property name="type">
>+ return "type" in doc && doc.type
missing semi-colon, and should probably return doc.type || ""; to match the default prefwindow behavior (missing attribute).
>+ <property name="instantApply">
>+ return ("instantApply" in doc && doc.instantApply) || rootBranch.getBoolPref("browser.preferences.instantApply")
I prefer explicit references to |this| (also missing a semi-colon). Shouldn't need the "in" check anymore either.
Should mark these readonly I guess (even though it doesn't seem to affect settability without a setter defined).
r=me with those.
Attachment #342205 -
Flags: review? → review+
Assignee | ||
Comment 18•16 years ago
|
||
patch to be checked in
Attachment #342205 -
Attachment is obsolete: true
Assignee | ||
Comment 19•16 years ago
|
||
forgot one nit in the last patch
Attachment #342492 -
Attachment is obsolete: true
Attachment #342504 -
Flags: review?
Assignee | ||
Comment 20•16 years ago
|
||
/me sighs. perhaps this one will be acceptable?
Attachment #342504 -
Attachment is obsolete: true
Attachment #342505 -
Flags: review?(gavin.sharp)
Attachment #342504 -
Flags: review?
Comment 21•16 years ago
|
||
Comment on attachment 342505 [details] [diff] [review]
451025-2.4.diff
this is perfectly acceptable, minus the changes to js/src/jsdtoa.cpp! :)
Attachment #342505 -
Flags: review?(gavin.sharp) → review+
Assignee | ||
Comment 22•16 years ago
|
||
lol. I completely forgot to leave those out.
Updated•16 years ago
|
Attachment #336099 -
Flags: review?(enndeakin)
Comment 23•16 years ago
|
||
This should be fixed, no?
Comment 25•13 years ago
|
||
This landed on Thu Oct 09 16:16:10 2008 -0700:
http://hg.mozilla.org/mozilla-central/pushloghtml?changeset=3fe2918df533
http://hg.mozilla.org/mozilla-central/rev/3fe2918df533
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•