comp_labelledby.html (4864B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>Name Comp: Labelledby</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="/resources/testdriver.js"></script> 8 <script src="/resources/testdriver-vendor.js"></script> 9 <script src="/resources/testdriver-actions.js"></script> 10 <script src="/wai-aria/scripts/aria-utils.js"></script> 11 </head> 12 <body> 13 14 <p>Tests the <a href="https://w3c.github.io/accname/#comp_labelledby">#comp_labelledby</a> portions of the AccName <em>Name Computation</em> algorithm.</p> 15 16 <!-- 17 18 Some overlap with other aria-labelledby tests in: 19 - /accname/name/comp_label.html (aria-labelledby / aria-label fallback, etc.) 20 - /accname/name/comp_name_from_content.html 21 - /accname/name/shadowdom/* 22 23 --> 24 <h2>Tests for <code>aria-labelledby</code></h2> 25 26 <div role="group" aria-labelledby="h" class="ex" data-expectedlabel="first heading" data-testname="div group explicitly labelledby heading"> 27 <h2 id="h">first heading</h2> 28 <p>text inside div group</p> 29 </div> 30 31 <div role="group" aria-label="self label" id="g2" aria-labelledby="g2 h2" class="ex" data-expectedlabel="self label + first heading" data-testname="div group explicitly labelledby self and heading"> 32 <h2 id="h2">+ first heading</h2> 33 <p>text inside div group</p> 34 </div> 35 36 <nav aria-labelledby="s1 s2 s3 s4" class="ex" data-expectedlabel="verify spaces between foreach" data-testname="nav with verified spaces appended between each of IDREFS"> 37 <span id="s1">verify</span><span id="s2">spaces</span><span>FAIL IF INCLUDED</span><span id="s3">between</span><span id="s4">foreach</span> 38 </nav> 39 40 41 <!-- Removed tests to be merged back in (or this PR reverted) after Interop 2024 completed on Feb 6, 2025. --> 42 43 <h2>Tests for <code>aria-labeledby</code> (non-standard spelling)</h2> 44 45 <span id="n1">first label</span> 46 <span id="n2">second label</span> 47 48 <h2>Tests for precedence: <code>aria-labelledby</code> vs. <code>aria-labeledby</code> (non-standard spelling)</h2> 49 <!-- The "aria-labelledby" spelling should take precedence over "aria-labeledby" for accname --> 50 51 <a href="#" aria-labelledby="n1" aria-labeledby="n2" class="ex" data-expectedlabel="first label" data-testname="link labelled by aria-labelledby supercedes aria-labeledby (non-standard spelling)">x</a> 52 <button aria-labelledby="n1" aria-labeledby="n2" class="ex" data-expectedlabel="first label" data-testname="button labelled by aria-labelledby supercedes aria-labeledby (non-standard spelling)">x</button> 53 <div role="group" aria-labelledby="n1" aria-labeledby="n2" class="ex" data-expectedlabel="first label" data-testname="div labelled by aria-labelledby supercedes aria-labeledby (non-standard spelling)">x</div> 54 55 <a href="#" aria-labeledby="n1" aria-labelledby="n2" class="ex" data-expectedlabel="second label" data-testname="link labelled by [aria-labeledby][aria-labelledby]">x</a> 56 <button aria-labeledby="n1" aria-labelledby="n2" class="ex" data-expectedlabel="second label" data-testname="button labelled by [aria-labeledby][aria-labelledby]">x</button> 57 <div role="group" aria-labeledby="n1" aria-labelledby="n2" class="ex" data-expectedlabel="second label" data-testname="div labelled by [aria-labeledby][aria-labelledby]">x</div> 58 59 <h2>Tests for name precedence with <code>aria-labeledby</code> (non-standard spelling)</h2> 60 <!-- Name computation: https://w3c.github.io/accname/#computation-steps --> 61 62 <!-- Step 2H: Recursive Name from Content, see wpt/accname/name/comp_name_from_content.html --> 63 <h3> 64 <a href="#" aria-labeledby="nested_image_label2"> 65 link1<!-- this text is skipped because of aria-labeledby --> 66 </a> 67 <a href="#" data-expectedlabel="link2 image link3" data-testname="link name from content for each child including nested image (referenced elsewhere via labeledby)" class="ex"> 68 link2 69 <img id="nested_image_label2" alt="image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="> 70 <!-- image skipped in this link (when computing heading text) because it was already referenced by the first link within this heading label recursion cycle. --> 71 <!-- but image not skipped when computing the text of the link itself since it has not been referenced in that context --> 72 link3 73 </a> 74 </h3> 75 76 <!-- 77 78 BLOCKED on https://github.com/w3c/accname/issues/209 79 80 Once that's resolved, it may be worthwhile to add a new ./comp_labelledby_recursion.html file, 81 so that the implementation diffs rolling in don't penalize this Interop 2024 test. 82 83 All remaining cases of https://w3c.github.io/accname/#comp_labelledby 84 - comp_labelledby_reset 85 - comp_labelledby_foreach 86 - comp_labelledby_set_current 87 - comp_labelledby_recursion 88 - comp_labelledby_append 89 - comp_labelledby_return 90 91 --> 92 93 <script> 94 AriaUtils.verifyLabelsBySelector(".ex"); 95 </script> 96 </body> 97 </html>