RE: AccName Prototype Updates

Hi,
No problem, I had to build out some tests to make sure this logic worked, and these might answer your questions.

Though it is okay to reference explicitly hidden elements using aria-labelledby or aria-describedby, this will only be true if that node is hidden and not if a parent node is hidden instead. Also, child nodes within such containers  that include attributes like hidden or aria-hidden="true" will be processed regardless as though these attributes did not exist. This is only true when referencing hidden elements however.

Examples:

If a form field uses aria-labelledby to point to the element below with id="name", accName will result as shown.

<div hidden id="name"> Test </div>

accName: "Test"

<div hidden>
<div id="name"> Test </div>
</div>

accName: ""

<div hidden id="name"><span aria-hidden="true"> Test </span> Me </div>

accName: "Test Me"

<div id="name"><span aria-hidden="true"> Test </span> Me </div>

accName: "Me"

Please let me know if anything is missing or unclear.

Thanks,
Bryan


Bryan Garaventa
Accessibility Fellow
Level Access, Inc.
Bryan.Garaventa@LevelAccess.com
415.624.2709 (o)
www.LevelAccess.com

-----Original Message-----
From: Gunderson, Jon R <jongund@illinois.edu> 
Sent: Monday, May 14, 2018 7:47 AM
To: Bryan Garaventa <bryan.garaventa@levelaccess.com>; ARIA Working Group <public-aria@w3.org>
Subject: RE: AccName Prototype Updates

Bryan,

Thank you for the update, a few clarifications:
1. Is it only the parent node of a referenced element being hidden that will result in no name or description or any ancestor of the referenced node being hidden?
2. If the parent node (or possibly any ancestor) is hidden of a referenced element, this will always result in no name  or description generated?

Jon

 


-----Original Message-----
From: Bryan Garaventa [mailto:bryan.garaventa@levelaccess.com] 
Sent: Friday, May 11, 2018 7:11 PM
To: ARIA Working Group <public-aria@w3.org>
Subject: AccName Prototype Updates

Hi,
Per the last Caucus discussion, I've updated the AccName Prototype code at https://github.com/WhatSock/w3c-alternative-text-computation

I didn't have time today  to get to the spec text changes, but coding this helps frame in my mind what is missing in the algorithm, so I'll likely be able to do this next Monday before I head out.

E.G Here are the coding changes in the prototype regarding the logic processing.

		if (ownedBy.ref) {
			if (isParentHidden(refNode, document.body, true, true)) {
				// If referenced via aria-labelledby or aria-describedby, do not return a name or description if a parent node is hidden.
				return fullResult;
			}
			else if (isHidden(refNode, document.body)) {
				// Otherwise, if aria-labelledby or aria-describedby reference a node that is explicitly hidden, then process all children regardless of their individual hidden states.
				var ignoreHidden = true;
			}
		}

As before, if the node referenced by aria-labelledby or aria-describedby is not explicitly hidden, then all children that are explicitly hidden will not be included in the computation. The above override only occurs when specifically referencing hidden nodes.

You can run this code on the prototype to validate this behavior, and please let me know if I've missed anything that we spoke of or if anything is working unexpectedly.

Thanks,
Bryan



Bryan Garaventa
Accessibility Fellow
Level Access, Inc.
Bryan.Garaventa@LevelAccess.com
415.624.2709 (o)
www.LevelAccess.com

Received on Monday, 14 May 2018 17:13:14 UTC