From 638544968e72573566d8bdbc27d17db75f3adc20 Mon Sep 17 00:00:00 2001 From: "blizzard%redhat.com" Date: Thu, 13 Nov 2003 16:33:52 +0000 Subject: [PATCH] Bug #225357. Plugins that specify coordinates that exceed maximum X coordinates cause X errors. Limit the size of plugins on this platform to the maximum size for X windows. r=bz, sr=roc git-svn-id: svn://10.0.0.236/trunk@149245 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsObjectFrame.cpp | 9 +++++++++ mozilla/layout/html/base/src/nsObjectFrame.cpp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index a0adcf95402..0f14f1567ba 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -930,6 +930,15 @@ nsObjectFrame::GetDesiredSize(nsIPresContext* aPresContext, aReflowState.mComputedMinHeight), aReflowState.mComputedMaxHeight); } + +#if defined (MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2) || defined (MOZ_WIDGET_XLIB) + // We need to make sure that the size of the object frame does not + // exceed the maximum size of X coordinates. See bug #225357 for + // more information. In theory Gtk2 can handle large coordinates, + // but underlying plugins can't. + aMetrics.height = PR_MIN(NSIntPixelsToTwips(PR_INT16_MAX, p2t), aMetrics.height); + aMetrics.width = PR_MIN(NSIntPixelsToTwips(PR_INT16_MAX, p2t), aMetrics.width); +#endif } // At this point, the width has an unconstrained value only if we have diff --git a/mozilla/layout/html/base/src/nsObjectFrame.cpp b/mozilla/layout/html/base/src/nsObjectFrame.cpp index a0adcf95402..0f14f1567ba 100644 --- a/mozilla/layout/html/base/src/nsObjectFrame.cpp +++ b/mozilla/layout/html/base/src/nsObjectFrame.cpp @@ -930,6 +930,15 @@ nsObjectFrame::GetDesiredSize(nsIPresContext* aPresContext, aReflowState.mComputedMinHeight), aReflowState.mComputedMaxHeight); } + +#if defined (MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2) || defined (MOZ_WIDGET_XLIB) + // We need to make sure that the size of the object frame does not + // exceed the maximum size of X coordinates. See bug #225357 for + // more information. In theory Gtk2 can handle large coordinates, + // but underlying plugins can't. + aMetrics.height = PR_MIN(NSIntPixelsToTwips(PR_INT16_MAX, p2t), aMetrics.height); + aMetrics.width = PR_MIN(NSIntPixelsToTwips(PR_INT16_MAX, p2t), aMetrics.width); +#endif } // At this point, the width has an unconstrained value only if we have