tor-browser

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

textarea-placeholder-lineheight.html (998B)


      1 <!DOCTYPE html>
      2 <html>
      3 
      4 <head>
      5  <title>textarea placeholder line-height</title>
      6  <link rel="author" title="Daniel Libby" href="mailto:dlibby@microsoft.com">
      7  <script src="/resources/testharness.js"></script>
      8  <script src="/resources/testharnessreport.js"></script>
      9  <style>
     10    textarea {
     11      margin: 0;
     12      border: 0;
     13      padding: 0;
     14    }
     15  </style>
     16 </head>
     17 
     18 <body>
     19  <textarea rows=1 placeholder=foo style="border:0"></textarea>
     20  <script>
     21    let textarea = document.querySelector('textarea');
     22    const lineHeight = 19.5;
     23    textarea.style.lineHeight = lineHeight + "px";
     24    test(
     25      function () {
     26        assert_equals(textarea.getBoundingClientRect().height, lineHeight);
     27      }, "Bounding rect height for textarea must be the same as line-height");
     28 
     29    test(
     30      function () {
     31        assert_equals(getComputedStyle(textarea).lineHeight, lineHeight + "px");
     32      }, "ComputedStyle line-height for textarea must be the same as set value");
     33  </script>
     34 </body>
     35 
     36 </html>