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

git-svn-id: svn://10.0.0.236/trunk@239218 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
Olli.Pettay%helsinki.fi
2007-11-12 19:09:09 +00:00
parent b4e26c3abe
commit 677288d9b5

View File

@@ -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),