Bug 1488889 - Pass nsSubDocumentFrame to nsDisplaySubDocument constructor r=mattwoodrow
authorMiko Mynttinen <mikokm@gmail.com>
Wed, 05 Sep 2018 23:16:17 +0000
changeset 435018 d7df7b04f55a2ae55a691b46b1c50fed6bf4ae75
parent 435017 fc5ee8a046456b4d2affd2142954ea8e3b685322
child 435019 85ec0c9fb5c39d7bcb49156d27c9b0f424eeada1
push id107530
push userapavel@mozilla.com
push dateThu, 06 Sep 2018 04:44:27 +0000
treeherdermozilla-inbound@5f5d7a3ce332 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1488889
milestone64.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 1488889 - Pass nsSubDocumentFrame to nsDisplaySubDocument constructor r=mattwoodrow Differential Revision: https://phabricator.services.mozilla.com/D5091
layout/generic/nsSubDocumentFrame.cpp
layout/painting/nsDisplayList.cpp
layout/painting/nsDisplayList.h
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -560,31 +560,31 @@ nsSubDocumentFrame::BuildDisplayList(nsD
   // is going to become the scrollable layer for the root scroll frame, so we
   // want to add nsDisplayOwnLayer::GENERATE_SCROLLABLE_LAYER to whatever layer
   // becomes the topmost. We do this below.
   if (constructZoomItem) {
     nsDisplayOwnLayerFlags zoomFlags = flags;
     if (ignoreViewportScrolling && !constructResolutionItem) {
       zoomFlags |= nsDisplayOwnLayerFlags::eGenerateScrollableLayer;
     }
-    nsDisplayZoom* zoomItem =
-      MakeDisplayItem<nsDisplayZoom>(aBuilder, subdocRootFrame, &childItems,
-                                   subdocAPD, parentAPD, zoomFlags);
+    nsDisplayZoom* zoomItem = MakeDisplayItem<nsDisplayZoom>(
+      aBuilder, subdocRootFrame, this, &childItems, subdocAPD, parentAPD, zoomFlags);
+
     childItems.AppendToTop(zoomItem);
     needsOwnLayer = false;
   }
   // Wrap the zoom item in the resolution item if we have both because we want the
   // resolution scale applied on top of the app units per dev pixel conversion.
   if (ignoreViewportScrolling) {
     flags |= nsDisplayOwnLayerFlags::eGenerateScrollableLayer;
   }
   if (constructResolutionItem) {
-    nsDisplayResolution* resolutionItem =
-      MakeDisplayItem<nsDisplayResolution>(aBuilder, subdocRootFrame, &childItems,
-                                           flags);
+    nsDisplayResolution* resolutionItem = MakeDisplayItem<nsDisplayResolution>(
+      aBuilder, subdocRootFrame, this, &childItems, flags);
+
     childItems.AppendToTop(resolutionItem);
     needsOwnLayer = false;
   }
 
   // We always want top level content documents to be in their own layer.
   nsDisplaySubDocument* layerItem = MakeDisplayItem<nsDisplaySubDocument>(
     aBuilder, subdocRootFrame ? subdocRootFrame : this, this,
     &childItems, flags);
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -7235,19 +7235,20 @@ nsDisplaySubDocument::GetOpaqueRegion(ns
     return nsRegion();
   }
 
   return nsDisplayOwnLayer::GetOpaqueRegion(aBuilder, aSnap);
 }
 
 nsDisplayResolution::nsDisplayResolution(nsDisplayListBuilder* aBuilder,
                                          nsIFrame* aFrame,
+                                         nsSubDocumentFrame* aSubDocFrame,
                                          nsDisplayList* aList,
                                          nsDisplayOwnLayerFlags aFlags)
-  : nsDisplaySubDocument(aBuilder, aFrame, nullptr, aList, aFlags)
+  : nsDisplaySubDocument(aBuilder, aFrame, aSubDocFrame, aList, aFlags)
 {
   MOZ_COUNT_CTOR(nsDisplayResolution);
 }
 
 void
 nsDisplayResolution::HitTest(nsDisplayListBuilder* aBuilder,
                              const nsRect& aRect,
                              HitTestState* aState,
@@ -7852,21 +7853,22 @@ void
 nsDisplayScrollInfoLayer::WriteDebugInfo(std::stringstream& aStream)
 {
   aStream << " (scrollframe " << mScrollFrame << " scrolledFrame "
           << mScrolledFrame << ")";
 }
 
 nsDisplayZoom::nsDisplayZoom(nsDisplayListBuilder* aBuilder,
                              nsIFrame* aFrame,
+                             nsSubDocumentFrame* aSubDocFrame,
                              nsDisplayList* aList,
                              int32_t aAPD,
                              int32_t aParentAPD,
                              nsDisplayOwnLayerFlags aFlags)
-  : nsDisplaySubDocument(aBuilder, aFrame, nullptr, aList, aFlags)
+  : nsDisplaySubDocument(aBuilder, aFrame, aSubDocFrame, aList, aFlags)
   , mAPD(aAPD)
   , mParentAPD(aParentAPD)
 {
   MOZ_COUNT_CTOR(nsDisplayZoom);
 }
 
 nsRect
 nsDisplayZoom::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) const
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -6257,16 +6257,17 @@ protected:
  * and ensure that it gets applied to all the right elements. This item creates
  * a container layer.
  */
 class nsDisplayResolution : public nsDisplaySubDocument
 {
 public:
   nsDisplayResolution(nsDisplayListBuilder* aBuilder,
                       nsIFrame* aFrame,
+                      nsSubDocumentFrame* aSubDocFrame,
                       nsDisplayList* aList,
                       nsDisplayOwnLayerFlags aFlags);
 #ifdef NS_BUILD_REFCNT_LOGGING
   ~nsDisplayResolution() override { MOZ_COUNT_DTOR(nsDisplayResolution); }
 #endif
 
   NS_DISPLAY_DECL_NAME("Resolution", TYPE_RESOLUTION)
 
@@ -6579,16 +6580,17 @@ public:
    * @param aParentAPD is the app units per dev pixel ratio of the parent
    * document.
    * @param aFlags eGenerateSubdocInvalidations :
    * Add UserData to the created ContainerLayer, so that invalidations
    * for this layer are send to our nsPresContext.
    */
   nsDisplayZoom(nsDisplayListBuilder* aBuilder,
                 nsIFrame* aFrame,
+                nsSubDocumentFrame* aSubDocFrame,
                 nsDisplayList* aList,
                 int32_t aAPD,
                 int32_t aParentAPD,
                 nsDisplayOwnLayerFlags aFlags = nsDisplayOwnLayerFlags::eNone);
 
 #ifdef NS_BUILD_REFCNT_LOGGING
   ~nsDisplayZoom() override { MOZ_COUNT_DTOR(nsDisplayZoom); }
 #endif