Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

adampage
Copy link
Member

@adampage adampage commented Feb 28, 2024

Companion tests for ARIA PR #1839: Clarify relationship between aria-hidden and aria-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 the button from its contents (involving a bunch of inner aria-owns, aria-hidden, and display: none; nonsense).

@spectranaut
Copy link
Contributor

@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 :)

@adampage adampage marked this pull request as ready for review May 29, 2024 23:30
@adampage
Copy link
Member Author

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>
Copy link
Contributor

@cookiecrook cookiecrook Aug 19, 2024

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"
Copy link
Contributor

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.

Copy link
Contributor

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"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants