details-blockification.html (1490B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Test: details children blockification</title> 4 <link rel="author" href="mailto:masonf@chromium.org"> 5 <link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements"> 6 <meta name="assert" content="Ensure blockification of <details> children"> 7 <script src=/resources/testharness.js></script> 8 <script src=/resources/testharnessreport.js></script> 9 <style> 10 11 /* continue testing the old behavior that this was intended to test */ 12 details[open]::details-content { 13 display: contents; 14 } 15 16 </style> 17 18 <div id="example1"> 19 <details style="display: grid" open> 20 <summary style="display: inline">foo</summary> 21 <div style="display: inline">bar</span> 22 </details> 23 </div> 24 25 <div id="example2" style="display: grid"> 26 <details style="display: contents" open> 27 <summary style="display: inline">foo</summary> 28 <div style="display: inline">bar</span> 29 </details> 30 </div> 31 32 <script> 33 function checkDetails(details) { 34 assert_equals(getComputedStyle(details.querySelector('summary')).display, "block"); 35 assert_equals(getComputedStyle(details.querySelector('div')).display, "block"); 36 } 37 test(() => { 38 checkDetails(document.querySelector('#example1')); 39 checkDetails(document.querySelector('#example2')); 40 assert_equals(getComputedStyle(document.querySelector('#example2>details')).display, "contents"); 41 }, "Summary and content should have display:block computed value"); 42 43 </script>