Bug 572599. If we get an event on a child widget that is in a disconnected view subtree the view subtree might not have a root widget. r=roc

This commit is contained in:
Timothy Nikkel 2010-08-18 20:16:58 -05:00
parent 4ce442895c
commit 9ef85e39a6

View File

@ -1004,6 +1004,9 @@ nsLayoutUtils::TranslateWidgetToView(nsPresContext* aPresContext,
{
nsPoint viewOffset;
nsIWidget* viewWidget = aView->GetNearestWidget(&viewOffset);
if (!viewWidget) {
return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
}
nsIWidget* fromRoot;
nsIntPoint fromOffset = GetWidgetOffset(aWidget, fromRoot);