demo · v132

Error matrix — the seven inactive scenarios

A popover or dialog can end up in an “inactive” document seven different ways — including detached iframe, navigated-away document, adopted node, removed shadow host. v132 ensures every one of them throws InvalidStateError on showModal() / showPopover(). Click each row to fire the scenario; observe the verdict and the actual exception thrown.

scenariopre-132v132+ verdictreal result here
dialog created in iframe, iframe detachedsilent no-opthrows
popover created in iframe, iframe detachedsilent no-opthrows
dialog adopted into iframe doc, then iframe detachedsilent no-opthrows
popover in a Document parseFromString-detached docsilent no-opthrows
dialog in active document (control)showsshows
popover in active document (control)showsshows
dialog reattached after detachmentshowsshows
// pre-132: silent no-op; the dialog never appears, no exception.
// v132+:    throws DOMException InvalidStateError with message "Document is detached".
try { dlg.showModal(); } catch (e) { ... }

see also