Iframe editor puts `aria-label` on `<body>`, which axe reports as aria-prohibited-attr

Open
#11,269 0 comments 0 reactions 0 assignees View on GitHub

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

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

type: bug

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

  1. Initialise TinyMCE 6.8.6 or 7.9.3 in iframe mode with iframe_aria_text: 'Body'.
  2. Run axe-core with the wcag2a, wcag2aa, wcag21a, wcag21aa and wcag22aa tags, including iframes.
  3. 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tinymce/tinymce

All issues in tinymce/tinymce

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.