Changeset 148136 in webkit


Ignore:
Timestamp:
Apr 10, 2013 1:45:43 PM (11 years ago)
Author:
Chris Fleizach
Message:

when ARIA button contains a link, label text is ignored (affects main buttons on m.facebook.com)
https://bugs.webkit.org/show_bug.cgi?id=113906

Reviewed by Tim Horton.

Source/WebCore:

If an element does not expose any children, then it's safe to include all of its sub children when determining
the visible text.
The bug is that all elements were ignoring focusable elements (like <a>) when determining visible children text

Test: accessibility/link-inside-button-accessible-text.html

  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::shouldUseAccessiblityObjectInnerText):

  • accessibility/AccessibilityNodeObject.h:

(AccessibilityNodeObject):

  • accessibility/AccessibilityObject.h:

(WebCore::AccessibilityObject::isDescendantOfBarrenParent):
(AccessibilityObject):

LayoutTests:

The static-text-role-uses-text-under-element.html relies on similar logic to this bug.

I realized that it was verifying the wrong thing and if we had looked closely at this layout test
we would have caught this regression earlier most likely.

  • accessibility/link-inside-button-accessible-text-expected.txt: Added.
  • accessibility/link-inside-button-accessible-text.html: Added.
  • platform/mac/accessibility/static-text-role-uses-text-under-element-expected.txt:
  • platform/mac/accessibility/static-text-role-uses-text-under-element.html:
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r148131 r148136  
     12013-04-10  Chris Fleizach  <cfleizach@apple.com>
     2
     3        when ARIA button contains a link, label text is ignored (affects main buttons on m.facebook.com)
     4        https://bugs.webkit.org/show_bug.cgi?id=113906
     5
     6        Reviewed by Tim Horton.
     7
     8        The static-text-role-uses-text-under-element.html relies on similar logic to this bug.
     9
     10        I realized that it was verifying the wrong thing and if we had looked closely at this layout test
     11        we would have caught this regression earlier most likely.
     12
     13        * accessibility/link-inside-button-accessible-text-expected.txt: Added.
     14        * accessibility/link-inside-button-accessible-text.html: Added.
     15        * platform/mac/accessibility/static-text-role-uses-text-under-element-expected.txt:
     16        * platform/mac/accessibility/static-text-role-uses-text-under-element.html:
     17
    1182013-04-10  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    219
  • trunk/LayoutTests/platform/mac/accessibility/static-text-role-uses-text-under-element-expected.txt

    r137946 r148136  
    55
    66
    7 PASS text.stringValue is 'AXValue:   Text 3'
     7PASS text.stringValue is 'AXValue: Text 1 Text 2 Text 3'
    88PASS successfullyParsed is true
    99
  • trunk/LayoutTests/platform/mac/accessibility/static-text-role-uses-text-under-element.html

    r137946 r148136  
    2727        document.getElementById("text1").focus();
    2828        var text = accessibilityController.focusedElement;
    29         shouldBe("text.stringValue", "'AXValue:   Text 3'");
     29        shouldBe("text.stringValue", "'AXValue: Text 1 Text 2 Text 3'");
    3030    }
    3131
  • trunk/Source/WebCore/ChangeLog

    r148135 r148136  
     12013-04-10  Chris Fleizach  <cfleizach@apple.com>
     2
     3        when ARIA button contains a link, label text is ignored (affects main buttons on m.facebook.com)
     4        https://bugs.webkit.org/show_bug.cgi?id=113906
     5
     6        Reviewed by Tim Horton.
     7
     8        If an element does not expose any children, then it's safe to include all of its sub children when determining
     9        the visible text.
     10        The bug is that all elements were ignoring focusable elements (like <a>) when determining visible children text
     11
     12        Test: accessibility/link-inside-button-accessible-text.html
     13
     14        * accessibility/AccessibilityNodeObject.cpp:
     15        (WebCore::shouldUseAccessiblityObjectInnerText):
     16        * accessibility/AccessibilityNodeObject.h:
     17        (AccessibilityNodeObject):
     18        * accessibility/AccessibilityObject.h:
     19        (WebCore::AccessibilityObject::isDescendantOfBarrenParent):
     20        (AccessibilityObject):
     21
    1222013-04-10  Chris Fleizach  <cfleizach@apple.com>
    223
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp

    r147802 r148136  
    14931493    // containers with lots of children.
    14941494
     1495    // If something doesn't expose any children, then we can always take the inner text content.
     1496    // This is what we want when someone puts an <a> inside a <button> for example.
     1497    if (obj->isDescendantOfBarrenParent())
     1498        return true;
     1499   
    14951500    // Skip focusable children, so we don't include the text of links and controls.
    14961501    if (obj->canSetFocusAttribute())
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h

    r145399 r148136  
    170170    AccessibilityRole remapAriaRoleDueToParent(AccessibilityRole) const;
    171171    bool hasContentEditableAttributeSet() const;
    172     bool isDescendantOfBarrenParent() const;
     172    virtual bool isDescendantOfBarrenParent() const;
    173173    void alterSliderValue(bool increase);
    174174    void changeValueByStep(bool increase);
  • trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r148033 r148136  
    554554    static AccessibilityObject* firstAccessibleObjectFromNode(const Node*);
    555555    void findMatchingObjects(AccessibilitySearchCriteria*, AccessibilityChildrenVector&);
    556 
     556    virtual bool isDescendantOfBarrenParent() const { return false; }
     557   
    557558    virtual AccessibilityObject* observableObject() const { return 0; }
    558559    virtual void linkedUIElements(AccessibilityChildrenVector&) const { }
Note: See TracChangeset for help on using the changeset viewer.