Bug 513684. Stop :hover from bleeding through certain elements. r=roc Test fixes from Markus Stange <mstange@themasta.com>.
authorKyle Huey <me@kylehuey.com>
Sat, 26 Sep 2009 16:35:05 -0700
changeset 33210 9ed976f3d466adfd367bc63fdcd11d83e2887d82
parent 33209 634385257da90ac1c472e6fc5a5981c94f8371bd
child 33211 f616aec6cce4895789355d4f55e45bc381fa5fac
push idunknown
push userunknown
push dateunknown
reviewersroc
bugs513684
milestone1.9.3a1pre
Bug 513684. Stop :hover from bleeding through certain elements. r=roc Test fixes from Markus Stange <mstange@themasta.com>.
layout/base/nsPresShell.cpp
widget/tests/native_mouse_mac_window.xul
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -4433,19 +4433,19 @@ PresShell::NotifyInvalidateForScrolledVi
 }
 
 NS_IMETHODIMP_(void)
 PresShell::DispatchSynthMouseMove(nsGUIEvent *aEvent,
                                   PRBool aFlushOnHoverChange)
 {
   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
     // can suppress any synthesized mouse moves caused by that reflow.
     FlushPendingNotifications(Flush_Layout);
   }
 }
 
--- a/widget/tests/native_mouse_mac_window.xul
+++ b/widget/tests/native_mouse_mac_window.xul
@@ -429,23 +429,18 @@
         function raiseLeftWindowTakeTwo(callback) {
           focusAndThen(left, callback);
         },
         // Now mouse events should get through to the panel (which is now over the
         // right window).
         [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, [
           { type: "mousemove", target: panel },
         ]],
         // Click the panel.
         [388, 171, NSLeftMouseDown, panel, left, [
           { type: "mousedown", target: panel }