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

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: 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 | « LayoutTests/accessibility/input-slider-change-value-by-percent-expected.txt ('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..6b6281ad409623bda294794dd02f0029379dfcfe 100644
--- a/Source/modules/accessibility/AXNodeObject.cpp
+++ b/Source/modules/accessibility/AXNodeObject.cpp
@@ -2081,8 +2081,12 @@ void AXNodeObject::changeValueByPercent(float percentChange)
{
float range = maxValueForRange() - minValueForRange();
float value = valueForRange();
+ float step = range * (percentChange / 100);
- value += range * (percentChange / 100);
dmazzoni 2015/04/09 15:11:24 i'm not sure I quite understand why this code didn
+ if (fabs(step) < 1)
+ step = percentChange > 0 ? 1 : -1;
+
+ value += step;
setValue(String::number(value));
axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged);
« no previous file with comments | « LayoutTests/accessibility/input-slider-change-value-by-percent-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698