|
13 | 13 |
|
14 | 14 | <p>Tests the <a href="https://w3c.github.io/accname/#comp_text_node">#comp_text_node</a> portions of the AccName <em>Name Computation</em> algorithm.</p>
|
15 | 15 |
|
16 |
| -<!-- I'm not certain whether #comp_text_node requires a lot of testing outside of the #comp_name_from_content contexts, --> |
17 |
| -<!-- but I did think of one example where text node versus comment node may make a difference when joining text nodes with a space vs innerText. --> |
| 16 | +<!-- Note: some overlap with the tests in ./comp_name_from_content.html --> |
18 | 17 |
|
19 |
| -<!-- Skipped (class="ex" removed) until https://github.com/w3c/accname/issues/193 is resolved --> |
20 |
| -<h2 class="ex-skipped" data-expectedlabel="heading label" data-testname="heading with text/comment/text nodes, no space"> |
21 |
| - heading<!-- with non-text node splitting concatenated text nodes -->label<!-- [sic] no extra spaces around first comment --> |
22 |
| -</h2> |
23 | 18 |
|
| 19 | +<h1>text/element/text nodes, no space</h1> |
| 20 | +<button class="ex" data-expectedlabel="buttonlabel" data-testname="button with text/comment/text nodes, no space">button<span></span>label</button> |
| 21 | +<h3 class="ex" data-expectedlabel="headinglabel" data-testname="heading with text/comment/text nodes, no space">heading<span></span>label</h3> |
| 22 | +<a href="#" class="ex" data-expectedlabel="linklabel" data-testname="link with text/comment/text nodes, no space">link<span></span>label</a> |
| 23 | +<br> |
| 24 | + |
| 25 | +<h1>text/comment/text nodes, no space</h1> |
| 26 | +<!-- Note: This set is not currently to spec until https://github.com/w3c/accname/issues/193 is resolved. --> |
| 27 | +<button class="ex" data-expectedlabel="buttonlabel" data-testname="button with text/comment/text nodes, no space"> |
| 28 | + button<!-- with non-text node splitting concatenated text nodes -->label<!-- [sic] no extra spaces around first comment --> |
| 29 | +</button> |
| 30 | +<h3 class="ex" data-expectedlabel="headinglabel" data-testname="heading with text/comment/text nodes, no space"> |
| 31 | + heading<!-- with non-text node splitting concatenated text nodes -->label<!-- [sic] no extra spaces around first comment --> |
| 32 | +</h3> |
| 33 | +<a href="#" class="ex" data-expectedlabel="linklabel" data-testname="link with text/comment/text nodes, no space"> |
| 34 | + link<!-- with non-text node splitting concatenated text nodes -->label<!-- [sic] no extra spaces around first comment --> |
| 35 | +</a> |
| 36 | +<br> |
24 | 37 |
|
25 |
| -<h2 class="ex" data-expectedlabel="heading label" data-testname="heading with text/comment/text nodes, with space"> |
| 38 | +<h1>text/comment/text nodes, with space</h1> |
| 39 | +<button class="ex" data-expectedlabel="button label" data-testname="button with text/comment/text nodes, with space"> |
| 40 | + button |
| 41 | + <!-- comment node between text nodes with leading/trailing whitespace --> |
| 42 | + label |
| 43 | +</button> |
| 44 | +<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text/comment/text nodes, with space"> |
26 | 45 | heading
|
27 | 46 | <!-- comment node between text nodes with leading/trailing whitespace -->
|
28 | 47 | label
|
29 |
| -</h2> |
| 48 | +</h3> |
| 49 | +<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text/comment/text nodes, with space"> |
| 50 | + link |
| 51 | + <!-- comment node between text nodes with leading/trailing whitespace --> |
| 52 | + label |
| 53 | +</a> |
| 54 | +<br> |
| 55 | + |
| 56 | +<h1>text node, with non-breaking space</h1> |
| 57 | +<button class="ex" data-expectedlabel="button label" data-testname="button with text node, with non-breaking space">button label</button> |
| 58 | +<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with non-breaking space">heading label</h3> |
| 59 | +<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with non-breaking space">link label</a> |
| 60 | +<br> |
| 61 | + |
| 62 | +<h1>text node, with extra non-breaking space</h1> |
| 63 | +<button class="ex" data-expectedlabel="button label" data-testname="button with text node, with extra non-breaking space">button label</button> |
| 64 | +<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with extra non-breaking space">heading label</h3> |
| 65 | +<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with extra non-breaking space">link label</a> |
| 66 | +<br> |
| 67 | + |
| 68 | +<h1>text node, with leading/trailing non-breaking space</h1> |
| 69 | +<button class="ex" data-expectedlabel="button label" data-testname="button with text node, with leading/trailing non-breaking space"> button label </button> |
| 70 | +<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with leading/trailing non-breaking space"> heading label </h3> |
| 71 | +<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with leading/trailing non-breaking space"> link label </a> |
| 72 | +<br> |
30 | 73 |
|
| 74 | +<h1>text nodes, with deeply nested space</h1> |
| 75 | +<button class="ex" data-expectedlabel="button label" data-testname="button with text node, with deeply nested space"> |
| 76 | +button<span><span><span><span><span><span><span> </span></span></span></span></span></span></span>label |
| 77 | +</button> |
| 78 | +<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with deeply nested space"> |
| 79 | +heading<span><span><span><span><span><span><span> </span></span></span></span></span></span></span>label |
| 80 | +</h3> |
| 81 | +<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with deeply nested space"> |
| 82 | +link<span><span><span><span><span><span><span> </span></span></span></span></span></span></span>label |
| 83 | +</a> |
| 84 | +<br> |
31 | 85 |
|
32 |
| -<!-- Todo: test all remaining cases of https://w3c.github.io/accname/#comp_text_node --> |
| 86 | +<h1>text nodes, with single line break</h1> |
| 87 | +<button class="ex" data-expectedlabel="button label" data-testname="button with text node, with single line break">button |
| 88 | +label</button> |
| 89 | +<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with single line break">heading |
| 90 | +label</h3> |
| 91 | +<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with single line break">link |
| 92 | +label</a> |
| 93 | +<br> |
33 | 94 |
|
34 | 95 | <script>
|
35 | 96 | AriaUtils.verifyLabelsBySelector(".ex");
|
|
0 commit comments