-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Add support for IA2_ROLE_LANDMARK #10110
Conversation
PR introduces Flake8 errors 😲 See test results for Failed build of commit 81d7d8ae95 |
PR introduces Flake8 errors 😲 See test results for Failed build of commit 43028ba5ea |
Unfortunately, no, I just found out through testing that the current version of Chrome does. |
@feerrenrut The remaining lint error is about using IA2_ROLE_LANDMARK which is imported using |
My first thought would be that we should move towards importing it as
Then doing things like ia2.IA2_ROLE_LANDMARK |
I like that. Probably will go for IA2 (upper case) for consistency reasons. |
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.
Are the types of landmarks presented in braille?
I wonder if it might be less complicated to just expose the landmark type via roleText (which is already supported in both speech and braille). E.g. the roleText for a landmark of type "main" could be "main landmark". This would remove the need for the specific code for landmarks in speakObjectProperties etc.
I like the idea of using roleText! |
Ugh, problem with using roleText is actually that we couldn't use landmark abbreviations in braille. |
Take a look at the nvaccess/ariaRoleDescriptionBraille branch. That implements roleTextBraille on NVDAObjects and handles it in braille.py. We won't want to take all of that code yet as aria-roleDescription-braille is not at all in the aria standard yet, but it was prototyped by Sina, Reef and myself last year at a math workshop. But you can certainly take the code in |
PR introduces Flake8 errors 😲 See test results for Failed build of commit 5687503491 |
PR introduces Flake8 errors 😲 See test results for Failed build of commit 3d98393ae0 |
@michaelDCurran I finished the implementation based on roleText. Everything uses roleText for landmarks now, i.e. the special code for landmarks has been removed from browseMOde and control field speech now uses roleText if there is a landmark in the field. Please note that the first known issue isn't caused by this pr. Code snippet: Control field for the landmark: Note the _startOfNode value, which is False and really should be True here, as I were positioned at the start of the landmark. We only add the name if _startOfNode is True. This code is there for historical reasons, but I can probably remove it because the contro field presentation category now takes landmarks into account. |
@michaelDCurran I finished the implementation based on roleText. Everything uses roleText for landmarks now, i.e. the special code for landmarks has been removed from browseMode and control field speech now uses roleText if there is a landmark in the field. Please note that the first known issue isn't caused by this pr. |
PR introduces Flake8 errors 😲 See test results for Failed build of commit b9f5213e7f |
@LeonarddeR just a reminder there are failing flake8 checks on this pr. |
@michaelDCurran Sorry, should have been fixed now. |
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.
There is a possibility that a landmark will be ignored if the landmark is not the first role in the ARIA roles. E.g. role="list navigation".
For instance, when fetching xml-roles, after splitting, you should take the first role that also appears in aria.landmarkRoles, rather than just the first thing in the list.
In other words, the check for aria.landmarkRoles should be done in each implementation of the landmark property, rather than in the base roleText property, as this is too late.
Thanks for pointing this out. I actually wasn't aware that you are
officially allowed to have multiple roles on a HTML node.
|
@michaelDCurran how do you actually expect In the current implementation (master), landmarks are treated separately from role, so this case will be reported as |
Hmm that is a tricky one.
I seem to think landmark should override role, but I can't really back
up why I think that.
|
In firefox with IA2ROLE_LANDMARK support:
May be @MarcoZehe and @jcsteh would like to share their ideas? |
Perhaps this section of the WAI-ARIA 1.1 spec or the listed Core-AM 1.1 section 5.4.1 help clarify: The list of tokens acts as a fallback mechanism, so if a user agent doesn't know the first role, it falls back to the second, etc. Since list is known, the landmark role, whichever that may be, will never be evaluated, and List wins. The first non-abstract role is what gets exposed. So if you have "list banner", "banner" would be considered a fall-back and would not get exposed since "list" is already there. Except for through the attribute XML-Roles, since that always gets the full token list. |
Ugh, turns out that I entirely forgot about the braille implementation for this. I will file a fixup pr later this week. cc @bramd |
Link to issue number:
Fixes #10101
Summary of the issue:
IA2 version 3 introduced IA2_ROLE_LANDMARK which is set on landmarks in recent Firefox and Chrome versions. This role was not supported.
Description of how this pull request fixes the issue:
banner landmark
. This works in Internet Explorer, Firefox, Chrome, Edge legacy and Edge beta. This is accomplished by using the roleText attribute on objects.Testing performed:
Tested the following snippet:
When moving with tab to the button, ensure that
banner landmark
is spoken before the button name. Also make sure that the landmark is silenced when reporting of landmarks is off.Known issues with pull request:
Change log entry: