From b4233487a4ea15c085fd85fa3da3b9eafda0c1df Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Wed, 7 Jul 1999 22:34:31 +0000 Subject: [PATCH] Fixing problems with redraw on initial show of window. git-svn-id: svn://10.0.0.236/trunk@38736 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsPresShell.cpp | 42 +------------------- mozilla/layout/html/base/src/nsPresShell.cpp | 42 +------------------- 2 files changed, 4 insertions(+), 80 deletions(-) diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 170f1781e6c..de8941874b3 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -934,46 +934,8 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight) if (NS_OK == mRootFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) { htmlReflow->Reflow(*mPresContext, desiredSize, reflowState, status); mRootFrame->SizeTo(desiredSize.width, desiredSize.height); - - if (maxSize.width == NS_UNCONSTRAINEDSIZE && maxSize.height == NS_UNCONSTRAINEDSIZE) { - // We were flowed intrinsically. Set our new visible area to our intrinsic - // size. - mPresContext->SetVisibleArea(nsRect(0,0,desiredSize.width, desiredSize.height)); - - // Provide our window with the hint that it needs to resize. - nsCOMPtr webShell; - nsCOMPtr container; - mPresContext->GetContainer(getter_AddRefs(container)); - if (container) { - webShell = do_QueryInterface(container); - if (webShell) { - // Retrieve our container and see if it's a browser window. - nsCOMPtr rootContainer; - webShell->GetContainer(*getter_AddRefs(rootContainer)); - if (rootContainer) { - nsCOMPtr browserWindow = do_QueryInterface(rootContainer); - if (browserWindow) { - PRInt32 chromeX,chromeY,chromeWidth,chromeHeight; - webShell->GetBounds(chromeX,chromeY,chromeWidth,chromeHeight); - - float t2p; - mPresContext->GetTwipsToPixels(&t2p); - PRInt32 width = PRInt32((float)desiredSize.width*t2p); - PRInt32 height = PRInt32((float)desiredSize.height*t2p); - - PRInt32 widthDelta = width - chromeWidth; - PRInt32 heightDelta = height - chromeHeight; - - nsRect windowBounds; - browserWindow->GetWindowBounds(windowBounds); - browserWindow->SizeWindowTo(windowBounds.width + widthDelta, - windowBounds.height + heightDelta); - } - } - } - } - } - + mPresContext->SetVisibleArea(nsRect(0,0,desiredSize.width,desiredSize.height)); + #ifdef NS_DEBUG if (nsIFrame::GetVerifyTreeEnable()) { mRootFrame->VerifyTree(); diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 170f1781e6c..de8941874b3 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -934,46 +934,8 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight) if (NS_OK == mRootFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) { htmlReflow->Reflow(*mPresContext, desiredSize, reflowState, status); mRootFrame->SizeTo(desiredSize.width, desiredSize.height); - - if (maxSize.width == NS_UNCONSTRAINEDSIZE && maxSize.height == NS_UNCONSTRAINEDSIZE) { - // We were flowed intrinsically. Set our new visible area to our intrinsic - // size. - mPresContext->SetVisibleArea(nsRect(0,0,desiredSize.width, desiredSize.height)); - - // Provide our window with the hint that it needs to resize. - nsCOMPtr webShell; - nsCOMPtr container; - mPresContext->GetContainer(getter_AddRefs(container)); - if (container) { - webShell = do_QueryInterface(container); - if (webShell) { - // Retrieve our container and see if it's a browser window. - nsCOMPtr rootContainer; - webShell->GetContainer(*getter_AddRefs(rootContainer)); - if (rootContainer) { - nsCOMPtr browserWindow = do_QueryInterface(rootContainer); - if (browserWindow) { - PRInt32 chromeX,chromeY,chromeWidth,chromeHeight; - webShell->GetBounds(chromeX,chromeY,chromeWidth,chromeHeight); - - float t2p; - mPresContext->GetTwipsToPixels(&t2p); - PRInt32 width = PRInt32((float)desiredSize.width*t2p); - PRInt32 height = PRInt32((float)desiredSize.height*t2p); - - PRInt32 widthDelta = width - chromeWidth; - PRInt32 heightDelta = height - chromeHeight; - - nsRect windowBounds; - browserWindow->GetWindowBounds(windowBounds); - browserWindow->SizeWindowTo(windowBounds.width + widthDelta, - windowBounds.height + heightDelta); - } - } - } - } - } - + mPresContext->SetVisibleArea(nsRect(0,0,desiredSize.width,desiredSize.height)); + #ifdef NS_DEBUG if (nsIFrame::GetVerifyTreeEnable()) { mRootFrame->VerifyTree();