comp_text_node.html (10884B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>Name Comp: Text Node</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_text_node">#comp_text_node</a> portions of the AccName <em>Name Computation</em> algorithm.</p> 15 16 <!-- 17 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> 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> 50 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"> 58 heading 59 <!-- comment node between text nodes with leading/trailing whitespace --> 60 label 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> 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> 136 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> 149 150 <script> 151 AriaUtils.verifyLabelsBySelector(".ex"); 152 </script> 153 </body> 154 </html>