Bug 1319560 Part 1: Add a mHitTestShouldStopAtFirstOpaque flag to nsDisplayListBuilder. draft
authorBrad Werth <bwerth@mozilla.com>
Mon, 28 Nov 2016 12:46:56 -0800
changeset 445478 d5c1c30af54814b9a1f9d31c2c4ada0766b13a50
parent 445465 8d8846f63b74eb930e48b410730ae088e9bdbee8
child 445479 d46d96e56d8b8f426be3b65a014c321de5d000fb
push id37512
push userbwerth@mozilla.com
push dateTue, 29 Nov 2016 18:23:05 +0000
bugs1319560
milestone53.0a1
Bug 1319560 Part 1: Add a mHitTestShouldStopAtFirstOpaque flag to nsDisplayListBuilder. 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.