Changeset 289713 in webkit


Ignore:
Timestamp:
Feb 13, 2022 8:00:33 AM (5 months ago)
Author:
Andres Gonzalez
Message:

Expose the correct role, subrole and role description properties for the <dialog> element.
https://bugs.webkit.org/show_bug.cgi?id=236359

Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/dialog-properties.html

Elements with role="dialog" are exposed to accessibility clients with
role AXGroup, subrole AXApplicationDialog and role description
"web dialog". This patch implements this behavior for the <dialog>
element.

  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::determineAccessibilityRoleFromNode const):

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::defaultObjectInclusion const):

LayoutTests:

Tests that these AX properties have the expected values both when the
dialog is shown modal or modeless.

  • accessibility/dialog-properties-expected.txt: Added.
  • accessibility/dialog-properties.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r289705 r289713  
     12022-02-13  Andres Gonzalez  <andresg_22@apple.com>
     2
     3        Expose the correct role, subrole and role description properties for the <dialog> element.
     4        https://bugs.webkit.org/show_bug.cgi?id=236359
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Tests that these AX properties have the expected values both when the
     9        dialog is shown modal or modeless.
     10
     11        * accessibility/dialog-properties-expected.txt: Added.
     12        * accessibility/dialog-properties.html: Added.
     13
    1142022-02-12  Tim Nguyen  <ntim@apple.com>
    215
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r289697 r289713  
    18501850#////////////////////////////////////////////////////////////////////////////////////////
    18511851
     1852accessibility/dialog-properties.html [ Skip ]
     1853
    18521854# These tests require platform support.
    18531855media/media-allowed-codecs.html
  • trunk/LayoutTests/platform/win/TestExpectations

    r289605 r289713  
    49214921accessibility/selected-state-changed-notifications.html [ Skip ]
    49224922accessibility/element-line-rects-and-text.html [ Skip ]
     4923accessibility/dialog-properties.html [ Skip ]
    49234924
    49244925webkit.org/b/229247 http/tests/fetch/keepalive-fetch-2.html [ Pass Failure ]
  • trunk/Source/WebCore/ChangeLog

    r289712 r289713  
     12022-02-13  Andres Gonzalez  <andresg_22@apple.com>
     2
     3        Expose the correct role, subrole and role description properties for the <dialog> element.
     4        https://bugs.webkit.org/show_bug.cgi?id=236359
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Test: accessibility/dialog-properties.html
     9
     10        Elements with role="dialog" are exposed to accessibility clients with
     11        role AXGroup, subrole AXApplicationDialog and role description
     12        "web dialog". This patch implements this behavior for the <dialog>
     13        element.
     14
     15        * accessibility/AccessibilityNodeObject.cpp:
     16        (WebCore::AccessibilityNodeObject::determineAccessibilityRoleFromNode const):
     17        * accessibility/AccessibilityObject.cpp:
     18        (WebCore::AccessibilityObject::defaultObjectInclusion const):
     19
    1202022-02-13  Alan Bujtas  <zalan@apple.com>
    221
  • trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp

    r289469 r289713  
    359359    if (node()->hasTagName(captionTag))
    360360        return AccessibilityRole::Caption;
     361    if (node()->hasTagName(dialogTag))
     362        return AccessibilityRole::ApplicationDialog;
    361363    if (node()->hasTagName(markTag))
    362364        return AccessibilityRole::Mark;
     
    415417    if (is<Element>(*node()) && downcast<Element>(*node()).isFocusable())
    416418        return AccessibilityRole::Group;
    417    
     419
    418420    return AccessibilityRole::Unknown;
    419421}
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r289248 r289713  
    36133613{
    36143614    bool useParentData = !m_isIgnoredFromParentData.isNull();
    3615    
     3615
    36163616    if (useParentData ? m_isIgnoredFromParentData.isAXHidden : isAXHidden())
    36173617        return AccessibilityObjectInclusion::IgnoreObject;
     
    36193619    if ((renderer() && renderer()->style().effectiveInert()) || ignoredFromModalPresence())
    36203620        return AccessibilityObjectInclusion::IgnoreObject;
    3621    
     3621
    36223622    if (useParentData ? m_isIgnoredFromParentData.isPresentationalChildOfAriaRole : isPresentationalChildOfAriaRole())
    36233623        return AccessibilityObjectInclusion::IgnoreObject;
    3624    
     3624
     3625    // Include <dialog> elements and elements with role="dialog".
     3626    if (roleValue() == AccessibilityRole::ApplicationDialog)
     3627        return AccessibilityObjectInclusion::IncludeObject;
     3628
    36253629    return accessibilityPlatformIncludesObject();
    36263630}
Note: See TracChangeset for help on using the changeset viewer.