Changeset 270896 in webkit


Ignore:
Timestamp:
Dec 16, 2020 10:23:34 AM (19 months ago)
Author:
Chris Fleizach
Message:

AX: Update list heuristics to include linked lists inside navigation containers
https://bugs.webkit.org/show_bug.cgi?id=193382
<rdar://problem/47233475>

Reviewed by Zalan Bujtas.

Source/WebCore:

If an unstyled list is inside a <nav> or a role=navigation, it should be marked
as an accessibility list.

Updated test: accessibility/list-detection2.html

  • accessibility/AccessibilityList.cpp:

(WebCore::AccessibilityList::determineAccessibilityRole):

LayoutTests:

  • accessibility/list-detection2-expected.txt:
  • accessibility/list-detection2.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r270891 r270896  
     12020-12-16  Chris Fleizach  <cfleizach@apple.com>
     2
     3        AX: Update list heuristics to include linked lists inside navigation containers
     4        https://bugs.webkit.org/show_bug.cgi?id=193382
     5        <rdar://problem/47233475>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        * accessibility/list-detection2-expected.txt:
     10        * accessibility/list-detection2.html:
     11
    1122020-12-16  Zalan Bujtas  <zalan@apple.com>
    213
  • trunk/LayoutTests/accessibility/list-detection2-expected.txt

    r267644 r270896  
    1818PASS: ol w/ counter content on ::before -> list.
    1919PASS: ol w/ counter content on inline ::before -> list.
     20PASS: ul list in a navigation role -> list.
     21PASS: ol list in a nav element -> list.
    2022PASS: ul w/ background image (NOT A LIST) -> .
    2123PASS: ul w/ background on ::before (NOT A LIST) -> .
  • trunk/LayoutTests/accessibility/list-detection2.html

    r214623 r270896  
    114114        <li>baz</li>
    115115    </ol>
     116    <div role="navigation">
     117       <div>
     118          <ul data-role="list" class="ex nomarkers" style="list-style-type:none" data-note=" list in a navigation role">
     119            <li>foo</li>
     120            <li>bar</li>
     121            <li>baz</li>
     122          </ul>
     123       </div>
     124    </div>
     125    <nav>
     126       <div>
     127          <ol data-role="list" class="ex nomarkers" style="list-style-type:none" data-note=" list in a nav element">
     128            <li>foo</li>
     129            <li>bar</li>
     130            <li>baz</li>
     131          </ol>
     132       </div>
     133    </nav>
    116134
    117135    <p>Since many web pages suffer from "list-itis" and some users have noted that they don't want to hear about so many lists, any UL or OL that does not match one of the above heuristics should not be exposed as a list. Chances are that they are just presentational lists using the elements for the sake of a styling hook.</p>
  • trunk/Source/WebCore/ChangeLog

    r270892 r270896  
     12020-12-16  Chris Fleizach  <cfleizach@apple.com>
     2
     3        AX: Update list heuristics to include linked lists inside navigation containers
     4        https://bugs.webkit.org/show_bug.cgi?id=193382
     5        <rdar://problem/47233475>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        If an unstyled list is inside a <nav> or a role=navigation, it should be marked
     10        as an accessibility list.
     11
     12        Updated test: accessibility/list-detection2.html
     13
     14        * accessibility/AccessibilityList.cpp:
     15        (WebCore::AccessibilityList::determineAccessibilityRole):
     16
    1172020-12-16  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/Source/WebCore/accessibility/AccessibilityList.cpp

    r245565 r270896  
    180180        }
    181181    }
    182    
     182
    183183    // Non <ul> lists and ARIA lists only need to have one child.
    184184    // <ul>, <ol> lists need to have visible markers.
     
    186186        if (!listItemCount)
    187187            role = AccessibilityRole::ApplicationGroup;
    188     } else if (!hasVisibleMarkers)
    189         role = AccessibilityRole::Group;
     188    } else if (!hasVisibleMarkers) {
     189        // http://webkit.org/b/193382 lists inside of navigation hierarchies should still be considered lists.
     190        if (Accessibility::findAncestor<AXCoreObject>(*this, false, [] (auto& object) { return object.roleValue() == AccessibilityRole::LandmarkNavigation; }))
     191            role = AccessibilityRole::List;
     192        else
     193            role = AccessibilityRole::Group;
     194    }
    190195
    191196    return role;
Note: See TracChangeset for help on using the changeset viewer.