Redundant img role (Test 46)

Test 46 flags img elements that carry a redundant role="img" attribute, since img already has a native semantic role of img. Images whose src ends in .svg (optionally followed by a query string or URL fragment, e.g. cache-busting "logo.svg?v=2") are excluded from this test, since some assistive technologies have historically misread the src of svg images without an explicit role="img" (WebKit bug 216364), and adding role="img" to svg-sourced img elements is a recognized best practice. See: MDN: identifying SVG as an image.

img with no role - N/A

img with role="img" not visible in the DOM - N/A

img with role="img" not available to assistive technology - N/A

img with role="img" and a raster (.jpg) src - Fail

img with role="img" and no src - Fail

img with role="img" and a src ending in .svg - Pass

Company logo

img with role="img" and a src ending in .SVG (all caps) - Pass

Company logo

img with role="img" and a src ending in .SvG (mixed case) - Pass

Company logo

img with role="img" and a .svg src followed by a cache-busting query string - Pass

Company logo

img with role="img" and a .svg src followed by a URL fragment - Pass

Company logo

img with role="img" and a src that merely contains .svg mid-string (not the real extension) - Fail

Company logo

Real world example (SidearmSports / UserWay widget) - Pass

University of Georgia Athletics