Skip to content

Determining interactivity returning different results with latest version of aria-query #8728

@benmccann

Description

@benmccann

Describe the bug

#8724 removed four tests that started failing with the upgrade of aria-query and axobject-query and added four TODOs

elementRoles from aria-query used to contain:

  { constraints: [ 'descendant of table' ], name: 'td' },
  { attributes: [ { name: 'role', value: 'gridcell' } ], name: 'td' }

But after #8724 it contains:

  {
    constraints: [ 'ancestor table element has table role' ],
    name: 'td'
  },
  {
    constraints: [ 'ancestor table element has grid role' ],
    name: 'td'
  }

This gives different results when element_interactivity calls match_schema because of the presence/absence of attributes:

https://github.com/sveltejs/svelte/blob/d6f0b7bd5bacbe3ab2aae8dc43a6313cbf42b99a/packages/svelte/src/compiler/compile/utils/a11y.js#LL157C13-L157C13

Reproduction

import { elementRoles } from 'aria-query';
console.log(elementRoles.keys().filter((schema) => schema.name === 'td'))

Logs

No response

System Info

`aria-query` 5.1.3 and 5.2.1

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions