Specify behavior when following a hidden subtree via aria-labelledby … · w3c/accname@3efa7de (original) (raw)
`@@ -249,11 +249,42 @@
Computation steps
`
249
249
`
root node
to the given element, the current node
to the root node
, and the total accumulated text
to the empty string (""). If the root node
's role prohibits naming, return the empty string ("").`
250
250
`
current node
:`
251
251
`
- If the
current node
is hidden and is not directly referenced byaria-labelledby
oraria-describedby
, nor directly referenced by a native host language text alternative element (e.g.label
in HTML) or attribute, return the empty string.`
``
252
`+
- If the
current node
is hidden and is:`
``
253
`+
- Not part of an
aria-labelledby
oraria-describedby
traversal, where the node directy referenced by that relation was hidden. - Nor part of a native host language text alternative element (e.g.
label
in HTML) or attribute traversal, where the root of that traversal was hidden.
`
``
254
`+
`
``
255
`+
`
``
256
`+
`
``
257
`+
Return the empty string.
`
``
258
`+
`
``
259
`+
Comment:
`
``
260
`+
It's important to clarify the broad definition of hidden for the purposes of accessible name calculation:
`
``
261
`+
- Nodes with CSS properties
display:none
,visibility:hidden
,visibility:collapse
orcontent-visibility:hidden
: They are considered hidden, as they match the guidelines "not perceivable" and "explicitly hidden". - Nodes with CSS properties
opacity:0
orfilter:opacity(0%)
, or similar SVG mechanisms: They are not considered hidden. Text hidden with these methods can still be selected or copied, and user agents still expose it in their accessibility trees. - Nodes with the
aria-hidden="true"
property: it is considered hidden, matching the "explicitly hidden" guideline. - Nodes hidden off screen or behind another object: they are not considered hidden. They are exposed in the accessibility tree and they can even name on-screen objects.
`
``
262
`+
`
``
263
`+
`
``
264
`+
`
``
265
`+
`
``
266
`+
`
``
267
`+
`
253
268
`
`
254
269
`
Comment:
`
255
270
`
By default, assistive technologies do not relay hidden information, but an author can explicitly override that and include hidden text as part of the accessible name or accessible description by using
aria-labelledby
oraria-describedby
.`
256
271
`
`
``
272
`+
`
``
273
`+
Example:
`
``
274
`+
The following examples show the meaning of the clause "Not part of an
aria-labelledby
oraria-describedby
traversal, where the node directy referenced by that relation was hidden.".`
``
275
`+
First,
element1
's accessible name is "hello" because, althoughelement3
is hidden, it is part of anaria-labelledby
traversal started inelement2
, which is hidden too.`
``
276
`+
<element1 id="el1" role="button" aria-labelledby="el2" /> ` `` `277` `+ <element2 id="el2" class="hidden"> ` `` `278` `+ <element3 id="el3" class="hidden">hello</element3> ` `` `279` `+ </element2>
` `` `280` `+`
``
281
`+
Alternatively,
element1
has no accessible name ifelement3
is hidden and it is part of anaria-labelledby
traversal started inelement2
, butelement2
is not hidden.`
``
282
`+
<element1 id="el1" role="button" aria-labelledby="el2" /> ` `` `283` `+ <element2 id="el2"> ` `` `284` `+ <element3 id="el3" class="hidden">hello</element3> ` `` `285` `+ </element2>
` `` `286` `+`
``
287
`+
`
257
288
`
- Not part of an
- Otherwise:
`
252
``
`-
`
258
289
`
`
259
290
`
`
`@@ -272,6 +303,9 @@
Computation steps
`
272
303
`
`
273
304
`
`
274
305
`
`
``
306
`+
`
``
307
`+
Comment:
`
``
308
`+
The result of step 2B.ii.b in combination with step 2A means that user agents MUST include all nodes in the subtree as part of the accessible name or accessible description, when the node referenced by aria-labelledby
or aria-describedby
is hidden.
`
275
309
`
`
276
310
`Example:
`
277
311
`
The following example shows the meaning of the clause "… and the current node
is not already part of an aria-labelledby
traversal …" .
`