Closed Bug 466288 Opened 16 years ago Closed 15 years ago

Make use of type="number" for textboxes representing integer preferences

Categories

(Calendar :: Preferences, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ssitter, Assigned: Fallen)

Details

Attachments

(1 file, 1 obsolete file)

We should use type="number" for textboxes representing integer preferences to benefit from automatic input check, range checks, spinbuttons, ...
https://developer.mozilla.org/En/XUL/Textbox#a-textbox.type
Attached patch fix (obsolete) — — Splinter Review
- uses type="number" on general, alarms and connection page
- limits event length and snooze time to 24 hours instead of just 999 minutes
- limits alarm offset to 32767 to avoid overflow similar to Bug 405650
Assignee: nobody → ssitter
Status: NEW → ASSIGNED
Attachment #349561 - Flags: review?(daniel.boelzle)
Stefan, I think, the function validateNaturalNums (http://mxr.mozilla.org/comm-central/source/calendar/base/content/calendar-ui-utils.js#594) should also be removed.
Comment on attachment 349561 [details] [diff] [review]
fix

Playing with the patch on Mac, my alarm prefs behave wrong, units toggle in a strange way.
Moreover I think validateNaturalNums() is obsolete then, you should remove it.
Attachment #349561 - Flags: review?(daniel.boelzle) → review-
Assignee: ssitter → nobody
Status: ASSIGNED → NEW
Attached patch Fix - v2 — — Splinter Review
This should do it. I went over all <textboxes>. I didn't set a max on the default event length, I don't see why the max should be 1440 (days). No doubt its unreasonable to make the default length that large, but why limit the user?
Assignee: nobody → philipp
Attachment #349561 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #383153 - Flags: review?(ssitter)
Comment on attachment 383153 [details] [diff] [review]
Fix - v2

The max attribute was set to prevent integer overflows as written above.

Daniel reviewed and denied the 1st patch, therefore he should review the 2nd too.
Attachment #383153 - Flags: review?(ssitter) → review?(dbo.moz)
Philipp, did you spend some testing on this patch?
Yes, I've briefly looked at all number textboxes. I tested at least one of them to see if the max/min range works.
Attachment #383153 - Flags: review?(dbo.moz) → review+
Comment on attachment 383153 [details] [diff] [review]
Fix - v2

r=dbo
Pushed to comm-central <http://hg.mozilla.org/comm-central/rev/08625567a7c7>

-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.0
These bugs are likely targeted at Lightning 1.0b1, not Lightning 1.0. If this change was done in error, please adjust the target milestone to its correct value. To filter on this bugspam, you can use "lightning-10-target-move".
Target Milestone: 1.0 → 1.0b1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: