IBMa / equal-access

IBM Equal Access Accessibility Checker contains tools to automate accessibility checking from a browser or in a continuous development/build environment
Apache License 2.0
615 stars 75 forks source link

ACT 46ca7f: Element marked as decorative is not exposed - Expected failed, but returned passed #1938

Open philljenkins opened 1 week ago

philljenkins commented 1 week ago

The Checker is passing this ACT testcase, but ACT says it is a failed example:

ACT ruleID 46ca7f: Element marked as decorative is not exposed

Failed Example 2 Open in a new tab This img element is marked as decorative through its empty alt attribute but has a non-empty aria-labelledby attribute causing it to be included in the accessibility tree with its implicit role of img.

<img src="/test-assets/shared/w3c-logo.png" alt="" aria-labelledby="label" /> 
<span hidden id="label">W3C logo</span>

Checker ACT results act-report-v2 2024-06-17.txt : Expected failed, but returned earl:passed for ACT 46ca7f

Checker rule: [aria_attribute_valid]() returns pass

    "ruleId": "aria_attribute_valid",
    "reasonId": "Pass",
    "message": "ARIA attributes are valid for the element and ARIA role",

help - aria_attribute_valid

philljenkins commented 1 week ago

See Chrome, Firefox, JAWS, and VoiceOver behaviors below:

Chrome

The Chrome browser Accessibility Tree (see image) seems to agree with the ACT logic assumption that the native HTML elements (roles) and attributes, such as <img alt="", take precedence and therefor ignore the aria-* label: image

Firefox

The Firefox browser Accessibility Tree also seems to agree with the ACT logic assumption that the native HTML elements (roles) and attributes, such as <img alt="", take precedence and therefor ignore the aria-* label: image

JAWS

JAWS does not read anything for the image. It does not say the label.

VoiceOver

However, VoiceOver does read the aria-labelledy "W3C logo" outloud.
This mean that JAWS is getting the alt="" decorative attribute differently, not via the accessibility tree, and/or it's a JAWS bug.

philljenkins commented 1 week ago

Checker rule logic seems to be validating the aria-* attribute for the HTML <img> even though it has the precedence setting alt="" attribute:

Pass: [
      {
        "ruleId": "aria_attribute_valid",
        "value": [
          "VIOLATION",
          "PASS"
        ],
        "path": {
          "dom": "/html[1]/body[1]/img[1]",
          "aria": "/document[1]/img[1]"
        },
        "ruleTime": 0,
        "reasonId": "Pass",
        "message": "ARIA attributes are valid for the element and ARIA role",
        "messageArgs": [
          "aria-labelledby",
          "img",
          "img"
        ],
        "apiArgs": [],
        "bounds": {
          "left": 8,
          "top": 8,
          "height": 48,
          "width": 72
        },
        "snippet": "<img aria-labelledby=\"label\" alt=\"\" src=\"/WAI/content-assets/wcag-act-rules/test-assets/shared/w3c-logo.png\">",
        "category": "Accessibility",
        "ignored": false,
        "level": "pass",
shunguoy commented 1 week ago

Aria_attribute_conflict: to map to ACT ruleID 46ca7f, make a specific reason code, and map to ACT (and remove 46ca7f mapping from aria_attribute_valid) or create a new rule for <img> element