tor-browser

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

hidden-charset-case-sensitive.html (1390B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <link rel="help" href="https://html.spec.whatwg.org/#hidden-state-(type=hidden):attr-fe-name-charset">
      4 <meta name="assert" content="special input@name value “_charset_” is case-sensitive">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <form target="child" method="GET" action="hidden-charset-case-sensitive-child.html">
      8  <input type="hidden" name="_charset_">
      9  <input type="hidden" name="_CHARSET_">
     10  <input type="hidden" name="_ChArSeT_">
     11  <input type="hidden" name="_charſet_">
     12 </form>
     13 <iframe name="child"></iframe>
     14 <script>
     15 // #attr-fe-name-charset only affects form submission, so we need to do that
     16 async_test(function() {
     17  // we use a message rather than the iframe’s load event to avoid dealing with
     18  // spurious load events that some browsers dispatch on the initial about:blank
     19  addEventListener("message", this.step_func_done(event => {
     20    const params = new URL(event.data).searchParams;
     21 
     22    assert_equals(params.get("_charset_"), "UTF-8", "lowercase valid");
     23    assert_equals(params.get("_CHARSET_"), "UTF-8", "uppercase valid");
     24    assert_equals(params.get("_ChArSeT_"), "UTF-8", "mixed case invalid");
     25    assert_equals(params.get("_charſet_"), "", "non-ASCII invalid");
     26  }));
     27 
     28  document.querySelector("form").submit();
     29 }, "keyword _charset_");
     30 </script>