text-control-client-width.html (761B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>text control with `display: inline` must not have 0 client width</title> 4 <link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#form-controls"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 8 <input id="input" style="display: inline;"> 9 <textarea id="textarea" style="display: inline;"></textarea> 10 11 <script> 12 test(() => { 13 assert_greater_than(document.querySelector("#input").clientWidth, 0); 14 }, "Input with `display: inline` should have positive client width"); 15 16 test(() => { 17 assert_greater_than(document.querySelector("#textarea").clientWidth, 0); 18 }, "Textarea with `display: inline` should have positive client width"); 19 </script>