w3c / html-aam

HTML Accessibility API Mappings
https://w3c.github.io/html-aam/
Other
97 stars 25 forks source link

Clarify contextual roles and accessibility parents #541

Open scottaohara opened 3 months ago

scottaohara commented 3 months ago

follow on to https://github.com/w3c/aria/issues/2137, and similar to https://github.com/w3c/html-aam/pull/540

for elements that have an accessibility parent / child dependency to expose their roles, ensure that any contextual role mappings take into account whether the element is an accessibility child of the required parent element.

go through the remaining elements to make sure everything is called out that needs to be.

aria-owns should be accounted for here, while also taking into account parser rules where aria-owns will be the only way to re-slot an errant element back into an otherwise invalid markup pattern.

for instance, table parsing will correct for invalid elements being nested into the table

<table>
    <tr>
        <article>
            <td>cell</td>
        </article>
        <td>other cell</td>
    </tr>
</table>

gets parsed to render as

<article> </article>
<table>
    <tr>
        <td>cell</td>
        <td>other cell</td>
    </tr>
</table>

there could be some debate as to if the following makes sense to re-establish a cell role for the td.... since while it can be inserted back into the row as the last cell, there could be some big lifts for an author to actually make this visually look like the cell is in the location it should be in... hmm..

<table>
    <tr aria-owns=f>
        <td>cell</td>
        <td>other cell</td>
    </tr>
</table>

<td id=f> why am i out here? </td>