visibility-collapse-row-004.html (927B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <script src='/resources/testharness.js'></script> 4 <script src='/resources/testharnessreport.js'></script> 5 <link rel="author" title="Aleks Totic" href="mailto:atotic@chromium.org"> 6 <link rel="help" href="https://www.w3.org/TR/CSS2/tables.html#dynamic-effects"> 7 <style> 8 table { background: red;} 9 td { background:green; padding: 0;} 10 </style> 11 <main> 12 <h1>Visibility collapse changes table height even when its height is fixed</h1> 13 14 <table style="height:150px;border-spacing: 0"> 15 <tr> 16 <td style="width:50px">a</td> 17 </tr> 18 <tr style="visibility:collapse"> 19 <td style="width:100px">hello</td> 20 </tr> 21 <tr> 22 <td>b</td> 23 </tr> 24 </table> 25 </main> 26 <script> 27 test(function() { 28 let t = document.querySelector("table"); 29 assert_equals(t.offsetWidth, 100); 30 assert_equals(t.offsetHeight, 100); 31 }, "collapsed row shrinks table height"); 32 </script>