Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images with implicit roles behave differently across browsers #4436

Open
1 task done
gaiety-deque opened this issue Apr 30, 2024 · 1 comment
Open
1 task done

Images with implicit roles behave differently across browsers #4436

gaiety-deque opened this issue Apr 30, 2024 · 1 comment
Labels
accessibility support fix Bug fixes info needed More information or research is needed to continue

Comments

@gaiety-deque
Copy link
Contributor

Product

axe-core

Product Version

4.9.0

Latest Version

  • I have tested the issue with the latest version of the product

Issue Description

Expectation

A decision should be made about how axe-core handles images with empty alt attributes (not unset ones) with regards to implicit VS implied roles as the spec specifies when using non-Global aria attributes like aria-level.

// test/checks/navigation/region.js
  it('should return false when img content outside of the region has a non-global aria attribute with an empty alt attribute string', function () {
    const checkArgs = checkSetup(`
      <img id="target" src="#" aria-level="2" alt="" />
      <div role="main">Content</div>
    `);

    assert.isFalse(checkEvaluate.apply(checkContext, checkArgs));
  });

Actual

axe.commons.standards.getGlobalAriaAttrs is leveraged for the region rule and possibly others, when the spec may mean we need to be more broad in cases that use getRole for images with empty alt attributes.

How to Reproduce

The following code behaves inconsistently according to the accessibility tree. In Firefox it is removed from the tree, in Chrome it is in the tree with an empty alt.

<img alt="" aria-level="2" />

Additional context

Presentational Roles Conflict Resolution is very specific about the behavior between elements with inherited VS implicit roles. An image with an empty alt attribute has an implicit img role I'd suspect the following would be the case:

However, if an element has only non-global, role-specific WAI-ARIA states or properties, the element MUST NOT be exposed unless the presentational role is inherited and an explicit non-presentational role is applied.

@gaiety-deque gaiety-deque added the ungroomed Ticket needs a maintainer to prioritize and label label Apr 30, 2024
@WilcoFiers
Copy link
Contributor

Interesting. Even if it's in the accessibility tree, assistive technologies will probably ignore it. I think this needs further testing before we do anything with it. The other thing that could be going on here is that Chrome DevTools is misleading us. Chrome DevTools sometimes shows things in the accessibility pane that isn't in the actual accessibility tree. I think it does that to try to be helpful, or maybe its just that the CDP doesn't provide all the information and they need to fake it a bit. Not sure.

In either case, its worth testing this with actual assistive tech.

@WilcoFiers WilcoFiers added fix Bug fixes accessibility support info needed More information or research is needed to continue and removed ungroomed Ticket needs a maintainer to prioritize and label labels May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility support fix Bug fixes info needed More information or research is needed to continue
Projects
None yet
Development

No branches or pull requests

2 participants