Skip to content

Commit

Permalink
AX: Import accname WPTs 11/11/2023
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264681
rdar://118277513

Reviewed by Chris Fleizach.

Import accname test at upstream commit:
web-platform-tests/wpt@4647677

* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_embedded_control-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_embedded_control.html:
* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_hidden_not_referenced-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_hidden_not_referenced.html:
* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_host_language_label-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_labelledby-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_labelledby.html:
* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_name_from_content-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_name_from_content.html:
* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_text_node-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_text_node.html:
* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_tooltip-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_tooltip.html:
* LayoutTests/platform/mac/TestExpectations:
accname/name/comp_host_language_label.html is not failing on Sonoma, so remove this expectation.

Canonical link: https://commits.webkit.org/270602@main
  • Loading branch information
twilco committed Nov 11, 2023
1 parent fed843b commit 741ed20
Show file tree
Hide file tree
Showing 14 changed files with 1,044 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,61 @@ Tests the #comp_embedded_control portions of the AccName Name Computation algori

Flash the screen times

Flash the screen times

Flash the screen times

Flash the screen times

Flash the screen 3 times

Flash the screen 3 times

Flash the screen
1
2
3
4
5
times

Flash the screen times

Flash the screen times

Flash the screen 3.0 times

Flash the screen 3.0 times

Flash the screen 3.0 times

Flash the screen 3.0 times


FAIL checkbox label with embedded textfield assert_equals: <input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded textfield" class="ex"> expected "Flash the screen 3 times" but got "Flash the screen number of times times"
PASS label of embedded textfield inside checkbox label
FAIL checkbox label with embedded select:not([size]) assert_equals: <input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded select:not([size])" class="ex"> expected "Flash the screen 3 times" but got "Flash the screen number of times times"
PASS label of embedded select:not([size]) inside checkbox label
FAIL checkbox label with embedded select[size] assert_equals: <input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded select[size]" class="ex"> expected "Flash the screen 3 times" but got "Flash the screen number of times times"
PASS label of embedded select[size] inside checkbox label
FAIL checkbox label with embedded combobox (input[type=text]) assert_equals: <input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded combobox (input[type=text])" class="ex"> expected "Flash the screen 3 times" but got "Flash the screen number of times times"
PASS label of embedded combobox (input[type=text]) inside checkbox label
FAIL checkbox label with embedded combobox (span) assert_equals: <input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded combobox (span)" class="ex"> expected "Flash the screen 3 times" but got "Flash the screen number of times times"
PASS label of embedded combobox (span) inside checkbox label
FAIL checkbox label with embedded combobox (div) assert_equals: <input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded combobox (div)" class="ex"> expected "Flash the screen 3 times" but got "Flash the screen number of times times"
PASS label of embedded combobox (div) inside checkbox label
FAIL checkbox label with embedded listbox>option[aria-selected=true] assert_equals: <input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded listbox>option[aria-selected=true]" class="ex"> expected "Flash the screen 3 times" but got "Flash the screen number of times times"
PASS label of embedded listbox>option[aria-selected=true] inside checkbox label
FAIL checkbox label with embedded input[type=range] assert_equals: <input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded input[type=range]" class="ex"> expected "Flash the screen 3 times" but got "Flash the screen number of times times"
PASS label of embedded input[type=range] inside checkbox label
FAIL checkbox label with embedded input[type=number] assert_equals: <input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded input[type=number]" class="ex"> expected "Flash the screen 3 times" but got "Flash the screen number of times times"
PASS label of embedded input[type=number] inside checkbox label
FAIL checkbox label with embedded ARIA slider (aria-valuenow) assert_equals: <input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded ARIA slider (aria-valuenow)" class="ex"> expected "Flash the screen 3 times" but got "Flash the screen number of times times"
PASS label of embedded ARIA slider (aria-valuenow) inside checkbox label
FAIL checkbox label with embedded ARIA slider (aria-valuetext) assert_equals: <input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded ARIA slider (aria-valuetext)" class="ex"> expected "Flash the screen 3 times" but got "Flash the screen number of times times"
PASS label of embedded ARIA slider (aria-valuetext) inside checkbox label
FAIL checkbox label with embedded ARIA spinbutton (aria-valuenow) assert_equals: <input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded ARIA spinbutton (aria-valuenow)" class="ex"> expected "Flash the screen 3 times" but got "Flash the screen number of times times"
PASS label of embedded ARIA spinbutton (aria-valuenow) inside checkbox label
FAIL checkbox label with embedded ARIA spinbutton (aria-valuetext) assert_equals: <input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded ARIA spinbutton (aria-valuetext)" class="ex"> expected "Flash the screen 3 times" but got "Flash the screen number of times times"
PASS label of embedded ARIA spinbutton (aria-valuetext) inside checkbox label

Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,119 @@

