I want to rule out iFrames as an obvious choice straight off, as they are likely to cause us more problems than they solve including performance, stability and debugging.
This may be premature. Although they definitely have their drawbacks — including one you left out, namely not playing nice in terms of layout — Iframes are a valuable approach to isolation, sandboxing, and encapsulation. The newishsrcdoc
attribute allows us to populate them without having to make an extra network call to retrieve their content. I am not quite sure what performance and stability problems you might be referring to. It’s no accident that past and existing approaches to cohabitation involve either iframes (with the obsolete seamless
attribute) or something very close (the proposed portal
element).