Re: [html-tests] Add tests for the realms involved in compiling event handlers (#4988)

So first of all, that test is not navigating the subframe, just assigning a .src property on its window (as opposed to the iframe element).  The beforeunload only fires when the whole page is unloaded.

But that shouldn't affect the behavior.  What does affect it is that gecko does NOT in fact set up an incumbent global on event handlers compiled from strings.  Which means the incumbent global ends up being "yeah, whatever is on the stack" if there's script on the stack (and the entry global if there's nothing on the stack).  But then if that incumbent global is not same origin-domain with the current global, we reset it to the current global.

In the "unload the page via browser UI" case, there's actually privileged script that's part of the browser UI on the stack.  So we get that as the incumbent, then it fails the same origin-domain check and we reset the incumbent to current.  And our current at that point is the global of the postMessage function, which is the parent.

Anyway, this is a bug in Gecko.  Filed https://bugzilla.mozilla.org/show_bug.cgi?id=1342513

View on GitHub: https://github.com/w3c/web-platform-tests/pull/4988#issuecomment-282397673

Received on Friday, 24 February 2017 20:35:36 UTC