From 02427b265c3ca2eef6a52e8ecb9536bd44a33552 Mon Sep 17 00:00:00 2001 From: "rjesup%wgate.com" Date: Tue, 21 Aug 2001 18:43:55 +0000 Subject: [PATCH] bug 93830. patch by gisburn. r=dcone@netscape.com, r=timeless, sr=waterson@netscape.com git-svn-id: svn://10.0.0.236/trunk@101521 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSFrameConstructor.cpp | 15 ++++----------- .../html/style/src/nsCSSFrameConstructor.cpp | 15 ++++----------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index c1df7414893..1c1e5317ceb 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -3799,22 +3799,15 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell, // --------- IF SCROLLABLE WRAP IN SCROLLFRAME -------- - // If the device supports scrolling (e.g., in galley mode on the screen and + // If the device supports scrolling (e.g., in galley mode on the screen and // for print-preview, but not when printing), then create a scroll frame that // will act as the scrolling mechanism for the viewport. // XXX Do we even need a viewport when printing to a printer? - // XXX It would be nice to have a better way to query for whether the device - // is scrollable PRBool isScrollable = PR_TRUE; if (aPresContext) { - nsIDeviceContext* dc; - aPresContext->GetDeviceContext(&dc); - if (dc) { - PRBool supportsWidgets; - if (NS_SUCCEEDED(dc->SupportsNativeWidgets(supportsWidgets))) { - isScrollable = supportsWidgets; - } - NS_RELEASE(dc); + PRBool isPaginated = PR_FALSE; + if (NS_SUCCEEDED(aPresContext->IsPaginated(&isPaginated))) { + isScrollable = !isPaginated; } } diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index c1df7414893..1c1e5317ceb 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -3799,22 +3799,15 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell, // --------- IF SCROLLABLE WRAP IN SCROLLFRAME -------- - // If the device supports scrolling (e.g., in galley mode on the screen and + // If the device supports scrolling (e.g., in galley mode on the screen and // for print-preview, but not when printing), then create a scroll frame that // will act as the scrolling mechanism for the viewport. // XXX Do we even need a viewport when printing to a printer? - // XXX It would be nice to have a better way to query for whether the device - // is scrollable PRBool isScrollable = PR_TRUE; if (aPresContext) { - nsIDeviceContext* dc; - aPresContext->GetDeviceContext(&dc); - if (dc) { - PRBool supportsWidgets; - if (NS_SUCCEEDED(dc->SupportsNativeWidgets(supportsWidgets))) { - isScrollable = supportsWidgets; - } - NS_RELEASE(dc); + PRBool isPaginated = PR_FALSE; + if (NS_SUCCEEDED(aPresContext->IsPaginated(&isPaginated))) { + isScrollable = !isPaginated; } }