Index: Source/modules/accessibility/AXNodeObject.cpp |
diff --git a/Source/modules/accessibility/AXNodeObject.cpp b/Source/modules/accessibility/AXNodeObject.cpp |
index c9294b0ff1f2039b98b16582f4c5c83e50ccc39a..ce4cabe26e0c52f53deb9e9685afd7ccfbd925a9 100644 |
--- a/Source/modules/accessibility/AXNodeObject.cpp |
+++ b/Source/modules/accessibility/AXNodeObject.cpp |
@@ -128,10 +128,20 @@ void AXNodeObject::alterSliderValue(bool increase) |
if (roleValue() != SliderRole) |
return; |
- if (!getAttribute(stepAttr).isEmpty()) |
- changeValueByStep(increase); |
- else |
- changeValueByPercent(increase ? 5 : -5); |
+ float value = valueForRange(); |
+ float step = stepValueForRange(); |
dmazzoni
2015/04/10 17:14:28
It looks like stepValueForRange is implemented nai
|
+ |
+ if (getAttribute(stepAttr).isEmpty()) { |
+ const float percentChange = 5; |
+ float range = maxValueForRange() - minValueForRange(); |
+ step = range * (percentChange / 100); |
+ if (step < 1) |
+ step = 1; |
+ } |
+ |
+ value += increase ? step : -step; |
+ setValue(String::number(value)); |
+ axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged); |
} |
String AXNodeObject::ariaAccessibilityDescription() const |
@@ -155,18 +165,6 @@ void AXNodeObject::ariaLabeledByElements(WillBeHeapVector<RawPtrWillBeMember<Ele |
elementsFromAttribute(elements, aria_labelledbyAttr); |
} |
-void AXNodeObject::changeValueByStep(bool increase) |
-{ |
- float step = stepValueForRange(); |
- float value = valueForRange(); |
- |
- value += increase ? step : -step; |
- |
- setValue(String::number(value)); |
- |
- axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged); |
-} |
- |
bool AXNodeObject::computeAccessibilityIsIgnored() const |
{ |
#if ENABLE(ASSERT) |
@@ -2077,15 +2075,4 @@ void AXNodeObject::ariaLabeledByText(Vector<AccessibilityText>& textOrder) const |
} |
} |
-void AXNodeObject::changeValueByPercent(float percentChange) |
-{ |
- float range = maxValueForRange() - minValueForRange(); |
- float value = valueForRange(); |
- |
- value += range * (percentChange / 100); |
- setValue(String::number(value)); |
- |
- axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged); |
-} |
- |
} // namespace blink |