зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1659231 - Treat defaultPrevented events as consumed r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D87171
This commit is contained in:
Родитель
cc69602cf2
Коммит
85af441835
|
@ -898,7 +898,10 @@ nsresult EventDispatcher::Dispatch(nsISupports* aTarget,
|
|||
|
||||
// Create visitor object and start event dispatching.
|
||||
// GetEventTargetParent for the original target.
|
||||
nsEventStatus status = aEventStatus ? *aEventStatus : nsEventStatus_eIgnore;
|
||||
nsEventStatus status =
|
||||
aDOMEvent && aDOMEvent->DefaultPrevented()
|
||||
? nsEventStatus_eConsumeNoDefault
|
||||
: aEventStatus ? *aEventStatus : nsEventStatus_eIgnore;
|
||||
nsCOMPtr<EventTarget> targetForPreVisitor = aEvent->mTarget;
|
||||
EventChainPreVisitor preVisitor(aPresContext, aEvent, aDOMEvent, status,
|
||||
isInAnon, targetForPreVisitor);
|
||||
|
@ -1102,7 +1105,7 @@ nsresult EventDispatcher::Dispatch(nsISupports* aTarget,
|
|||
}
|
||||
|
||||
if (!externalDOMEvent && preVisitor.mDOMEvent) {
|
||||
// An dom::Event was created while dispatching the event.
|
||||
// A dom::Event was created while dispatching the event.
|
||||
// Duplicate private data if someone holds a pointer to it.
|
||||
nsrefcnt rc = 0;
|
||||
NS_RELEASE2(preVisitor.mDOMEvent, rc);
|
||||
|
|
Загрузка…
Ссылка в новой задаче