|
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 | +<!-- |
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> |
| 18 | + Note: some overlap with the tests in: |
| 19 | + - /accname/name/comp_label.html |
| 20 | + - /accname/name/comp_name_from_content.html |
| 21 | +
|
| 22 | +--> |
| 23 | + |
| 24 | +<h1>text/element/text nodes, no space</h1> |
| 25 | +<span role="button" tabindex="0" class="ex" data-expectedlabel="buttonlabel" data-testname="span[role=button] with text/element/text nodes, no space">button<span></span>label</span> |
| 26 | +<div role="heading" class="ex" data-expectedlabel="headinglabel" data-testname="div[role=heading] with text/element/text nodes, no space">heading<span></span>label</div> |
| 27 | +<button class="ex" data-expectedlabel="buttonlabel" data-testname="button with text/element/text nodes, no space">button<span></span>label</button> |
| 28 | +<h3 class="ex" data-expectedlabel="headinglabel" data-testname="heading with text/element/text nodes, no space">heading<span></span>label</h3> |
| 29 | +<a href="#" class="ex" data-expectedlabel="linklabel" data-testname="link with text/element/text nodes, no space">link<span></span>label</a> |
| 30 | +<br> |
23 | 31 |
|
| 32 | +<h1>text/comment/text nodes, no space</h1> |
| 33 | +<!-- Note: This set is not currently to spec until https://github.com/w3c/accname/issues/193 is resolved. --> |
| 34 | +<span role="button" tabindex="0" class="ex" data-expectedlabel="buttonlabel" data-testname="span[role=button] with text/comment/text nodes, no space"> |
| 35 | + button<!-- with non-text node splitting concatenated text nodes -->label<!-- [sic] no extra spaces around first comment --> |
| 36 | +</span> |
| 37 | +<div role="heading" class="ex" data-expectedlabel="headinglabel" data-testname="div[role=heading] with text/comment/text nodes, no space"> |
| 38 | + heading<!-- with non-text node splitting concatenated text nodes -->label<!-- [sic] no extra spaces around first comment --> |
| 39 | +</div> |
| 40 | +<button class="ex" data-expectedlabel="buttonlabel" data-testname="button with text/comment/text nodes, no space"> |
| 41 | + button<!-- with non-text node splitting concatenated text nodes -->label<!-- [sic] no extra spaces around first comment --> |
| 42 | +</button> |
| 43 | +<h3 class="ex" data-expectedlabel="headinglabel" data-testname="heading with text/comment/text nodes, no space"> |
| 44 | + heading<!-- with non-text node splitting concatenated text nodes -->label<!-- [sic] no extra spaces around first comment --> |
| 45 | +</h3> |
| 46 | +<a href="#" class="ex" data-expectedlabel="linklabel" data-testname="link with text/comment/text nodes, no space"> |
| 47 | + link<!-- with non-text node splitting concatenated text nodes -->label<!-- [sic] no extra spaces around first comment --> |
| 48 | +</a> |
| 49 | +<br> |
24 | 50 |
|
25 |
| -<h2 class="ex" data-expectedlabel="heading label" data-testname="heading with text/comment/text nodes, with space"> |
| 51 | +<h1>text/comment/text nodes, with space</h1> |
| 52 | +<span role="button" tabindex="0" class="ex" data-expectedlabel="button label" data-testname="span[role=button] with text/comment/text nodes, with space"> |
| 53 | + button |
| 54 | + <!-- comment node between text nodes with leading/trailing whitespace --> |
| 55 | + label |
| 56 | +</span> |
| 57 | +<div role="heading" class="ex" data-expectedlabel="heading label" data-testname="div[role=heading] with text/comment/text nodes, with space"> |
26 | 58 | heading
|
27 | 59 | <!-- comment node between text nodes with leading/trailing whitespace -->
|
28 | 60 | label
|
29 |
| -</h2> |
| 61 | +</div> |
| 62 | +<button class="ex" data-expectedlabel="button label" data-testname="button with text/comment/text nodes, with space"> |
| 63 | + button |
| 64 | + <!-- comment node between text nodes with leading/trailing whitespace --> |
| 65 | + label |
| 66 | +</button> |
| 67 | +<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text/comment/text nodes, with space"> |
| 68 | + heading |
| 69 | + <!-- comment node between text nodes with leading/trailing whitespace --> |
| 70 | + label |
| 71 | +</h3> |
| 72 | +<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text/comment/text nodes, with space"> |
| 73 | + link |
| 74 | + <!-- comment node between text nodes with leading/trailing whitespace --> |
| 75 | + label |
| 76 | +</a> |
| 77 | +<br> |
| 78 | + |
| 79 | +<h1>text node, with tab char</h1> |
| 80 | +<span role="button" tabindex="0" class="ex" data-expectedlabel="button label" data-testname="span[role=button] with text node, with tab char">button label</span> |
| 81 | +<div role="heading" class="ex" data-expectedlabel="heading label" data-testname="div[role=heading] with text node, with tab char">heading label</div> |
| 82 | +<button class="ex" data-expectedlabel="button label" data-testname="button with text node, with tab char">button label</button> |
| 83 | +<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with tab char">heading label</h3> |
| 84 | +<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with tab char">link label</a> |
| 85 | +<br> |
| 86 | + |
| 87 | +<h1>text node, with non-breaking space</h1> |
| 88 | +<span role="button" tabindex="0" class="ex" data-expectedlabel="button label" data-testname="span[role=button] with text node, with non-breaking space">button label</span> |
| 89 | +<div role="heading" class="ex" data-expectedlabel="heading label" data-testname="div[role=heading] with text node, with non-breaking space">heading label</div> |
| 90 | +<button class="ex" data-expectedlabel="button label" data-testname="button with text node, with non-breaking space">button label</button> |
| 91 | +<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with non-breaking space">heading label</h3> |
| 92 | +<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with non-breaking space">link label</a> |
| 93 | +<br> |
| 94 | + |
| 95 | +<h1>text node, with extra non-breaking space</h1> |
| 96 | +<span role="button" tabindex="0" class="ex" data-expectedlabel="button label" data-testname="span[role=button] with text node, with extra non-breaking space">button label</span> |
| 97 | +<div role="heading" class="ex" data-expectedlabel="heading label" data-testname="div[role=heading] with text node, with extra non-breaking space">heading label</div> |
| 98 | +<button class="ex" data-expectedlabel="button label" data-testname="button with text node, with extra non-breaking space">button label</button> |
| 99 | +<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with extra non-breaking space">heading label</h3> |
| 100 | +<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with extra non-breaking space">link label</a> |
| 101 | +<br> |
| 102 | + |
| 103 | +<h1>text node, with leading/trailing non-breaking space</h1> |
| 104 | +<span role="button" tabindex="0" class="ex" data-expectedlabel="button label" data-testname="span[role=button] with text node, with leading/trailing non-breaking space"> button label </span> |
| 105 | +<div role="heading" class="ex" data-expectedlabel="heading label" data-testname="div[role=heading] with text node, with leading/trailing non-breaking space"> heading label </div> |
| 106 | +<button class="ex" data-expectedlabel="button label" data-testname="button with text node, with leading/trailing non-breaking space"> button label </button> |
| 107 | +<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with leading/trailing non-breaking space"> heading label </h3> |
| 108 | +<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with leading/trailing non-breaking space"> link label </a> |
| 109 | +<br> |
| 110 | + |
| 111 | +<h1>text node, with mixed space and non-breaking space</h1> |
| 112 | +<span role="button" tabindex="0" class="ex" data-expectedlabel="button label" data-testname="span[role=button] with text node, with mixed space and non-breaking space">button label</span> |
| 113 | +<div role="heading" class="ex" data-expectedlabel="heading label" data-testname="div[role=heading] with text node, with mixed space and non-breaking space">heading label</div> |
| 114 | +<button class="ex" data-expectedlabel="button label" data-testname="button with text node, with mixed space and non-breaking space">button label</button> |
| 115 | +<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with mixed space and non-breaking space">heading label</h3> |
| 116 | +<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with mixed space and non-breaking space">link label</a> |
| 117 | +<br> |
30 | 118 |
|
| 119 | +<h1>text nodes, with deeply nested space</h1> |
| 120 | +<span role="button" tabindex="0" class="ex" data-expectedlabel="button label" data-testname="span[role=button] with text node, with deeply nested space"> |
| 121 | +button<span><span><span><span><span><span><span> </span></span></span></span></span></span></span>label |
| 122 | +</span> |
| 123 | +<div role="heading" class="ex" data-expectedlabel="heading label" data-testname="div[role=heading] with text node, with deeply nested space"> |
| 124 | +heading<span><span><span><span><span><span><span> </span></span></span></span></span></span></span>label |
| 125 | +</div> |
| 126 | +<button class="ex" data-expectedlabel="button label" data-testname="button with text node, with deeply nested space"> |
| 127 | +button<span><span><span><span><span><span><span> </span></span></span></span></span></span></span>label |
| 128 | +</button> |
| 129 | +<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with deeply nested space"> |
| 130 | +heading<span><span><span><span><span><span><span> </span></span></span></span></span></span></span>label |
| 131 | +</h3> |
| 132 | +<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with deeply nested space"> |
| 133 | +link<span><span><span><span><span><span><span> </span></span></span></span></span></span></span>label |
| 134 | +</a> |
| 135 | +<br> |
31 | 136 |
|
32 |
| -<!-- Todo: test all remaining cases of https://w3c.github.io/accname/#comp_text_node --> |
| 137 | +<h1>text nodes, with single line break</h1> |
| 138 | +<span role="button" tabindex="0" class="ex" data-expectedlabel="button label" data-testname="span[role=button] with text node, with single line break">button |
| 139 | +label</span> |
| 140 | +<div role="heading" class="ex" data-expectedlabel="heading label" data-testname="div[role=heading] with text node, with single line break">heading |
| 141 | +label</div> |
| 142 | +<button class="ex" data-expectedlabel="button label" data-testname="button with text node, with single line break">button |
| 143 | +label</button> |
| 144 | +<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with single line break">heading |
| 145 | +label</h3> |
| 146 | +<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with single line break">link |
| 147 | +label</a> |
| 148 | +<br> |
33 | 149 |
|
34 | 150 | <script>
|
35 | 151 | AriaUtils.verifyLabelsBySelector(".ex");
|
|
0 commit comments