Changeset 207035 in webkit


Ignore:
Timestamp:
Oct 10, 2016 5:11:40 PM (8 years ago)
Author:
n_wang@apple.com
Message:

AX: Expose invalid status for input types with that information
https://bugs.webkit.org/show_bug.cgi?id=163252
<rdar://problem/28704409>

Reviewed by Chris Fleizach.

Source/WebCore:

For input types with invalid input value, we should expose the invalid
status to the assitive technology.

Test: accessibility/mac/invalid-status-for-input-types.html

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::invalidStatus):

LayoutTests:

  • accessibility/mac/invalid-status-for-input-types-expected.txt: Added.
  • accessibility/mac/invalid-status-for-input-types.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r207032 r207035  
     12016-10-10  Nan Wang  <n_wang@apple.com>
     2
     3        AX: Expose invalid status for input types with that information
     4        https://bugs.webkit.org/show_bug.cgi?id=163252
     5        <rdar://problem/28704409>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        * accessibility/mac/invalid-status-for-input-types-expected.txt: Added.
     10        * accessibility/mac/invalid-status-for-input-types.html: Added.
     11
    1122016-10-10  Ryan Haddad  <ryanhaddad@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r207034 r207035  
     12016-10-10  Nan Wang  <n_wang@apple.com>
     2
     3        AX: Expose invalid status for input types with that information
     4        https://bugs.webkit.org/show_bug.cgi?id=163252
     5        <rdar://problem/28704409>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        For input types with invalid input value, we should expose the invalid
     10        status to the assitive technology.
     11
     12        Test: accessibility/mac/invalid-status-for-input-types.html
     13
     14        * accessibility/AccessibilityObject.cpp:
     15        (WebCore::AccessibilityObject::invalidStatus):
     16
    1172016-10-10  Konstantin Tokarev  <annulen@yandex.ru>
    218
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r207014 r207035  
    19101910    String ariaInvalid = stripLeadingAndTrailingHTMLSpaces(getAttribute(aria_invalidAttr));
    19111911   
     1912    if (ariaInvalid.isEmpty()) {
     1913        // We should expose invalid status for input types.
     1914        Node* node = this->node();
     1915        if (node && is<HTMLInputElement>(*node)) {
     1916            HTMLInputElement& input = downcast<HTMLInputElement>(*node);
     1917            if (input.hasBadInput() || input.typeMismatch())
     1918                return trueValue;
     1919        }
     1920        return falseValue;
     1921    }
     1922   
    19121923    // If "false", "undefined" [sic, string value], empty, or missing, return "false".
    1913     if (ariaInvalid.isEmpty() || ariaInvalid == falseValue || ariaInvalid == undefinedValue)
     1924    if (ariaInvalid == falseValue || ariaInvalid == undefinedValue)
    19141925        return falseValue;
    19151926    // Besides true/false/undefined, the only tokens defined by WAI-ARIA 1.0...
Note: See TracChangeset for help on using the changeset viewer.