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

SIA-R57 is potentially not recognizing the search landmark #1288

Open
offsetChris opened this issue Dec 8, 2022 · 2 comments
Open

SIA-R57 is potentially not recognizing the search landmark #1288

offsetChris opened this issue Dec 8, 2022 · 2 comments
Labels
bug Report of unexpected or faulty behaviour in Alfa

Comments

@offsetChris
Copy link

I came across an instance where it seems like the search landmark is not being recognized by the check, however this may need further investigation. The search landmark should not require an accessible name unless there are multiple in the same document. The code example may shed light on this issue:

<form role="search">
  <label>
    Search
    <input type="text">
  </label>
  <button type="submit">Search</button>
</form>
@offsetChris offsetChris added the bug Report of unexpected or faulty behaviour in Alfa label Dec 8, 2022
@Jym77
Copy link
Contributor

Jym77 commented Dec 9, 2022

🤔
<form> without an accessible name do not have an implicit role (per HTML AAM), which we cannot really handle in the Accessibility tree building the way we currently do it (#298), so we hack around a bit in the rules that need it, such as R57. However, this hack should accept the explicit role.

I guess there is some problem in hasIncorrectRoleWithoutName

@Jym77
Copy link
Contributor

Jym77 commented Dec 9, 2022

@offsetChris When trying to run R57 on that example, I get no error 🤔

const form = (
  <form role="search">
    <label>
      Search
      <input type="text" />
    </label>
    <button type="submit">Search</button>
  </form>
);

const document = h.document([form]);

main();

async function main() {
  const result = Array.from(
    await evaluate(Rules.get("R57").getUnsafe(), { document })
  );
  const failed = result.filter((outcome) => outcome.outcome === "failed");

  console.log(`failures: ${failed.length}`);
}

Gives me 0 failures.
Do you have a page to reproduce the problem? Could it be due to an older Alfa version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report of unexpected or faulty behaviour in Alfa
Projects
None yet
Development

No branches or pull requests

2 participants