Closed
Description
The relevant spec definition is:
At any time, one Document in each browsing context is designated the active document.
and https://html.spec.whatwg.org/multipage/browsers.html#history-traversal step 4 substep 3 explicitly sets a document as the active document of the browsing context.
When a frame is removed, we land in https://html.spec.whatwg.org/multipage/browsers.html#a-browsing-context-is-discarded which calls https://html.spec.whatwg.org/multipage/browsers.html#discard-a-document but none of that seems to unset the "active document" pointer from the browsing context.
I suspect, but it's worth testing what UAs actually do, that somewhere in here we should explicitly make the browsing context not have an active document or something...