See spec change at https://github.com/whatwg/html/pull/2673 and tests at https://github.com/web-platform-tests/wpt/pull/19632. (Test results should show up at https://wpt.fyi/results/html/semantics/scripting-1/the-script-element/moving-between-documents?label=master&label=experimental&product=chrome&product=firefox&product=safari&aligned soon.)
<rdar://problem/62211179>
Note regarding the test results: this bug is specifically about the after-prepare - and moved-back- cases. The before-prepare-iframe cases, which both Chrome and Safari fail, are somewhat contentious and we're still discussing what to do with them on the spec side. See https://github.com/whatwg/html/issues/2137.