Skip to content

Support ARIA role='mark' and html mark tag#11436

Merged
michaelDCurran merged 8 commits into
masterfrom
supportMarkRole
Jul 30, 2020
Merged

Support ARIA role='mark' and html mark tag#11436
michaelDCurran merged 8 commits into
masterfrom
supportMarkRole

Conversation

@michaelDCurran

Copy link
Copy Markdown
Member

Link to issue number:

None.

Summary of the issue:

Content authors can indicate that content is marked (highlighted) by wrapping the content in an html 'mark' tag, or placing role='mark' on any other tag wrapping the content.
NVDA should report the existence of marked text in speech and braille.

Description of how this pull request fixes the issue:

This pr:

  • Upgrades IAccessible2 to the latest commit, providing the IA2_ROLE_MARK constant.
  • Added a new MARKED_CONTENT role to NVDA, and map to it from IAccessible2's IA2_ROLE_MARK.
  • Added a new document formatting option for reporting highlighting.
  • Braille and speech report the start and end of ROLE_MARKED_CONTENT. In speech it is "marked content blahblahblah out of marked content" and in braile it is "mrkd blahblahblah mrkd end".
  • In Internet Explorer, added support for ARIA role=mark, and replaced the older support for the html mark tag with one that conforms with the above implementations.

These changes now mean that NVDA will report the existence of marked text in both speech and braille, in Firefox, chrome, Edge (Chromium) and Internet Explorer.

Testing performed:

Using the following test case:
Ensured that NVDA reported the existence of marked text in both speech and braille when report highlight was on, and not when it was off. Tested in Firefox, chrome, Microsoft Edge and Internet Explorer.

Known issues with pull request:

  • Marked text is now reported by default in web browsers, where as previously, at least in Internet Explorer, you needed to turn on report emphasis. I would argue that marking (highlighting) is extremely important semantically, and should be reported by default, as this is used in many education scenarios including online exams. However, having it under report emphasis along with em and strong would cause many users to want to keep the option off, as those two other tags are used way too much (and sometimes inappropriately) on web pages.
  • As all browsers have exposed mark as an object rather than a run of text, this has forced NvDA to implement support for it via controlFields rather than formatFields. Thus the presentation is more like a blockquote rather than basic text formatting. Thus, in speech we get "out of marked content" rather than "not marked". I don't believe this is terrible myself.

Change log entry:

new features:

  • The existence of marked (highlighted) content is reported in both speech and braille in all web browsers.
  • This can be toggled on and off by a new NVDA Document Formatting option for Highlighting.

…ighted) content. Have speech and braille report its start and end within rich text if the report emphasis document formatting option is enabled. Map the IAccessible2 MARK role to the NVDA MARK role. This all means that the mark role will be reported in both Firefox and Chrome.
…tings, on by default, and have marked content be affected by that option rather than report emphasis.
@AppVeyorBot

This comment has been minimized.

Comment thread source/controlTypes.py
@feerrenrut

This comment has been minimized.

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably needs a change to the user guide.

Comment thread source/gui/settingsDialogs.py Outdated
@XLTechie

XLTechie commented Jul 29, 2020 via email

Copy link
Copy Markdown
Collaborator

@codeofdusk

codeofdusk commented Jul 29, 2020

Copy link
Copy Markdown
Contributor

This will be good, but why "marked content" instead of something shorter like "marked text"?

Presumably not just text can be marked.

… (highlighting).

UserGuide: mention the braille abbreviation for marked content.
feerrenrut
feerrenrut previously approved these changes Jul 30, 2020

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codeofdusk

codeofdusk commented Jul 30, 2020

Copy link
Copy Markdown
Contributor

@feerrenrut Did you intend to merge this or are you waiting for another reviewer?

@michaelDCurran michaelDCurran merged commit 39606f1 into master Jul 30, 2020
@michaelDCurran michaelDCurran deleted the supportMarkRole branch July 30, 2020 22:03
@nvaccessAuto nvaccessAuto added this to the 2020.3 milestone Jul 30, 2020
@btman16

btman16 commented Sep 14, 2020

Copy link
Copy Markdown

Hi,

I just installed NVDA 2020.3 beta 1 and while I think it's great that this option exists, I'd like to ask if this can please be off by default?
On certain sites, such as the classic Twitter mobile interface, user names are emphasized as being strong and it creates a lot of extra verbosity. A similar case came up after the release of NVDA 2015.4. At that time, reporting if text was marked as strong or not happened when emphasis reporting was checked in Document Formatting and this option was later disabled by default.

I'm wondering if a similar thing could be done with the marking option?

Thank you very much for your time and I look forward to any input you may have.

Sincerely,

Brandon Tyson

@feerrenrut

Copy link
Copy Markdown
Contributor

Hi @btman16 could you please create a new issue for this?

@btman16

btman16 commented Sep 16, 2020 via email

Copy link
Copy Markdown

@feerrenrut

Copy link
Copy Markdown
Contributor

I think this should be described as a feature. However, please do include any example sites where role=mark causes excessive verbosity. Thanks!

@btman16

btman16 commented Sep 19, 2020 via email

Copy link
Copy Markdown

@feerrenrut

Copy link
Copy Markdown
Contributor

Thanks @btman16, for reference the issue is #11640.

feerrenrut added a commit that referenced this pull request Oct 8, 2021
Prior work: #11436

- Use "highlight" instead of "marked content" for speech.
- Use "hlght" instead of "mrkd" for braille

'mark' elements were being reported as "marked content" which is long.
Additionally, the standard visual representation (in browsers) of mark is a yellow background, as if the text has been highlighted.
Arguably, "highlighted" is a more common phrase in English and more specific to the visual representation in browsers
The more general "marked" content could mean many different kinds of markings with varied semantics.
With the introduction of "role-description", less common usages of mark can be achieved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants