On Thu Nov 17 14:00:47 2022 +0000, Jacek Caban wrote:
I think `pageshow` might be the only one we can use from Gecko, the
other two are intertwined on native IE and must be sent on all windows interleaved. What's wrong with Gecko's unload event?
It will also be necessary to control their dispatch ourselves when
implementing performance.timing.unloadEventStart (and the respective End). Well, we could always dispatch it ourselves just in that one case. (And, of course, there is a question about why not to use Gecko for performance.timing).
I can't get the unload event sent from Gecko when the SetClientSite is set to NULL, to match the tests. Any ideas here what I should be trying? I guess I can try to `load_nsuri` to "about:blank" but that would need some message pump to wait and dispatch the events since it's async, and might send too many other notifications (no idea).
That said we'll still need specialized handler in `nsevents.c` for handle_unload in this case, both for `pagehide` and for the performance timing later. That shouldn't be a problem, though, I don't mind doing it that way. One thing where it might be better is with `beforeunload`. I should probably add tests for `beforeunload` as well since I need to see if it's correct.
BTW we can't use gecko for performance timing because it doesn't expose it as XPCOM, and it's more trouble than it's worth, IMO, considering how "simple" it is to set it otherwise (we already even have get_time_stamp() function used for events).
But my main issue right now with using gecko's unload is the SetClientSite thing…