Bug 1561002 - Use buildingRect for remote browser clipping when we don't have anything more precise. r=mattwoodrow
authorRyan Hunt <rhunt@eqrion.net>
Wed, 26 Jun 2019 02:50:36 +0000
changeset 543665 8d6b6b345e249a49802444da28119c111621786d
parent 543664 832c35afa350fdad83140fa71d46de9609991e79
child 543666 98db541275e5d242f5c5d3fff6ccacbfb5716481
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1561002
milestone69.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 1561002 - Use buildingRect for remote browser clipping when we don't have anything more precise. r=mattwoodrow Differential Revision: https://phabricator.services.mozilla.com/D35677
layout/generic/nsSubDocumentFrame.cpp
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -1404,20 +1404,21 @@ already_AddRefed<mozilla::layers::Layer>
   }
 
   if (RefPtr<RemoteBrowser> remoteBrowser =
           GetFrameLoader()->GetRemoteBrowser()) {
     // Adjust mItemVisibleRect, which is relative to the reference frame, to be
     // relative to this frame
     nsRect visibleRect;
     if (aContainerParameters.mItemVisibleRect) {
-      visibleRect = *aContainerParameters.mItemVisibleRect - ToReferenceFrame();
+      visibleRect = *aContainerParameters.mItemVisibleRect;
     } else {
-      visibleRect = mFrame->GetContentRectRelativeToSelf();
+      visibleRect = GetBuildingRect();
     }
+    visibleRect -= ToReferenceFrame();
 
     // Generate an effects update notifying the browser it is visible
     aBuilder->AddEffectUpdate(remoteBrowser,
                               EffectsInfo::VisibleWithinRect(
                                   visibleRect, aContainerParameters.mXScale,
                                   aContainerParameters.mYScale));
     // FrameLayerBuilder will take care of notifying the browser when it is no
     // longer visible
@@ -1472,21 +1473,24 @@ bool nsDisplayRemote::CreateWebRenderCom
     mozilla::layers::RenderRootStateManager* aManager,
     nsDisplayListBuilder* aDisplayListBuilder) {
   if (!mLayersId.IsValid()) {
     return true;
   }
 
   if (RefPtr<RemoteBrowser> remoteBrowser =
           GetFrameLoader()->GetRemoteBrowser()) {
+    // Adjust mItemVisibleRect, which is relative to the reference frame, to be
+    // relative to this frame
+    nsRect visibleRect = GetBuildingRect() - ToReferenceFrame();
+
     // Generate an effects update notifying the browser it is visible
-    // TODO - Gather visibleRect and scaling factors
+    // TODO - Gather scaling factors
     aDisplayListBuilder->AddEffectUpdate(
-        remoteBrowser, EffectsInfo::VisibleWithinRect(
-                           mFrame->GetContentRectRelativeToSelf(), 1.0f, 1.0f));
+        remoteBrowser, EffectsInfo::VisibleWithinRect(visibleRect, 1.0f, 1.0f));
 
     // Create a WebRenderRemoteData to notify the RemoteBrowser when it is no
     // longer visible
     RefPtr<WebRenderRemoteData> userData =
         aManager->CommandBuilder()
             .CreateOrRecycleWebRenderUserData<WebRenderRemoteData>(
                 this, aBuilder.GetRenderRoot(), nullptr);
     userData->SetRemoteBrowser(remoteBrowser);