Bug 1551688. Make it clearer that nsIContentViewer.setPageMode() is for testing only by renaming it. r=bobowen

Differential Revision: https://phabricator.services.mozilla.com/D31126

--HG--
extra : rebase_source : 8365f296ef575e6632b27d06617d197f0fc50cff
This commit is contained in:
Jonathan Watt 2019-04-29 14:53:25 +01:00
parent 95de896564
commit e811a45220
3 changed files with 8 additions and 7 deletions

View File

@ -190,7 +190,8 @@ interface nsIContentViewer : nsISupports
* Change the layout to view the document with page layout (like print preview), but
* dynamic and editable (like Galley layout).
*/
void setPageMode(in boolean aPageMode, in nsIPrintSettings aPrintSettings);
void setPageModeForTesting(in boolean aPageMode,
in nsIPrintSettings aPrintSettings);
/**
* Get the history entry that this viewer will save itself into when

View File

@ -852,7 +852,7 @@ nsresult nsDocumentViewer::InitInternal(nsIWidget* aParentWidget,
bool aNeedMakeCX /*= true*/,
bool aForceSetNewDocument /* = true*/) {
if (mIsPageMode) {
// XXXbz should the InitInternal in SetPageMode just pass false
// XXXbz should the InitInternal in SetPageModeForTesting just pass false
// here itself?
aForceSetNewDocument = false;
}
@ -885,8 +885,8 @@ nsresult nsDocumentViewer::InitInternal(nsIWidget* aParentWidget,
mDocument->GetDisplayDocument()->GetPresShell()))) {
// Create presentation context
if (mIsPageMode) {
// Presentation context already created in SetPageMode which is calling
// this method
// Presentation context already created in SetPageModeForTesting which
// is calling this method
} else {
mPresContext = CreatePresContext(
mDocument, nsPresContext::eContext_Galley, containerView);
@ -4103,8 +4103,8 @@ void nsDocumentViewer::OnDonePrinting() {
#endif // NS_PRINTING && NS_PRINT_PREVIEW
}
NS_IMETHODIMP nsDocumentViewer::SetPageMode(bool aPageMode,
nsIPrintSettings* aPrintSettings) {
NS_IMETHODIMP nsDocumentViewer::SetPageModeForTesting(
bool aPageMode, nsIPrintSettings* aPrintSettings) {
// XXX Page mode is only partially working; it's currently used for
// reftests that require a paginated context
mIsPageMode = aPageMode;

View File

@ -219,7 +219,7 @@ function setupPrintMode() {
ps.footerStrLeft = "";
ps.footerStrCenter = "";
ps.footerStrRight = "";
docShell.contentViewer.setPageMode(true, ps);
docShell.contentViewer.setPageModeForTesting(/* aPageMode */ true, ps);
}
// Prints current page to a PDF file and calls callback when sucessfully