mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1125422 - Change EventDispatcher::Dispatch to take an nsTArray instead of a nsCOMArray. r=smaug
This commit is contained in:
parent
33e1ee03aa
commit
fde7d819d1
@ -397,7 +397,7 @@ EventDispatcher::Dispatch(nsISupports* aTarget,
|
||||
nsIDOMEvent* aDOMEvent,
|
||||
nsEventStatus* aEventStatus,
|
||||
EventDispatchingCallback* aCallback,
|
||||
nsCOMArray<EventTarget>* aTargets)
|
||||
nsTArray<EventTarget*>* aTargets)
|
||||
{
|
||||
PROFILER_LABEL("EventDispatcher", "Dispatch",
|
||||
js::ProfileEntry::Category::EVENTS);
|
||||
@ -476,7 +476,7 @@ EventDispatcher::Dispatch(nsISupports* aTarget,
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
if (!nsContentUtils::IsSafeToRunScript()) {
|
||||
if (aEvent->message != NS_EVENT_NULL && !nsContentUtils::IsSafeToRunScript()) {
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
if (target->GetContextForEventHandlers(&rv) ||
|
||||
NS_FAILED(rv)) {
|
||||
@ -625,7 +625,7 @@ EventDispatcher::Dispatch(nsISupports* aTarget,
|
||||
aTargets->Clear();
|
||||
aTargets->SetCapacity(chain.Length());
|
||||
for (uint32_t i = 0; i < chain.Length(); ++i) {
|
||||
aTargets->AppendObject(chain[i].CurrentTarget()->GetTargetForDOMEvent());
|
||||
aTargets->AppendElement(chain[i].CurrentTarget()->GetTargetForDOMEvent());
|
||||
}
|
||||
} else {
|
||||
// Event target chain is created. Handle the chain.
|
||||
|
@ -255,7 +255,7 @@ public:
|
||||
nsIDOMEvent* aDOMEvent = nullptr,
|
||||
nsEventStatus* aEventStatus = nullptr,
|
||||
EventDispatchingCallback* aCallback = nullptr,
|
||||
nsCOMArray<dom::EventTarget>* aTargets = nullptr);
|
||||
nsTArray<dom::EventTarget*>* aTargets = nullptr);
|
||||
|
||||
/**
|
||||
* Dispatches an event.
|
||||
|
@ -171,11 +171,11 @@ EventListenerService::GetEventTargetChainFor(nsIDOMEventTarget* aEventTarget,
|
||||
*aOutArray = nullptr;
|
||||
NS_ENSURE_ARG(aEventTarget);
|
||||
WidgetEvent event(true, NS_EVENT_NULL);
|
||||
nsCOMArray<EventTarget> targets;
|
||||
nsTArray<EventTarget*> targets;
|
||||
nsresult rv = EventDispatcher::Dispatch(aEventTarget, nullptr, &event,
|
||||
nullptr, nullptr, nullptr, &targets);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
int32_t count = targets.Count();
|
||||
int32_t count = targets.Length();
|
||||
if (count == 0) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user