Iframe editor puts `aria-label` on `<body>`, which axe reports as aria-prohibited-attr
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 39/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- html, javascript, typescript
- Domain
- accessibility, frontend
Research direction
Start with getIframeHtml in tinymce.js, which the issue identifies as producing the body markup, and review the iframe_aria_text documentation. Reproduce the axe violation in iframe mode and check how the editor name is announced in Chrome, Firefox, and Safari. Done means finding a naming approach that preserves screen reader behavior and passes axe, or documenting the limitation if no such approach is possible.
Written by the indexing model from the issue text.
Description
Iframe editor puts aria-label on <body>, which axe reports as aria-prohibited-attr
What happens
In iframe (classic) mode, TinyMCE builds the editing document with the iframe_aria_text value as an aria-label on <body>:
<body id="tinymce" class="mce-content-body" data-id="…" aria-label="…">
axe-core (4.13.0, WCAG 2.x A/AA tags) reports this as aria-prohibited-attr (serious): body has no permitted roles, and naming it is prohibited. The target is #<editor-id>_ifr #tinymce.
This is the same markup in 6.8.6 and 7.9.3 (getIframeHtml in tinymce.js).
Why it can't just be removed
Screen readers find the editor's name in different places:
| Browser | Where the name comes from |
|---|---|
| Firefox | The iframe's title (7.x already sets it to iframe_aria_text in Firefox only) |
| Chrome | The aria-label on <body> |
| Safari | The aria-label on <body> |
We removed the body label in an integration and moved the name to the iframe document's <title>. Firefox still announced the name. Chrome announced only "text area, new line, insertion at beginning of text", and Safari announced nothing. So the label is what makes the editor accessible in Chrome and Safari, yet it is also what makes automated WCAG audits fail (WCAG 2.2 SC 4.1.2 Name, Role, Value).
Steps to reproduce
- Initialise TinyMCE 6.8.6 or 7.9.3 in iframe mode with
iframe_aria_text: 'Body'. - Run axe-core with the
wcag2a,wcag2aa,wcag21a,wcag21aaandwcag22aatags, including iframes. - Expected: no violations on the editing area. Actual: aria-prohibited-attr on
#tinymce.
What we're asking
Guidance, or a fix, for naming the iframe editing area in a way that both works with screen readers in Chrome and Safari and passes axe. If none is possible in iframe mode, it would help to say so in the accessibility documentation and the iframe_aria_text docs, so that integrators can record it as a known automated-check failure rather than remove the label.
Environment
- TinyMCE 6.8.6 (also confirmed in the 7.9.3 source)
- axe-core 4.13.0 via @axe-core/playwright
- Chrome, Firefox and Safari on macOS, with screen readers
- Dominant language
- TypeScript
- Stars
- 16.3k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tinymce/tinymce
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Autosave: storeDraft throws "Cannot read properties of undefined (reading 'isEmpty')" on BeforeUnload for an editor that is still initialisingPossibly taken @rayw-lab claimed this 6 days ago. Openplugin: autosave status: escalated type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
tenstorrent/ttnn-visualizer#2526 ·
Maintainers usually reply within 1 day
-
trySessionCache calls /get-session twice when minting session_data (cache miss or expired cookie)Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
neondatabase/neon-js#301 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tashfeenahmed/freellmapi#2305 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100