Changeset 207647 in webkit


Ignore:
Timestamp:
Oct 20, 2016 6:15:21 PM (8 years ago)
Author:
n_wang@apple.com
Message:

AX: VoiceOver is not detecting ARIA treeview if it contains role="presentation"
https://bugs.webkit.org/show_bug.cgi?id=163763

Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/mac/aria-tree-with-presentation-role.html

Web authors sometimes use presentation role in the aria tree to hide elements. We should
consider this a valid case if they specify tree items and groups correctly.

  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::hierarchicalLevel):

  • accessibility/AccessibilityTree.cpp:

(WebCore::AccessibilityTree::nodeHasTreeItemChild):
(WebCore::AccessibilityTree::isTreeValid):

  • accessibility/AccessibilityTree.h:

LayoutTests:

  • accessibility/mac/aria-tree-with-presentation-role-expected.txt: Added.
  • accessibility/mac/aria-tree-with-presentation-role.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r207642 r207647  
     12016-10-20  Nan Wang  <n_wang@apple.com>
     2
     3        AX: VoiceOver is not detecting ARIA treeview if it contains role="presentation"
     4        https://bugs.webkit.org/show_bug.cgi?id=163763
     5
     6        Reviewed by Chris Fleizach.
     7
     8        * accessibility/mac/aria-tree-with-presentation-role-expected.txt: Added.
     9        * accessibility/mac/aria-tree-with-presentation-role.html: Added.
     10
    1112016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r207644 r207647  
     12016-10-20  Nan Wang  <n_wang@apple.com>
     2
     3        AX: VoiceOver is not detecting ARIA treeview if it contains role="presentation"
     4        https://bugs.webkit.org/show_bug.cgi?id=163763
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Test: accessibility/mac/aria-tree-with-presentation-role.html
     9
     10        Web authors sometimes use presentation role in the aria tree to hide elements. We should
     11        consider this a valid case if they specify tree items and groups correctly.
     12
     13        * accessibility/AccessibilityNodeObject.cpp:
     14        (WebCore::AccessibilityNodeObject::hierarchicalLevel):
     15        * accessibility/AccessibilityTree.cpp:
     16        (WebCore::AccessibilityTree::nodeHasTreeItemChild):
     17        (WebCore::AccessibilityTree::isTreeValid):
     18        * accessibility/AccessibilityTree.h:
     19
    1202016-10-20  Myles C. Maxfield  <mmaxfield@apple.com>
    221
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp

    r207429 r207647  
    16161616    unsigned level = 1;
    16171617    for (AccessibilityObject* parent = parentObject(); parent; parent = parent->parentObject()) {
    1618         AccessibilityRole parentRole = parent->roleValue();
     1618        AccessibilityRole parentRole = parent->ariaRoleAttribute();
    16191619        if (parentRole == GroupRole)
    16201620            level++;
  • trunk/Source/WebCore/accessibility/AccessibilityTree.cpp

    r191002 r207647  
    6868}
    6969
     70bool AccessibilityTree::nodeHasTreeItemChild(Node& node) const
     71{
     72    for (auto* child = node.firstChild(); child; child = child->nextSibling()) {
     73        if (nodeHasRole(child, "treeitem"))
     74            return true;
     75    }
     76    return false;
     77}
     78
    7079bool AccessibilityTree::isTreeValid() const
    7180{
     
    8897        if (nodeHasRole(child, "treeitem"))
    8998            continue;
     99        if (nodeHasRole(child, "presentation")) {
     100            if (!nodeHasTreeItemChild(*child))
     101                return false;
     102            continue;
     103        }
    90104        if (!nodeHasRole(child, "group"))
    91105            return false;
  • trunk/Source/WebCore/accessibility/AccessibilityTree.h

    r197563 r207647  
    4545    AccessibilityRole determineAccessibilityRole() override;
    4646    bool isTreeValid() const;
     47    bool nodeHasTreeItemChild(Node&) const;
    4748};
    4849   
Note: See TracChangeset for help on using the changeset viewer.