-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add tests for aria-owns
and hiding techniques in assorted scenarios
#44822
base: master
Are you sure you want to change the base?
Add tests for aria-owns
and hiding techniques in assorted scenarios
#44822
Conversation
@adampage, I think you can mark this a "ready for review" because I'm guessing no one has taken a look yet since it is still draft :) |
Thanks, @spectranaut 😅 — done. |
<p><span id="child-simulated">Bold text with a yellow background</span> is the target of another element’s <code>aria-owns</code>.</p> | ||
|
||
<h2>Child is moved, nothing is hidden</h2> | ||
<p>Expected: <q>I love cats and dogs I like birds</q></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR warps my brain. I think we might need a working session to review the intentions here. A few things that might make the PR easier to review are:
- expected values that are more relevant to the function than random cat/dog/bird strings... Perhaps "[rendered contents owning][rendered owned contents that is child of aria-hidden parent]" or something that indicates the expectation and why you expect it.
- more functional or less contrived examples (to the extent possible), that should obviously work according to an authors intention.
<p>Expected: <q>I love cats and dogs I like birds</q></p> | ||
<button | ||
class="ex-label" | ||
data-testname="Child is moved, nothing is hidden" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates to the test name might also lend clarity. It's difficult to understand the expectations from the CI results comparison page too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g. why does the "Child is moved, nothing is hidden" test expect "I love cats and dogs I like birds"?
Companion tests for ARIA PR #1839: Clarify relationship between
aria-hidden
andaria-owns
.In development of that PR, I created a Codepen to manually test a few different scenarios involving combinations of
aria-owns
,aria-hidden
, and host language hiding techniques.This PR is my attempt to translate those scenarios into roughly comparable WPT tests. In the Codepen, I rendered a bunch of
generic
elements and manually tested their exposure in the accessibility tree as static text nodes.In porting those scenarios into to this PR, I decided to leverage WPT’s
get_computed_label()
function and considered two markup testing approaches: name from author and name from content.I chose name from content and tweaked each of my markup scenarios to use a parent
button
element, then compared my expected label to whatever accname was assembled for thebutton
from its contents (involving a bunch of inneraria-owns
,aria-hidden
, anddisplay: none;
nonsense).