Skip to content

Commit 2209875

Browse files
committed
text node tests for whitespace, etc.
1 parent 08b5fe9 commit 2209875

File tree

1 file changed

+70
-9
lines changed

1 file changed

+70
-9
lines changed

accname/name/comp_text_node.html

+70-9
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,84 @@
1313

1414
<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>
1515

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 -->
1817

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>
2318

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>
2437

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">
2645
heading
2746
<!-- comment node between text nodes with leading/trailing whitespace -->
2847
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&nbsp;label</button>
58+
<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with non-breaking space">heading&nbsp;label</h3>
59+
<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with non-breaking space">link&nbsp;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&nbsp;&nbsp;&nbsp;label</button>
64+
<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with extra non-breaking space">heading&nbsp;&nbsp;&nbsp;label</h3>
65+
<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with extra non-breaking space">link&nbsp;&nbsp;&nbsp;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">&nbsp;button&nbsp;label&nbsp;</button>
70+
<h3 class="ex" data-expectedlabel="heading label" data-testname="heading with text node, with leading/trailing non-breaking space">&nbsp;heading&nbsp;label&nbsp;</h3>
71+
<a href="#" class="ex" data-expectedlabel="link label" data-testname="link with text node, with leading/trailing non-breaking space">&nbsp;link&nbsp;label&nbsp;</a>
72+
<br>
3073

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>
3185

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>
3394

3495
<script>
3596
AriaUtils.verifyLabelsBySelector(".ex");

0 commit comments

Comments
 (0)