Bug 1246404 - Check mouseContent before calling IsInComposedDoc(). r=smaug
authorTing-Yu Lin <tlin@mozilla.com>
Sat, 06 Feb 2016 23:44:00 +0800
changeset 283430 a674340dc97ef303e1959eb9efc2d9cf49755bde
parent 283429 02c902f1919052fd4a9bf0f982a874f5cee440e5
child 283431 149dc37ee4c71fe51780f0864b201755fb1658e0
push id71530
push usertlin@mozilla.com
push dateMon, 08 Feb 2016 05:58:22 +0000
treeherdermozilla-inbound@a674340dc97e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1246404
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1246404 - Check mouseContent before calling IsInComposedDoc(). r=smaug It's possible that PresShell::HandleEventWithTarget() above will make mouseContent become nullptr. We should check the validity of mouseContent before calling its method.
dom/events/EventStateManager.cpp
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -4678,17 +4678,17 @@ EventStateManager::CheckForAndDispatchCl
         return NS_OK;
       }
 
       // HandleEvent clears out mCurrentTarget which we might need again
       nsWeakFrame currentTarget = mCurrentTarget;
       ret = presShell->HandleEventWithTarget(&event, currentTarget,
                                              mouseContent, aStatus);
       if (NS_SUCCEEDED(ret) && aEvent->clickCount == 2 &&
-          mouseContent->IsInComposedDoc()) {
+          mouseContent && mouseContent->IsInComposedDoc()) {
         //fire double click
         WidgetMouseEvent event2(aEvent->mFlags.mIsTrusted, eMouseDoubleClick,
                                 aEvent->widget, WidgetMouseEvent::eReal);
         event2.refPoint = aEvent->refPoint;
         event2.clickCount = aEvent->clickCount;
         event2.modifiers = aEvent->modifiers;
         event2.buttons = aEvent->buttons;
         event2.mFlags.mNoContentDispatch = notDispatchToContents;