Are ARIA roles inherited by descendants?

In the following markup, I have a wrapper around an element <main>for presentation purposes.

<div id="main-wrapper" role="presentation">
  <main id="main" role="main">
    <h1>Title</h1>
    <p>Lorem ipsum, dolor sit amet.</p>
  </main>
</div>

However, I'm not sure that ARIA roles are inherited by descendants. It would be a problem if the element is <main>considered as presentation, since the wrapper around it has role="presentation".

Are ARIA roles used correctly? How are ARIA roles inherited?

+4
source share
1 answer

, . : http://www.w3.org/TR/wai-aria/roles#presentation " " role="presentation".

role="presentation" . role="main" "", <main>. , <main> ARIA-, <main>

, role="presentation" . <span> <div> , , :

, , , API-

<!-- 3. This role declaration is redundant. -->
<span role="presentation"> Sample Content </span>

role="presentation" , .

+3

Source: https://habr.com/ru/post/1526325/


All Articles