From db971d9c23f18a94663a84103984ac77ccfd10a2 Mon Sep 17 00:00:00 2001 From: "sfraser%netscape.com" Date: Fri, 5 Oct 2001 00:05:15 +0000 Subject: [PATCH] Fix for blocker bug 103036 -- crash when opening prefs dialog in Mac classic skin. Bullet-proof nsDocShell::FocusAvailable() against recursion, and fix the XBL to set focus later on. r=adamlock, sr=hyatt git-svn-id: svn://10.0.0.236/trunk@104603 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 8 ++++++-- .../global/resources/content/bindings/dialog.xml | 12 ++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index c4c39879564..47c39d7a78b 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -3026,7 +3026,7 @@ nsDocShell::FocusAvailable(nsIBaseWindow * aCurrentFocus, } - //Otherwise, check the chilren and offer it to the next sibling. + //Otherwise, check the children and offer it to the next sibling. PRInt32 i; PRInt32 n = mChildren.Count(); for (i = 0; i < n; i++) { @@ -3076,7 +3076,11 @@ nsDocShell::FocusAvailable(nsIBaseWindow * aCurrentFocus, // Call again to offer focus upwards and to start at the beginning of our // child list if no one above us wants focus. - return FocusAvailable(this, aForward, aTookFocus); + if (NS_STATIC_CAST(nsIBaseWindow*, this) != aCurrentFocus) + return FocusAvailable(this, aForward, aTookFocus); + + *aTookFocus = PR_FALSE; + return NS_OK; } NS_IMETHODIMP diff --git a/mozilla/xpfe/global/resources/content/bindings/dialog.xml b/mozilla/xpfe/global/resources/content/bindings/dialog.xml index 4ac53349b13..2c3dcf31b7c 100644 --- a/mozilla/xpfe/global/resources/content/bindings/dialog.xml +++ b/mozilla/xpfe/global/resources/content/bindings/dialog.xml @@ -29,7 +29,7 @@ - + + + + + + +