mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-20 17:20:54 +00:00
Bug 354611, Crash [@ nsXULElement::HideWindowChrome] setting hidechrome to true, r=enndeakin, sr=neil
This commit is contained in:
parent
e7bf3029de
commit
f5aa214f8b
@ -2379,7 +2379,7 @@ nsresult
|
||||
nsXULElement::HideWindowChrome(PRBool aShouldHide)
|
||||
{
|
||||
nsIDocument* doc = GetCurrentDoc();
|
||||
if (!doc)
|
||||
if (!doc || doc->GetRootContent() != this)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
nsIPresShell *shell = doc->GetShellAt(0);
|
||||
@ -2394,8 +2394,9 @@ nsXULElement::HideWindowChrome(PRBool aShouldHide)
|
||||
nsIView* view = frame->GetClosestView();
|
||||
|
||||
if (view) {
|
||||
// XXXldb Um, not all views have widgets...
|
||||
view->GetWidget()->HideWindowChrome(aShouldHide);
|
||||
nsIWidget* w = view->GetWidget();
|
||||
NS_ENSURE_STATE(w);
|
||||
w->HideWindowChrome(aShouldHide);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user