tor-browser

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

translate-enumerated-ascii-case-insensitive.html (1180B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <link rel="help" href="https://html.spec.whatwg.org/#attr-translate">
      4 <link rel="help" href="https://html.spec.whatwg.org/#enumerated-attribute">
      5 <meta name="assert" content="@translate values are ASCII case-insensitive">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <!--
      9  We wrap the <span> elements under test with <div> elements so the invalid
     10  value default (inherit) can be distinguished from true through the IDL
     11  attribute. The inherit state would otherwise yield true because inheritance
     12  would go all the way to :root, whose translation mode is translate-enabled
     13  because it’s also in the inherit state.
     14 -->
     15 <div translate="no"><span translate="yes"></span></div>
     16 <div translate="no"><span translate="YeS"></span></div>
     17 <div translate="no"><span translate="yeſ"></span></div>
     18 <script>
     19 const span = document.querySelectorAll("span");
     20 
     21 test(() => {
     22  assert_equals(span[0].translate, true, "lowercase valid");
     23  assert_equals(span[1].translate, true, "mixed case valid");
     24  assert_equals(span[2].translate, false, "non-ASCII invalid");
     25 }, "keyword yes");
     26 </script>