Background
Vector uses msg-parentheses and msg-brackets in order to generate visual brackets and parenthesis via CSS content. This method was originally used to hide the visual content from screenreaders and assistive tech, but depending on the browser and screenreader the content can still be read out. Adding alternative text to the CSS content would be a quick fix, though it's support is limited to Chrome.
Related: https://phabricator.wikimedia.org/T268900#8256603
Requirement
Scope: Desktop web (Vector 2022).
- CSS-generated content (e.g., msg-parentheses, msg-brackets) must include alternative text of an empty string ('') to prevent screen readers from reading visual brackets or parentheses.
- Rendering must remain compatible with older browsers that do not support content alternative text.
- The visual display of parentheses and brackets must remain unchanged.
- Screen readers must only read the label text, not decorative characters.
BDD
Feature: Accessibility improvement for CSS-generated content
Scenario: Screenreader behavior with CSS-generated parentheses
Given I am using a modern browser and screenreader
When viewing a Vector page that includes `msg-parentheses` or `msg-brackets`
Then screenreader output does not announce the parentheses or brackets
And only the label text is read aloudTest Steps
Test Case 1: Screenreader validation
- Open a Vector 2022 page containing elements with msg-parentheses or msg-brackets.
- Enable VoiceOver (macOS) or NVDA (Windows).
- AC1: Screenreader reads only the label text.
- AC2: Parentheses/brackets are not read aloud.
QA Results - Beta
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T320996#11248379 |
| 2 | ✅ | T320996#11248379 |
QA Results - Prod
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T320996#11248384 |
| 2 | ✅ | T320996#11248384 |
Acceptance criteria for done
- CSS generated content in Vector has alternative text of empty string (i.e. content: '@{msg-parentheses-end}' / '')
- The rendering doesn't fail in older browsers that don't support content alternative text


