Changeset 208159 in webkit


Ignore:
Timestamp:
Oct 31, 2016 10:18:19 AM (7 years ago)
Author:
n_wang@apple.com
Message:

AX: iOS Voiceover does not announce previously selected value from input type="date" form field
https://bugs.webkit.org/show_bug.cgi?id=164176

Reviewed by Chris Fleizach.

Source/WebCore:

Input type date is a popup button on iOS and its value was not exposed in stringValue() since
it's not considered a text control. Instead, the value was exposed in AXTitle. Fixed this by adding
the case in stringValue() and removing the AXTitle exposure.

Changes are covered in modified test.

  • accessibility/AccessibilityObject.h:
  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::stringValue):

  • accessibility/ios/AccessibilityObjectIOS.mm:

(WebCore::AccessibilityObject::isInputTypePopupButton):

  • accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:

(-[WebAccessibilityObjectWrapper accessibilityLabel]):

LayoutTests:

  • accessibility/ios-simulator/input-type-time-expected.txt:
  • accessibility/ios-simulator/input-type-time.html:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r208150 r208159  
     12016-10-31  Nan Wang  <n_wang@apple.com>
     2
     3        AX: iOS Voiceover does not announce previously selected value from input type="date" form field
     4        https://bugs.webkit.org/show_bug.cgi?id=164176
     5
     6        Reviewed by Chris Fleizach.
     7
     8        * accessibility/ios-simulator/input-type-time-expected.txt:
     9        * accessibility/ios-simulator/input-type-time.html:
     10
    1112016-10-31  Jer Noble  <jer.noble@apple.com>
    212
  • trunk/LayoutTests/accessibility/ios-simulator/input-type-time-expected.txt

    r192173 r208159  
    1 
     1 
    22This tests that input type: time is accessible on iOS.
    33
     
    77PASS timeinput.description is 'AXLabel: (Between: 07:00 AM-09:00 AM)'
    88PASS timeinput.isIgnored is false
     9PASS timeinput.stringValue is 'AXValue: 8:00 AM'
     10PASS timeinput2.description is 'AXLabel: '
     11PASS timeinput2.stringValue is 'AXValue: 8:00 AM'
    912PASS successfullyParsed is true
    1013
  • trunk/LayoutTests/accessibility/ios-simulator/input-type-time.html

    r192173 r208159  
    99<body id="body">
    1010
    11 <input id="timeinput" type="time" aria-label="(Between: 07:00 AM-09:00 AM)" min="07:00" max="09:00" step="300" placeholder="00:00 AM">
     11<input id="timeinput" type="time" aria-label="(Between: 07:00 AM-09:00 AM)" min="07:00" max="09:00" step="300" placeholder="00:00 AM" value="08:00">
     12<input id="timeinput2" type="time" min="07:00" max="09:00" step="300" value="08:00">
    1213
    1314<p id="description"></p>
     
    2122
    2223        var timeinput = accessibilityController.accessibleElementById("timeinput");
     24        var timeinput2 = accessibilityController.accessibleElementById("timeinput2");
    2325        shouldBe("timeinput.description", "'AXLabel: (Between: 07:00 AM-09:00 AM)'");
    2426        shouldBeFalse("timeinput.isIgnored");
     27       
     28        // Test value is exposed in AXValue.
     29        shouldBe("timeinput.stringValue", "'AXValue: 8:00 AM'");
     30        shouldBe("timeinput2.description", "'AXLabel: '");
     31        shouldBe("timeinput2.stringValue", "'AXValue: 8:00 AM'");
    2532    }
    2633
  • trunk/Source/WebCore/ChangeLog

    r208158 r208159  
     12016-10-31  Nan Wang  <n_wang@apple.com>
     2
     3        AX: iOS Voiceover does not announce previously selected value from input type="date" form field
     4        https://bugs.webkit.org/show_bug.cgi?id=164176
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Input type date is a popup button on iOS and its value was not exposed in stringValue() since
     9        it's not considered a text control. Instead, the value was exposed in AXTitle. Fixed this by adding
     10        the case in stringValue() and removing the AXTitle exposure.
     11
     12        Changes are covered in modified test.
     13
     14        * accessibility/AccessibilityObject.h:
     15        * accessibility/AccessibilityRenderObject.cpp:
     16        (WebCore::AccessibilityRenderObject::stringValue):
     17        * accessibility/ios/AccessibilityObjectIOS.mm:
     18        (WebCore::AccessibilityObject::isInputTypePopupButton):
     19        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
     20        (-[WebAccessibilityObjectWrapper accessibilityLabel]):
     21
    1222016-10-31  Simon Fraser  <simon.fraser@apple.com>
    223
  • trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r208112 r208159  
    10431043    int accessibilityPasswordFieldLength();
    10441044    bool hasTouchEventListener() const;
     1045    bool isInputTypePopupButton() const;
    10451046#endif
    10461047   
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r208112 r208159  
    777777        return text();
    778778   
     779#if PLATFORM(IOS)
     780    if (isInputTypePopupButton())
     781        return textUnderElement();
     782#endif
     783   
    779784    if (is<RenderFileUploadControl>(*m_renderer))
    780785        return downcast<RenderFileUploadControl>(*m_renderer).fileTextValue();
  • trunk/Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm

    r203955 r208159  
    9191    return false;
    9292}
     93   
     94bool AccessibilityObject::isInputTypePopupButton() const
     95{
     96    if (is<HTMLInputElement>(node()))
     97        return roleValue() == PopUpButtonRole;
     98    return false;
     99}
    93100
    94101} // WebCore
  • trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm

    r207583 r208159  
    998998    NSString *axDescription = [self baseAccessibilityDescription];
    999999    NSString *landmarkDescription = [self ariaLandmarkRoleDescription];
     1000   
     1001    // We should expose the value of the input type date or time through AXValue instead of AXTitle.
     1002    if (m_object->isInputTypePopupButton() && [axTitle isEqualToString:[self accessibilityValue]])
     1003        axTitle = nil;
    10001004
    10011005    // Footer is not considered a landmark, but we want the role description.
Note: See TracChangeset for help on using the changeset viewer.