Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule: ARIA required context role (ff89c9) #255

Merged
merged 74 commits into from
Nov 25, 2019
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
4b2cd9a
Create SC1-3-1-aria-required-context-role.md
Sep 14, 2018
bdbfbeb
Update SC1-3-1-aria-required-context-role.md
Sep 15, 2018
f80607d
Editorial update per feedback
Oct 3, 2018
409bb9a
Removed test case per feedback
Oct 3, 2018
8f79ac6
Update to Accessibility Support
Oct 3, 2018
4f4701d
Cleaner WAI-ARIA references
Oct 5, 2018
7b43dde
Editorials per feedback from Kasper
Oct 18, 2018
2ac617f
Create owner-element.md
Jan 22, 2019
ded2be6
Update owner-element.md
Jan 22, 2019
8a81b50
Update rule to use new Owner element definition
Jan 22, 2019
1542f48
Update owner-element.md
Jan 22, 2019
b9b79a8
chore: merge from master
jeeyyy Jan 22, 2019
8bf6038
Update included-in-the-accessibility-tree.md
Jan 22, 2019
dfc56b2
Update owner-element.md
Jan 22, 2019
c2ccbc1
Removed role="none"/"presentation"
Jan 22, 2019
35d480e
Updated test cases to match new definitions
Jan 22, 2019
9835b44
Add note about divergence from WAI-ARIA spec
Jan 22, 2019
d92d89c
Update SC1-3-1-aria-required-context-role.md
Jan 22, 2019
16f50c7
Editorials
Jan 22, 2019
47e4ce5
`aria-owns` support added to Accessibility Support
Feb 12, 2019
96472af
Test case moved from Failed to Inapplicable
Feb 12, 2019
0785f09
Changed "element" to "node"
Feb 12, 2019
9c81dcd
Disclaimer notes inserted
Feb 12, 2019
52a4b1e
Note added on hiding elements
Feb 12, 2019
4339973
Editorials per Wilco's comments
Mar 5, 2019
5c7b137
Updating to account for competing owned elements
Mar 6, 2019
127beb4
Adding links to definitions
Mar 6, 2019
473016f
Added link to definition
Mar 6, 2019
b952555
Rule updated to use new "owned by" definition
Mar 6, 2019
dc50845
Reverting changes to "included in the acc. tree"
Mar 6, 2019
542090d
Added inapplicable test case
Mar 6, 2019
31a7bf1
Added Passed test case
Mar 7, 2019
576eb0d
New assumption: role being used to comply to WCAG
Mar 7, 2019
c031c89
Further elaboration of assumption
Mar 7, 2019
8d08752
Editorials per Kasper's comments
Mar 21, 2019
08069fa
Fix incorrect code and descriptions in test cases
Apr 23, 2019
7578413
Accessibility Support note on empty elements
Apr 23, 2019
b360785
Editorial: Slight rewording of Expectation
May 1, 2019
4b13b65
Add id to frontmatter of rule
May 1, 2019
922d3e8
Update template + editorials + note for Appl.
Jun 7, 2019
33d0f44
Now tree-crossing ownership for implicit ownership
Jun 12, 2019
e9f8a8a
Added test cases crossing shadow boundaries
Jun 12, 2019
1a6d693
Extended description for shadow DOM test cases
Jun 13, 2019
9a6da41
Update SC1-3-1-aria-required-context-role.md
Brynanders Jul 3, 2019
6839767
Merge branch 'develop' into sc1-3-1-aria-required-context-role
jeeyyy Jul 3, 2019
376ce5f
Editorials
Jul 10, 2019
9b73e57
Editorial: plural for consistency
Jul 12, 2019
87777d3
Change test case description to match test case
Jul 12, 2019
476a2e6
Merge branch 'develop' into sc1-3-1-aria-required-context-role
jeeyyy Jul 17, 2019
4ff8e00
Rename SC1-3-1-aria-required-context-role.md to aria-required-context…
jeeyyy Jul 17, 2019
b7e25e0
Insert link to Understanding 1.3.1 document
Jul 18, 2019
c41e314
Add example to Appl. + change definition links
Jul 26, 2019
78169f8
Remove `slot` element from Passed Example 6
Jul 26, 2019
ee977ac
Add content to elements + Add new test case
Jul 26, 2019
c41dfe3
More links to "explicit-role" def. + fix typo
Aug 5, 2019
8f62229
Expectation: Note on superclass/subclass roles
Aug 6, 2019
32b92de
Edit subclass inclusion in required context roles
Aug 13, 2019
07ba91a
Add note about descoping DPUB from applicability
Aug 13, 2019
191b5cc
Adding inapplicable DPUB test case
Aug 14, 2019
c4e760e
Merge branch 'develop' into sc1-3-1-aria-required-context-role
jeeyyy Aug 14, 2019
f152e32
chore: merge from develop
jeeyyy Aug 14, 2019
8262e3a
Rename owner-element.md to owned-by.md
Aug 16, 2019
4efedba
Remove note + inclusion i acc. tree for point 1
Aug 16, 2019
1af2679
Editorials + change test cases
Aug 16, 2019
45f5648
Changing Passed Example 5 to pass SC 1.3.1
Aug 21, 2019
ca84d89
Merge branch 'develop' into sc1-3-1-aria-required-context-role
WilcoFiers Sep 25, 2019
89aee3c
Merge branch 'develop' into sc1-3-1-aria-required-context-role
Jym77 Oct 18, 2019
f4f5188
chore: update rule to use accessibility tree as input
WilcoFiers Nov 1, 2019
5b45798
Merge branch 'develop' into sc1-3-1-aria-required-context-role
WilcoFiers Nov 1, 2019
e3db62e
chore: fix failing tests
WilcoFiers Nov 1, 2019
5cbc373
Apply suggestions from code review
WilcoFiers Nov 13, 2019
7362c00
Merge branch 'develop' into sc1-3-1-aria-required-context-role
WilcoFiers Nov 13, 2019
5db02eb
Update aria-required-context-role-ff89c9.md
WilcoFiers Nov 13, 2019
b8519e1
Merge branch 'develop' into sc1-3-1-aria-required-context-role
jeeyyy Nov 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
191 changes: 191 additions & 0 deletions _rules/SC1-3-1-aria-required-context-role.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
---
name: ARIA required context role
description: |
This rule checks that a role does not exist outside of its required context roles

