summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/shadow/SliderThumbElement.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-25 15:09:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-25 15:09:11 +0200
commita89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (patch)
treeb7abd9f49ae1d4d2e426a5883bfccd42b8e2ee12 /Source/WebCore/html/shadow/SliderThumbElement.cpp
parent8d473cf9743f1d30a16a27114e93bd5af5648d23 (diff)
downloadqtwebkit-a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd.tar.gz
Imported WebKit commit eb5c1b8fe4d4b1b90b5137433fc58a91da0e6878 (http://svn.webkit.org/repository/webkit/trunk@118516)
Diffstat (limited to 'Source/WebCore/html/shadow/SliderThumbElement.cpp')
-rw-r--r--Source/WebCore/html/shadow/SliderThumbElement.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/WebCore/html/shadow/SliderThumbElement.cpp b/Source/WebCore/html/shadow/SliderThumbElement.cpp
index 7f1f1d5c0..8422a3019 100644
--- a/Source/WebCore/html/shadow/SliderThumbElement.cpp
+++ b/Source/WebCore/html/shadow/SliderThumbElement.cpp
@@ -53,8 +53,9 @@ namespace WebCore {
inline static double sliderPosition(HTMLInputElement* element)
{
- StepRange range(element);
- return range.proportionFromValue(range.valueFromElement(element));
+ const StepRange stepRange(element->createStepRange(RejectAny));
+ const double oldValue = parseToDoubleForNumberType(element->value(), stepRange.defaultValue());
+ return stepRange.proportionFromValue(stepRange.clampValue(oldValue));
}
inline static bool hasVerticalAppearance(HTMLInputElement* input)
@@ -235,11 +236,11 @@ void SliderThumbElement::setPositionFromPoint(const LayoutPoint& point)
if (position == currentPosition)
return;
- StepRange range(input);
double fraction = static_cast<double>(position) / trackSize;
if (isVertical || !renderBox()->style()->isLeftToRightDirection())
fraction = 1 - fraction;
- double value = range.clampValue(range.valueFromProportion(fraction));
+ StepRange stepRange(input->createStepRange(RejectAny));
+ double value = stepRange.clampValue(stepRange.valueFromProportion(fraction));
// FIXME: This is no longer being set from renderer. Consider updating the method name.
input->setValueFromRenderer(serializeForNumberType(value));