tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

selectors-case-sensitive-001.html (1332B)


      1 <!DOCTYPE html>
      2 <title>Test element names are case-insensitive only in ASCII range</title>
      3 <link rel="help" href="https://www.w3.org/TR/selectors-4/#case-sensitive">
      4 <link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org">
      5 <script src='/resources/testharness.js'></script>
      6 <script src='/resources/testharnessreport.js'></script>
      7 <style>
      8 \212A {
      9  display: block;
     10  background: lime;
     11  width: 200px;
     12  height: 100px;
     13 }
     14 </style>
     15 <body>
     16  <p>You should see a green square below.</p>
     17  <div id="container"></div>
     18 <script>
     19 // Insert from JavaScript to avoid parser doing something special.
     20 let test_element = document.createElement('\u212A');
     21 container.appendChild(test_element);
     22 let test_element_with_ns = document.createElementNS('https://dummy.ns', '\u212A');
     23 container.appendChild(test_element_with_ns);
     24 
     25 test(() => {
     26  assert_equals(test_element.offsetHeight, 100);
     27 }, 'CSS selector should match for Unicode uppercase element');
     28 
     29 test(() => {
     30  // Elements in different namespace cannot compute style or height.
     31  // Test the height of the container instead.
     32  assert_equals(container.offsetHeight, 200);
     33 }, 'Elements with namespace should work the same way');
     34 
     35 test(() => {
     36  let e = document.querySelector('k');
     37  assert_equals(e, null);
     38 }, '`querySelector` should not use Unicode case-folding');
     39 </script>
     40 </body>