зеркало из https://github.com/mozilla/pjs.git
When creating the root view's widget, don't show it. This prevents full-page Invalidates during page load caused by showing and then hiding the widget. Bug 97895, r=blizzard, sr=hyatt.
This commit is contained in:
Родитель
1482877627
Коммит
c3d6f78b18
|
@ -1391,7 +1391,6 @@ DocumentViewerImpl::SetPreviousViewer(nsIContentViewer* aViewer)
|
|||
// link from the chain. This ensures that at most only 2 documents are alive
|
||||
// and undestroyed at any given time (the one that is showing and the one that
|
||||
// is loading with painting suppressed).
|
||||
aViewer->Validate();
|
||||
nsCOMPtr<nsIContentViewer> prevViewer;
|
||||
aViewer->GetPreviousViewer(getter_AddRefs(prevViewer));
|
||||
if (prevViewer) {
|
||||
|
@ -1463,15 +1462,6 @@ DocumentViewerImpl::Hide(void)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DocumentViewerImpl::Validate(void)
|
||||
{
|
||||
NS_PRECONDITION(mWindow, "null window");
|
||||
if (mWindow)
|
||||
mWindow->Validate();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
DocumentViewerImpl::FindFrameSetWithIID(nsIContent * aParentContent, const nsIID& aIID)
|
||||
{
|
||||
|
@ -3827,7 +3817,9 @@ DocumentViewerImpl::MakeWindow(nsIWidget* aParentWidget,
|
|||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
rv = mView->CreateWidget(kWidgetCID, nsnull, aParentWidget->GetNativeData(NS_NATIVE_WIDGET));
|
||||
rv = mView->CreateWidget(kWidgetCID, nsnull,
|
||||
aParentWidget->GetNativeData(NS_NATIVE_WIDGET),
|
||||
PR_TRUE, PR_FALSE);
|
||||
|
||||
if (rv != NS_OK)
|
||||
return rv;
|
||||
|
|
|
@ -55,7 +55,6 @@ interface nsIContentViewer : nsISupports
|
|||
|
||||
void show();
|
||||
void hide();
|
||||
void validate();
|
||||
|
||||
attribute boolean enableRendering;
|
||||
};
|
||||
|
|
|
@ -1391,7 +1391,6 @@ DocumentViewerImpl::SetPreviousViewer(nsIContentViewer* aViewer)
|
|||
// link from the chain. This ensures that at most only 2 documents are alive
|
||||
// and undestroyed at any given time (the one that is showing and the one that
|
||||
// is loading with painting suppressed).
|
||||
aViewer->Validate();
|
||||
nsCOMPtr<nsIContentViewer> prevViewer;
|
||||
aViewer->GetPreviousViewer(getter_AddRefs(prevViewer));
|
||||
if (prevViewer) {
|
||||
|
@ -1463,15 +1462,6 @@ DocumentViewerImpl::Hide(void)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DocumentViewerImpl::Validate(void)
|
||||
{
|
||||
NS_PRECONDITION(mWindow, "null window");
|
||||
if (mWindow)
|
||||
mWindow->Validate();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
DocumentViewerImpl::FindFrameSetWithIID(nsIContent * aParentContent, const nsIID& aIID)
|
||||
{
|
||||
|
@ -3827,7 +3817,9 @@ DocumentViewerImpl::MakeWindow(nsIWidget* aParentWidget,
|
|||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
rv = mView->CreateWidget(kWidgetCID, nsnull, aParentWidget->GetNativeData(NS_NATIVE_WIDGET));
|
||||
rv = mView->CreateWidget(kWidgetCID, nsnull,
|
||||
aParentWidget->GetNativeData(NS_NATIVE_WIDGET),
|
||||
PR_TRUE, PR_FALSE);
|
||||
|
||||
if (rv != NS_OK)
|
||||
return rv;
|
||||
|
|
|
@ -577,14 +577,6 @@ PluginViewerImpl::SetPreviousViewer(nsIContentViewer* aViewer)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PluginViewerImpl::Validate()
|
||||
{
|
||||
if (mWindow)
|
||||
mWindow->Validate();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PluginViewerImpl::SetBounds(const nsRect& aBounds)
|
||||
{
|
||||
|
|
|
@ -434,7 +434,8 @@ public:
|
|||
NS_IMETHOD CreateWidget(const nsIID &aWindowIID,
|
||||
nsWidgetInitData *aWidgetInitData = nsnull,
|
||||
nsNativeWidget aNative = nsnull,
|
||||
PRBool aEnableDragDrop = PR_TRUE) = 0;
|
||||
PRBool aEnableDragDrop = PR_TRUE,
|
||||
PRBool aResetVisibility = PR_TRUE) = 0;
|
||||
|
||||
/**
|
||||
* Set the widget associated with this view.
|
||||
|
|
|
@ -942,7 +942,8 @@ NS_IMETHODIMP nsView :: GetClientData(void *&aData) const
|
|||
NS_IMETHODIMP nsView :: CreateWidget(const nsIID &aWindowIID,
|
||||
nsWidgetInitData *aWidgetInitData,
|
||||
nsNativeWidget aNative,
|
||||
PRBool aEnableDragDrop)
|
||||
PRBool aEnableDragDrop,
|
||||
PRBool aResetVisibility)
|
||||
{
|
||||
nsIDeviceContext *dx;
|
||||
nsRect trect = mBounds;
|
||||
|
@ -983,10 +984,12 @@ NS_IMETHODIMP nsView :: CreateWidget(const nsIID &aWindowIID,
|
|||
|
||||
//make sure visibility state is accurate
|
||||
|
||||
if (aResetVisibility) {
|
||||
nsViewVisibility vis;
|
||||
|
||||
GetVisibility(vis);
|
||||
SetVisibility(vis);
|
||||
}
|
||||
|
||||
NS_RELEASE(dx);
|
||||
|
||||
|
|
|
@ -115,7 +115,8 @@ public:
|
|||
NS_IMETHOD CreateWidget(const nsIID &aWindowIID,
|
||||
nsWidgetInitData *aWidgetInitData = nsnull,
|
||||
nsNativeWidget aNative = nsnull,
|
||||
PRBool aEnableDragDrop = PR_TRUE);
|
||||
PRBool aEnableDragDrop = PR_TRUE,
|
||||
PRBool aResetVisibility = PR_TRUE);
|
||||
NS_IMETHOD SetWidget(nsIWidget *aWidget);
|
||||
NS_IMETHOD GetWidget(nsIWidget *&aWidget) const;
|
||||
NS_IMETHOD HasWidget(PRBool *aHasWidget) const;
|
||||
|
|
|
@ -405,7 +405,8 @@ public:
|
|||
NS_IMETHOD CreateWidget(const nsIID &aWindowIID,
|
||||
nsWidgetInitData *aWidgetInitData = nsnull,
|
||||
nsNativeWidget aNative = nsnull,
|
||||
PRBool aEnableDragDrop = PR_TRUE)
|
||||
PRBool aEnableDragDrop = PR_TRUE,
|
||||
PRBool aResetVisibility = PR_TRUE)
|
||||
{ NS_ASSERTION(PR_FALSE, "Unimplemented"); return NS_ERROR_NOT_IMPLEMENTED; }
|
||||
NS_IMETHOD SetWidget(nsIWidget *aWidget)
|
||||
{ return NS_OK; }
|
||||
|
|
|
@ -870,6 +870,12 @@ NS_IMETHODIMP nsWidget::SetCursor(nsCursor aCursor)
|
|||
#define CAPS_LOCK_IS_ON \
|
||||
(nsWidget::sDebugFeedback && (nsGtkUtils::gdk_keyboard_get_modifiers() & GDK_LOCK_MASK))
|
||||
|
||||
NS_IMETHODIMP nsWidget::Validate()
|
||||
{
|
||||
mUpdateArea->SetTo(0, 0, 0, 0);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsWidget::Invalidate(PRBool aIsSynchronous)
|
||||
{
|
||||
if (!mWidget)
|
||||
|
|
|
@ -162,6 +162,7 @@ public:
|
|||
NS_IMETHOD CaptureMouse(PRBool aCapture) { return NS_ERROR_FAILURE; }
|
||||
|
||||
|
||||
NS_IMETHOD Validate();
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
||||
NS_IMETHOD Invalidate(const nsRect &aRect, PRBool aIsSynchronous);
|
||||
NS_IMETHOD InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSynchronous);
|
||||
|
|
|
@ -182,8 +182,6 @@ nsWindow::nsWindow()
|
|||
{
|
||||
mShell = nsnull;
|
||||
mResized = PR_FALSE;
|
||||
mVisible = PR_FALSE;
|
||||
mDisplayed = PR_FALSE;
|
||||
mLowerLeft = PR_FALSE;
|
||||
mWindowType = eWindowType_child;
|
||||
mBorderStyle = eBorderStyle_default;
|
||||
|
@ -965,6 +963,15 @@ void nsWindow::NativeGrab(PRBool aGrab)
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsWindow::Validate()
|
||||
{
|
||||
if (mIsUpdating) {
|
||||
mUpdateArea->SetTo(0, 0, 0, 0);
|
||||
UnqueueDraw();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsWindow::Invalidate(PRBool aIsSynchronous)
|
||||
{
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ public:
|
|||
NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener,
|
||||
PRBool aDoCapture,
|
||||
PRBool aConsumeRollupEvent);
|
||||
NS_IMETHOD Validate();
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
||||
NS_IMETHOD Invalidate(const nsRect &aRect, PRBool aIsSynchronous);
|
||||
NS_IMETHOD InvalidateRegion(const nsIRegion* aRegion, PRBool aIsSynchronous);
|
||||
|
@ -209,8 +210,6 @@ protected:
|
|||
virtual void InitCallbacks(char * aName = nsnull);
|
||||
NS_IMETHOD CreateNative(GtkObject *parentWidget);
|
||||
|
||||
PRBool mVisible;
|
||||
PRBool mDisplayed;
|
||||
PRBool mIsTooSmall;
|
||||
|
||||
// Resize event management
|
||||
|
|
Загрузка…
Ссылка в новой задаче