Closed
Bug 521246
Opened 15 years ago
Closed 15 years ago
use toolkit's numberbox and spinbuttons widgets
Categories
(Core Graveyard :: XForms, defect)
Core Graveyard
XForms
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: raphael.fairise.bugs, Assigned: sergeyreym)
References
Details
Attachments
(3 files, 1 obsolete file)
570 bytes,
patch
|
Details | Diff | Splinter Review | |
20.31 KB,
patch
|
surkov
:
review+
smaug
:
review+
|
Details | Diff | Splinter Review |
427 bytes,
application/xhtml+xml
|
Details |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090910 Ubuntu/9.04 (jaunty) Shiretoko/3.5.3
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4pre) Gecko/20090915 Thunderbird/3.0b4
Without XForms add-on, the value property of a XUL:textbox with type=number has string data type.
This is correct according to https://developer.mozilla.org/en/XUL/Property/Textbox.value
With XForms add-on installed, the data type of the value property of a XUL:textbox with type=number is changed to "number".
This breaks code where textbox's value is used as a string.
I've identified at least one case in Thunderbird:
Preferences->Composition->Addressing->Edit Directories->Add
"LDAP Directory Servers" window
The "port number" field is checked with a match() function that exists only with strings.
When using XForms add-on, an exception is thrown.
"Internal error in pref-directory-add.js:onAccept() TypeError: number.match is not a function"
I think that the issue is in xforms/resources/content/widgets-xul.xml
Code has been copied from mozilla/toolkit/content/widgets/numberbox.xml but, I don't know why, valueNumber property has disappeared and value property returns now a number.
Proposed patch following.
Reproducible: Always
Reporter | ||
Comment 1•15 years ago
|
||
Comment on attachment 405273 [details] [diff] [review]
Patch for textbox value
Alex, you know XUL the best, probably. Can you review the bug and the patch?
Attachment #405273 -
Flags: review?(surkov.alexander)
Comment 3•15 years ago
|
||
Gecko 1.9 has numberbox widget and xforms hg sources are targeted to the latest version of Gecko. Therefore we don't need to keep a copy of the widget in xforms any more. Please update the patch.
The bug is targeted to 1.9.1.3. Do you need the fix for builds prior to Gecko 1.9?
Updated•15 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•15 years ago
|
Assignee: nobody → raphael.fairise.bugs
Comment 4•15 years ago
|
||
(In reply to comment #3)
>
> The bug is targeted to 1.9.1.3. Do you need the fix for builds prior to Gecko
> 1.9?
Just reread the bug description, and it seems you don't need since it hasn't known affects to xforms processor. The problem is we replace toolkit's textbox@type="number" widget on xforms one.
Reporter | ||
Comment 5•15 years ago
|
||
(In reply to comment #3)
> Gecko 1.9 has numberbox widget and xforms hg sources are targeted to the latest
> version of Gecko. Therefore we don't need to keep a copy of the widget in
> xforms any more. Please update the patch.
I'm not sure to understand what you expect.
> The bug is targeted to 1.9.1.3. Do you need the fix for builds prior to Gecko
> 1.9?
Yes. Same problem with FF 2.0.0.20 + XForms 0.8.6ff2.
textbox@type="number" XUL widget is modified by XForms add-on.
Comment 6•15 years ago
|
||
(In reply to comment #5)
> (In reply to comment #3)
> > Gecko 1.9 has numberbox widget and xforms hg sources are targeted to the latest
> > version of Gecko. Therefore we don't need to keep a copy of the widget in
> > xforms any more. Please update the patch.
>
> I'm not sure to understand what you expect.
I think all you should do is to remove xforms version of numberbox widget entirerly.
> > The bug is targeted to 1.9.1.3. Do you need the fix for builds prior to Gecko
> > 1.9?
>
> Yes. Same problem with FF 2.0.0.20 + XForms 0.8.6ff2.
> textbox@type="number" XUL widget is modified by XForms add-on.
That's interesting because I thought numberbox was introduced a bit later than Firefox 2.0 (which is based on Gecko 1.8 iirc).
Attachment #405273 -
Flags: review?(surkov.alexander) → review+
Attachment #405273 -
Flags: review+ → review?(surkov.alexander)
Comment on attachment 405273 [details] [diff] [review]
Patch for textbox value
Sorry, accidentally marked this as approved. Re-asking for review from Alex.
Comment 8•15 years ago
|
||
Somebody should update the patch to remove numberbox widget completely from XForms extension.
Comment 9•15 years ago
|
||
Sergey, can you look at this as well?
Assignee | ||
Comment 10•15 years ago
|
||
I made patch for that. Also I don't know who can review this patch except Alexand Surkov.
Attachment #410780 -
Flags: review?(surkov.alexander)
Comment 11•15 years ago
|
||
Thank you for the patch. It sounds you can remove spinbuttons binding too. How did you test it?
Comment 12•15 years ago
|
||
Sergey, some tests for spinbuttons you can find in bug 353880
Assignee | ||
Comment 13•15 years ago
|
||
I've removed spinbutton and numberbox.
Also for testing I add lines to xforms.css (else my test doesn't work):
html|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#integer"],
html|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#int"],
...
Is it correct?
Attachment #410780 -
Attachment is obsolete: true
Attachment #413527 -
Flags: review?(surkov.alexander)
Attachment #410780 -
Flags: review?(surkov.alexander)
Assignee | ||
Comment 14•15 years ago
|
||
This test I use for patch.
Also I've catch new bug. Value in <data2> sets in <xf:input> but when I change it by spinbuttons it become 1 or -1. It looks like that numberbox or spinbutton internal value are 0 (zero).
Assignee | ||
Updated•15 years ago
|
Attachment #413527 -
Flags: review?(Olli.Pettay)
Updated•15 years ago
|
Attachment #413527 -
Flags: review?(Olli.Pettay) → review+
Comment 15•15 years ago
|
||
(In reply to comment #14)
> Also I've catch new bug. Value in <data2> sets in <xf:input> but when I change
> it by spinbuttons it become 1 or -1. It looks like that numberbox or spinbutton
> internal value are 0 (zero).
Please file new bug for this.
Updated•15 years ago
|
Attachment #405273 -
Flags: review?(surkov.alexander)
Comment 16•15 years ago
|
||
reassigning to Sergey since he works on it currently.
Assignee: raphael.fairise.bugs → sergeyreym
Status: NEW → ASSIGNED
Comment 17•15 years ago
|
||
Comment on attachment 413527 [details] [diff] [review]
remove numberbox and spinbutton
thanks, nice work.
Attachment #413527 -
Flags: review?(surkov.alexander) → review+
Comment 18•15 years ago
|
||
changing a summary to better reflect the bug
Summary: value of a XUL:textbox with type=number should be a string → use toolkit's numberbox and spinbuttons widgets
Comment 19•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•