Attempting to fix crashes in RetargetEventToParent (bug 303725). Leave a weak container pointer so that events targetted to cached pres shells can be sent up to the parent, and don't crash if this fails. r=aaronl, sr=dbaron.
git-svn-id: svn://10.0.0.236/trunk@178582 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1630,6 +1630,12 @@ nsIPresShell::GetVerifyReflowFlags()
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nsIPresShell::SetForwardingContainer(nsISupports *aContainer)
|
||||
{
|
||||
mForwardingContainer = do_GetWeakReference(aContainer);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
@@ -5944,9 +5950,16 @@ nsresult PresShell::RetargetEventToParent(nsIView *aView,
|
||||
// Next, update the display so the old focus ring is no longer visible
|
||||
|
||||
nsCOMPtr<nsISupports> container = mPresContext->GetContainer();
|
||||
if (!container)
|
||||
container = do_QueryReferent(mForwardingContainer);
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(container));
|
||||
NS_ASSERTION(docShell, "No docshell for container.");
|
||||
if (!docShell) {
|
||||
// We don't have any place to send this event.
|
||||
NS_WARNING("dropping event, no forwarding shell");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContentViewer> contentViewer;
|
||||
docShell->GetContentViewer(getter_AddRefs(contentViewer));
|
||||
if (contentViewer) {
|
||||
|
||||
Reference in New Issue
Block a user