-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
miscellaneous a11y improvements #137
base: master
Are you sure you want to change the base?
Commits on Sep 5, 2024
-
miscellaneous a11y improvements
- set role="application" on toolbar and sidebar to force screen readers to use focus mode in those areas since reading mode is not applicable here and one should not have to manually switch to focus mode - made outline values visible to screen readers - improved aria-live message announced during search navigation to include the page number as well as the snippet of the result - added role="navigation" to start containers of epub ranges so that screen readers indicate when one moves to a new page. It also enabled navigation via d/shift-d for NVDA and r/shift-r for JAWS to go to next/previous page as with PDFs. - added a state variable a11yVirtualCursorTarget to record which node the screen readers should place its virtual cursor on next time the focus enters the reader. It forces virtual cursor to be moved onto that node, as opposed to landing in the beginning of the document. It is currently used to make sure screen readers begin reading the chapter/section selected in the outline, as well as to place virtual cursor on the last search result. On scroll, a11yVirtualCursorTarget is cleared to not interfere with mouse navigation. To make sure that scroll events of document that fire when outline is navigated don't clear the a11yVirtualCursorTarget that was just set, we wait for scrolling to finish and do not allow a11yVirtualCursorTarget to be cleared if it was added within the last 0.5 second.
Configuration menu - View commit details
-
Copy full SHA for 6d411f1 - Browse repository at this point
Copy the full SHA 6d411f1View commit details
Commits on Sep 6, 2024
-
move virtual cursor when page is set in toolbar
So that screen reader users land on the right page after changing the page number in the input or via buttons next to it. Once the input is changed, Escape keypress re-focuses the reader and it will focus an element at the top of the page for virtual cursor to move.
Configuration menu - View commit details
-
Copy full SHA for 8ae1105 - Browse repository at this point
Copy the full SHA 8ae1105View commit details -
move virtualCursor handling into views
Except for placeA11yVirtualCursor which has the logic shared by all view types but it now fetches the node to focus from the view.
Configuration menu - View commit details
-
Copy full SHA for e8f1a15 - Browse repository at this point
Copy the full SHA e8f1a15View commit details -
record top page to focus in _updateViewStats
- Update the target node to focus for in _updateViewStats which triggers on every view scroll update. It allows us to have one place where we record which page to refocus, as opposed to doing it for every navigation method - To make sure our updates don't run too often and are not cleared by the scroll listener right after they are set, a11yWillPlaceVirtCursorOnTop runs through a debounce which will set the node when view updates are all finished. - Removed timestamp of what the target was recorded since it's irrelevant now - Instead, added allowUpdates variable which will not allow the node of _a11yVirtualCursorTarget to be updated. It is needed for search results to not get overriden by the a11yWillPlaceVirtCursorOnTop when scrolling is done
Configuration menu - View commit details
-
Copy full SHA for 577a916 - Browse repository at this point
Copy the full SHA 577a916View commit details
Commits on Sep 10, 2024
-
Configuration menu - View commit details
-
Copy full SHA for a4af150 - Browse repository at this point
Copy the full SHA a4af150View commit details
Commits on Sep 11, 2024
-
move placeA11yVirtualCursor into utilities.js
So that views can share it without keeping it in the reader.js. Also, clear the virtual cursor target on mousedown instead of during scroll - it also fixes the issue of focus jumping to focused element on click after scroll after an outline entry is selected. But it also allows us to avoid multiple processes fighting to set or clear virtual cursor and reduce debounce timeout as a result.
Configuration menu - View commit details
-
Copy full SHA for 9ad399f - Browse repository at this point
Copy the full SHA 9ad399fView commit details
Commits on Sep 12, 2024
-
move a11y search message handling to reader.js
General refactoring to handle search result announcements from top-level Reader. a11yAnnounceSearchMessage adds readers currentSnippet and currentPageLabel from findState result if provided. Those don't exist for pdfs yet. Added currentSnippet and currentPageLabel to be included in epub and snapshot search results, so those are announced. More refactoring to avoid different event handlers fighting over who gets to set _a11yVirtualCursorTarget. It will just not be set by the navigation handler during search mode, which allows us to remove extraneous .allowUpdates field. Removed a11yHandleSearchResultUpdate from all views since messages are handler in Reader and curtorTargets can now be just set directly in findNext/findPrevious. Added a11yWillPlaceVirtCursorOnSearchResult specifically for pdf-view to update virtual cursor target, since findNext does not fire on first result, so we call a11yWillPlaceVirtCursorOnSearchResult when findState is updated.
Configuration menu - View commit details
-
Copy full SHA for cadc0ee - Browse repository at this point
Copy the full SHA cadc0eeView commit details
Commits on Sep 16, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f28c24c - Browse repository at this point
Copy the full SHA f28c24cView commit details -
expose getLocalizeString to views
And use it to get localized page label for epub
Configuration menu - View commit details
-
Copy full SHA for 2bd6260 - Browse repository at this point
Copy the full SHA 2bd6260View commit details