Bug 1406715 - Use the RenderFrameParent's content rect as the bounds of the webrender iframe display item. r?kats draft
authorMarkus Stange <mstange@themasta.com>
Sun, 22 Oct 2017 00:48:01 -0400
changeset 686639 d156c4455bbb6fa2418e7b7ea796c2a9526639e1
parent 684075 a59008dae04d3ee24ea243a62d6932f049c82e0c
child 737416 c700940555fd32d5c4e0d119273a9e78eaca6c47
push id86233
push userbmo:mstange@themasta.com
push dateThu, 26 Oct 2017 04:39:49 +0000
reviewerskats
bugs1406715
milestone58.0a1
Bug 1406715 - Use the RenderFrameParent's content rect as the bounds of the webrender iframe display item. r?kats It was using the visible rect of the display item before, which can be larger than the frame for various reasons. But the bounds we pass for the webrender iframe item determines the iframe's position, so it needs to be informed by the layout position of the frame, not by circumstances of the paint. MozReview-Commit-ID: JSmFGLmAm0h
layout/ipc/RenderFrameParent.cpp
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -385,21 +385,21 @@ bool
 nsDisplayRemote::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
                                          mozilla::wr::IpcResourceUpdateQueue& aResources,
                                          const StackingContextHelper& aSc,
                                          mozilla::layers::WebRenderLayerManager* aManager,
                                          nsDisplayListBuilder* aDisplayListBuilder)
 {
   mOffset = mozilla::layout::GetContentRectLayerOffset(mFrame, aDisplayListBuilder);
 
-  mozilla::LayoutDeviceRect visible = mozilla::LayoutDeviceRect::FromAppUnits(
-      GetVisibleRect(), mFrame->PresContext()->AppUnitsPerDevPixel());
-  visible += mOffset;
+  mozilla::LayoutDeviceRect rect = mozilla::LayoutDeviceRect::FromAppUnits(
+    mFrame->GetContentRectRelativeToSelf(), mFrame->PresContext()->AppUnitsPerDevPixel());
+  rect += mOffset;
 
-  aBuilder.PushIFrame(aSc.ToRelativeLayoutRect(visible),
+  aBuilder.PushIFrame(aSc.ToRelativeLayoutRect(rect),
       !BackfaceIsHidden(),
       mozilla::wr::AsPipelineId(GetRemoteLayersId()));
 
   return true;
 }
 
 bool
 nsDisplayRemote::UpdateScrollData(mozilla::layers::WebRenderScrollData* aData,