Bug 1319560 Part 1: Add a mHitTestShouldStopAtFirstOpaque flag to nsDisplayListBuilder. r=mattwoodrow
authorBrad Werth <bwerth@mozilla.com>
Mon, 28 Nov 2016 12:46:56 -0800
changeset 324871 c396937ada0f756403e473b580c36a05eedf2231
parent 324870 512d5944a602d037a7c3455190a41f39aab37c9a
child 324872 707be7b4ca59f8fa692f12c35f1929c0163d8b0b
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersmattwoodrow
bugs1319560
milestone53.0a1
Bug 1319560 Part 1: Add a mHitTestShouldStopAtFirstOpaque flag to nsDisplayListBuilder. r=mattwoodrow MozReview-Commit-ID: AuXcAUMhlJW
layout/painting/nsDisplayList.cpp
layout/painting/nsDisplayList.h
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -768,17 +768,18 @@ nsDisplayListBuilder::nsDisplayListBuild
       mIsCompositingCheap(false),
       mContainsPluginItem(false),
       mAncestorHasApzAwareEventHandler(false),
       mHaveScrollableDisplayPort(false),
       mWindowDraggingAllowed(false),
       mIsBuildingForPopup(nsLayoutUtils::IsPopup(aReferenceFrame)),
       mForceLayerForScrollParent(false),
       mAsyncPanZoomEnabled(nsLayoutUtils::AsyncPanZoomEnabled(aReferenceFrame)),
-      mBuildingInvisibleItems(false)
+      mBuildingInvisibleItems(false),
+      mHitTestShouldStopAtFirstOpaque(false)
 {
   MOZ_COUNT_CTOR(nsDisplayListBuilder);
   PL_InitArenaPool(&mPool, "displayListArena", 4096,
                    std::max(NS_ALIGNMENT_OF(void*),NS_ALIGNMENT_OF(double))-1);
 
   nsPresContext* pc = aReferenceFrame->PresContext();
   nsIPresShell *shell = pc->PresShell();
   if (pc->IsRenderingOnlySelection()) {
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -1128,16 +1128,23 @@ public:
     mPreserves3DCtx.mDirtyRect = aDirtyRect;
   }
 
   bool IsBuildingInvisibleItems() const { return mBuildingInvisibleItems; }
   void SetBuildingInvisibleItems(bool aBuildingInvisibleItems) {
     mBuildingInvisibleItems = aBuildingInvisibleItems;
   }
 
+  bool HitTestShouldStopAtFirstOpaque() const {
+    return mHitTestShouldStopAtFirstOpaque;
+  }
+  void SetHitTestShouldStopAtFirstOpaque(bool aHitTestShouldStopAtFirstOpaque) {
+    mHitTestShouldStopAtFirstOpaque = aHitTestShouldStopAtFirstOpaque;
+  }
+
 private:
   void MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame, nsIFrame* aFrame,
                                     const nsRect& aDirtyRect);
 
   /**
    * Returns whether a frame acts as an animated geometry root, optionally
    * returning the next ancestor to check.
    */
@@ -1277,16 +1284,17 @@ private:
   // display list has a display port. An async-scrollable scroll frame is one
   // which WantsAsyncScroll().
   bool                           mHaveScrollableDisplayPort;
   bool                           mWindowDraggingAllowed;
   bool                           mIsBuildingForPopup;
   bool                           mForceLayerForScrollParent;
   bool                           mAsyncPanZoomEnabled;
   bool                           mBuildingInvisibleItems;
+  bool                           mHitTestShouldStopAtFirstOpaque;
 };
 
 class nsDisplayItem;
 class nsDisplayList;
 /**
  * nsDisplayItems are put in singly-linked lists rooted in an nsDisplayList.
  * nsDisplayItemLink holds the link. The lists are linked from lowest to
  * highest in z-order.