Bug 1467867 - Ensure we populate the event regions overrides properly. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 08 Jun 2018 21:16:43 +0000
changeset 478715 192713c16fc1f199c78f470f11c3c6f12109ec27
parent 478714 3a3bbb2e68ef7429368c347c53b4ac819b5db6a0
child 478716 c77f7fe4c21b50dc7525602f9b147530e89c2e8b
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1467867
milestone62.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 1467867 - Ensure we populate the event regions overrides properly. r=botond The event regions override flags are needed whenever APZ is doing hit-testing off the layer tree. This can happen even if IsBuildingLayerEventRegions() returns false, because we can instead be building nsDisplayCompositorHitTestInfo items from which we populate the layer tree's EventRegions objects. So the guard condition here is wrong, and we can just remove it to ensure the flags are always put on the layer tree. If APZ isn't enabled on this layer tree then they won't be used, and there might be a slight perf hit, but it should be negligible. Differential Revision: https://phabricator.services.mozilla.com/D1599
layout/ipc/RenderFrameParent.cpp
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -345,26 +345,24 @@ RenderFrameParent::EnsureLayersConnected
 
 nsDisplayRemote::nsDisplayRemote(nsDisplayListBuilder* aBuilder,
                                  nsSubDocumentFrame* aFrame,
                                  RenderFrameParent* aRemoteFrame)
   : nsDisplayItem(aBuilder, aFrame)
   , mRemoteFrame(aRemoteFrame)
   , mEventRegionsOverride(EventRegionsOverride::NoOverride)
 {
-  if (aBuilder->IsBuildingLayerEventRegions()) {
-    bool frameIsPointerEventsNone =
-      aFrame->StyleUserInterface()->GetEffectivePointerEvents(aFrame) ==
-        NS_STYLE_POINTER_EVENTS_NONE;
-    if (aBuilder->IsInsidePointerEventsNoneDoc() || frameIsPointerEventsNone) {
-      mEventRegionsOverride |= EventRegionsOverride::ForceEmptyHitRegion;
-    }
-    if (nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(aFrame->PresShell())) {
-      mEventRegionsOverride |= EventRegionsOverride::ForceDispatchToContent;
-    }
+  bool frameIsPointerEventsNone =
+    aFrame->StyleUserInterface()->GetEffectivePointerEvents(aFrame) ==
+      NS_STYLE_POINTER_EVENTS_NONE;
+  if (aBuilder->IsInsidePointerEventsNoneDoc() || frameIsPointerEventsNone) {
+    mEventRegionsOverride |= EventRegionsOverride::ForceEmptyHitRegion;
+  }
+  if (nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(aFrame->PresShell())) {
+    mEventRegionsOverride |= EventRegionsOverride::ForceDispatchToContent;
   }
 }
 
 already_AddRefed<Layer>
 nsDisplayRemote::BuildLayer(nsDisplayListBuilder* aBuilder,
                             LayerManager* aManager,
                             const ContainerLayerParameters& aContainerParameters)
 {