It's not my fault that I keep finding problems both with patches themselves (see XHR problem) and tests (see above and !4312 earlier). I think that you too easily ignore signs of problems with tests. Given current findings, for all we know, native may have similar problems of using non-owned references. Your claims that it's one and the only right solution is simply not backed by convincing arguments.
Note that we hide a lot of complexity behind Gecko, but native complexity surely needs more complex data structures, just like Gecko does. It means that we can't blindly extrapolate `get_parentWindow` test result to all outer_window use cases.
The big picture is that inner window is not the same thing as the outer window and pretending that inner window becomes another inner window after navigation (when `inner_window->outer_window->inner_window != inner_window`) is likely a sign of a problem. The fact that your message source implementation depends on it is worrying, for example.
I mean it's known to be full of bugs and security exploits, to the point of becoming a meme.
It sure is, but you can't use it as an excuse to ignore signs of problems with tests. In this particular case, I'd be very surprised if you could reproduce that crash in pure JS.
actually, can't event handlers still be called after navigation on the old doc/window?
I'd hope that you'd know the answer before signing off patches like this (or !4312 for that matter).