mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 568975 - m-c message manager slowed down event handling a bit, r=jst
--HG-- extra : rebase_source : 33a1b10f31760b69a565645f43062f872b136b98
This commit is contained in:
parent
e7c4ebf400
commit
afac1feb5b
@ -943,6 +943,7 @@ nsGlobalWindow::CleanUp(PRBool aIgnoreModalDialog)
|
||||
mContext = nsnull; // Forces Release
|
||||
}
|
||||
mChromeEventHandler = nsnull; // Forces Release
|
||||
mParentTarget = nsnull;
|
||||
|
||||
nsGlobalWindow *inner = GetCurrentInnerWindowInternal();
|
||||
|
||||
@ -1197,6 +1198,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGlobalWindow)
|
||||
|
||||
// Traverse stuff from nsPIDOMWindow
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mChromeEventHandler)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mParentTarget)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mDocument)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mFrameElement)
|
||||
|
||||
@ -1230,6 +1232,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGlobalWindow)
|
||||
|
||||
// Unlink stuff from nsPIDOMWindow
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mChromeEventHandler)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mParentTarget)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mDocument)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mFrameElement)
|
||||
|
||||
@ -2399,16 +2402,19 @@ nsGlobalWindow::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
}
|
||||
}
|
||||
|
||||
nsPIDOMEventTarget* chromeTarget = mChromeEventHandler;
|
||||
if (!mParentTarget) {
|
||||
nsCOMPtr<nsIFrameLoaderOwner> flo = do_QueryInterface(mChromeEventHandler);
|
||||
if (flo) {
|
||||
nsRefPtr<nsFrameLoader> fl = flo->GetFrameLoader();
|
||||
if (fl) {
|
||||
nsPIDOMEventTarget* t = fl->GetTabChildGlobalAsEventTarget();
|
||||
chromeTarget = t ? t : chromeTarget;
|
||||
mParentTarget = fl->GetTabChildGlobalAsEventTarget();
|
||||
}
|
||||
}
|
||||
aVisitor.mParentTarget = chromeTarget;
|
||||
if (!mParentTarget) {
|
||||
mParentTarget = mChromeEventHandler;
|
||||
}
|
||||
}
|
||||
aVisitor.mParentTarget = mParentTarget;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -524,6 +524,8 @@ protected:
|
||||
|
||||
void SetChromeEventHandlerInternal(nsPIDOMEventTarget* aChromeEventHandler) {
|
||||
mChromeEventHandler = aChromeEventHandler;
|
||||
// mParentTarget will be set when the next event is dispatched.
|
||||
mParentTarget = nsnull;
|
||||
}
|
||||
|
||||
// These two variables are special in that they're set to the same
|
||||
@ -532,6 +534,8 @@ protected:
|
||||
nsCOMPtr<nsPIDOMEventTarget> mChromeEventHandler; // strong
|
||||
nsCOMPtr<nsIDOMDocument> mDocument; // strong
|
||||
|
||||
nsCOMPtr<nsPIDOMEventTarget> mParentTarget; // strong
|
||||
|
||||
// These members are only used on outer windows.
|
||||
nsCOMPtr<nsIDOMElement> mFrameElement;
|
||||
nsIDocShell *mDocShell; // Weak Reference
|
||||
|
Loading…
Reference in New Issue
Block a user