OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>ASCII case-insensitive attribute selector matching</title> |
| 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <div id="element1" attr-exact="fİx"></div> |
| 6 <div id="element2" attr-exact="äpple"></div> |
| 7 <div id="element3" attr-list="apelsin äpple citron"></div> |
| 8 <div id="element4" attr-hyphen="äppel-cider"></div> |
| 9 <div id="element5" attr-begin="äppelcider"></div> |
| 10 <div id="element6" attr-end="giftäpple"></div> |
| 11 <div id="element7" attr-contain="glasäppelkorg"></div> |
| 12 <script> |
| 13 function matchingId(selector) { |
| 14 return (document.querySelector(selector) || { id: '' }).id; |
| 15 } |
| 16 test(function() { |
| 17 assert_equals(matchingId('div[attr-exact="f\u0130x"]'), 'element1'); |
| 18 assert_equals(matchingId('div[attr-exact="FIX" i]'), ''); |
| 19 assert_equals(matchingId('div[attr-exact="A\u0308pple" i]'), 'element2'); |
| 20 assert_equals(matchingId('div[attr-list~="A\u0308pple" i]'), 'element3'); |
| 21 assert_equals(matchingId('div[attr-hyphen|="A\u0308ppel" i]'), 'element4'); |
| 22 assert_equals(matchingId('div[attr-begin^="A\u0308ppel" i]'), 'element5'); |
| 23 assert_equals(matchingId('div[attr-end$="A\u0308pple" i]'), 'element6'); |
| 24 assert_equals(matchingId('div[attr-contain*="A\u0308ppel" i]'), 'element7'); |
| 25 }); |
| 26 </script> |
OLD | NEW |