popover-active-document.html (671B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <link rel="author" href="mailto:masonf@chromium.org"> 4 <link rel=help href="https://github.com/whatwg/html/pull/10705"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 8 <script> 9 test(() => { 10 const doc = document.implementation.createHTMLDocument(); 11 const popover = doc.createElement('div'); 12 popover.setAttribute('popover',''); 13 doc.body.appendChild(popover); 14 assert_throws_dom('InvalidStateError',() => popover.showPopover()); 15 assert_false(popover.matches(':popover-open')); 16 },'showPopover should throw when the document isn\'t active'); 17 </script>