core-aam icon indicating copy to clipboard operation
core-aam copied to clipboard

aria-owns mappings incorrect

Open aleventhal opened this issue 4 years ago • 6 comments

For example, IA2 mapping says to use relations. In reality, aria-owns alter what the browser exposes as normal parent/child relationships in the ax object hierarchy.

Also, there should be a section on how to handle illegal uses of aria-owns:

  • The same object is owned multiple times
  • Cycles, e.g. one element is owned by an element that owns it.

aleventhal avatar Oct 30 '20 14:10 aleventhal

We should probably update the mappings to state that the relationship is only needed when the user agent does not change the normal parent/child relationships. (e.g. I don't think WebKit changes it, though I'd need to triple check that).

Regarding the proposed section, that would belong in the ARIA spec I believe. Handling illegal uses has nothing to do with which accessibility API is being used, right?

joanmarie avatar Oct 30 '20 14:10 joanmarie

Just FYI, the Handling Author Errors -- States and Properties section of the ARIA spec currently says:

User agents are not responsible for logical validation, such as the following:

  1. Circular references created by relations, such as specifying that two elements own each other.
  2. Correct usage with regard to DOM tree structure, such as an element being owned by more than one other element.

carmacleod avatar Nov 01 '20 13:11 carmacleod

Thanks for these replies.

Regarding circular references, user agents end up being responsible for them anyway because they can cause crashes, but I guess I would take the spec as saying, do what you want with illegal aria-owns.

Fixing weird crashes with aria-owns has taken way too much of my time in the Chrome code source code for the reparenting benefit it provides. I hate that aria-owns does this, but it's too late to drop that at this point.

aleventhal avatar Nov 03 '20 13:11 aleventhal

If you think that stronger words in the definition of aria-owns would be helpful, please suggest some. Here are the current instructions for authors (looks a bit weak to me, and doesn't mention circular refs):

Authors SHOULD NOT use aria-owns as a replacement for the DOM hierarchy. If the relationship is represented in the DOM, do not use aria-owns. Authors MUST ensure that an element's ID is not specified in more than one other element's aria-owns attribute at any time. In other words, an element can have only one explicit owner.

carmacleod avatar Nov 03 '20 14:11 carmacleod

Authors MUST NOT create circular references with aria-owns. In the case of authoring error with aria-owns, the user agent MAY ignore some aria-owns element references, if necessary in order to build a consistent model of the content.

On Tue, Nov 3, 2020 at 9:07 AM Carolyn MacLeod [email protected] wrote:

If you think that stronger words in the definition of aria-owns https://w3c.github.io/aria/#aria-owns would be helpful, please suggest some. Here are the current instructions for authors (looks a bit weak to me, and doesn't mention circular refs):

Authors SHOULD NOT use aria-owns as a replacement for the DOM hierarchy. If the relationship is represented in the DOM, do not use aria-owns. Authors MUST ensure that an element's ID is not specified in more than one other element's aria-owns attribute at any time. In other words, an element can have only one explicit owner.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/w3c/core-aam/issues/82#issuecomment-721137141, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKQAZSJVUV5T2RRA4WG4R3SOAFCTANCNFSM4TFBSHYA .

aleventhal avatar Nov 03 '20 15:11 aleventhal

Done - see https://github.com/w3c/aria/pull/1351

Decided to split out the "authors MUST/MUST NOT" into a separate paragraph to make it stand out more (instead of just adding new sentences to the end of the previous paragraph).

I put both of you as reviewers. :)

PS: Doesn't close this issue, as there may still be mapping updates needed?

carmacleod avatar Nov 03 '20 16:11 carmacleod