Specify behavior when following a hidden subtree via aria-labelledby … by jaragu...
source link: https://github.com/jaragunde/accname/pull/1
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Specify behavior when following a hidden subtree via aria-labelledby … #1
Conversation
Owner
…or -describedby.
This describes more accurately the actual behavior of Firefox and Blink. There is a fundamental difference between those two yet, Firefox does not hidden aria-hidden nodes while Blink does. My preference would be to use aria-hidden to allow authors to explicitly hide content if they really want but I wouldn't push hard for it.
About WebKit, its behavior changes depending on how nodes were hidden, visibility:hidden
and display:none
seem to have different behaviors which suggests to have followed the innerText implementation, maybe sharing code.
Owner
Author
TODO: specify the possibility to use |
Outdated
<p>By default, <a class="termref">assistive technologies</a> do not relay hidden information, but an author can explicitly override that and include hidden text as part of the <a class="termref">accessible name</a> or <a class="termref">accessible description</a> by using <code>aria-labelledby</code> or <code>aria-describedby</code>. </p> |
||
</details></div> |
||
<div><details> |
||
<summary>Example:</summary> |
Owner
Author
These examples are new, too.
Outdated
</pre> |
||
</details></div> |
||
</li> |
||
<li id="step2A.ii">If the <code>current node</code> has the <code>aria-hidden</code> property set to true, return the empty string. |
Owner
Author
This clause, with the example below, are the only remaining additions to the text.
Outdated
</details></div> |
||
<li id="step2A"> |
||
<ol> |
||
<li id="step2A.i">If the <code>current node</code> is <strong>not</strong> <a href="https://html.spec.whatwg.org/multipage/rendering.html#being-rendered">being rendered</a> <strong>and is</strong>: |
Owner
Author
In the line above, I'm replacing the use of "hidden" with "not being rendered", like James Nurthen had proposed here.
Nit: does not hidden -> does not hide
We should mention there are a few possibilities:
After writing all of these out, I'm starting to get a preference for w3c#2. I think the tooltip case with some hidden content is contrived. The author can just remove those nodes. It's not worth creating the mess of w3c#3. And #1 has the issue for repair situations. WDYT?
We should add this line at the bottom: |
left a comment
Good start. I added some thoughts. LMK what you think.
Outdated Show resolved
Outdated Show resolved
Outdated Show resolved
Outdated Show resolved
Owner
Author
I'm changing my mind and I'd go with 2 right now. It should make the text easier to write and understand, and that's very important in an already complicated spec. The kind of authors who care about the scenario we would solve in option 3 are probably already implementing it in a way that works with 2 (remove the node), because that's the way Firefox has always worked. I'll give a try at how the text would look like. |
Outdated
@@ -0,0 +1,2 @@ | ||
<p>Indicates that the <a href="#dfn-element" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-element-4">element</a> is not visible, <a href="#dfn-perceivable" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-perceivable-3">perceivable</a>, or interactive to <em>any</em> user. An element is considered <em>hidden</em> if it or any one of its ancestor elements is not rendered or is explicitly hidden.</p> |
||
<p>This definition includes elements <a href="https://html.spec.whatwg.org/multipage/rendering.html#being-rendered">not being rendered</a>, which don't have an associated layout box, or rendered with a <a href="https://drafts.csswg.org/css-cascade/#computed-value" data-x-internal="computed-value">computed value</a> of <a href="https://drafts.csswg.org/css2/#propdef-visibility" data-x-internal="'visibility'">'visibility'</a> different from 'visible', or hidden from assistive technologies using the <a href="https://www.w3.org/TR/wai-aria-1.2/#aria-hidden">aria-hidden</a> state.</p> |
Owner
Author
The definition of hidden is from WAI-ARIA, I'm copying it here so we can discuss.
The second paragraph is new, it specifies the different kinds of hidden referencing other definitions and other specs too. I'm using the innerText spec as a source for some this text, because it explains the difference between display:none and visibility:hidden in an "spec-y" way.
Update in b2cfbb8: we discard proposing changes to WAI-ARIA definition of hidden.
<li id="step2A">If the <code>current node</code> is <a class="termref">hidden</a> <strong>and is not</strong> directly referenced by <code>aria-labelledby</code> or <code>aria-describedby</code>, nor directly referenced by a native host language text alternative <a class="termref">element</a> (e.g. <code>label</code> in HTML) or <a class="termref">attribute</a>, return the empty string. |
||
<li id="step2A">If the <code>current node</code> is <a class="termref">hidden</a> <strong>and is</strong>: |
||
<ul> |
||
<li><strong>Not</strong> part of an <code>aria-labelledby</code> or <code>aria-describedby</code> traversal, where the node directy referenced by that relation was hidden.</li> |
Owner
Author
This replaces the existing "current node is hidden and is not directly referenced by aria-labelledby..." text with something that explicitly includes its children.
Outdated
@@ -272,6 +293,9 @@ <h4>Computation steps</h4> | ||
</ol> |
||
</li> |
||
</ul> |
||
<div><details> |
||
<summary>Comment:</summary> |
||
<p>The result of <a href="#step2B.ii.b">step 2B.ii.b<a> in combination with <a href="#step2A">step 2A<a> means that <a class="termref">user agents</a> MUST include any hidden nodes as part of the <a class="termref">accessible name</a> or <a class="termref">accessible description</a> when traversing an <code>aria-labelledby</code> or <code>aria-describedby</code> relation and the referenced node is hidden.</p> |
Owner
Author
This is a new comment where I hope to clarify further how UAs should behave when traversing a hidden aria-labelledby/describedby, because the actual logic is spread between 2A and 2B.
It's also true in the case.
Another way of saying it is that the user agent MUST include all nodes in the subtree when the root of the relation was hidden. Correct? Maybe this is even clearer?
It sounds clearer, my wording somehow leaves readers to wonder "what about non-hidden nodes" when there is actually no question: all are hidden and all are included.
This was hopefully made clearer in 688456b.
Outdated
<li id="step2A">If the <code>current node</code> is <a class="termref">hidden</a> <strong>and is</strong>: |
||
<ul> |
||
<li><strong>Not</strong> part of an <code>aria-labelledby</code> or <code>aria-describedby</code> traversal, where the node directy referenced by that relation was hidden.</li> |
||
<li><strong>Nor</strong> directly referenced by a native host language text alternative <a class="termref">element</a> (e.g. <code>label</code> in HTML) or <a class="termref">attribute</a>.</li> |
Owner
Author
This remains as it was, I have been "skipping" this piece of text but when examinating it closely I realized that I really didn't understand it. After some internal discussion, I'm opening a new issue about it: w3c#148
I think we need to word this similar to the first bullet, e.g.
Not part of a native host language text traversal (e.g. label in HTML), where the root of that traversal was hidden.
Reworked this in 94eeb38.
Outdated
@@ -0,0 +1,2 @@ | ||
<p>Indicates that the <a href="#dfn-element" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-element-4">element</a> is not visible, <a href="#dfn-perceivable" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-perceivable-3">perceivable</a>, or interactive to <em>any</em> user. An element is considered <em>hidden</em> if it or any one of its ancestor elements is not rendered or is explicitly hidden.</p> |
The first paragraph is wrong, because aria-hidden content is often perceivable visually, when it's not also styled to be visible.
Another problem is that when an element is placed behind something to hide it, or offscreen to hide it, it's arguably still explicitly hidden.
Perhaps there is a benefit from having a table of hiding methods, and for each, describe why it matches the definition of hidden, and if not, what the reason is.
- CSS display:none, visibility:hidden, visibility: collapse, content-visibility:hidden. Yes, explicitly hidden and not perceivable.
- CSS opacity: 0 or filter:opacity(0%), or similar SVG mechanisms: No (give reason)
- aria-hidden: Yes, explicitly hidden
- Hidden off screen or behind another object: No (give reason)
For me, having this list will help us make sure our definition matches, and is a pragmatic way to make sure implementers and authors have something easy enough to understand, and will be in alignment on the meaning. The abstract definition is just going to be too easy to misunderstand, no matter how careful we are.
Update in b2cfbb8: added these guidelines as a "comment" in the accname spec.
Outdated
<li id="step2A">If the <code>current node</code> is <a class="termref">hidden</a> <strong>and is</strong>: |
||
<ul> |
||
<li><strong>Not</strong> part of an <code>aria-labelledby</code> or <code>aria-describedby</code> traversal, where the node directy referenced by that relation was hidden.</li> |
||
<li><strong>Nor</strong> directly referenced by a native host language text alternative <a class="termref">element</a> (e.g. <code>label</code> in HTML) or <a class="termref">attribute</a>.</li> |
I think we need to word this similar to the first bullet, e.g.
Not part of a native host language text traversal (e.g. label in HTML), where the root of that traversal was hidden.
Outdated
@@ -272,6 +293,9 @@ <h4>Computation steps</h4> | ||
</ol> |
||
</li> |
||
</ul> |
||
<div><details> |
||
<summary>Comment:</summary> |
||
<p>The result of <a href="#step2B.ii.b">step 2B.ii.b<a> in combination with <a href="#step2A">step 2A<a> means that <a class="termref">user agents</a> MUST include any hidden nodes as part of the <a class="termref">accessible name</a> or <a class="termref">accessible description</a> when traversing an <code>aria-labelledby</code> or <code>aria-describedby</code> relation and the referenced node is hidden.</p> |
It's also true in the case.
Another way of saying it is that the user agent MUST include all nodes in the subtree when the root of the relation was hidden. Correct? Maybe this is even clearer?
Owner
Author
To submit this, I think we could include a summary of what user agents will need to change to comply with this text update:
|
Firefox actually has some pretty hacky code around this with special cases, last time I checked. I think James Teh will tell us there is much work to be done. |
Owner
Author
Moved here: w3c#150 |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
No one assigned
None yet
No milestone
Recommend
-
102
symfony/polyfill-mbstring: This component provides a partial, native PHP implementation for the Mbstring extension. Sk...
-
147
symfony/phpunit-bridge: Provides utilities for PHPUnit, especially user deprecation notices management. Skip to content
-
143
symfony/console: The Console component eases the creation of beautiful and testable command line interfaces. Skip to content...
-
7
The difference between aria-label and aria-labelledby24th of August 2020The aria-label and ar...
-
9
How to Specify Program (Undefined) Behavior? This summer, I am given the awesome opportunity of spending three months in the Mozilla offices in Portland, working on Rust. I am extremely grateful that Mozilla is providing this opportu...
-
5
aria-labelledby attribute Related Articles ...
-
4
图书推荐:Invisible Influence - The Hidden forces that shape behavior Bob Jiang 2016-07-28 Page content 这本书是我的偶像Daniel Pink推荐的,看了一下介...
-
5
Сообщение для российских читателейARIA landmark roles provide a useful way for screen reader users to navigate through web pages, and to understand the purpose of different sections of content on the page. With just a little bit more AR...
-
4
Contributor ...
-
8
Robotic system offers hidden window into collective bee behavior by Celia Luterbacher,...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK