-
Notifications
You must be signed in to change notification settings - Fork 236
Implement new explorer paradigm #1241
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
Conversation
The DetailsNow that the In order to accommodate the platform-specific configuration defaults, the In We also override the speech MathItem's The ExplorerMathDocument gets a new We add a number of styles for handling the temporary speech nodes, as well as help icon. The constructor is modified to add the styles to the document, and to create the needed SVG elements for the info icon. Finally, the role description set from the menu settings. In The Here the The selectors for walking are changed, since we no longer use The The The static Some getters are used for easy access to the role and description. Next come some values used to store the element clicked in a Click event, the node to refocus on after the element regains focus (e.g., after a menu is displayed and removed), the selector string to look for after the expression is rerendered (e.g., by an maction toggle), plus pointers to the active temporary speech node, and the extra top-level speech node with Next come the event handlers. The focus-in handler calls The keydown handler gets the KeyMapping for the pressed key from the For a mouse down, we check that there are no modifiers (e.g., that would cause selections to be extended), and that the button is the left button (so contextual menu clicks won't be registered, for example). We find the speech element that was clicked, if any, and if it is the info icon, error stop propagation and return (it will be handled by the click event later). Otherwise, if the active element is not the top-level node (i.e., we have clicked on a subexpression), then if we have clicked on a For the actual click events, if it has modifiers or is not the left button or we have a selection already (e.g., we drag selected and have just un-clicked at the end of that, which still generates a click event), then focus out and let the system handle the selection. Otherwise, find the clicked speech node, and if it is the info icon, stop the event and open the help dialog. If not, then if we either haven't got a click element (in which case we will select the full equation), or the container contains the clicked item, then stop the event and record the clicked item as the one to focus on when the container receives the focus-in event, but if it was a link, start right away (we won't get a focus-in). The next section is the key actions. These first few are straight forward. The Enter key action checks if we are active, and if so, looks for a link or an maction to activate. If not already active (e.g., we pressed Escape earlier), then we start the explorer again. The arrow actions look up the proper node, if any, and use the The depth action gets the depth string and speaks that. The summary speaks the summary string. The next rules action removes the attached speech marker (so speech will be added again), gets the new rules, and restarts after the new speech has been attached. Similarly, for the next styles action. The help action creates the help dialog box with its controls, and adds event handlers to deal with closing it, then focuses the dialog. The next section handles the actual speech nodes. the The The The The The The next section is for various utility functions. The The The The The The The The The The action and link methods have minor adjustments. Finally, That covers a pretty complicate set of changes. I will add more about the other files later (to of time right now). |
More DetailsFor In In In In in The The In Finally, That completes the details about these changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some typos.
The help box could be done with the help box from the menu. Not sure if we want to do this at some point or keep it independent.
I'll send you an email regarding testing.
|
There are some issues that I have now discovered (in the
if (this.current) {
this.current.classList.remove('mjx-selected');
this.pool.unhighlight();
if (!node) {
this.removeSpeech();
this.node.removeAttribute('aria-busy');
return;
}
} |
|
I've partially solved point (3) by ensuring that These will be my next steps:
@dpvc in other words, you can merge this PR and we clean up in a few smaller ones. |
|
The issue with collapsing is actually due to a problem with the I have a straight forward fox for item 2. You already indicate how to fix 1. I have another update to make for some other issues with the explorer/menu interactions, as well as a proper implementation for the container-replacement idea from I will make a PR for these changes, so you don't need to do the second PR you mentioned above. |
|
Great. I am just in the process of making an SRE release for the new
SRE PR. It took me all morning to get the tests sorted out and the
github actions running again.
Then I make a PR of the fixes and you can have a look at it.
Best,
Volker
…On Wed, 14 May 2025 at 15:22, Davide P. Cervone ***@***.***> wrote:
dpvc left a comment (mathjax/MathJax-src#1241)
The issue with collapsing is actually due to a problem with the semanticFocus() method, as well as a timing issue with the fix that I made for Orca (that clones the container node), if you are using the test/explorer branch. I have a fixes for both. There is also a problem with the menu not loading the complexity extension on startup, and I have fixed that as well. These should take care of your items 3 and 4.
I have a straight forward fox for item 2. You already indicate how to fix 1.
I have another update to make for some other issues with the explorer/menu interactions, as well as a proper implementation for the container-replacement idea from test/explorer. (That branch was only meant as a quick test of whether that idea worked for you, not as a base for further development, in case that is the branch you are using.)
I will make a PR for these changes, so you don't need to do the second PR you mentioned above.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because your review was requested.Message ID: ***@***.***>
|
This PR implements a new paradigm for the expression explorer. The main goals are:
I tested with 11 combinations (Chrome, Firefox, and Safari on MacOS with VoiceOver; Chrome, Firefox, and Edge on Windows with NVDA and JAWS; and Chrome and Firefox on Linux with Orca) and I believe the all these goals are met. I spent several weeks experimenting with these 11 configurations to find out what worked the same among them and what worked differently in order to try to find a common approach that worked for all the combinations. Unfortunately, there didn't seem to be a single setup that worked consistently across all 11, but fortunately, within an OS, there was a setup that worked for all the browser/screen-reader combinations, so it is possible to make it work without users having to change settings by hand.
The prior approach (in the current beta.7 version) is to add aria-labels and
role="treeitem"to the sub-nodes of the DOM tree and move the focus among these as the expression is explored. This had several problems. First,treeitemnodes must be in a container withrole="tree", which was not the case for us. Second, it did not enter "focus mode" automatically. Third, it did not read the full expression when reading the full page in some of the combinations. Fourth, it basically did not work at all in VoiceOver.In the new approach, rather than focusing the various node in the math display tree, when you walk to a new node that should be spoken, the explorer inserts a new temporary node that has the needed aria-label and focuses that while visually highlighting the proper display node. The temporary node is removed when you navigate to the next node and a new one is added for the new speech. The whole display tree has
aria-hidden="true"and only the new speech node is visible to the AT. This part works consistently across all the browser/OS/screen-reader combinations tested. The only point of contention is how the top-level container element is handled.In MacOS, there is no "focus mode" versus "browse mode" dichotomy, but in Windows and Unix, we need trigger the screen reader to enter "focus mode" when the expression is focused. That requires the top-level
mjx-containerto have a role that does that, such asapplicationortree. Whiletreecould be used to enter focus mode, this role is designed as a means of making selections, and screen readers speak extra information about where you are in the tree and whether the current item is selected or not, which interferes with the reading of the math itself. (E.g., NDVA would say things like "item 1 of 8, not selected" when moving within the expression.) So it turned out to be impractical to use thetreerole. Theapplicationrole was the only one that worked consistently across browsers and screen readers in Windows. Fortunately, that role also works with Orca in Unix. This role also has the advantage that itsaria-labelis spoken when reading through the page, whereas other roles would end up not speaking anything, so the math was skipped when reading through the page.For MacOS, the handling of the various top-level roles varied widely across browsers, and there was not a role that would be read properly in all browsers when the page is being read as a whole. The solution used here is to insert an extra node in the container that holds the speech for the entire equation and give it
role="img", since that seems to be one of the few roles whosearia-labelwill be spoken when the page is being read (this is also needed for JAWS to read the expression while reading the full page, if I recall correctly). The top-level container gets noroleoraria-labelin this case, and when the expression is focused, the explorer descends to themathnode and produces its speech (for Windows and Linux, the focus must remain on the container in order for the screen reader to enter focus mode).In order to handle the "press H for help" message, MacOS includes it in the speech string when the expression is first focused (it is on the temporary node created for the speech). Because the other OSs must keep the top-level expression focused in order to enter focus mode, the help message is added to the
aria-roledescriptionon the fly (technically not legal, but works; this is the only illegal thing being done in this new explorer, though the use ofimgrole is not ideal).The timing of when the temporary images are created and removed, and when the
tabindexis changed is important, and has been carefully managed, here.I will add more comments about the details of the changes below soon, but wanted to get the PR out so that you can be trying it out in the meantime.