⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 185828 in webkit


Ignore:
Timestamp:
Jun 22, 2015, 9:17:04 AM (11 years ago)
Author:
dbates@webkit.org
Message:

AX: UI Automation cannot find AutoFill or search cancel buttons
https://bugs.webkit.org/show_bug.cgi?id=145241
<rdar://problem/21051411>

Reviewed by Chris Fleizach.

Source/WebCore:

Add support for hit testing the search cancel button and AutoFill button so that
they can be accessed by UI Automation.

Currently the accessibility hit test machinery ignores nodes in a shadow tree.
So, it neither finds the <input type="search"> cancel button nor the AutoFill button
when it performs a hit test. Therefore these buttons cannot be accessed using
UI Automation.

Tests: accessibility/hit-test-input-auto-fill-button.html

accessibility/hit-test-input-search-cancel-button.html
accessibility/input-search-cancel-button.html

  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::accessibilityTextFieldDecorationHitTest): Added; returns
the AccessibilityObject for the search cancel button or AutoFill text field decoration as applicable.
(WebCore::AccessibilityRenderObject::accessibilityHitTest): Check whether the hit node
is a text field decoration.

LayoutTests:

Add tests to ensure that there exists an accessibility element for the
search cancel button and that it can be hit using a cursor position. Also
add a test to ensue that the AutoFill button can be hit using a cursor position.

  • accessibility/hit-test-input-auto-fill-button-expected.txt: Added.
  • accessibility/hit-test-input-auto-fill-button.html: Copied from LayoutTests/accessibility/input-auto-fill-button.html.
  • accessibility/hit-test-input-search-cancel-button-expected.txt: Added.
  • accessibility/hit-test-input-search-cancel-button.html: Added.
  • accessibility/input-search-cancel-button-expected.txt: Added.
  • accessibility/input-search-cancel-button.html: Copied from LayoutTests/accessibility/input-auto-fill-button.html.
  • accessibility/resources/shouldBeAccessibleByCursor.js: Added.

(shouldBeAccessibleByCursor): Tests whether an AccessibilityUIElement can be hit
using its screen position.

  • platform/wk2/TestExpectations: Mark tests hit-test-input-{auto-fill, search-cancel}-button.html

as failing due to <https://bugs.webkit.org/show_bug.cgi?id=71298>.

Location:
trunk
Files:
7 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r185826 r185828  
     12015-06-22  Daniel Bates  <dabates@apple.com>
     2
     3        AX: UI Automation cannot find AutoFill or search cancel buttons
     4        https://bugs.webkit.org/show_bug.cgi?id=145241
     5        <rdar://problem/21051411>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        Add tests to ensure that there exists an accessibility element for the
     10        search cancel button and that it can be hit using a cursor position. Also
     11        add a test to ensue that the AutoFill button can be hit using a cursor position.
     12
     13        * accessibility/hit-test-input-auto-fill-button-expected.txt: Added.
     14        * accessibility/hit-test-input-auto-fill-button.html: Copied from LayoutTests/accessibility/input-auto-fill-button.html.
     15        * accessibility/hit-test-input-search-cancel-button-expected.txt: Added.
     16        * accessibility/hit-test-input-search-cancel-button.html: Added.
     17        * accessibility/input-search-cancel-button-expected.txt: Added.
     18        * accessibility/input-search-cancel-button.html: Copied from LayoutTests/accessibility/input-auto-fill-button.html.
     19        * accessibility/resources/shouldBeAccessibleByCursor.js: Added.
     20        (shouldBeAccessibleByCursor): Tests whether an AccessibilityUIElement can be hit
     21        using its screen position.
     22        * platform/wk2/TestExpectations: Mark tests hit-test-input-{auto-fill, search-cancel}-button.html
     23        as failing due to <https://bugs.webkit.org/show_bug.cgi?id=71298>.
     24
    1252015-06-22  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
    226
  • trunk/LayoutTests/platform/wk2/TestExpectations

    r185322 r185828  
    4747
    4848# AX tests that require hit testing do not work in WK2.
     49webkit.org/b/71298 accessibility/hit-test-input-auto-fill-button.html
     50webkit.org/b/71298 accessibility/hit-test-input-search-cancel-button.html
    4951webkit.org/b/71298 accessibility/loading-iframe-updates-axtree.html
    5052webkit.org/b/71298 platform/mac/accessibility/html-slider-indicator.html
  • trunk/Source/WebCore/ChangeLog

    r185826 r185828  
     12015-06-22  Daniel Bates  <dabates@apple.com>
     2
     3        AX: UI Automation cannot find AutoFill or search cancel buttons
     4        https://bugs.webkit.org/show_bug.cgi?id=145241
     5        <rdar://problem/21051411>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        Add support for hit testing the search cancel button and AutoFill button so that
     10        they can be accessed by UI Automation.
     11
     12        Currently the accessibility hit test machinery ignores nodes in a shadow tree.
     13        So, it neither finds the <input type="search"> cancel button nor the AutoFill button
     14        when it performs a hit test. Therefore these buttons cannot be accessed using
     15        UI Automation.
     16
     17        Tests: accessibility/hit-test-input-auto-fill-button.html
     18               accessibility/hit-test-input-search-cancel-button.html
     19               accessibility/input-search-cancel-button.html
     20
     21        * accessibility/AccessibilityRenderObject.cpp:
     22        (WebCore::AccessibilityRenderObject::accessibilityTextFieldDecorationHitTest): Added; returns
     23        the AccessibilityObject for the search cancel button or AutoFill text field decoration as applicable.
     24        (WebCore::AccessibilityRenderObject::accessibilityHitTest): Check whether the hit node
     25        is a text field decoration.
     26
    1272015-06-22  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
    228
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r185558 r185828  
    21962196}
    21972197
     2198AccessibilityObject* AccessibilityRenderObject::accessibilityTextFieldDecorationHitTest(const HTMLInputElement& inputElement, const Node& decoration) const
     2199{
     2200    if (inputElement.autoFillButtonElement() == &decoration || inputElement.cancelButtonElement() == &decoration) {
     2201        AccessibilityObject* object = axObjectCache()->getOrCreate(decoration.renderer());
     2202        if (object && !object->accessibilityIsIgnored())
     2203            return object;
     2204    }
     2205    return nullptr;
     2206}
     2207
    21982208AccessibilityObject* AccessibilityRenderObject::remoteSVGElementHitTest(const IntPoint& point) const
    21992209{
     
    22302240    Node* node = hitTestResult.innerNode()->deprecatedShadowAncestorNode();
    22312241    ASSERT(node);
     2242
     2243    if (is<HTMLInputElement>(*node)) {
     2244        if (AccessibilityObject* object = accessibilityTextFieldDecorationHitTest(downcast<HTMLInputElement>(*node), *hitTestResult.innerNode()))
     2245            return object;
     2246    }
    22322247
    22332248    if (is<HTMLAreaElement>(*node))
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h

    r184068 r185828  
    243243    AccessibilityObject* internalLinkElement() const;
    244244    AccessibilityObject* accessibilityImageMapHitTest(HTMLAreaElement*, const IntPoint&) const;
     245    AccessibilityObject* accessibilityTextFieldDecorationHitTest(const HTMLInputElement&, const Node&) const;
    245246    AccessibilityObject* accessibilityParentForImageMap(HTMLMapElement*) const;
    246247    virtual AccessibilityObject* elementAccessibilityHitTest(const IntPoint&) const override;
Note: See TracChangeset for help on using the changeset viewer.