Re: [w3ctag/design-reviews] Review Accessibility Object Model (#134)

> I thought the role IDL attribute might work more like input's type content attribute and IDL attribute (e.g., how the IDL attribute always returns the "computed" value).

I'm not sure I follow. The `type` IDL attribute returns the value of the `type` content attribute, except where that value is missing or invalid, in which case it returns the default value.

Computing the role can be complex, for example the [ARIA 1.1 spec](https://www.w3.org/TR/wai-aria-1.1/) states:

> When an explicit or inherited role of `presentation` is applied to an element with the implicit semantic of a WAI-ARIA role that has required owned elements, in addition to the element with the explicit role of `presentation`, the user agent MUST apply an inherited role of `presentation` to any owned elements that do not have an explicit role defined. 

In terms of a code example, this means:

```html
<table role="presentation">
  <tr>
    <td>All</td>
    <td>these</td>
  </tr>
  <tr>
    <td>elements</td>
    <td>are</td>
  </tr>
  <tr>
    <td colspan="2">presentational</td>
  </tr>
</table>
```

Because a table must own rows, and rows must own cells, the `<table>` element having a role of `presentation` means that every `<tr>` and `<td>` also has a role of `presentation`, instead of `row` or `cell`. So computing the role can involve a tree walk.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/134#issuecomment-434512322

Received on Tuesday, 30 October 2018 23:51:03 UTC