OAA HEADING_7: Text content for a heading must not come just from image alt text.

Rulesets

WCAG 2.0 Requirement 2.4.6 Headings and Labels
Status: Accepted
Severity: Recommendation
Priority: Priority 1
IITAA 1.0 1.4 Use headings to introduce sections and sub-sections, and use them in the correct order.
Type:
Severity: Violation
Priority: Priority 1
Status: Accepted

Markup References

Validation Code

Message

Each subheading element (h2..h6) should have text content exclusive of the alt text of any img elements it contains.

Dependencies

None

Context

h2 | h3 | h4 | h5 | h6

Parameters

None

Code

function (ruleContext) {
  var headingText = util.getNodeTextRecursively(ruleContext).length > 0;
  var passed = headingText != util.getDisplayableAlt(ruleContext);
  return new ValidationResult(passed, [ruleContext], [], '', []);
}  // endfunction