On Wed Feb 28 11:44:42 2024 +0000, Jacek Caban wrote:
That doesn't prove that we should update times on custom events. To prove that, you'd need to use `dispatchEvent()` to dispatch a custom event and see if `domContentLoadedEventStart` value changes (and I'd expect not). Did you use `nsIDOMEvent` for that? I don't remember details, but there were reasons it's not used for our `IDOMEvent::get_isTrusted()`, so please try `DOMEvent.trusted` if you didn't.
I wanted to investigate this failing test further, but I haven't been able to recreate it this morning. So I've just pushed the change as it was.
You can see I'm using `DOMEvent.trusted` in the `pre_handle_event`, but `nsIDOMEvent::GetIsTrusted` in `handle_event`.
I assume we want to make the same check in `handle_event`? But I couldn't see a way to get the `DOMEvent` (it doesn't seem like anything we pass to `handle_event` has a reference to the `DOMEvent`?), so I resorted to using `nsIDOMEvent::GetIsTrusted`.
But it doesn't feel right to do one thing in `pre_handle_event` and another in `handle_event`, so I'm happy to change `handle_event` (and all the existing implementations) to accept a `DOMEvent` instead of `nsIDOMEvent` if you think that's the right thing to do?