-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
Support IAccessible2 "mark" text attribute. #16910
Conversation
Note that Chrome supports text fragments, but even though it scrolls to the fragment, it does not yet expose the highlight to IAccessible2. That change will need to be made in Chrome. |
I wonder whether the marked FormatField key should report "highlighted" instead.
I would imagine users can more easily relate to the highlighted concept.
|
I tend to agree. I wasn't sure whether there was a good reason this is currently reported as "marked", though, so thought I'd avoid making that change here. |
Is this new |
It's not formalised yet. I will file a PR against IA2 at some point to add it. I'm holding off at this point because it's slightly possible (though very unlikely) that I'll discover something before the Firefox patches land that requires me to change how this is exposed. |
WalkthroughThe changes introduce new functionality in NVDA to enhance accessibility in Mozilla Firefox. The Changes
Recent review detailsConfiguration used: .coderabbit.yml Files selected for processing (2)
Additional context usedPath-based instructions (2)
Additional comments not posted (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add Documentation and Community
|
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.
Actionable comments posted: 1
Thanks @jcsteh ! |
Link to issue number:
None.
Summary of the issue:
Text fragments is a new web concept that allows you to link directly to a specified piece of arbitrary text on a page without needing a predefined id. For example:
https://www.jantrid.net/#:~:text=browsers%20were%20much%20simpler
As well as scrolling to the element containing the text, the browser will highlight the text. Because this could span a partial object, this can't be exposed using IA2_ROLE_MARK. Instead, similar to spelling errors, this is exposed using an IAccessible2 text attribute, specifically the new attribute mark:true.
This will also be used eventually to support CSS custom highlights.
Description of user facing changes
In Mozilla Firefox, NVDA will report the highlighted text when a URL containing a text fragment is visited.
Description of development approach
NVDA already supports the "marked" attribute on FormatFields. To be consistent with IA2_ROLE_MARK, it was decided to name the IA2 attribute "mark" instead of "marked". This PR simply maps the attribute appropriately in
normalizeIA2TextFormatField
.Testing strategy:
data:text/html,<p>The first phrase.</p><p>The second <b>phrase.</b></p>#:~:text=second phrase
Known issues with pull request:
None with the PR itself.
I did notice that we report "highlighted" for
controlTypes.Role.MARKED_CONTENT
, but we report "marked" for the marked FormatField key, even though these are the same concept. I wonder whether the marked FormatField key should report "highlighted" instead.Code Review Checklist:
Summary by CodeRabbit
formatField
attribute, ensuring accurate handling of themark
key for better functionality.