Closed
Bug 299580
Opened 19 years ago
Closed 19 years ago
Cannot enter 8 or 9 into the history "days" box
Categories
(Firefox :: Settings UI, defect)
Firefox
Settings UI
Tracking
()
RESOLVED
FIXED
Firefox1.5
People
(Reporter: BlindWolf8, Assigned: bugs.caleb)
References
Details
Attachments
(1 file, 3 obsolete files)
|
902 bytes,
patch
|
mconnor
:
review+
shaver
:
approval-aviary1.1a2+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050703 Firefox/1.0+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050703 Firefox/1.0+ I cannot seem to enter 8 or 9 into the "Days to keep history" box without highlighting the entire number in the box and pushing Backspace. Pushing backspace all the way automatically enters a 0 (zero) in the box. Entering other numbers (1-7) when the zero is present yields the expected result (replacing the zero with the number), however, when evering an 8 or 9, the field acts as if the number is going to be entered by displaying it for a split second (such as "08" or "09"), but then erases it, as if the Backspace key had been pushed. **Note: this only happens when the caret is to the right of the 0 and entering a number. Numbers such as "80" and "90" appear fine.** Reproducible: Always Steps to Reproduce: 1. Open up DPa1 2. Go to Tools -> Options... -> Privacy -> History 3. Try and enter "08" or "09" in the box 4. See the wacky bug Actual Results: Went to Bugzilla and reported this bug Expected Results: "8" or "9" should have been entered into the box Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050703 Firefox/1.0+ ID:2005070312 Zip build Default theme Default extensions Default profile
| Reporter | ||
Updated•19 years ago
|
Severity: normal → major
Comment 1•19 years ago
|
||
WFM Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b2) Gecko/20050624 Firefox/1.0+
Comment 2•19 years ago
|
||
and... another with a new build WFM Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b2) Gecko/20050703 Firefox/1.0+
Comment 3•19 years ago
|
||
Confirmed Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050630 Firefox/1.0+ ID:2005063006 entering 08 and 09 into the box reverts the number to 0.
| Reporter | ||
Comment 4•19 years ago
|
||
I can reproduce this on: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050703 Firefox/1.0+ ID:2005070317 Build from: http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/pacifica-trunk/firefox-1.0+.en-US.win32.zip Default theme/extensions Clean profile
Comment 6•19 years ago
|
||
I can confirm this: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050703 Firefox/1.0+ ID:2005070306
| Reporter | ||
Comment 7•19 years ago
|
||
Anyone know any Mac OS testers to see if this is a true Windows-only bug?
I think this probably belongs to Firefox/Preferences.
Status: UNCONFIRMED → NEW
Component: History → Preferences
Ever confirmed: true
Comment 9•19 years ago
|
||
I think this is because
parseInt("08") = 0
(08 looks like an octal number, incorrect, so the value is 0)
should use parseInt("08",10) to enforce parsing as decimal.
References:
http://developer-test.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Functions:parseInt#Description
* If the input string begins with "0", the radix is eight (octal). This feature
is deprecated.
Comment 10•19 years ago
|
||
located at http://lxr.mozilla.org/mozilla/source/toolkit/content/widgets/preferences.xml#370 (becomes firefox/chrome/toolkit.jar/content/global/bindings/preferences.xml after compilation) - return value != "" ? parseInt(value) : 0; + return value != "" ? parseInt(value, 10) : 0; (i can't make a patch, because i don't have the sources, :-) ) Ben review ?
| Assignee | ||
Comment 12•19 years ago
|
||
(In reply to comment #9) > I think this is because > parseInt("08") = 0 > (08 looks like an octal number, incorrect, so the value is 0) > > should use parseInt("08",10) to enforce parsing as decimal. > > * If the input string begins with "0", the radix is eight (octal). This feature > is deprecated. Nice catch Mathieu! The line that is supposed to be modified is this: http://lxr.mozilla.org/seamonkey/source/toolkit/content/widgets/preferences.xml#370 The problem is, that would kinda affect anyone using the preferences (so people who MAY want to store hex values will get their values converted to decimals or NaN).
| Assignee | ||
Comment 13•19 years ago
|
||
This will check if the value string starts with "0x" (a hexadecimal) and attempt to return a hexadecimal parsed int, otherwise we think it's a decimal, so we force the conversion.
Attachment #188186 -
Flags: review?(mconnor)
Comment 14•19 years ago
|
||
Comment on attachment 188186 [details] [diff] [review] patch v1.0 The third |return| statement will never happen...
Attachment #188186 -
Flags: review?(mconnor) → review-
| Assignee | ||
Comment 15•19 years ago
|
||
(In reply to comment #14) > (From update of attachment 188186 [details] [diff] [review] [edit]) > The third |return| statement will never happen... > Argh, that one accidently sneaked in.. should have been removed. Updated patch coming!
| Assignee | ||
Comment 16•19 years ago
|
||
Without the extra line...
Assignee: nobody → bugs.caleb
Attachment #188186 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #188188 -
Flags: review?(mconnor)
Comment 17•19 years ago
|
||
Comment on attachment 188188 [details] [diff] [review] patch v1.1 this still has |else| after |return|.
| Assignee | ||
Comment 18•19 years ago
|
||
If this doesn't do it, I'm going to roll over and die :P
Attachment #188188 -
Attachment is obsolete: true
Attachment #188191 -
Flags: review?(mconnor)
Attachment #188188 -
Flags: review?(mconnor)
Comment 20•19 years ago
|
||
I think my 'inline' patch do the thing: - return value != "" ? parseInt(value) : 0; + return value != "" ? parseInt(value, 10) : 0; because 0x... numbers are converted to 0 when typing x. Example (browser.preferences.instantApply= true): if you type 0xA => 0 because it will do step by step: 0 => 0 0x => 0 0xA = 0A => 0 So the current version doesn't work with hexa values (only if you paste the complete value)
Comment 21•19 years ago
|
||
Comment on attachment 188191 [details] [diff] [review] patch v1.2 > switch (this.type) { > case "int": >- return value != "" ? parseInt(value) : 0; >+ if (value != "") { >+ // work around the fact that parseInt (in JS 1.5) converts >+ // ints starting with "08" to octal >+ return value.substring(1, 2) == "0x" ? parseInt(value, 16) : parseInt(value, 10); >+ } why do we care about hex values? and why is hex ok but real octal isn't? don't overthink this stuff, just add the second arg to force it to base ten.
Attachment #188191 -
Flags: review?(mconnor) → review-
| Reporter | ||
Comment 22•19 years ago
|
||
This does not seem to happen when browser.preferences.instantApply is set to true. When entering 8 or 9 in the box then, the 0 becomes 08 or 09 (NOT 8 or 9 as it should be). Testing using: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050704 Firefox/1.0+ ID:2005070405
| Reporter | ||
Comment 23•19 years ago
|
||
Why don't you guys look at the code for entering the amount of disk space to use for cache? This bug doesn't happen there.
| Assignee | ||
Comment 24•19 years ago
|
||
No more funny shtuff, as per request.
Attachment #188191 -
Attachment is obsolete: true
Attachment #188280 -
Flags: review?(mconnor)
Updated•19 years ago
|
Attachment #188280 -
Flags: review?(mconnor) → review+
| Assignee | ||
Comment 25•19 years ago
|
||
Comment on attachment 188280 [details] [diff] [review] patch vI.III Requesting approval for this very small patch.
Attachment #188280 -
Flags: approval-aviary1.1a2?
Comment 26•19 years ago
|
||
Comment on attachment 188280 [details] [diff] [review] patch vI.III a=shaver.
Attachment #188280 -
Flags: approval-aviary1.1a2? → approval-aviary1.1a2+
Comment 27•19 years ago
|
||
Checking in preferences.xml; /cvsroot/mozilla/toolkit/content/widgets/preferences.xml,v <-- preferences.xml new revision: 1.23; previous revision: 1.22 done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
OS: Windows XP → All
Hardware: PC → All
Resolution: --- → FIXED
Target Milestone: --- → Firefox1.1
You need to log in
before you can comment on or make changes to this bug.
Description
•