Bug 1596494 - Call UpdateCompositionBoundsForRCDRSF only if we are in the top level content document. r=tnikkel
authorHiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
Fri, 15 Nov 2019 01:54:05 +0000
changeset 502113 ff4ff0dd4da373d91ebf6b5f9a13782a69de7847
parent 502112 3322c8c93b02a7e848951a454a5c94f6d4704a74
child 502114 2007edb47f8ffdda9ef310c833e131ac7efc230f
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1596494, 1562505
milestone72.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 1596494 - Call UpdateCompositionBoundsForRCDRSF only if we are in the top level content document. r=tnikkel Though there is another call site of UpdateCompositionBoundsForRCDRSF in nsLayoutUtils::CalculateRootCompositionSize, it's not clear to me whether it is necessary or not since we early return from the function in the case where |aIsRootContentDocRootScrollFrame| argument is true. We will audit it later in bug 1562505. Differential Revision: https://phabricator.services.mozilla.com/D53117
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -8517,17 +8517,17 @@ nsSize nsLayoutUtils::CalculateCompositi
   nsRect rect = scrollableFrame ? scrollableFrame->GetScrollPortRect()
                                 : aFrame->GetRect();
   nsSize size = rect.Size();
 
   nsPresContext* presContext = aFrame->PresContext();
   PresShell* presShell = presContext->PresShell();
 
   bool isRootContentDocRootScrollFrame =
-      presContext->IsRootContentDocument() &&
+      presContext->IsRootContentDocumentCrossProcess() &&
       aFrame == presShell->GetRootScrollFrame();
   if (isRootContentDocRootScrollFrame) {
     ParentLayerRect compBounds;
     if (UpdateCompositionBoundsForRCDRSF(compBounds, presContext, false)) {
       int32_t auPerDevPixel = presContext->AppUnitsPerDevPixel();
       size = nsSize(compBounds.width * auPerDevPixel,
                     compBounds.height * auPerDevPixel);
     }
@@ -9196,17 +9196,17 @@ ScrollMetadata nsLayoutUtils::ComputeScr
   // bounds, which doesn't actually correspond to what is visible when
   // nsIDOMWindowUtils::setCSSViewport has been called to modify the visible
   // area of the prescontext that the viewport frame is reflowed into. In that
   // case if our document has a widget then the widget's bounds will correspond
   // to what is visible. If we don't have a widget the root view's bounds
   // correspond to what would be visible because they don't get modified by
   // setCSSViewport.
   bool isRootContentDocRootScrollFrame =
-      isRootScrollFrame && presContext->IsRootContentDocument();
+      isRootScrollFrame && presContext->IsRootContentDocumentCrossProcess();
   if (isRootContentDocRootScrollFrame) {
     UpdateCompositionBoundsForRCDRSF(frameBounds, presContext, true);
   }
 
   nsMargin sizes = ScrollbarAreaToExcludeFromCompositionBoundsFor(aScrollFrame);
   // Scrollbars are not subject to resolution scaling, so LD pixels = layer
   // pixels for them.
   ParentLayerMargin boundMargins =