Can't drag <scale> thumb when |max| and |increment| are set to large values

NEW
Unassigned

Status

()

Toolkit
XUL Widgets
9 years ago
4 years ago

People

(Reporter: Dolske, Unassigned)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

9 years ago
When using a <scale> with large values set for |max| and |increment|, you can't drag the thumb with the mouse. EG:

<xul:scale increment="10000" max="30000"/>

The culprit is nsSliderFrame::SetCurrentThumbPosition()...

723   if (aMaySnap && mContent->AttrValueIs(...) {
725     // If snap="true", then the slider may only be set to min + (increment * x).
726     // Otherwise, the slider may be set to any positive integer.
727     PRInt32 increment = GetIncrement(aScrollbar);
728     realpos = NSToCoordRound(realpos / float(increment)) * increment;
729   }

"realpos" here seems to be a pixel count. The end result is that it's diving $smallnum by $largenum, and realpos ends up being 0.

Looks like there needs to be some additional logic here. Say, converting realpos into a percentage, computing which slot that is (incorporating min, max, and increment), and then snapping to that slot.

Found this while working on the videocontrols, but it's not blocking. I thought the |increment| only affected what the arrow keys did (as |pageIncrement| does for pgup/pgdn). I don't want the snapping when dragging, so leaving the attribute at its default value avoids both problems.
You need to log in before you can comment on or make changes to this bug.