Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 2063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2074 RefPtr<AXObject> axElement = axObjectCache()->getOrCreate(element); | 2074 RefPtr<AXObject> axElement = axObjectCache()->getOrCreate(element); |
| 2075 textOrder.append(AccessibilityText(ariaLabeledBy, AlternativeText, a xElement)); | 2075 textOrder.append(AccessibilityText(ariaLabeledBy, AlternativeText, a xElement)); |
| 2076 } | 2076 } |
| 2077 } | 2077 } |
| 2078 } | 2078 } |
| 2079 | 2079 |
| 2080 void AXNodeObject::changeValueByPercent(float percentChange) | 2080 void AXNodeObject::changeValueByPercent(float percentChange) |
| 2081 { | 2081 { |
| 2082 float range = maxValueForRange() - minValueForRange(); | 2082 float range = maxValueForRange() - minValueForRange(); |
| 2083 float value = valueForRange(); | 2083 float value = valueForRange(); |
| 2084 float step = range * (percentChange / 100); | |
| 2084 | 2085 |
| 2085 value += range * (percentChange / 100); | 2086 if (fabs(step) < 1) |
|
dmazzoni
2015/04/09 15:11:24
i'm not sure I quite understand why this code didn
| |
| 2087 step = percentChange > 0 ? 1 : -1; | |
| 2088 | |
| 2089 value += step; | |
| 2086 setValue(String::number(value)); | 2090 setValue(String::number(value)); |
| 2087 | 2091 |
| 2088 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged) ; | 2092 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged) ; |
| 2089 } | 2093 } |
| 2090 | 2094 |
| 2091 } // namespace blink | 2095 } // namespace blink |
| OLD | NEW |