Bug 587944. Need to clear are target frame when we clear our target content. r=smaug a=blocking 130078 which blocks
☠☠ backed out by 958a30df30dd ☠ ☠
authorTimothy Nikkel <tnikkel@gmail.com>
Wed, 18 Aug 2010 20:16:58 -0500
changeset 50859 66dcf25705f96aa875d7ee152e7d5407598ef448
parent 50858 5ca1e06cedf133404a8bf6b04dd2fc1bf22cbf8b
child 50860 11de95535653f3b68e7ced50831f0bbaf6b8e64d
child 50945 958a30df30dd730e0ee407b433ceed66449a2c5e
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssmaug, blocking
bugs587944, 130078
milestone2.0b5pre
Bug 587944. Need to clear are target frame when we clear our target content. r=smaug a=blocking 130078 which blocks
content/events/src/nsEventStateManager.cpp
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -3287,16 +3287,17 @@ nsEventStateManager::PostHandleEvent(nsP
     }
     break;
 #endif // ANDROID
 #endif // MOZ_IPC
   }
 
   //Reset target frame to null to avoid mistargeting after reentrant event
   mCurrentTarget = nsnull;
+  mCurrentTargetContent = nsnull;
 
   return ret;
 }
 
 #ifdef MOZ_IPC
 #ifdef ANDROID
 mozilla::dom::PBrowserParent*
 nsEventStateManager::GetCrossProcessTarget()
@@ -3606,32 +3607,34 @@ nsEventStateManager::DispatchMouseEvent(
   event.isControl = ((nsMouseEvent*)aEvent)->isControl;
   event.isAlt = ((nsMouseEvent*)aEvent)->isAlt;
   event.isMeta = ((nsMouseEvent*)aEvent)->isMeta;
   event.pluginEvent = ((nsMouseEvent*)aEvent)->pluginEvent;
   event.relatedTarget = aRelatedContent;
   event.inputSource = static_cast<nsMouseEvent*>(aEvent)->inputSource;
 
   mCurrentTargetContent = aTargetContent;
+  mCurrentTarget = nsnull;
 
   nsIFrame* targetFrame = nsnull;
   if (aTargetContent) {
     nsESMEventCB callback(aTargetContent);
     nsEventDispatcher::Dispatch(aTargetContent, mPresContext, &event, nsnull,
                                 &status, &callback);
 
     // Although the primary frame was checked in event callback, 
     // it may not be the same object after event dispatching and handling.
     // So we need to refetch it.
     if (mPresContext) {
       targetFrame = mPresContext->GetPrimaryFrameFor(aTargetContent);
     }
   }
 
   mCurrentTargetContent = nsnull;
+  mCurrentTarget = nsnull;
 
   return targetFrame;
 }
 
 void
 nsEventStateManager::NotifyMouseOut(nsGUIEvent* aEvent, nsIContent* aMovingInto)
 {
   if (!mLastMouseOverElement)
@@ -3786,16 +3789,17 @@ nsEventStateManager::GenerateMouseEnterE
 
       NotifyMouseOut(aEvent, nsnull);
     }
     break;
   }
 
   // reset mCurretTargetContent to what it was
   mCurrentTargetContent = targetBeforeEvent;
+  mCurrentTarget = nsnull;
 }
 
 void
 nsEventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
                                                nsGUIEvent* aEvent)
 {
   //Hold onto old target content through the event and reset after.
   nsCOMPtr<nsIContent> targetBeforeEvent = mCurrentTargetContent;