success_criterion:
- 1.3.1 # Info and Relationships
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update to the new format.


test_aspects:
- DOM Tree
- CSS Styling

authors:
- Anne Thyme Nørregaard
---

## Test procedure

### Applicability

The rule applies to any HTML or SVG element that is [included in the accessibility tree](#included-in-the-accessibility-tree) and has an explicit [semantic role](#semantic-role) with a [WAI-ARIA required context role](https://www.w3.org/TR/wai-aria-1.1/#scope), except if the element has an implicit semantic role that is identical to its explicit semantic role.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

WilcoFiers marked this conversation as resolved.
Show resolved Hide resolved

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editorial: Add an example to clarify the last point:

except if the element has an implicit semantic role that is identical to its explicit semantic role (e.g. <li role="listitem">).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example added, but as a note to keep normative and informative parts of the rule seperate.


### Expectation

The [owner element](owner-element) for each target element has a [semantic role](#semantic-role) matching one of the [WAI-ARIA required context roles](https://www.w3.org/TR/wai-aria-1.1/#scope) for the target element.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should put in an example here. Maybe just add something like "(e.g. listitem is owned by a list)". This sentence is all Auto-WCAG and ARIA jargon. This might help explain it.


## Assumptions

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.


_There are currently no assumptions_

## Accessibility Support

This rule relies on assistive technologies to recognize [owner elements](#owner-element). This includes when the owner elements are ancestors that are not parents of the target element. However, some assistive technologies do not recognize owner elements that are not parents, unless workarounds are used.

This comment was marked as resolved.

Furthermore, `aria-owns` has limited support in user agents.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"in user agents" -> "in some user agents"


## Background

- [Required Context Role](https://www.w3.org/TR/wai-aria-1.1/#scope)

## Test Cases

### Passed

#### Passed example 1

Element with role `listitem` is contained within its required context role `list`, expressed as an explicit role.

```html
<div role="list">
<div role="listitem"></div>
</div>
```

#### Passed example 2

Element with role `listitem` is contained within its required context role `list`, through the implicit role of `ul`.

```html
<ul>
<div role="listitem"></div>
</ul>
```

#### Passed example 3

Element contained within its required context role even though it is not a direct child of the context role.

```html
<div role="list">
<div>
<div>
<div>
<div role="listitem"></div>
jeeyyy marked this conversation as resolved.
Show resolved Hide resolved
</div>
<div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two <div> should be </div> (although it doesn't change the outcome)

<div>
</div>
```

#### Passed example 4

`aria-owns` used to give the target element the right context role.

```html
<div role="list" aria-owns="id1">
<div role="tabpanel">
<div id="id1" role="listitem"></div>

This comment was marked as resolved.

This comment was marked as resolved.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Example 5, I put text in the list item and I expected that VO reads "a list with 1 item". But it doesn't give us the semantic of the element.

<div role="list" aria-owns="id1 id2">
    <div>Follow a list</div>
    <div id="id1" role="listitem">Lista 1</div>
    <div id="id2" role="listitem">Lista 2</div>
  </div>

With VO: how many items in the list? 3. I expected 2.

Either w/ a more natural building, VO doesn't recognise the aria-owns:

<h2>Test 1: 1 native nested list w/ native relation</h2>

<ul>
<li>Fruts
  <ul>
    <li>Apples</li>
    <li>Bananas</li>
  </ul>
 </li>
 <li>Vegetables</li>
</ul>
  
  
<h2>Teste 2: 2 native lists w/ relations through aria-owns</h2>
  
<ul>
<li aria-owns="child">Fruts</li>
<li>Vegetables</li>
</ul>

<ul id="child">
<li>Apples</li>
<li>Bananas</li>
</ul>
  
<h2>Test 3: 2 non-native lists + relations through aria-owns and list semantic through ARIA</h2>

<div role="list">
<div role="listitem" aria-owns="fruit">Fruts</div>
<div role="listitem">Vegetables</div>
</div>

<div role="list" id="fruit">
<div role="listitem">Apples</div>
<div role="listitem">Bananas</div>
</div>

VO do not recognise the relations neither in test 2 nor test 3

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jorgeponto, do you think this is covered well enough in the current Accessibility support section?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kasperisager and I discussed this, and we feel that it is covered through the following sections:

Accessibility Support

  • This rule relies on assistive technologies to recognize which elements are owned by each other. This includes when the element is owned by another element that is an ancestor, but not a parent of the target element. Some assistive technologies do not accept these owned by relationships, unless workarounds are used.
    Furthermore, aria-owns has limited support in some user agents.
  • Some user agents and assistive technologies ignore empty elements, which means they are not presented to all users. However, since this is handled inconsitently across user agents and assistive technologies, empty elements are applicable to this rule.

"Owned by" definition:

Note: This definition is diverging from the definition of "owned element" in WAI-ARIA. The reason is that the WAI-ARIA definition was found to provide too little guidance on how to handle specific edge cases where several elements compete about the ownership, and it seem that browser implementations of this are diverging a lot. This definition seeks to find a reasonable middle ground, but will have to be updated if the WAI-ARIA definition changes.

I am going to gamble, and go ahead and take this rule into Final Call, while waiting for @jorgeponto to get back on this.
If we find out, against expectations, that substantial changes are required to handle the cases of VO acting out, we will just have to redo the Final Call afterwards.

</div>
</div>
```

### Failed

#### Failed example 1

No context role.

```html
<div role="listitem"></div>
```

#### Failed example 2

Wrong context role

```html
<div role="tablist">
<div role="listitem"></div>
</div>
```

#### Failed example 3

Element not contained within its required context role.

```html
<div role="list"></div>
<div role="listitem"></div>
```

#### Failed example 4

This comment was marked as resolved.

This comment was marked as outdated.

Element with role `listitem` has a closer ancestor, that is included in the accessibility tree, than the role `list` that should have been its context role
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should have Failed example 5 and 7 in here. I agree, these are correct, but given that we're going outside standards land I think we should be a little forgiving about tools that don't have an owned elements implementation that works exactly the way we've defined owned element.

I'd prefer to remove this, but if you feel strongly about it, leave them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to make it very explicit what the consequences of our definition is, and then have a discussion about it, if people disagree, rather than having it be a big blur, where everyone can have their own interpretation...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilcoFiers, I have added notes for the two test cases in question (now Failed example 4+6) and for the Expectation.
Do you think this works?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My preference is to remove them, but since you're the author, I'll leave it up to you.


```html
<div role="list">
<div aria-label="menu">
<div role="listitem"></div>
<div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be </div>

</div>
```

#### Failed example 5

Element with role `listitem` has a closer ancestor, that is included in the accessibility tree, than the role `list` that should have been its context role

```html
<div role="list">
<div role="tabpanel">
<div role="listitem"></div>
</div>
</div>
```

#### Failed example 6

The owner element is the first element that references the target element through `aria-owns`, which results in the wrong context role.

```html
<div role="tabpanel" aria-owns="id1">
<div role="list" aria-owns="id1">
<div id="id1" role="listitem"></div>
</div>
</div>
```

### Inapplicable

#### Inapplicable example 1

Element does not have an explicit semantic role

```html
<ul></ul>
```

#### Inapplicable example 2

Element is not exposed to assistive technologies.

```html
<div role="tab" aria-hidden="true"></div>
```

#### Inapplicable example 3

Role does not have any required context roles listed in WAI-ARIA spec.

```html
<div role="radio"></div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the #546 , this test case is missing an accessible name to conform to SC 1.3.1 . Moreover, the radio implicit role required aria-checked to share its state.

Proposal

<label for="control-radio"> A radio control</label>
<div role="radio" aria-checked="true" id="control-radio"></div>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say it actually doesn't. The rule Form field has an accessible name is only for 4.1.2.
I would also say that the requirement for having aria-checked on there is for 4.1.2 - if it is a requirement at all, since there is a fallback value (false) specified for it in WAI-ARIA (see "Implicit value for role" in https://www.w3.org/TR/wai-aria-1.1/#radio).

It's not that I don't want to put it on, but then at least also the tabpanel roles in Passed Example 5, Failed Example 5 and Failed Example 6 also needs to have a name, since accessible name is required for that role too (see https://www.w3.org/TR/wai-aria-1.1/#tabpanel).

```

#### Failed example 4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed => Inapplicable


Element is not exposed to assistive technologies, since decendant has `aria-hidden` attribute with value set to `true`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decendant > descendant

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not the "descendant" but the "parent" that has the aria-hidden property no?


```html
<div role="list" aria-hidden="true">
<div role="listitem"></div>
</div>
```
17 changes: 15 additions & 2 deletions pages/glossary/included-in-the-accessibility-tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,21 @@ title: Included in the accessibility tree
key: included-in-the-accessibility-tree
---

Elements included in the accessibility tree of platform specific accessibility APIs. Elements in the accessibility tree are exposed to assistive technologies, allowing users to interact with the elements in a way that meet the requirements of the individual user.
Elements included in the accessibility tree of platform specific accessibility APIs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this say "DOM Nodes" instead of "Elements"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Researched to see which wording is used elsewhere, and found this definition of "accessible object", which may when matured into a recommendation replace our definition of "included in the accessibility tree": https://www.w3.org/TR/html-aam-1.0/#dfn-accessible-object

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"accessible object" is also a definition in Core Accessibility API Mappings 1.1, https://www.w3.org/TR/core-aam/#dfn-accessible-object, that is already a recommendation...


The general rules for when elements are included in the accessibility tree are defined in the [core accessibility API mappings](https://www.w3.org/TR/core-aam/). For native markup languages, such as HTML and SVG, additional rules for when elements are [included in the accessibility tree][] can be found in the [HTML accessibility API mappings](https://www.w3.org/TR/html-aam/) and the [SVG accessibility API mappings](https://www.w3.org/TR/svg-aam/).
Elements in the accessibility tree are exposed to assistive technologies, allowing users to interact with the elements in a way that meet the requirements of the individual user.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r/meet/meets


An element is included in the accessibility tree if it is a DOM node in the flattened DOM tree that meets the following criteria:

1. It isn't hidden through WAI-ARIA or CSS, and
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed "2. It does not have a semantic role of none or presentation, and" from @WilcoFiers' original suggestion at #302 (comment), since giving an element role presentation or none will not remove the element from the accessibility tree, just remove its role.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we clarify aria-hidden, display:none or visibility:hidden? There are only 3 options here so maybe we can just include them.

2. it has one or more of the following:
* It has a [semantic role](#semantic-role), or
* It has an accessible name that, when trimmed of whitespace, is not an empty string, or
* it owns another element though an `aria-owns` attribute, or
* It is owned by another element that references it with `aria-owns`

> **Note:** Text nodes and pseudo elements can also be part of the accessibility tree, since they have their text content as the accessible name.

The general rules for when elements are included in the accessibility tree are defined in the [core accessibility API mappings](https://www.w3.org/TR/core-aam/). For native markup languages, such as HTML and SVG, additional rules for when elements are [included in the accessibility tree](#included-in-the-accessibility-tree) can be found in the [HTML accessibility API mappings](https://www.w3.org/TR/html-aam/) and the [SVG accessibility API mappings](https://www.w3.org/TR/svg-aam/).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this paragraph needs to be here. These mapping documents describe how to map attributes to the accessibility APIs. It doesn't say much about which elements are and which aren't part of the accessibility tree.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilcoFiers, I just looked into it, and it seems that the core-aam has some pretty neat guidance on when things should excluded from and included in the accessibility tree.
Reading this, we can see things that we have gotten wrong so far, e.g. missing the html5 hidden attribute as a way of excluding things from the accessibility tree, and that focusable elements per the spec should be included in the accessibility tree...

Will check out the other two specs for relevance later...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilcoFiers At least SVG AAM defines additional criteria for when elements are included in/excluded from the accessibility tree, see https://www.w3.org/TR/svg-aam/#include_elements and https://www.w3.org/TR/svg-aam/#exclude_elements. As such, SVG elements have different requirements than e.g. HTML for when accessible objects are created in the accessibility tree and do not fit the criteria currently listed.


> **Note:** Users of assistive technologies might still be able to interact with elements that are not included in the accessibility tree. An example of this is a [focusable](#focusable) element with an `aria-hidden` attribute with a value of `true`. Such an element could still be interacted with using sequential keyboard navigation regardless of the assistive technologies used, even though the element would not be included in the accessibility tree.
12 changes: 12 additions & 0 deletions pages/glossary/owner-element.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally the file name should be owned-by.md

title: Owner element
key: owner-element
---


If the node is referenced by an element through the `aria-owns` attribute, then the owner element is the first node in the DOM tree that references it through `aria-owns`.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be "the first node in the DOM tree that is not hidden using WAI-ARIA or CSS and that references it through aria-owns." ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilcoFiers, first node, would that be traversing up through the DOM from the referencing/owned element? Or down from the top of the DOM tree?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on the answer for this, Failed example 7 might have to be changed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My interpretation of the Core Accessibility API mappings is that it is from the top of the DOM tree (which makes failed example 7 a fail). But I might be wrong since it is not explicit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@annethyme That's a good question. I would say that as long as the element is in the DOM, its "aria-owns" claim should persist, so that putting aria-hidden="true" on it means it and all its owned elements are considered hidden, and not cause its owned elements to change owner. I can easily see that being decided differently if this ever makes it to a standards group, but for now, my vote would be to keep what is here. It's also the simplest way to look at it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilcoFiers, added a note reflecting your view on hiding the owner element's consequence for owned elements.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilcoFiers, can you agree to what Carlos also said on this:
first node, would that be traversing up through the DOM from the referencing/owned element? Or down from the top of the DOM tree?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting from the root node, yes.

Copy link
Collaborator Author

@annethyme annethyme Mar 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kasperisager found this case that is not covered by the current definition:

<html>
  <body>
    <div aria-owns="child">
      Parent
    </div>

    <div id="child">
      Child 1
    </div>

    <div id="child">
      Child 2
    </div>
  </body>
</html>

Parent owns Child 1
Parent does not own Child 2

Otherwise, the owner element is the closest ancestor that is [included in the accessibility tree](#included-in-the-accessibility-tree).

Nodes that are not included in the accessibility tree do not have an owner element.

> **Note:** This definition is diverging from the definition of ["owned element" in WAI-ARIA](https://www.w3.org/TR/wai-aria-1.1/#dfn-owned-element). The reason is that the WAI-ARIA definition was found to provide too little guidance on how to handle specific edge cases where several elements compete about the ownership, and it seem that browser implementations of this are diverging a lot. This definition seeks to find a reasonable middle ground, but will have to be updated if the WAI-ARIA definition changes.