зеркало из https://github.com/mozilla/gecko-dev.git
Bug 277875. Rewrite nsIFrame::GetWindow and make it not assert --- it's OK to not have a widget when we're printing. r+sr=bzbarsky
This commit is contained in:
Родитель
e6e37d31f2
Коммит
05a4dd52a6
|
@ -2442,30 +2442,10 @@ nsIFrame::AreAncestorViewsVisible() const
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
nsIWidget* nsIFrame::GetWindow() const
|
||||
nsIWidget*
|
||||
nsIFrame::GetWindow() const
|
||||
{
|
||||
const nsIFrame* frame;
|
||||
for (frame = this; frame; frame = frame->GetAncestorWithView()) {
|
||||
if (frame->HasView()) {
|
||||
nsIWidget* window = frame->GetView()->GetWidget();
|
||||
if (window) {
|
||||
return window;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Ask the view manager for the widget
|
||||
NS_NOTREACHED("this shouldn't happen, should it?");
|
||||
nsIWidget* window;
|
||||
GetPresContext()->GetViewManager()->GetWidget(&window);
|
||||
// drop refcount that the view manager added, since we are not supposed
|
||||
// to be adding a refcount
|
||||
if (window) {
|
||||
window->Release();
|
||||
}
|
||||
|
||||
NS_POSTCONDITION(window, "no window in frame tree");
|
||||
return window;
|
||||
return GetClosestView()->GetNearestWidget(nsnull);
|
||||
}
|
||||
|
||||
nsIAtom*
|
||||
|
|
|
@ -1044,6 +1044,7 @@ public:
|
|||
* view and the view has a window, then this frames window is
|
||||
* returned, otherwise this frame's geometric parent is checked
|
||||
* recursively upwards.
|
||||
* XXX virtual because gfx callers use it! (themes)
|
||||
*/
|
||||
virtual nsIWidget* GetWindow() const;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче