Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1769)

Unified Diff: Source/modules/accessibility/AXNodeObject.cpp

Issue 1071873004: Changing slider values do not work properly when percent change of a step is less than one. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make some cleanup Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698