backdrop / backdrop-issues

Issue tracker for Backdrop core.
145 stars 40 forks source link

[A11Y] Content on 404, 403 are not within a semantic element. #6755

Closed laryn closed 5 days ago

laryn commented 1 week ago

Description of the bug

An internal accessibility review flagged default 404 page content:

Content is not within a semantic element

Steps To Reproduce

Look at a default 404 page. The text "The requested page path could not be found." is not within a semantic element.

Expected behavior

I'll suggest we display that content inside a paragraph tag. PR coming.

stpaultim commented 6 days ago

I suppose, since this is only effecting pages with messages for what are essentially errors, backward compatibility issues are minimal.

This is what it looked like before:

  <div class="block block-system-title-combo">
    <div class="block-content">
      <h1 class="page-title">Page not found</h1>
    </div>
  </div>
</div>
<div class="l-middle row">
  <main class="l-content col-md-9" role="main" aria-label="Main content">
    The requested page "/cats" could not be found.        </main>
  <div class="l-sidebar l-sidebar-first col-md-3"></div>
</div><!-- /.l-middle -->

After this PR

<div class="block block-system-title-combo">
  <div class="block-content">
    <h1 class="page-title">Page not found</h1>
  </div>
</div>
</div>
  <div class="l-middle row">
    <main class="l-content col-md-9" role="main" aria-label="Main content">
      <p>The requested page "/cats" could not be found.</p>        </main>
    <div class="l-sidebar l-sidebar-first col-md-3">
  </div>
</div><!-- /.l-middle -->

Works for me. But, I'd love to have at least one other person look at this.

quicksketch commented 5 days ago

Thanks @stpaultim for the summary. This seems mostly harmless from a backwards-compatibility standpoint and has a clear accessibility benefit.

quicksketch commented 5 days ago

I merged https://github.com/backdrop/backdrop/pull/4903 into 1.x and 1.29.x. Thank you @laryn and @stpaultim!