Bug 528829 - If mouse button is held down during page transition, Firefox stops responding to mouse clicks, r=roc

This commit is contained in:
Olli Pettay 2009-12-10 10:58:33 -08:00
Родитель a4f10a3bdf
Коммит 41892fd0c4
1 изменённых файлов: 16 добавлений и 0 удалений

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

@ -1028,6 +1028,18 @@ protected:
// Utility method to restore the root scrollframe state
void RestoreRootScrollPosition();
void MaybeReleaseCapturingContent()
{
nsCOMPtr<nsFrameSelection> frameSelection = FrameSelection();
if (frameSelection) {
frameSelection->SetMouseDownState(PR_FALSE);
}
if (gCaptureInfo.mContent &&
gCaptureInfo.mContent->GetOwnerDoc() == mDocument) {
SetCapturingContent(nsnull, 0);
}
}
nsCOMPtr<nsICSSStyleSheet> mPrefStyleSheet; // mStyleSet owns it but we
// maintain a ref, may be null
#ifdef DEBUG
@ -1832,6 +1844,8 @@ PresShell::Destroy()
if (mHaveShutDown)
return NS_OK;
MaybeReleaseCapturingContent();
mContentToScrollTo = nsnull;
if (mPresContext) {
@ -7075,6 +7089,8 @@ FreezeSubDocument(nsIDocument *aDocument, void *aData)
void
PresShell::Freeze()
{
MaybeReleaseCapturingContent();
mDocument->EnumerateFreezableElements(FreezeElement, this);
if (mCaret)