https://a11ysupport.io/tests/html/aria_gridcell(aria-selected).html
<table role="grid">
<tr>
<th>
Date
</th>
<th>
Name
</th>
</tr>
<tr>
<td tabindex="0">
2018-01-01
</td>
<td aria-selected="false" tabindex="0">
target 1
</td>
</tr>
<tr>
<td tabindex="0">
2018-01-02
</td>
<td aria-selected="true" tabindex="0">
target 2
</td>
</tr>
</table>
Expectation: No "aria-allowed-attr" violation.
Actual: An "aria-allowed-attr" violation: Fix any of the following: ARIA attribute is not allowed: aria-selected="true"
Motivation:
axe-core version: 4.0.1
axe-webdriver, extension or other integration version: N/A
Browser and Assistive Technology versions
- Firefox Developer Edition 80.0b8 (64-bit)
For Tooling issues:
- Node version: N/A
- Platform: macOS Catalina 10.15.6
Thanks for the issue. The problem looks like we don't look for a parent grid in our implicit role calculation so the td is being resolved with a role of cell instead of gridcell.
The implicit role calculation needs to be updated for td by turning it into a function (rather than a string). The function accepts vNode as an argument. The function should look for the closest table element and look at its explicit role (getExplicitRole). If the role is grid or treegrid it should return gridcell, otherwise return cell.
No Aria attribute failure is seeing for table's data look for a parent grid so the td is being resolved with a role of cell instead of gridcell. Hence results now we can see in the passes with appropriate message even.

No docs required
Most helpful comment
Thanks for the issue. The problem looks like we don't look for a parent
gridin our implicit role calculation so thetdis being resolved with a role ofcellinstead ofgridcell.