We have a test that is supposed to verify that this doesn't happen, but it is incorrect, as it lets the document be destroyed.
Created attachment 24711 [details] proposed fix
Comment on attachment 24711 [details] proposed fix I'm a little worried that this kind of check might be needed in more cases other than just this event listener function. Is there a way to make this change a more natural part of how you get the frame from the window in the first place? What's a good way to audit the rest of the code to se if we need other changes like this? Is there a way to change the design to fill this "crack in the foundation"? r=me
I think that DOMWindow's frame pointer should be cleared out when it stops being active, just like it is the case for Document. And going from DOMWindow to Document and back probably shouldn't involve Frame at all. In this case, this check wouldn't be necessary. But I don't know the reasons for the current design, maybe I'm way off.
(In reply to comment #3) > I think that DOMWindow's frame pointer should be cleared out when it stops > being active, just like it is the case for Document. And going from DOMWindow > to Document and back probably shouldn't involve Frame at all. In this case, > this check wouldn't be necessary. Maybe we could add a FIXME mentioning this alternate possible design. It seems fine to clear the DOMWindow's frame pointer; we just need to test to see if there are any code paths that require on it not being cleared.
Committed revision 37971. Added a FIXME.