Skip to content
  • dmazzoni@google.com's avatar
    AX: textUnderElement should consider alt text, but skip links and controls · d4d4a68b
    dmazzoni@google.com authored
    https://bugs.webkit.org/show_bug.cgi?id=101650
    
    Reviewed by Chris Fleizach.
    
    Source/WebCore:
    
    Getting inner text from an element now ignores focusable descendants
    and containers, but uses alternative text.  The computation of
    textUnderElement is now recursive and doesn't depend on text
    iterators, which might not do the right thing for accessibility
    anyways.
    
    For GTK, the old behavior is retained so that support for
    the object replacement character is still there. Filed a new
    bug (105214) for GTK folks to look at this.
    
    Test: accessibility/button-title-uses-inner-img-alt.html
    Test: accessibility/focusable-div.html
    
    * accessibility/AccessibilityNodeObject.cpp:
    (WebCore):
    (WebCore::shouldUseAccessiblityObjectInnerText):
    (WebCore::AccessibilityNodeObject::textUnderElement):
    * accessibility/AccessibilityRenderObject.cpp:
    (WebCore::AccessibilityRenderObject::textUnderElement):
    
    LayoutTests:
    
    Adds new tests to show that getting inner text from an element
    now ignores focusable descendants and containers, but uses alternative
    text.
    
    Updates and rebaselines several tests to reflect the new logic.
    Skips these tests on GTK until support for the object replacement
    character can be added.
    
    * accessibility/button-title-uses-inner-img-alt-expected.txt: Added.
    * accessibility/button-title-uses-inner-img-alt.html: Added.
    * accessibility/focusable-div-expected.txt: Extended with more test cases.
    * accessibility/focusable-div.html: Extended with more test cases.
    * platform/chromium/TestExpectations: Un-skip test that now passes.
    * platform/chromium/accessibility/image-link-expected.txt: Rebaseline
    * platform/mac/accessibility/image-link-expected.txt: Rebaseline
    * platform/mac/accessibility/internal-link-anchors2-expected.txt: Rebaseline
    * platform/mac/accessibility/static-text-role-uses-text-under-element-expected.txt: Rebaseline
    * platform/mac/accessibility/static-text-role-uses-text-under-element.html: Fix
    * platform/mac/accessibility/table-with-aria-role-expected.txt: Rebaseline
    * platform/gtk/TestExpectations: Skip these tests until this feature is implemented for GTK.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137946 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d4d4a68b