зеркало из https://github.com/mozilla/gecko-dev.git
Bug 504473 FORWARD_NULL deref of mPresContext in nsEventStateManager::GetEventTarget
r=smaug sr=smaug
This commit is contained in:
Родитель
5e7740d543
Коммит
267275b06b
|
@ -3719,25 +3719,25 @@ nsEventStateManager::CheckForAndDispatchClick(nsPresContext* aPresContext,
|
|||
NS_IMETHODIMP
|
||||
nsEventStateManager::GetEventTarget(nsIFrame **aFrame)
|
||||
{
|
||||
if (!mCurrentTarget && mCurrentTargetContent) {
|
||||
if (mPresContext) {
|
||||
nsIPresShell *shell = mPresContext->GetPresShell();
|
||||
if (shell) {
|
||||
mCurrentTarget = shell->GetPrimaryFrameFor(mCurrentTargetContent);
|
||||
}
|
||||
nsIPresShell *shell;
|
||||
if (mCurrentTarget ||
|
||||
!mPresContext ||
|
||||
!(shell = mPresContext->GetPresShell())) {
|
||||
*aFrame = mCurrentTarget;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (mCurrentTargetContent) {
|
||||
mCurrentTarget = shell->GetPrimaryFrameFor(mCurrentTargetContent);
|
||||
if (mCurrentTarget) {
|
||||
*aFrame = mCurrentTarget;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mCurrentTarget) {
|
||||
nsIPresShell *presShell = mPresContext->GetPresShell();
|
||||
if (presShell) {
|
||||
nsIFrame* frame = nsnull;
|
||||
presShell->GetEventTargetFrame(&frame);
|
||||
mCurrentTarget = frame;
|
||||
}
|
||||
}
|
||||
|
||||
*aFrame = mCurrentTarget;
|
||||
nsIFrame* frame = nsnull;
|
||||
shell->GetEventTargetFrame(&frame);
|
||||
*aFrame = mCurrentTarget = frame;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче