diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 5702a5a2660..136675643ee 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -4438,9 +4438,9 @@ PresShell::DispatchSynthMouseMove(nsGUIEvent *aEvent, { PRUint32 hoverGenerationBefore = mFrameConstructor->GetHoverGeneration(); nsEventStatus status; - nsIView* rootView; - mViewManager->GetRootView(rootView); - mViewManager->DispatchEvent(aEvent, rootView, &status); + nsIView* targetView; + targetView = nsIView::GetViewFor(aEvent->widget); + mViewManager->DispatchEvent(aEvent, targetView, &status); if (aFlushOnHoverChange && hoverGenerationBefore != mFrameConstructor->GetHoverGeneration()) { // Flush so that the resulting reflow happens now so that our caller diff --git a/widget/tests/native_mouse_mac_window.xul b/widget/tests/native_mouse_mac_window.xul index 78916451a22..9d598df8b5b 100644 --- a/widget/tests/native_mouse_mac_window.xul +++ b/widget/tests/native_mouse_mac_window.xul @@ -434,13 +434,8 @@ [387, 170, NSMouseMoved, null, right, [ { type: "mouseover", target: panel }, { type: "mousemove", target: panel }, - { type: "mouseout", target: panel, todoShouldNotHaveFired: true }, - { type: "mouseover", target: left.document.documentElement, todoShouldNotHaveFired: true }, ]], - // Why does left.document.documentElement get entered? This makes no sense. [387, 171, NSMouseMoved, null, left, [ - { type: "mouseout", target: left.document.documentElement, todoShouldNotHaveFired: true }, - { type: "mouseover", target: panel, todoShouldNotHaveFired: true }, { type: "mousemove", target: panel }, ]], [388, 171, NSMouseMoved, panel, left, [