Make WordPress Core


Ignore:
Timestamp:
11/01/2021 09:45:45 PM (3 years ago)
Author:
joedolson
Message:

General: Remove role="navigation" from nav elements.

Role="navigation" was required for assistive technology to recognize HTML5 element's native ARIA roles while HTML5 and ARIA were being introduced. With the deprecation of IE11, the role attribute is only required when mapping elements that don't have native role.

Props costdev, mukesh27.
Fixes #54054.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwenty/template-parts/modal-menu.php

    r48861 r51967  
    4646                    ?>
    4747
    48                     <nav class="expanded-menu<?php echo esc_attr( $expanded_nav_classes ); ?>" aria-label="<?php echo esc_attr_x( 'Expanded', 'menu', 'twentytwenty' ); ?>" role="navigation">
     48                    <nav class="expanded-menu<?php echo esc_attr( $expanded_nav_classes ); ?>" aria-label="<?php echo esc_attr_x( 'Expanded', 'menu', 'twentytwenty' ); ?>">
    4949
    5050                        <ul class="modal-menu reset-list-style">
     
    7171                    ?>
    7272
    73                     <nav class="mobile-menu" aria-label="<?php echo esc_attr_x( 'Mobile', 'menu', 'twentytwenty' ); ?>" role="navigation">
     73                    <nav class="mobile-menu" aria-label="<?php echo esc_attr_x( 'Mobile', 'menu', 'twentytwenty' ); ?>">
    7474
    7575                        <ul class="modal-menu reset-list-style">
     
    115115                <?php if ( has_nav_menu( 'social' ) ) { ?>
    116116
    117                     <nav aria-label="<?php esc_attr_e( 'Expanded Social links', 'twentytwenty' ); ?>" role="navigation">
     117                    <nav aria-label="<?php esc_attr_e( 'Expanded Social links', 'twentytwenty' ); ?>">
    118118                        <ul class="social-menu reset-list-style social-icons fill-children-current-color">
    119119
Note: See TracChangeset for help on using the changeset viewer.