<p>Tests the <a href="https://w3c.github.io/accname/#comp_embedded_control">#comp_embedded_control</a> portions of the AccName <em>Name Computation</em> algorithm.</p>

<!-- Textfield (textbox) -->
<label>
<input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded textfield" class="ex">
Flash the screen
<input value="3" aria-label="number of times" data-expectedlabel="number of times" data-testname="label of embedded textfield inside checkbox label" class="ex"> times
</label>
<br><br>

<!-- HTML select:not([size]) element renders as menu button (on Mac) or single-row listbox (on Windows/Linux) -->
<label>
<input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded select:not([size])" class="ex">
Flash the screen
<select aria-label="number of times" data-expectedlabel="number of times" data-testname="label of embedded select:not([size]) inside checkbox label" class="ex">
<option value="1">1</option>
<option value="2">2</option>
<option value="3" selected>3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
times
</label>
<br><br>

<!-- HTML select[size] element renders as multi-row listbox -->
<label>
<input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded select[size]" class="ex">
Flash the screen
<select size=5 aria-label="number of times" data-expectedlabel="number of times" data-testname="label of embedded select[size] inside checkbox label" class="ex">
<option value="1">1</option>
<option value="2">2</option>
<option value="3" selected>3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
times
</label>
<br><br>

<!-- ARIA combobox examples (not interactive) -->
<label>
<input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded combobox (input[type=text])" class="ex">
Flash the screen
<input role="combobox" value="3" aria-label="number of times" data-expectedlabel="number of times" data-testname="label of embedded combobox (input[type=text]) inside checkbox label" class="ex"> times
</label>
<br><br>
<label>
<input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded combobox (span)" class="ex">
Flash the screen
<span role="combobox" tabindex="0" aria-label="number of times" data-expectedlabel="number of times" data-testname="label of embedded combobox (span) inside checkbox label" class="ex">3</span> times
</label>
<br><br>
<label>
<input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded combobox (div)" class="ex">
Flash the screen
<div style="display: inline-block;" role="combobox" tabindex="0" aria-label="number of times" data-expectedlabel="number of times" data-testname="label of embedded combobox (div) inside checkbox label" class="ex">3</div> times
</label>
<br><br>
<!-- Todo: we may want another combobox example using aria-activedescendant? -->


<!-- ARIA listbox examples (not interactive) -->
<label>
<input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded listbox>option[aria-selected=true]" class="ex">
Flash the screen
<ul role="listbox" aria-label="number of times" data-expectedlabel="number of times" data-testname="label of embedded listbox>option[aria-selected=true] inside checkbox label" class="ex" style="padding:0; list-style:none; border: solid 1px gray; width: 15em; display: inline-block;">
<li role="option" tabindex="-1" style="padding:0.2em 0.8em; list-style:none;">1</li>
<li role="option" tabindex="-1" style="padding:0.2em 0.8em; list-style:none;">2</li>
<li role="option" tabindex="0" aria-selected="true" style="padding:0.2em 0.8em; list-style:none; color: white; background-color: #555;">3</li>
<li role="option" tabindex="-1" style="padding:0.2em 0.8em; list-style:none;">4</li>
<li role="option" tabindex="-1" style="padding:0.2em 0.8em; list-style:none;">5</li>
</ul> times
</label>
<br><br>

