Bug 101234: crash when calling focus() or blur() on not-yet-appended XUL

Element.  r=sicking(!), sr=blizzard


git-svn-id: svn://10.0.0.236/trunk@104513 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
shaver%mozilla.org
2001-10-03 02:48:00 +00:00
parent 6d17c71703
commit ac62853b71

View File

@@ -22,7 +22,7 @@
* Pierre Phaneuf <pp@ludusdesign.com>
* Peter Annema <disttsc@bart.nl>
* Brendan Eich <brendan@mozilla.org>
*
* Mike Shaver <shaver@mozilla.org>
*
* This Original Code has been modified by IBM Corporation.
* Modifications made by IBM described herein are
@@ -4890,6 +4890,10 @@ nsXULElement::IsAncestor(nsIDOMNode* aParentNode, nsIDOMNode* aChildNode)
NS_IMETHODIMP
nsXULElement::Focus()
{
// What kind of crazy tries to focus an element without a doc?
if (!mDocument)
return NS_OK;
// Obtain a presentation context and then call SetFocus.
PRInt32 count = mDocument->GetNumberOfShells();
if (count == 0)
@@ -4909,6 +4913,10 @@ nsXULElement::Focus()
NS_IMETHODIMP
nsXULElement::Blur()
{
// What kind of crazy tries to blur an element without a doc?
if (!mDocument)
return NS_OK;
// Obtain a presentation context and then call SetFocus.
PRInt32 count = mDocument->GetNumberOfShells();
if (count == 0)