Backed out changeset 1a0729e5b901 (bug 1151152) for m1 test failures in test_pointerevent_pointerleave_descendant_over-manual.html on a CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 19 Jun 2015 12:04:52 +0200
changeset 267854 1b15f41920c75dd5dc84c21f21876925b4d3ab9c
parent 267853 b41a69e1b81c4ab38dd1b0291c4bc37aaf2e85b1
child 267855 a624cf1be2914080452fded2dbbf76be2dcdc103
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1151152
milestone41.0a1
backs out1a0729e5b901fa3feac22995169625b1d73b2979
Backed out changeset 1a0729e5b901 (bug 1151152) for m1 test failures in test_pointerevent_pointerleave_descendant_over-manual.html on a CLOSED TREE
layout/base/nsPresShell.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -7072,21 +7072,19 @@ PresShell::HandleEvent(nsIFrame* aFrame,
       nsPrintfCString warning("%d event is discarded", aEvent->message);
       NS_WARNING(warning.get());
     }
 #endif
     nsContentUtils::WarnScriptWasIgnored(GetDocument());
     return NS_OK;
   }
 
-  nsIContent* capturingContent = ((aEvent->mClass == ePointerEventClass ||
-                                   aEvent->mClass == eWheelEventClass ||
-                                   aEvent->HasMouseEventMessage())
-                                 ? GetCapturingContent()
-                                 : nullptr);
+  nsIContent* capturingContent =
+    (aEvent->HasMouseEventMessage() ||
+     aEvent->mClass == eWheelEventClass ? GetCapturingContent() : nullptr);
 
   nsCOMPtr<nsIDocument> retargetEventDoc;
   if (!aDontRetargetEvents) {
     // key and IME related events should not cross top level window boundary.
     // Basically, such input events should be fired only on focused widget.
     // However, some IMEs might need to clean up composition after focused
     // window is deactivated.  And also some tests on MozMill want to test key
     // handling on deactivated window because MozMill window can be activated
@@ -7484,29 +7482,29 @@ PresShell::HandleEvent(nsIFrame* aFrame,
     // EventStateManager of the current PresContext.
     // If that is the case, and mouse is over some ancestor document,
     // forward event handling to the active document.
     // This way content can get mouse events even when
     // mouse is over the chrome or outside the window.
     //
     // Note, currently for backwards compatibility we don't forward mouse events
     // to the active document when mouse is over some subdocument.
-    if (EventStateManager* activeESM = EventStateManager::GetActiveEventStateManager()) {
-      if (aEvent->mClass == ePointerEventClass || aEvent->HasMouseEventMessage()) {
-        if (activeESM != shell->GetPresContext()->EventStateManager()) {
-          if (nsPresContext* activeContext = activeESM->GetPresContext()) {
-            if (nsIPresShell* activeShell = activeContext->GetPresShell()) {
-              if (nsContentUtils::ContentIsCrossDocDescendantOf(activeShell->GetDocument(),
-                                                                shell->GetDocument())) {
-                shell = static_cast<PresShell*>(activeShell);
-                frame = shell->GetRootFrame();
-              }
-            }
-          }
-        }
+    EventStateManager* activeESM =
+      EventStateManager::GetActiveEventStateManager();
+    if (activeESM && aEvent->HasMouseEventMessage() &&
+        activeESM != shell->GetPresContext()->EventStateManager() &&
+        static_cast<EventStateManager*>(activeESM)->GetPresContext()) {
+      nsIPresShell* activeShell =
+        static_cast<EventStateManager*>(activeESM)->GetPresContext()->
+          GetPresShell();
+      if (activeShell &&
+          nsContentUtils::ContentIsCrossDocDescendantOf(activeShell->GetDocument(),
+                                                        shell->GetDocument())) {
+        shell = static_cast<PresShell*>(activeShell);
+        frame = shell->GetRootFrame();
       }
     }
 
     // Before HandlePositionedEvent we should save mPointerEventTarget in some cases
     nsWeakFrame weakFrame;
     if (sPointerEventEnabled && aTargetContent && ePointerEventClass == aEvent->mClass) {
       weakFrame = frame;
       shell->mPointerEventTarget = frame->GetContent();