Use PresShell::UnsuppressPainting instead of just an invalidate, to make sure the content area receives focus if needed. Bug 295931, r+sr=dbaron, a=brendan.

This commit is contained in:
bryner%brianryner.com 2005-07-01 07:12:02 +00:00
Родитель a0e0f33406
Коммит 8ef8edecb8
4 изменённых файлов: 15 добавлений и 19 удалений

Просмотреть файл

@ -5326,19 +5326,10 @@ nsDocShell::RestorePresentation(nsISHEntry *aSHEntry, PRBool aSavePresentation,
rv = mContentViewer->Show();
NS_ENSURE_SUCCESS(rv, rv);
// Restart plugins
// Restart plugins, and paint the content.
if (shell)
shell->Thaw();
// XXXbryner Making this invalidate synchronous causes unpainted areas
// (on Mac, at least) if the above locationchanged event hides Firefox's
// infobar. Doing it asynchronously seems to work around the problem, but
// shouldn't the style change that hides the infobar handle all necessary
// invalidation, including the newly-exposed area?
rv = mParentWidget->Invalidate(PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
*aRestored = PR_TRUE;
return NS_OK;
}

Просмотреть файл

@ -1225,7 +1225,7 @@ DocumentViewerImpl::Open()
// XXX re-enable image animations once that works correctly
mEnableRendering = PR_TRUE;
PrepareToStartLoad();
return NS_OK;
}

Просмотреть файл

@ -89,8 +89,8 @@ class nsIStyleSheet;
class nsCSSFrameConstructor;
#define NS_IPRESSHELL_IID \
{ 0x3861ee48, 0xb397, 0x11d9, \
{0x86, 0x9e, 0x00, 0x11, 0x24, 0x78, 0xd6, 0x26} }
{ 0x1dd0fbb6, 0xe856, 0x11d9, \
{0xa1, 0x56, 0x00, 0x11, 0x24, 0x78, 0xd6, 0x26} }
// Constants uses for ScrollFrameIntoView() function
#define NS_PRESSHELL_SCROLL_TOP 0
@ -681,16 +681,16 @@ public:
/**
* Stop all active elements (plugins and the caret) in this presentation and
* in the presentations of subdocuments.
* in the presentations of subdocuments. Resets painting to a suppressed state.
* XXX this should include image animations
*/
virtual void Freeze() = 0;
/**
* Restarts active elements (plugins) in this presentation and in the
* presentations of subdocuments.
* presentations of subdocuments, then do a full invalidate of the content area.
*/
virtual void Thaw() = 0;
virtual void Thaw(PRBool aTopLevel = PR_TRUE) = 0;
protected:
// IMPORTANT: The ownership implicit in the following member variables

Просмотреть файл

@ -1209,7 +1209,7 @@ public:
virtual nsresult ReconstructFrames(void);
virtual void Freeze();
virtual void Thaw();
virtual void Thaw(PRBool aIsTopLevel);
#ifdef IBMBIDI
NS_IMETHOD SetCaretBidiLevel(PRUint8 aLevel);
@ -6580,6 +6580,8 @@ PresShell::Freeze()
if (mCaret)
mCaret->SetCaretVisible(PR_FALSE);
mPaintingSuppressed = PR_TRUE;
if (mDocument)
mDocument->EnumerateSubDocuments(FreezeSubDocument, nsnull);
}
@ -6609,13 +6611,13 @@ ThawSubDocument(nsIDocument *aDocument, void *aData)
{
nsIPresShell *shell = aDocument->GetShellAt(0);
if (shell)
shell->Thaw();
shell->Thaw(PR_FALSE);
return PR_TRUE;
}
void
PresShell::Thaw()
PresShell::Thaw(PRBool aIsTopLevel)
{
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(mDocument);
if (domDoc) {
@ -6626,6 +6628,9 @@ PresShell::Thaw()
if (mDocument)
mDocument->EnumerateSubDocuments(ThawSubDocument, nsnull);
if (aIsTopLevel)
UnsuppressPainting();
}
//--------------------------------------------------------