Bug 403514, Crash when closing tab with CTRL+W, r+sr=dbaron,a=schrep

This commit is contained in:
Olli.Pettay@helsinki.fi 2007-11-12 11:09:09 -08:00
Родитель 3bc37fa97f
Коммит 02636c5f45
1 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -154,7 +154,11 @@ nsPoint nsDOMUIEvent::GetClientPoint() {
}
nsPoint pt(0, 0);
nsIFrame* rootFrame = mPresContext->PresShell()->GetRootFrame();
nsIPresShell* shell = mPresContext->PresShell();
if (!shell) {
return pt;
}
nsIFrame* rootFrame = shell->GetRootFrame();
if (rootFrame)
pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(mEvent, rootFrame);
@ -196,11 +200,15 @@ nsDOMUIEvent::GetPagePoint()
if (((nsGUIEvent*)mEvent)->widget) {
// Native event; calculate using presentation
nsPoint pt(0, 0);
nsIScrollableFrame* scrollframe =
mPresContext->PresShell()->GetRootScrollFrameAsScrollable();
nsIPresShell* shell = mPresContext->PresShell();
if (!shell) {
return pt;
}
nsIScrollableFrame* scrollframe = shell->GetRootScrollFrameAsScrollable();
if (scrollframe)
pt += scrollframe->GetScrollPosition();
nsIFrame* rootFrame = mPresContext->PresShell()->GetRootFrame();
nsIFrame* rootFrame = shell->GetRootFrame();
if (rootFrame)
pt += nsLayoutUtils::GetEventCoordinatesRelativeTo(mEvent, rootFrame);
return nsPoint(nsPresContext::AppUnitsToIntCSSPixels(pt.x),