tor-browser

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

Element-setAttribute-crbug-1138487.html (958B)


      1 <!DOCTYPE html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script>
      5 // Regression test for crbug.com/1138487.
      6 //
      7 // It was possible for a non-ASCII-lowercase string to be used when inserting
      8 // into the attribute collection if a hashtable encountered it during probing
      9 // while looking for the ASCII-lowercase equivalent.
     10 //
     11 // This caused such a string to be illegally used as an attribute name, thus
     12 // causing inconsistent behavior in future attribute lookup.
     13 test(() => {
     14  const el = document.createElement('div');
     15  el.setAttribute('labelXQL', 'abc');
     16  el.setAttribute('_valueXQL', 'def');
     17  assert_equals(el.getAttribute('labelXQL'), 'abc');
     18  assert_equals(el.getAttribute('labelxql'), 'abc');
     19  assert_equals(el.getAttribute('_valueXQL'), 'def');
     20  assert_equals(el.getAttribute('_valuexql'), 'def');
     21 }, "Attributes first seen in mixed ASCII case should not be corrupted.");
     22 </script>