Verified Commit 75a55279 authored by Dave Long's avatar Dave Long
Browse files

fix: #2655794 Remove redundant WAI-ARIA role attributes from <main>, <nav>,...

fix: #2655794 Remove redundant WAI-ARIA role attributes from <main>, <nav>, <aside>, <header>, and <footer> elements

By: BarisW
By: mgifford
By: feyp
By: pk188
By: andrewmacpherson
By: mherchel
By: gauravvvv
By: akshay kashyap
By: liam morland
By: dcam
By: longwave
By: bnjmnm
(cherry picked from commit 3fd5767a)
parent 7f0aa96a
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -407,11 +407,11 @@ public function moveBlockToRegion(array $block, $region): void {
    $this->assertSession()->pageTextContains($block['settings[label]']);

    $region_xpath = [
      'header' => '//header[@role = "banner"]',
      'header' => '//header',
      'sidebar_first' => '//aside[contains(@class, "layout-sidebar-first")]',
      'content' => '//div[contains(@class, "layout-content")]',
      'sidebar_second' => '//aside[contains(@class, "layout-sidebar-second")]',
      'footer' => '//footer[@role = "contentinfo"]',
      'footer' => '//footer',
    ];

    // Confirm that the content block was found at the proper region.
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ public function testBlockDemoUiPage(): void {
    $this->drupalPlaceBlock('help_block', ['region' => 'help']);
    $this->drupalGet('admin/structure/block');
    $this->clickLink('Demonstrate block regions (Stark)');
    $this->assertSession()->elementExists('xpath', '//header[@role = "banner"]/div/div[contains(@class, "block-region") and contains(text(), "Header")]');
    $this->assertSession()->elementExists('xpath', '//header/div/div[contains(@class, "block-region") and contains(text(), "Header")]');

    // Ensure that other themes can use the block demo page.
    \Drupal::service('theme_installer')->install(['test_theme']);
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ public function testCommentTypeCreation(): void {
    $this->assertSession()->addressEquals('admin/structure/comment/manage/' . $edit['id'] . '/fields');

    // Asserts that the comment type is visible in breadcrumb.
    $this->assertTrue($this->assertSession()->elementExists('css', 'nav[role="navigation"]')->hasLink('title for foo'));
    $this->assertTrue($this->assertSession()->elementExists('css', 'nav')->hasLink('title for foo'));

    $comment_type = CommentType::load('foo');
    $this->assertInstanceOf(CommentType::class, $comment_type);
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@
 */
#}
{% set heading_id = attributes.id ~ '-menu'|clean_id %}
<nav role="navigation" aria-labelledby="{{ heading_id }}"{{ attributes|without('role', 'aria-labelledby') }}>
<nav aria-labelledby="{{ heading_id }}"{{ attributes|without('role', 'aria-labelledby') }}>
  {# Label. If not displayed, we still provide it for screen readers. #}
  {% if not configuration.label_display %}
    {% set title_attributes = title_attributes.addClass('visually-hidden') %}
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
 */
#}
{% if breadcrumb %}
  <nav role="navigation" aria-labelledby="system-breadcrumb">
  <nav aria-labelledby="system-breadcrumb">
    <h2 id="system-breadcrumb" class="visually-hidden">{{ 'Breadcrumb'|t }}</h2>
    <ol>
    {% for item in breadcrumb %}
Loading