Skip to content

Commit

Permalink
Add hidden-matchable accessibility test
Browse files Browse the repository at this point in the history
This was asked for here [1]. Hopefully we can actually upstream it to
WPT once a replacement for content_shell's accessibilityController is
exposed in WPT [2].

[1] w3ctag/design-reviews#511 (comment)
[2] web-platform-tests/wpt#27374

Change-Id: Idc2b610c3b7a52042c3bbecc4689124f78a2be91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2657063
Reviewed-by: vmpstr <vmpstr@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#848261}
GitOrigin-RevId: 59f6ff500d33ce6f0df48df19348b1ce2445e63e
  • Loading branch information
josepharhar authored and copybara-github committed Jan 28, 2021
1 parent 5255a33 commit f4561a9
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<link rel="author" title="Joey Arhar" href="mailto:jarhar@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<input id=inputid aria-labelledby="hiddenmatchable-label">
<div style="content-visibility: hidden-matchable">
<span id="hiddenmatchable-label">hiddenmatchable label text</span>
</div>

<script>
test(() => {
const axInput = accessibilityController.accessibleElementById('inputid');
assert_equals(axInput.name, 'hiddenmatchable label text');
}, `aria labels inside content-visibility:hidden-matchable subtrees should still work.`);
</script>

0 comments on commit f4561a9

Please sign in to comment.