Last Comment Bug 366743 - range regression, no thumb showing
: range regression, no thumb showing
: fixed1.8.0.12, fixed1.8.1.4
Product: Core Graveyard
Classification: Graveyard
Component: XForms (show other bugs)
: Trunk
: x86 Windows XP
-- normal (vote)
: ---
Assigned To: Merle Sterling
: Stephen Pride
Depends on:
Blocks: 353738
  Show dependency treegraph
Reported: 2007-01-11 15:26 PST by aaronr
Modified: 2016-07-15 14:46 PDT (History)
1 user (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---

testcase (1.56 KB, application/xhtml+xml)
2007-01-11 15:31 PST, aaronr
no flags Details
patch (2.06 KB, patch)
2007-01-23 13:26 PST, Merle Sterling
aaronr: review+
surkov.alexander: review+
Details | Diff | Splinter Review

Description User image aaronr 2007-01-11 15:26:04 PST
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.
    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
    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) ["
    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.
Comment 1 User image aaronr 2007-01-11 15:31:43 PST
Created attachment 251224 [details]

this testcase should show a simple range with 5 steps from 10 to 50 with an initial value of 30.
Comment 2 User image Merle Sterling 2007-01-23 13:26:30 PST
Created attachment 252515 [details] [diff] [review]

Need to check !isNaN(this.value) instead of !isNaN(value) in value setter of slider; also fix incorrect isInRange method in range.xml.
Comment 3 User image aaronr 2007-01-29 13:42:58 PST
checked into trunk for msterlin
Comment 4 User image aaronr 2007-04-23 16:01:36 PDT
checked into 1.8 branch on 2007-04-12
checked into 1.8.0 branch on 2007-04-16

Note You need to log in before you can comment on or make changes to this bug.