Changeset 162587 in webkit


Ignore:
Timestamp:
Jan 22, 2014 8:12:53 PM (10 years ago)
Author:
Samuel White
Message:

AX: Can't always increment web sliders.
https://bugs.webkit.org/show_bug.cgi?id=127451

Reviewed by Chris Fleizach.

Source/WebCore:

Clamping the decrement/increment amount to one when necessary (if a percent change would result in a change of less than one).

Test: accessibility/range-alter-by-percent.html

  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::changeValueByPercent):

LayoutTests:

Adding range-alter-by-percent.html to compliment the existing range-alter-by-step.html test.

  • accessibility/range-alter-by-percent-expected.txt: Added.
  • accessibility/range-alter-by-percent.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r162576 r162587  
     12014-01-22  Samuel White  <samuel_white@apple.com>
     2
     3        AX: Can't always increment web sliders.
     4        https://bugs.webkit.org/show_bug.cgi?id=127451
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Adding range-alter-by-percent.html to compliment the existing range-alter-by-step.html test.
     9
     10        * accessibility/range-alter-by-percent-expected.txt: Added.
     11        * accessibility/range-alter-by-percent.html: Added.
     12
    1132014-01-22  Chris Fleizach  <cfleizach@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r162579 r162587  
     12014-01-22  Samuel White  <samuel_white@apple.com>
     2
     3        AX: Can't always increment web sliders.
     4        https://bugs.webkit.org/show_bug.cgi?id=127451
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Clamping the decrement/increment amount to one when necessary (if a percent change would result in a change of less than one).
     9
     10        Test: accessibility/range-alter-by-percent.html
     11
     12        * accessibility/AccessibilityNodeObject.cpp:
     13        (WebCore::AccessibilityNodeObject::changeValueByPercent):
     14
    1152014-01-22  Myles C. Maxfield  <mmaxfield@apple.com>
    216
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp

    r162576 r162587  
    10971097{
    10981098    float range = maxValueForRange() - minValueForRange();
     1099    float step = range * (percentChange / 100);
    10991100    float value = valueForRange();
    11001101
    1101     value += range * (percentChange / 100);
     1102    // Make sure the specified percent will cause a change of one integer step or larger.
     1103    if (fabs(step) < 1)
     1104        step = fabs(percentChange) * (1 / percentChange);
     1105
     1106    value += step;
    11021107    setValue(String::number(value));
    11031108
Note: See TracChangeset for help on using the changeset viewer.