Bug 1430813 - Prevent scenario where we keep a dead frame pointer on the EventStateManager. r=smaug

MozReview-Commit-ID: HN8XgsMGisy

--HG--
extra : rebase_source : c2f632bd37a6d3e9220be65fc05bc2b0e2cfa246
This commit is contained in:
Kartikaya Gupta 2018-04-23 09:35:12 -04:00
Родитель 65577c0773
Коммит eaf147ebce
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -7212,14 +7212,15 @@ PresShell::HandleEvent(nsIFrame* aFrame,
frame = targetFrame;
}
AutoWeakFrame weakFrame(targetFrame);
AutoWeakFrame weakTargetFrame(targetFrame);
AutoWeakFrame weakFrame(frame);
nsCOMPtr<nsIContent> targetContent;
PointerEventHandler::DispatchPointerFromMouseOrTouch(
shell, targetFrame, targetElement, aEvent,
aDontRetargetEvents, aEventStatus,
getter_AddRefs(targetContent));
if (!weakFrame.IsAlive() && aEvent->mClass == eMouseEventClass) {
if (!weakTargetFrame.IsAlive() && aEvent->mClass == eMouseEventClass) {
// Spec only defines that mouse events must be dispatched to the same
// target as the pointer event. If the target is no longer participating
// in its ownerDocument's tree, fire the event at the original target's
@ -7232,6 +7233,8 @@ PresShell::HandleEvent(nsIFrame* aFrame,
if (!shell) {
return NS_OK;
}
} else if (!weakFrame.IsAlive()) {
return NS_OK;
}
}