table-border-collapse-client-width-height.html (1017B)
1 <!DOCTYPE html> 2 <title>CSSOM Test: Table with border-collapse: collapse's clientWidth/Height</title> 3 <link rel="help" href="https://www.w3.org/TR/CSS2/tables.html#model" /> 4 <link rel="help" href="https://www.w3.org/TR/CSS2/tables.html#collapsing-borders" /> 5 <link rel="help" href="https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface" /> 6 <script src=/resources/testharness.js></script> 7 <script src=/resources/testharnessreport.js></script> 8 <style> 9 table { 10 border-collapse: collapse; 11 } 12 td { 13 border: 8px solid #faa; 14 } 15 </style> 16 <table> 17 <tbody> 18 <tr> 19 <td>a</td> 20 <td>b</td> 21 </tr> 22 <tr> 23 <td>c</td> 24 <td>d</td> 25 </tr> 26 </tbody> 27 </table> 28 <script type="text/javascript"> 29 var table = document.getElementsByTagName('table')[0]; 30 test(function() { 31 assert_equals(table.clientWidth, table.offsetWidth); 32 assert_equals(table.clientHeight, table.offsetHeight); 33 }, "Table's clientWidth/Height and OffsetWidth/Height should be the same"); 34 </script>