Bug 900835 - crash in nsEventStateManager::PreHandleEvent (Accessible::DoCommand, r=smaug, tbsaunde

This commit is contained in:
Alexander Surkov 2013-08-05 00:00:08 -04:00
parent df25dad82d
commit ac1e4e29f5
2 changed files with 6 additions and 8 deletions

View File

@ -75,8 +75,7 @@ nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
if (!document)
return;
nsIPresShell *presShell = nullptr;
presShell = document->GetShell();
nsCOMPtr<nsIPresShell> presShell = document->GetShell();
if (!presShell)
return;
@ -102,14 +101,14 @@ nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
tcBoxObj->GetY(&tcY);
// Dispatch mouse events.
nsIFrame* tcFrame = tcContent->GetPrimaryFrame();
nsWeakFrame tcFrame = tcContent->GetPrimaryFrame();
nsIFrame* rootFrame = presShell->GetRootFrame();
nsPoint offset;
nsIWidget *rootWidget =
rootFrame->GetViewExternal()->GetNearestWidget(&offset);
nsPresContext* presContext = presShell->GetPresContext();
nsRefPtr<nsPresContext> presContext = presShell->GetPresContext();
int32_t cnvdX = presContext->CSSPixelsToDevPixels(tcX + x + 1) +
presContext->AppUnitsToDevPixels(offset.x);

View File

@ -2285,7 +2285,7 @@ Accessible::DispatchClickEvent(nsIContent *aContent, uint32_t aActionIndex)
if (IsDefunct())
return;
nsIPresShell* presShell = mDoc->PresShell();
nsCOMPtr<nsIPresShell> presShell = mDoc->PresShell();
// Scroll into view.
presShell->ScrollContentIntoView(aContent,
@ -2293,7 +2293,7 @@ Accessible::DispatchClickEvent(nsIContent *aContent, uint32_t aActionIndex)
nsIPresShell::ScrollAxis(),
nsIPresShell::SCROLL_OVERFLOW_HIDDEN);
nsIFrame* frame = aContent->GetPrimaryFrame();
nsWeakFrame frame = aContent->GetPrimaryFrame();
if (!frame)
return;
@ -2305,8 +2305,7 @@ Accessible::DispatchClickEvent(nsIContent *aContent, uint32_t aActionIndex)
nsSize size = frame->GetSize();
nsPresContext* presContext = presShell->GetPresContext();
nsRefPtr<nsPresContext> presContext = presShell->GetPresContext();
int32_t x = presContext->AppUnitsToDevPixels(point.x + size.width / 2);
int32_t y = presContext->AppUnitsToDevPixels(point.y + size.height / 2);