mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-12 00:50:40 +00:00
Bug 900835 - crash in nsEventStateManager::PreHandleEvent (Accessible::DoCommand, r=smaug, tbsaunde
This commit is contained in:
parent
df25dad82d
commit
ac1e4e29f5
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user