OAA LINK_5: Images should be at least 16 pixels by 16 pixels when used as links.

Rulesets

WCAG 2.0 Requirement 2.4.4 Link Purpose (In Context)
Status: Accepted
Severity: Recommendation
Priority: Priority 1
IITAA 1.0 9.1 Ensure that links are understandable out of context.
Type:
Severity: Violation
Priority: Priority 1
Status: Accepted

Markup References

Validation Code

Message

Avoid using images that are smaller than 16 pixels by 16 pixels as links.

Dependencies

None

Context

a

Parameters

None

Code

function (ruleContext) {
  var passed = true;
  if(ruleContext.childNodes && !xbrowser.getTextContent(ruleContext)) {
    for(var i=0; i<ruleContext.childNodes.length; i++) {
      if(ruleContext.childNodes[i].tagName) {
        if (ruleContext.childNodes[i].tagName.toLowerCase() == "img") {
          if (ruleContext.childNodes[i].clientWidth < 16 || ruleContext.childNodes[i].clientHeight < 16) {
            passed = false;
          } //endif
        } //endif  
      } //endif
    } //endfor
  } //endif
  return new ValidationResult(passed, [ruleContext], '', '', []);  
} // endfunction