fieldset-generated-content.html (981B)
1 <!doctype html> 2 <title>fieldset generated content</title> 3 <script src=/resources/testharness.js></script> 4 <script src=/resources/testharnessreport.js></script> 5 <link rel="stylesheet" href="/fonts/ahem.css"> 6 <style> 7 .wrapper { 8 /* Use Ahem to avoid fractional letter widths. */ 9 font: 20px/1 Ahem; 10 } 11 12 fieldset { 13 display: inline-block; 14 /* Paddings might have fractional values by default, and they can cause 15 rounding differences between the test element and the reference element. */ 16 padding: 0; 17 } 18 19 #test::before, #test::after { content:"X"; } 20 </style> 21 <div class="wrapper"> 22 <fieldset id=test><legend>A</legend>Y</fieldset> 23 <fieldset id=ref><legend>A</legend>XYX</fieldset> 24 </div> 25 <script> 26 test(() => { 27 const testElm = document.querySelector('#test'); 28 const refElm = document.querySelector('#ref'); 29 assert_equals(testElm.clientWidth, refElm.clientWidth, 'clientWidth'); 30 assert_equals(testElm.clientHeight, refElm.clientHeight, 'clientHeight'); 31 }); 32 </script>