diff --git a/dom/ipc/BrowserBridgeParent.cpp b/dom/ipc/BrowserBridgeParent.cpp index b8dd66089d92..8ae0b2d7b312 100644 --- a/dom/ipc/BrowserBridgeParent.cpp +++ b/dom/ipc/BrowserBridgeParent.cpp @@ -174,12 +174,6 @@ IPCResult BrowserBridgeParent::RecvUpdateEffects(const EffectsInfo& aEffects) { return IPC_OK(); } -IPCResult BrowserBridgeParent::RecvUpdateRemotePrintSettings( - const embedding::PrintData& aPrintData) { - Unused << mBrowserParent->SendUpdateRemotePrintSettings(aPrintData); - return IPC_OK(); -} - IPCResult BrowserBridgeParent::RecvRenderLayers( const bool& aEnabled, const layers::LayersObserverEpoch& aEpoch) { Unused << mBrowserParent->SendRenderLayers(aEnabled, aEpoch); diff --git a/dom/ipc/BrowserBridgeParent.h b/dom/ipc/BrowserBridgeParent.h index f50d814d1fe9..3e0d16edf54f 100644 --- a/dom/ipc/BrowserBridgeParent.h +++ b/dom/ipc/BrowserBridgeParent.h @@ -17,10 +17,6 @@ namespace a11y { class DocAccessibleParent; } -namespace embedding { -class PrintData; -} - namespace dom { class BrowserParent; @@ -79,8 +75,6 @@ class BrowserBridgeParent : public PBrowserBridgeParent { mozilla::ipc::IPCResult RecvUpdateDimensions(const nsIntRect& aRect, const ScreenIntSize& aSize); mozilla::ipc::IPCResult RecvUpdateEffects(const EffectsInfo& aEffects); - mozilla::ipc::IPCResult RecvUpdateRemotePrintSettings( - const embedding::PrintData&); mozilla::ipc::IPCResult RecvRenderLayers(const bool& aEnabled, const LayersObserverEpoch& aEpoch); diff --git a/dom/ipc/BrowserChild.cpp b/dom/ipc/BrowserChild.cpp index 9f1bccda2efe..ad17e8bf2e40 100644 --- a/dom/ipc/BrowserChild.cpp +++ b/dom/ipc/BrowserChild.cpp @@ -1089,7 +1089,10 @@ mozilla::ipc::IPCResult BrowserChild::RecvCloneDocumentTreeIntoSelf( } } - return RecvUpdateRemotePrintSettings(aPrintData); + rv = cv->SetPrintSettingsForSubdocument(printSettings); + if (NS_WARN_IF(NS_FAILED(rv))) { + return IPC_OK(); + } #endif return IPC_OK(); } @@ -1107,8 +1110,9 @@ mozilla::ipc::IPCResult BrowserChild::RecvUpdateRemotePrintSettings( return IPC_OK(); } - RefPtr bc = ourDocShell->GetBrowsingContext(); - if (NS_WARN_IF(!bc)) { + nsCOMPtr cv; + ourDocShell->GetContentViewer(getter_AddRefs(cv)); + if (NS_WARN_IF(!cv)) { return IPC_OK(); } @@ -1126,31 +1130,11 @@ mozilla::ipc::IPCResult BrowserChild::RecvUpdateRemotePrintSettings( } printSettingsSvc->DeserializeToPrintSettings(aPrintData, printSettings); - - bc->PreOrderWalk([&](BrowsingContext* aBc) { - if (nsCOMPtr inProcess = aBc->GetDocShell()) { - nsCOMPtr cv; - inProcess->GetContentViewer(getter_AddRefs(cv)); - if (NS_WARN_IF(!cv)) { - return BrowsingContext::WalkFlag::Skip; - } - // The CanRunScript analysis is not smart enough to see across - // the std::function PreOrderWalk uses, so we cheat a bit here, but it is - // fine because PreOrderWalk does deal with arbitrary script changing the - // BC tree, and our code above is simple enough and keeps strong refs to - // everything. - ([&]() MOZ_CAN_RUN_SCRIPT_BOUNDARY { - cv->SetPrintSettingsForSubdocument(printSettings); - }()); - } else if (RefPtr remoteChild = - BrowserBridgeChild::GetFrom(aBc->GetEmbedderElement())) { - Unused << remoteChild->SendUpdateRemotePrintSettings(aPrintData); - return BrowsingContext::WalkFlag::Skip; - } - return BrowsingContext::WalkFlag::Next; - }); + rv = cv->SetPrintSettingsForSubdocument(printSettings); + if (NS_WARN_IF(NS_FAILED(rv))) { + return IPC_OK(); + } #endif - return IPC_OK(); } diff --git a/dom/ipc/PBrowserBridge.ipdl b/dom/ipc/PBrowserBridge.ipdl index 3b6c37edd0b0..8b0c181e863a 100644 --- a/dom/ipc/PBrowserBridge.ipdl +++ b/dom/ipc/PBrowserBridge.ipdl @@ -10,7 +10,6 @@ include protocol PDocAccessible; #endif include DOMTypes; -include PPrintingTypes; include "mozilla/LayoutMessageUtils.h"; include "mozilla/dom/BindingIPCUtils.h"; @@ -93,7 +92,6 @@ parent: async RenderLayers(bool aEnabled, LayersObserverEpoch aEpoch); async UpdateEffects(EffectsInfo aEffects); - async UpdateRemotePrintSettings(PrintData aPrintData); /** * Navigate by key (Tab/Shift+Tab/F6/Shift+f6). diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp index 21aa342d953f..82440a4461f4 100644 --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -747,7 +747,7 @@ void nsSubDocumentFrame::Reflow(nsPresContext* aPresContext, FinishAndStoreOverflow(&aDesiredSize); - if (!aPresContext->IsRootPaginatedDocument() && !mPostedReflowCallback) { + if (!aPresContext->IsPaginated() && !mPostedReflowCallback) { PresShell()->PostReflowCallback(this); mPostedReflowCallback = true; } diff --git a/testing/web-platform/meta/html/browsers/windows/iframe-cross-origin-print.sub.html.ini b/testing/web-platform/meta/html/browsers/windows/iframe-cross-origin-print.sub.html.ini new file mode 100644 index 000000000000..b262e45840f1 --- /dev/null +++ b/testing/web-platform/meta/html/browsers/windows/iframe-cross-origin-print.sub.html.ini @@ -0,0 +1,5 @@ +[iframe-cross-origin-print.sub.html] + bug: + if fission: https://bugzilla.mozilla.org/show_bug.cgi?id=1695806 + expected: + if fission: FAIL