Skip to content

Commit

Permalink
[GENERIC viewer] Try to improve a11y, for search results, in the find…
Browse files Browse the repository at this point in the history
…bar (issue 14525)

*Please note:* I don't really know anything about a11y, hence it's possible that this patch either doesn't work correctly or at least isn't a complete solution.

Based on skimming through the two MDN articles linked below, it seems that tagging the `findMsg` and `findResultsCount` spans accordingly could be a solution to notify a11y software about search results.

 - https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/status_role
 - https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_status_role
  • Loading branch information
Snuffleupagus committed Mar 30, 2022
1 parent d6592b5 commit 942da71
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<div id="mainContainer">
<div class="findbar hidden doorHanger" id="findbar">
<div id="findbarInputContainer">
<input id="findInput" class="toolbarField" title="Find" placeholder="Find in document…" tabindex="91" data-l10n-id="find_input">
<input id="findInput" class="toolbarField" title="Find" placeholder="Find in document…" tabindex="91" data-l10n-id="find_input" aria-controls="findMsg findResultsCount">
<div class="splitToolbarButton">
<button id="findPrevious" class="toolbarButton findPrevious" title="Find the previous occurrence of the phrase" tabindex="92" data-l10n-id="find_previous">
<span data-l10n-id="find_previous_label">Previous</span>
Expand All @@ -142,10 +142,10 @@
</div>

<div class="findbarMessageContainer">
<span id="findResultsCount" class="toolbarLabel"></span>
<span id="findResultsCount" class="toolbarLabel" role="status"></span>
</div>
<div class="findbarMessageContainer">
<span id="findMsg" class="toolbarLabel"></span>
<span id="findMsg" class="toolbarLabel" role="status"></span>
</div>
</div> <!-- findbar -->

Expand Down

0 comments on commit 942da71

Please sign in to comment.