From 41892fd0c4f4d84a038e64d49e4852a75cd374ec Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Thu, 10 Dec 2009 10:58:33 -0800 Subject: [PATCH] Bug 528829 - If mouse button is held down during page transition, Firefox stops responding to mouse clicks, r=roc --- layout/base/nsPresShell.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 7100da93718a..171d0536317f 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -1028,6 +1028,18 @@ protected: // Utility method to restore the root scrollframe state void RestoreRootScrollPosition(); + void MaybeReleaseCapturingContent() + { + nsCOMPtr frameSelection = FrameSelection(); + if (frameSelection) { + frameSelection->SetMouseDownState(PR_FALSE); + } + if (gCaptureInfo.mContent && + gCaptureInfo.mContent->GetOwnerDoc() == mDocument) { + SetCapturingContent(nsnull, 0); + } + } + nsCOMPtr 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)