<!--

Todo: test all remaining cases of https://w3c.github.io/accname/#comp_embedded_control
- comp_embedded_control_textbox
- comp_embedded_control_combobox_or_listbox
- comp_embedded_control_range
- comp_embedded_control_range_valuetext
- comp_embedded_control_range_valuenow
- comp_embedded_control_range_host_language_value
<!-- Ranges: HTML native and ARIA sliders and steppers (valuetext, valuenow, host language specific) -->
<label>
<input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded input[type=range]" class="ex">
Flash the screen
<input type ="range" min="1" max="5" value="3" step="1" aria-label="number of times" data-expectedlabel="number of times" data-testname="label of embedded input[type=range] inside checkbox label" class="ex"> times
</label>
<br><br>
<label>
<input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded input[type=number]" class="ex">
Flash the screen
<input type ="number" min="1" max="5" value="3" step="1" aria-label="number of times" data-expectedlabel="number of times" data-testname="label of embedded input[type=number] inside checkbox label" class="ex"> times
</label>
<br><br>
<label>
<input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded ARIA slider (aria-valuenow)" class="ex">
Flash the screen
<span tabindex="0" role="slider" aria-valuemin="1" aria-valuemax="5" aria-valuenow="3" aria-label="number of times" data-expectedlabel="number of times" data-testname="label of embedded ARIA slider (aria-valuenow) inside checkbox label" class="ex">3.0</span> times
</label>
<br><br>
<label>
<input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded ARIA slider (aria-valuetext)" class="ex">
Flash the screen
<span tabindex="0" role="slider" aria-valuemin="1.0" aria-valuemax="5.0" aria-valuenow="3.0" aria-valuetext="3" aria-label="number of times" data-expectedlabel="number of times" data-testname="label of embedded ARIA slider (aria-valuetext) inside checkbox label" class="ex">3.0</span> times
</label>
<br><br>
<label>
<input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded ARIA spinbutton (aria-valuenow)" class="ex">
Flash the screen
<span tabindex="0" role="spinbutton" aria-valuemin="1" aria-valuemax="5" aria-valuenow="3" aria-label="number of times" data-expectedlabel="number of times" data-testname="label of embedded ARIA spinbutton (aria-valuenow) inside checkbox label" class="ex">3.0</span> times
</label>
<br><br>
<label>
<input type="checkbox" data-expectedlabel="Flash the screen 3 times" data-testname="checkbox label with embedded ARIA spinbutton (aria-valuetext)" class="ex">
Flash the screen
<span tabindex="0" role="spinbutton" aria-valuemin="1.0" aria-valuemax="5.0" aria-valuenow="3.0" aria-valuetext="3" aria-label="number of times" data-expectedlabel="number of times" data-testname="label of embedded ARIA spinbutton (aria-valuetext) inside checkbox label" class="ex">3.0</span> times
</label>
<br><br>

-->

<script>
AriaUtils.verifyLabelsBySelector(".ex");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
Tests the #comp_hidden_not_referenced portions of the AccName Name Computation algorithm.

heading label
hidden, visible to all users hidden but referenced, visible to all users hidden, visible to all users visible to all users, hidden, hidden but referenced,
visible to all users, un-hidden for all users


