Closed Bug 366743 Opened 18 years ago Closed 18 years ago

range regression, no thumb showing

Categories

(Core Graveyard :: XForms, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aaronr, Assigned: msterlin)

References

Details

(Keywords: fixed1.8.0.12, fixed1.8.1.4)

Attachments

(2 files)

Range thumb doesn't paint on the slider in this very simple range testcase.  Debugging, I see an error in the error console:

Error: [Exception... "An invalid or illegal string was specified"  code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)"  location: "chrome://xforms/content/widgets-xhtml.xml Line: 552"]
Source File: chrome://xforms/content/widgets-xhtml.xml
Line: 552

this is the JS call stack that I get running up to where we are setting the slider's value to an invalid value:

Hit JavaScript "debugger" keyword. JS call stack...
0 set_value(val = NaN) ["chrome://xforms/content/widgets-xhtml.xml":341]
    value = 10
    boxobj = [object Object]
    this = [object HTMLSpanElement @ 0x5015258 (native @ 0x4feabe0)]
1 setStep(aValue = 10, aRefresh = true) ["chrome://xforms/content/widgets-xhtml.
xml":419]
    this = [object HTMLSpanElement @ 0x5015258 (native @ 0x4feabe0)]
2 set_step(val = 10) ["chrome://xforms/content/widgets-xhtml.xml":0]
    this = [object HTMLSpanElement @ 0x5015258 (native @ 0x4feabe0)]
3 set_step(val = 10) ["chrome://xforms/content/range.xml":0]
    this = [object Element @ 0x4fea9b0 (native @ 0x47518d8)]
4 adjustRangeValues(aStart = 10, aEnd = 50, aStep = 10) ["chrome://xforms/conten
t/range.xml":271]
    this = [object Element @ 0x4fea9b0 (native @ 0x47518d8)]
5 refresh() ["chrome://xforms/content/range.xml":69]
    value = undefined
    inrange = undefined
    this = [object Element @ 0x4fea9b0 (native @ 0x47518d8)]
6 [native frame]
7 anonymous(aDelegate = [object Element @ 0x4fea9b0 (native @ 0x47518d8)], 5) ["
chrome://xforms/content/range-xhtml.xml":93]
    this = [object Window @ 0x4731ec0 (native @ 0x472d58c)]
8 [native frame]

The problem seems to be that refresh calls adjustRangeValues which will end up trying to do stuff with the slider's value and end up trying to set the slider's value property with an invalid value which will call eraseSlider with an invalid value.  This will get passed to Canvas's clearRect method which generates the error in the error console.

The call to erase slider is protected by isNaN(value), but it doesn't make any test for isNaN(this.value) which is what is passed to eraseSlider.  That is probably the bug.  But I'd like Merle to look at this since he set up a lot of this code in range/slider.  Please make sure that my guess is right.
Attached file testcase
this testcase should show a simple range with 5 steps from 10 to 50 with an initial value of 30.
Status: NEW → ASSIGNED
Attached patch patchSplinter Review
Need to check !isNaN(this.value) instead of !isNaN(value) in value setter of slider; also fix incorrect isInRange method in range.xml.
Attachment #252515 - Flags: review?(aaronr)
Attachment #252515 - Flags: review?(surkov.alexander)
Attachment #252515 - Flags: review?(aaronr) → review+
Attachment #252515 - Flags: review?(surkov.alexander) → review+
Blocks: 353738
checked into trunk for msterlin
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
checked into 1.8 branch on 2007-04-12
checked into 1.8.0 branch on 2007-04-16
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: