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; } }