Note: There are a few cases of duplicates in user autocompletion which are being worked on.

range regression, no thumb showing

RESOLVED FIXED

Status

Core Graveyard
XForms
RESOLVED FIXED
11 years ago
a year ago

People

(Reporter: aaronr, Assigned: Merle Sterling)

Tracking

({fixed1.8.0.12, fixed1.8.1.4})

Trunk
x86
Windows XP
fixed1.8.0.12, fixed1.8.1.4

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

1.56 KB, application/xhtml+xml
Details
2.06 KB, patch
aaronr
: review+
surkov
: review+
Details | Diff | Splinter Review
(Reporter)

Description

11 years ago
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.
(Reporter)

Comment 1

11 years ago
Created attachment 251224 [details]
testcase

this testcase should show a simple range with 5 steps from 10 to 50 with an initial value of 30.
(Assignee)

Updated

11 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 2

11 years ago
Created attachment 252515 [details] [diff] [review]
patch

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)
(Assignee)

Updated

11 years ago
Attachment #252515 - Flags: review?(surkov.alexander)
(Reporter)

Updated

11 years ago
Attachment #252515 - Flags: review?(aaronr) → review+

Updated

11 years ago
Attachment #252515 - Flags: review?(surkov.alexander) → review+
(Reporter)

Updated

11 years ago
Blocks: 353738
(Reporter)

Comment 3

11 years ago
checked into trunk for msterlin
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
(Reporter)

Comment 4

10 years ago
checked into 1.8 branch on 2007-04-12
checked into 1.8.0 branch on 2007-04-16
Keywords: fixed1.8.0.12, fixed1.8.1.4
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.