diff --git a/mozilla/webshell/tests/viewer/nsViewerApp.cpp b/mozilla/webshell/tests/viewer/nsViewerApp.cpp index 3b6ed91cf3c..2b425970cc0 100644 --- a/mozilla/webshell/tests/viewer/nsViewerApp.cpp +++ b/mozilla/webshell/tests/viewer/nsViewerApp.cpp @@ -100,6 +100,8 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kIXPBaseWindowIID, NS_IXPBASE_WINDOW_IID); +#define DEFAULT_WIDTH 620 +#define DEFAULT_HEIGHT 400 nsViewerApp::nsViewerApp() @@ -117,6 +119,8 @@ nsViewerApp::nsViewerApp() mNumSamples = 14; mAllowPlugins = PR_TRUE; mIsInitialized = PR_FALSE; + mWidth = DEFAULT_WIDTH; + mHeight = DEFAULT_HEIGHT; } nsViewerApp::~nsViewerApp() @@ -490,7 +494,7 @@ nsViewerApp::ProcessArguments(int argc, char** argv) PrintHelpInfo(argv); exit(-1); } - mCrawler->SetWidth(width); + mWidth = width > 0 ? width : DEFAULT_WIDTH; } else if (PL_strcmp(argv[i], "-h") == 0) { int height; @@ -500,7 +504,7 @@ nsViewerApp::ProcessArguments(int argc, char** argv) PrintHelpInfo(argv); exit(-1); } - mCrawler->SetHeight(height); + mHeight = height > 0 ? height : DEFAULT_HEIGHT; } else if (PL_strcmp(argv[i], "-r") == 0) { i++; @@ -593,7 +597,8 @@ nsViewerApp::OpenWindow() return rv; } bw->SetApp(this); - bw->Init(mAppShell, mPrefs, nsRect(0, 0, 620, 400), PRUint32(~0), mAllowPlugins); + bw->Init(mAppShell, mPrefs, nsRect(0, 0, mWidth, mHeight), + PRUint32(~0), mAllowPlugins); bw->Show(); nsIBrowserWindow* bwCurrent; mCrawler->GetBrowserWindow(&bwCurrent); diff --git a/mozilla/webshell/tests/viewer/nsViewerApp.h b/mozilla/webshell/tests/viewer/nsViewerApp.h index 5060064373d..16a1ae6a89f 100644 --- a/mozilla/webshell/tests/viewer/nsViewerApp.h +++ b/mozilla/webshell/tests/viewer/nsViewerApp.h @@ -86,6 +86,7 @@ protected: nsWebCrawler* mCrawler; PRBool mAllowPlugins; PRBool mIsInitialized; + PRInt32 mWidth, mHeight; }; class nsNativeViewerApp : public nsViewerApp { diff --git a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp index 59003024690..ec062235129 100644 --- a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp +++ b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp @@ -158,8 +158,6 @@ nsWebCrawler::nsWebCrawler(nsViewerApp* aViewer) mJiggleLayout = PR_FALSE; mPostExit = PR_FALSE; mDelay = 0; - mWidth = -1; - mHeight = -1; mMaxPages = -1; mRecord = nsnull; mLinkTag = NS_NewAtom("a"); @@ -698,16 +696,6 @@ nsWebCrawler::LoadNextURL() if (nsnull != url) { if (OkToLoad(*url)) { RecordLoadedURL(*url); - if (0<=mWidth || 0<=mHeight) - { - nsRect r; - mBrowser->GetBounds(r); - if (0<=mWidth) - r.width = mWidth; - if (0<=mHeight) - r.height = mHeight; - mBrowser->SizeTo(r.width, r.height); - } nsIWebShell* webShell; mBrowser->GetWebShell(webShell); mCurrentURL = *url; diff --git a/mozilla/webshell/tests/viewer/nsWebCrawler.h b/mozilla/webshell/tests/viewer/nsWebCrawler.h index 463dde4eda1..5affa774eeb 100644 --- a/mozilla/webshell/tests/viewer/nsWebCrawler.h +++ b/mozilla/webshell/tests/viewer/nsWebCrawler.h @@ -65,16 +65,6 @@ public: mDelay = aSeconds; } - /** Set the initial window width */ - void SetWidth(PRInt32 aWidth) { - mWidth = aWidth; - } - - /** Set the initial window width */ - void SetHeight(PRInt32 aHeight) { - mHeight = aHeight; - } - void EnableJiggleLayout() { mJiggleLayout = PR_TRUE; } @@ -151,8 +141,6 @@ protected: PRBool mJiggleLayout; PRBool mPostExit; PRInt32 mDelay; - PRInt32 mWidth; - PRInt32 mHeight; PRInt32 mMaxPages; nsString mCurrentURL;