Bug 1443424 - Only set eScrollbarThumb on a CompositorHitTestInfo item if the thumb is being layerized. r=kats
authorBotond Ballo <botond@mozilla.com>
Tue, 17 Apr 2018 18:58:42 -0400
changeset 468211 a10d637e167809a078442e81df24b2f0ae1c63bf
parent 468210 0e471630583f6d4f8f6dd24c826b92095b1041fc
child 468212 58b37794b1b8df7fb14b536c1179a5295e8f6baa
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1443424
milestone61.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 1443424 - Only set eScrollbarThumb on a CompositorHitTestInfo item if the thumb is being layerized. r=kats MozReview-Commit-ID: CvngEy9ZsUD
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -11363,17 +11363,23 @@ nsIFrame::GetCompositorHitTestInfo(nsDis
       MOZ_ASSERT((result & CompositorHitTestInfo::eTouchActionMask)
                == CompositorHitTestInfo::eTouchActionMask);
     }
   }
 
   nsDisplayOwnLayerFlags flags = aBuilder->GetCurrentScrollbarFlags();
   if (flags != nsDisplayOwnLayerFlags::eNone) {
     if (GetContent()->IsXULElement(nsGkAtoms::thumb)) {
-      result |= CompositorHitTestInfo::eScrollbarThumb;
+      bool thumbGetsLayer = aBuilder->GetCurrentScrollbarTarget() !=
+          layers::FrameMetrics::NULL_SCROLL_ID;
+      if (thumbGetsLayer) {
+        result |= CompositorHitTestInfo::eScrollbarThumb;
+      } else {
+        result |= CompositorHitTestInfo::eDispatchToContent;
+      }
     }
     // The only flags that get set in nsDisplayListBuilder::mCurrentScrollbarFlags
     // are the scrollbar direction flags
     if (flags == nsDisplayOwnLayerFlags::eVerticalScrollbar) {
       result |= CompositorHitTestInfo::eScrollbarVertical;
     } else {
       MOZ_ASSERT(flags == nsDisplayOwnLayerFlags::eHorizontalScrollbar);
     }