PASS heading with interior hidden node
PASS button containing a rendered, unreferenced element that is aria-hidden=true, an unreferenced element with the hidden host language attribute, and an unreferenced element that is unconditionally rendered
PASS button labelled by element that is aria-hidden=true
PASS button labelled by element with the hidden host language attribute
PASS link labelled by elements with assorted visibility and a11y tree exposure
FAIL heading with name from content, containing element that is visibility:hidden with nested content that is visibility:visible assert_equals: <h2 class="ex" data-testname="heading with name from content, containing element that is visibility:hidden with nested content that is visibility:visible" data-expectedlabel="visible to all users, un-hidden for all users">
visible to all users,
<span style="visibility: hidden;">
hidden from all users,
<span style="visibility: visible;">un-hidden for all users</span>
</span>
</h2> expected "visible to all users, un-hidden for all users" but got "visible to all users,"

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Name Comp: Hidden Not Referenced</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand All @@ -13,16 +14,79 @@

<p>Tests the <a href="https://w3c.github.io/accname/#comp_hidden_not_referenced">#comp_hidden_not_referenced</a> portions of the AccName <em>Name Computation</em> algorithm.</p>

<h2 class="ex" data-expectedlabel="heading label" data-testname="heading with interior hidden node">
heading
<span hidden>bogus</span>
label
<button
class="ex"
data-expectedlabel="visible to all users"
data-testname="button containing a rendered, unreferenced element that is aria-hidden=true, an unreferenced element with the hidden host language attribute, and an unreferenced element that is unconditionally rendered"
>
<span aria-hidden="true">hidden,</span>
<span hidden>hidden from all users,</span>
<span>visible to all users</span>
</button>

<button
class="ex"
data-expectedlabel="hidden but referenced,"
data-testname="button labelled by element that is aria-hidden=true"
aria-labelledby="button-label-2"
>
<span aria-hidden="true" id="button-label-2">hidden but referenced,</span>
<span hidden>hidden from all users,</span>
<span>visible to all users</span>
</button>

<button
class="ex"
data-expectedlabel="hidden from all users but referenced,"
data-testname="button labelled by element with the hidden host language attribute"
aria-labelledby="button-label-3"
>
<span aria-hidden="true">hidden,</span>
<span hidden id="button-label-3">hidden from all users but referenced,</span>
<span>visible to all users</span>
</button>

<a
class="ex"
data-testname="link labelled by elements with assorted visibility and a11y tree exposure"
data-expectedlabel="visible to all users, hidden but referenced, hidden from all users but referenced"
href="#"
aria-labelledby="link-label-1a link-label-1b link-label-1c"
>
<span id="link-label-1a">
<span>visible to all users,</span>
<span aria-hidden="true">hidden,</span>
</span>
<span aria-hidden="true" id="link-label-1b">hidden but referenced,</span>
<span hidden id="link-label-1c">hidden from all users but referenced</span>
</a>

<h2
class="ex"
data-testname="heading with name from content, containing element that is visibility:hidden with nested content that is visibility:visible"
data-expectedlabel="visible to all users, un-hidden for all users"
>
visible to all users,
<span style="visibility: hidden;">
hidden from all users,
<span style="visibility: visible;">un-hidden for all users</span>
</span>
</h2>

<!-- Todo: test all remaining cases of https://w3c.github.io/accname/#comp_hidden_not_referenced -->
<!-- TODO: Test cases once https://github.com/w3c/aria/issues/1256 resolved: -->
<!-- - button labelled by an element that is aria-hidden=true which contains a nested child that is aria-hidden=false -->
<!-- - button labelled by an element that is aria-hidden=false which belongs to a parent that is aria-hidden=true -->
<!-- - heading with name from content, containing rendered content that is aria-hidden=true with nested, rendered content that is aria-hidden=false -->
<!-- - heading with name from content, containing element with the hidden host language attribute with nested content that is aria-hidden=false -->

<!-- TODO: New test case?
<!-- What is the expectation for a details element when it’s given an -->
<!-- explicit role that allows name from contents (e.g., `comment`) -->
<!-- but is also not in the open state, and therefore has contents -->
<!-- that are both not rendered and excluded from the a11y tree. -->

<script>
AriaUtils.verifyLabelsBySelector(".ex");
</script>
</body>
</html>
</html>

0 comments on commit 741ed20

Please sign in to comment.