fieldset-default-style.html (1786B)
1 <!doctype html> 2 <title>fieldset default style</title> 3 <script src=/resources/testharness.js></script> 4 <script src=/resources/testharnessreport.js></script> 5 <style> 6 #ref { 7 display: block; 8 margin-left: 2px; 9 margin-right: 2px; 10 /* TODO replace above declarations with these when they are widely supported. 11 margin-inline-start: 2px; 12 margin-inline-end: 2px; 13 */ 14 border: groove 2px; 15 padding: 0.35em 0.75em 0.625em 0.75em; 16 /* TODO replace above declarations with these when they are widely supported. 17 padding-block-start: 0.35em; 18 padding-inline-end: 0.75em; 19 padding-block-end: 0.625em; 20 padding-inline-start: 0.75em; 21 */ 22 min-width: min-content; 23 /* TODO change the above to min-inline-size when it's widely supported. */ 24 } 25 </style> 26 <fieldset id=test></fieldset> 27 <div id=ref></div> 28 <script> 29 const testElm = document.querySelector('#test'); 30 const refElm = document.querySelector('#ref'); 31 const props = ['display', 32 'margin-top', 33 'margin-right', 34 'margin-bottom', 35 'margin-left', 36 'border-top-style', 37 'border-right-style', 38 'border-bottom-style', 39 'border-left-style', 40 'border-top-width', 41 'border-right-width', 42 'border-bottom-width', 43 'border-left-width', 44 'padding-top', 45 'padding-right', 46 'padding-bottom', 47 'padding-left', 48 'min-width', 49 ]; 50 const testStyle = getComputedStyle(testElm); 51 const refStyle = getComputedStyle(refElm); 52 props.forEach(prop => { 53 test(() => { 54 assert_equals(testStyle[prop], refStyle[prop]); 55 }, `${prop}`); 56 }); 57 </script>