Bug 1508789 - Force 'pointer-events: auto' used value for root content. r=mstange
authorRyan Hunt <rhunt@eqrion.net>
Thu, 22 Nov 2018 14:16:14 +0000
changeset 504435 d15d34168dd095c25dfbca6313a3bfa1b389da38
parent 504434 6713926d58d28f438b010bf217fba98722e2c1e8
child 504436 56b6151b48228e19e2e076053294b78f75880046
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1508789
milestone65.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 1508789 - Force 'pointer-events: auto' used value for root content. r=mstange It seems that other browsers don't allow 'pointer-events: none' on the root content, and this can cause us interoperability issues. Differential Revision: https://phabricator.services.mozilla.com/D12500
layout/style/nsStyleStructInlines.h
--- a/layout/style/nsStyleStructInlines.h
+++ b/layout/style/nsStyleStructInlines.h
@@ -244,24 +244,20 @@ nsStyleDisplay::IsAbsolutelyPositioned(c
   return IsAbsolutelyPositionedStyle() &&
          !nsSVGUtils::IsInSVGTextSubtree(aContextFrame);
 }
 
 uint8_t
 nsStyleUI::GetEffectivePointerEvents(nsIFrame* aFrame) const
 {
   if (aFrame->GetContent() && !aFrame->GetContent()->GetParent()) {
-    // The root element has a cluster of frames associated with it
-    // (root scroll frame, canvas frame, the actual primary frame). Make
-    // those take their pointer-events value from the root element's primary
-    // frame.
-    nsIFrame* f = aFrame->GetContent()->GetPrimaryFrame();
-    if (f) {
-      return f->StyleUI()->mPointerEvents;
-    }
+    // The root frame is not allowed to have pointer-events: none, or else
+    // no frames could be hit test against and scrolling the viewport would
+    // not work.
+    return NS_STYLE_POINTER_EVENTS_AUTO;
   }
   return mPointerEvents;
 }
 
 bool
 nsStyleBackground::HasLocalBackground() const
 {
   NS_FOR_VISIBLE_IMAGE_LAYERS_BACK_TO_FRONT(i, mImage) {