Backing myself out ... IDIOT.

git-svn-id: svn://10.0.0.236/trunk@92932 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
roc+%cs.cmu.edu
2001-04-23 18:40:01 +00:00
parent ef97784bf9
commit 67f2bfdbac
6 changed files with 19 additions and 122 deletions

View File

@@ -99,9 +99,6 @@
#include "nsIUBidiUtils.h"
#endif
#include "nsIFrame.h"
#include "nsIStyleContext.h"
static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
static NS_DEFINE_CID(kSimpleURICID, NS_SIMPLEURI_CID);
static NS_DEFINE_CID(kDocumentCharsetInfoCID, NS_DOCUMENTCHARSETINFO_CID);
@@ -3022,33 +3019,13 @@ NS_IMETHODIMP nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
}
}
nscolor bgcolor = NS_RGBA(0, 0, 0, 0);
PRBool bgSet = PR_FALSE;
if (mContentViewer) {
// Stop any activity that may be happening in the old document before
// releasing it...
if (mContentViewer) {
mContentViewer->Stop();
// Try to extract the default background color from the old
// view manager, so we can use it for the next document.
nsCOMPtr<nsIDocumentViewer> docviewer = do_QueryInterface(mContentViewer);
if (docviewer) {
nsCOMPtr<nsIPresShell> shell;
docviewer->GetPresShell(*getter_AddRefs(shell));
if (shell) {
nsCOMPtr<nsIViewManager> vm;
shell->GetViewManager(getter_AddRefs(vm));
if (vm) {
vm->GetDefaultBackgroundColor(&bgcolor);
bgSet = PR_TRUE;
}
}
}
if (mContentViewer) {
mContentViewer->Destroy();
mContentViewer = nsnull;
}
@@ -3079,26 +3056,6 @@ NS_IMETHODIMP nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
return NS_ERROR_FAILURE;
}
if (bgSet) {
// Stuff the bgcolor from the last view manager into the new
// view manager. This improves page load continuity.
nsCOMPtr<nsIDocumentViewer> docviewer = do_QueryInterface(mContentViewer);
if (docviewer) {
nsCOMPtr<nsIPresShell> shell;
docviewer->GetPresShell(*getter_AddRefs(shell));
if (shell) {
nsCOMPtr<nsIViewManager> vm;
shell->GetViewManager(getter_AddRefs(vm));
if (vm) {
vm->SetDefaultBackgroundColor(bgcolor);
}
}
}
}
#ifdef IBMBIDI
if (newViewer) {
// set the old state onto the new content viewer

View File

@@ -511,21 +511,6 @@ public:
NS_IMETHOD FlushPendingInvalidates()=0;
/**
* Set the default background color that the view manager should use
* to paint otherwise unowned areas. If the color isn't known, just set
* it to zero (which means 'transparent' since the color is RGBA).
*
* @param aColor the default background color
*/
NS_IMETHOD SetDefaultBackgroundColor(nscolor aColor)=0;
/**
* Retrieve the default background color.
*
* @param aColor the default background color
*/
NS_IMETHOD GetDefaultBackgroundColor(nscolor* aColor)=0;
};
//when the refresh happens, should it be double buffered?

View File

@@ -423,7 +423,6 @@ nsViewManager::nsViewManager()
mX = 0;
mY = 0;
mCachingWidgetChanges = 0;
mDefaultBackgroundColor = NS_RGBA(0, 0, 0, 0);
mAllowDoubleBuffering = PR_TRUE;
mHasPendingInvalidates = PR_FALSE;
mPendingInvalidateEvent = PR_FALSE;
@@ -948,35 +947,6 @@ void nsViewManager::Refresh(nsIView *aView, nsIRenderingContext *aContext, const
#endif
}
void nsViewManager::DefaultRefresh(nsIView* aView, const nsRect* aRect)
{
nsCOMPtr<nsIWidget> widget;
GetWidgetForView(aView, getter_AddRefs(widget));
if (! widget)
return;
nsCOMPtr<nsIRenderingContext> context
= getter_AddRefs(CreateRenderingContext(*aView));
if (! context)
return;
nscolor bgcolor = mDefaultBackgroundColor;
if (NS_GET_A(mDefaultBackgroundColor) == 0) {
// If we haven't been given a default bgcolor, then use the
// widget's bgcolor.
nsCOMPtr<nsIWidget> widget;
GetWidgetForView(aView, getter_AddRefs(widget));
if (widget)
bgcolor = widget->GetBackgroundColor();
}
context->SetColor(bgcolor);
context->FillRect(*aRect);
}
// Perform a *stable* sort of the buffer by increasing Z-index. The common case is
// when many or all z-indices are equal and the list is mostly sorted; make sure
// that's fast (should be linear time if all z-indices are equal).
@@ -1960,14 +1930,28 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent, nsEventStatus *aS
Refresh(view, ((nsPaintEvent*)aEvent)->renderingContext, &damrect, updateFlags);
}
else {
// since we got an NS_PAINT event, we need to
// draw something so we don't get blank areas.
DefaultRefresh(view, &damrect);
// since we got an NS_PAINT event we need to draw something so we don't get blank areas.
nsCOMPtr<nsIWidget> widget;
GetWidgetForView(view, getter_AddRefs(widget));
if (widget) {
nsCOMPtr<nsIRenderingContext> context;
context = getter_AddRefs(CreateRenderingContext(*view));
if (context) {
nscolor bgColor = 0;
SystemAttrStruct info;
info.mColor = &bgColor;
mContext->GetSystemAttribute(eSystemAttr_Color_WindowBackground, &info);
context->SetColor(bgColor);
context->FillRect(damrect);
}
}
}
}
}
*aStatus = nsEventStatus_eConsumeNoDefault;
}
break;
}
@@ -3849,16 +3833,4 @@ nsViewManager::ProcessWidgetChanges(nsIView* aView)
return NS_OK;
}
NS_IMETHODIMP
nsViewManager::SetDefaultBackgroundColor(nscolor aColor)
{
mDefaultBackgroundColor = aColor;
return NS_OK;
}
NS_IMETHODIMP
nsViewManager::GetDefaultBackgroundColor(nscolor* aColor)
{
*aColor = mDefaultBackgroundColor;
return NS_OK;
}

