Skip to content

Commit

Permalink
HTML Reporter: Change #qunit-banner from H2 to DIV
Browse files Browse the repository at this point in the history
There is no need for this presentational pixel bar to be a heading
element. It is completely a presentational thing that is better
represented with a DIV instead.

This previously produced the following accessiblity warning,
e.g. in Firefox's Accessibility inspector, or in Chrome with AXE.

> Headings must not be labeled.
>
> `Role: heading. "" [text label]`
>
> https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Text_labels_and_names

> Headings must not be empty.
>
> https://github.com/dequelabs/axe-core/blob/v4.9.1/doc/rule-descriptions.md
> https://act-rules.github.io/rules/ffd0e9

Fixes #1427.
  • Loading branch information
Krinkle committed Jul 1, 2024
1 parent f3faf02 commit e19ea9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ QUnit 1.x, 2.x:
```html
<div id="qunit">
<h1 id="qunit-header">…</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-banner"></div>
<div id="qunit-testrunner-toolbar">…</div>
<h2 id="qunit-userAgent">…</h2>
<div id="qunit-testresult">…</div>
Expand Down
2 changes: 1 addition & 1 deletion src/reporters/HtmlReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ export default class HtmlReporter {
// contains id="qunit".
qunit.innerHTML =
"<h1 id='qunit-header'>" + escapeText(document.title) + '</h1>' +
"<h2 id='qunit-banner'></h2>" +
"<div id='qunit-banner'></div>" +
"<div id='qunit-testrunner-toolbar' role='navigation'></div>" +
this.appendFilteredTest() +
"<h2 id='qunit-userAgent'></h2>" +
Expand Down

0 comments on commit e19ea9f

Please sign in to comment.