Bug 1588675 - Use nsPresContext::IsRootContentDocumentCrossProcess instead of IsRootContentDocument for places where we call nsLayoutUtils::ComputeScrollMetadata. r=botond
authorHiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
Wed, 16 Oct 2019 21:34:45 +0000
changeset 497922 2d6b09a782bb7e2523b41d0c829c382140d74907
parent 497921 fc5ca4f1d3e0f2b1faf7c3530759abf4afef063b
child 497923 7c046b2cdab468155e42adf35456d8dd3f7f92de
push id36701
push userncsoregi@mozilla.com
push dateThu, 17 Oct 2019 09:35:24 +0000
treeherdermozilla-central@273c3db836e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1588675
milestone71.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 1588675 - Use nsPresContext::IsRootContentDocumentCrossProcess instead of IsRootContentDocument for places where we call nsLayoutUtils::ComputeScrollMetadata. r=botond Differential Revision: https://phabricator.services.mozilla.com/D49272
layout/base/nsLayoutUtils.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/painting/nsDisplayList.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -9252,17 +9252,17 @@ Maybe<ScrollMetadata> nsLayoutUtils::Get
   if (ensureMetricsForRootId && content) {
     ViewID scrollId = nsLayoutUtils::FindOrCreateIDFor(content);
     if (aCallback(scrollId)) {
       ensureMetricsForRootId = false;
     }
   }
 
   if (addMetrics || ensureMetricsForRootId) {
-    bool isRootContent = presContext->IsRootContentDocument();
+    bool isRootContent = presContext->IsRootContentDocumentCrossProcess();
 
     nsRect viewport(aBuilder->ToReferenceFrame(frame), frame->GetSize());
     if (isRootContent && rootScrollFrame) {
       nsIScrollableFrame* scrollableFrame =
           rootScrollFrame->GetScrollTargetFrame();
       viewport.SizeTo(scrollableFrame->GetScrollPortRect().Size());
     }
     return Some(nsLayoutUtils::ComputeScrollMetadata(
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -3550,19 +3550,20 @@ void ScrollFrameHelper::BuildDisplayList
             nsMargin(caretRect.height / 2, caretRect.width, 0, 0));
         contentBoxClip = Some(inflatedClip);
       }
     }
   }
 
   nsDisplayListCollection set(aBuilder);
 
+  bool isRootContent =
+      mIsRoot && mOuter->PresContext()->IsRootContentDocumentCrossProcess();
   bool willBuildAsyncZoomContainer =
-      aBuilder->ShouldBuildAsyncZoomContainer() && mIsRoot &&
-      mOuter->PresContext()->IsRootContentDocument();
+      aBuilder->ShouldBuildAsyncZoomContainer() && isRootContent;
 
   nsRect scrollPortClip = mScrollPort + aBuilder->ToReferenceFrame(mOuter);
   nsRect clipRect = scrollPortClip;
   // Our override of GetBorderRadii ensures we never have a radius at
   // the corners where we have a scrollbar.
   nscoord radii[8];
   bool haveRadii = mOuter->GetPaddingBoxBorderRadii(radii);
   if (mIsRoot) {
@@ -4024,17 +4025,17 @@ Maybe<ScrollMetadata> ScrollFrameHelper:
       mOuter->GetOffsetToCrossDoc(aContainerReferenceFrame);
 
   Maybe<nsRect> parentLayerClip;
   if (aClip && mAddClipRectToLayer) {
     parentLayerClip = Some(aClip->GetClipRect());
   }
 
   bool isRootContent =
-      mIsRoot && mOuter->PresContext()->IsRootContentDocument();
+      mIsRoot && mOuter->PresContext()->IsRootContentDocumentCrossProcess();
 
   MOZ_ASSERT(mScrolledFrame->GetContent());
 
   nsRect scrollport = mScrollPort + toReferenceFrame;
 
   return Some(nsLayoutUtils::ComputeScrollMetadata(
       mScrolledFrame, mOuter, mOuter->GetContent(), aContainerReferenceFrame,
       aLayerManager, mScrollParentID, scrollport, parentLayerClip,
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -7174,17 +7174,17 @@ UniquePtr<ScrollMetadata> nsDisplaySubDo
     LayerManager* aLayerManager,
     const ContainerLayerParameters& aContainerParameters) {
   if (!(mFlags & nsDisplayOwnLayerFlags::GenerateScrollableLayer)) {
     return UniquePtr<ScrollMetadata>(nullptr);
   }
 
   nsPresContext* presContext = mFrame->PresContext();
   nsIFrame* rootScrollFrame = presContext->PresShell()->GetRootScrollFrame();
-  bool isRootContentDocument = presContext->IsRootContentDocument();
+  bool isRootContentDocument = presContext->IsRootContentDocumentCrossProcess();
   PresShell* presShell = presContext->PresShell();
   ContainerLayerParameters params(
       aContainerParameters.mXScale * presShell->GetResolution(),
       aContainerParameters.mYScale * presShell->GetResolution(), nsIntPoint(),
       aContainerParameters);
 
   nsRect viewport = mFrame->GetRect() - mFrame->GetPosition() +
                     mFrame->GetOffsetToCrossDoc(ReferenceFrame());