View File

@@ -154,8 +154,6 @@ public:
NS_IMETHOD AllowDoubleBuffering(PRBool aDoubleBuffer);
NS_IMETHOD IsPainting(PRBool& aIsPainting);
NS_IMETHOD FlushPendingInvalidates();
NS_IMETHOD SetDefaultBackgroundColor(nscolor aColor);
NS_IMETHOD GetDefaultBackgroundColor(nscolor* aColor);
nsresult ProcessInvalidateEvent();
static PRInt32 GetViewManagerCount();
static const nsVoidArray* GetViewManagerArray();
@@ -177,7 +175,6 @@ private:
nsIRegion *region, PRUint32 aUpdateFlags);
void Refresh(nsIView* aView, nsIRenderingContext *aContext,
const nsRect *rect, PRUint32 aUpdateFlags);
void DefaultRefresh(nsIView* aView, const nsRect* aRect);
void RenderViews(nsIView *aRootView, nsIRenderingContext& aRC, const nsRect& aRect,
PRBool &aResult);
@@ -330,7 +327,6 @@ private:
nsRect mTranslucentArea; // bounding box of all translucent views.
nsIScrollableView *mRootScrollable;
PRInt32 mCachingWidgetChanges;
nscolor mDefaultBackgroundColor;
nsHashtable mMapPlaceholderViewToZTreeNode;

View File

@@ -2967,15 +2967,4 @@ nsViewManager2::ProcessWidgetChanges(nsIView* aView)
return NS_OK;
}
NS_IMETHODIMP
nsViewManager2::SetDefaultBackgroundColor(nscolor aColor)
{
return NS_OK;
}
NS_IMETHODIMP
nsViewManager2::GetDefaultBackgroundColor(nscolor* aColor)
{
*aColor = 0;
return NS_OK;
}

View File

@@ -151,8 +151,6 @@ public:
NS_IMETHOD AllowDoubleBuffering(PRBool aDoubleBuffer);
NS_IMETHOD IsPainting(PRBool& aIsPainting);
NS_IMETHOD FlushPendingInvalidates();
NS_IMETHOD SetDefaultBackgroundColor(nscolor aColor);
NS_IMETHOD GetDefaultBackgroundColor(nscolor* aColor);
nsresult ProcessInvalidateEvent();
static PRInt32 GetViewManagerCount();
static const nsVoidArray* GetViewManagerArray();