Bug 1843484 - Use EventTarget* instead of nsISupports* for the event target parameter of the EventDispatcher::Dispatch methods. r=smaug

This saves a few QueryInterface calls on the hot path.

Differential Revision: https://phabricator.services.mozilla.com/D186977
This commit is contained in:
Markus Stange
2023-08-28 23:38:43 +00:00
parent 70bd936589
commit a4e2816d54
19 changed files with 69 additions and 68 deletions

View File

@@ -4220,9 +4220,8 @@ bool nsGlobalWindowInner::DispatchEvent(Event& aEvent, CallerType aCallerType,
RefPtr<nsPresContext> presContext = mDoc->GetPresContext();
nsEventStatus status = nsEventStatus_eIgnore;
// TODO: Bug 1506441
nsresult rv = EventDispatcher::DispatchDOMEvent(
MOZ_KnownLive(ToSupports(this)), nullptr, &aEvent, presContext, &status);
nsresult rv = EventDispatcher::DispatchDOMEvent(this, nullptr, &aEvent,
presContext, &status);
bool retval = !aEvent.DefaultPrevented(aCallerType);
if (NS_FAILED(rv)) {
aRv.Throw(rv);