Changeset 231720 in webkit


Ignore:
Timestamp:
May 11, 2018 2:58:19 PM (6 years ago)
Author:
n_wang@apple.com
Message:

AX: In role=dialog elements with aria-modal=true VoiceOver iOS/macOS can't manually focus or read dialog paragraph description text inside the modal.
https://bugs.webkit.org/show_bug.cgi?id=185219
<rdar://problem/39920009>

Reviewed by Chris Fleizach.

Source/WebCore:

The text node descendants of a modal dialog are ignored. Fixed it by using AccessibilityObject's
node() to determine if it's the descendant of the modal dialog node.

Test: accessibility/aria-modal-text-descendants.html

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::isModalDescendant const):

LayoutTests:

  • accessibility/aria-modal-text-descendants-expected.txt: Added.
  • accessibility/aria-modal-text-descendants.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r231717 r231720  
     12018-05-11  Nan Wang  <n_wang@apple.com>
     2
     3        AX: In role=dialog elements with aria-modal=true VoiceOver iOS/macOS can't manually focus or read dialog paragraph description text inside the modal.
     4        https://bugs.webkit.org/show_bug.cgi?id=185219
     5        <rdar://problem/39920009>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        * accessibility/aria-modal-text-descendants-expected.txt: Added.
     10        * accessibility/aria-modal-text-descendants.html: Added.
     11
    1122018-05-11  Ryosuke Niwa  <rniwa@webkit.org>
    213
  • trunk/Source/WebCore/ChangeLog

    r231717 r231720  
     12018-05-11  Nan Wang  <n_wang@apple.com>
     2
     3        AX: In role=dialog elements with aria-modal=true VoiceOver iOS/macOS can't manually focus or read dialog paragraph description text inside the modal.
     4        https://bugs.webkit.org/show_bug.cgi?id=185219
     5        <rdar://problem/39920009>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        The text node descendants of a modal dialog are ignored. Fixed it by using AccessibilityObject's
     10        node() to determine if it's the descendant of the modal dialog node.
     11
     12        Test: accessibility/aria-modal-text-descendants.html
     13
     14        * accessibility/AccessibilityObject.cpp:
     15        (WebCore::AccessibilityObject::isModalDescendant const):
     16
    1172018-05-11  Ryosuke Niwa  <rniwa@webkit.org>
    218
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r231628 r231720  
    20892089bool AccessibilityObject::isModalDescendant(Node* modalNode) const
    20902090{
    2091     if (!modalNode || !this->element())
    2092         return false;
    2093    
    2094     if (this->element() == modalNode)
     2091    Node* node = this->node();
     2092    if (!modalNode || !node)
     2093        return false;
     2094   
     2095    if (node == modalNode)
    20952096        return true;
    20962097   
    20972098    // ARIA 1.1 aria-modal, indicates whether an element is modal when displayed.
    20982099    // For the decendants of the modal object, they should also be considered as aria-modal=true.
    2099     for (auto& ancestor : elementAncestors(this->element())) {
    2100         if (&ancestor == modalNode)
    2101             return true;
    2102     }
    2103     return false;
     2100    return node->isDescendantOf(*modalNode);
    21042101}
    21052102
Note: See TracChangeset for help on using the changeset viewer.