From c217da4fc81436b567a74fc9800ab94cbebd9cf3 Mon Sep 17 00:00:00 2001 From: "aaronleventhal@moonset.net" Date: Fri, 25 Jan 2008 12:43:12 -0800 Subject: [PATCH] Bug 405951. Missing content in Thunderbird window. r=surkov, a=blocking1.9 --- accessible/src/base/nsCaretAccessible.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/accessible/src/base/nsCaretAccessible.cpp b/accessible/src/base/nsCaretAccessible.cpp index 7d20365af48..8ce7cd8d36c 100644 --- a/accessible/src/base/nsCaretAccessible.cpp +++ b/accessible/src/base/nsCaretAccessible.cpp @@ -90,6 +90,8 @@ nsresult nsCaretAccessible::SetControlSelectionListener(nsIDOMNode *aCurrentNode { NS_ENSURE_TRUE(mRootAccessible, NS_ERROR_FAILURE); + ClearControlSelectionListener(); + mCurrentControl = aCurrentNode; mLastTextAccessible = nsnull; @@ -123,7 +125,6 @@ nsresult nsCaretAccessible::SetControlSelectionListener(nsIDOMNode *aCurrentNode nsCOMPtr domSel; selCon->GetSelection(nsISelectionController::SELECTION_NORMAL, getter_AddRefs(domSel)); - ClearControlSelectionListener(); nsCOMPtr selPrivate(do_QueryInterface(domSel)); NS_ENSURE_TRUE(selPrivate, NS_ERROR_FAILURE); @@ -133,6 +134,8 @@ nsresult nsCaretAccessible::SetControlSelectionListener(nsIDOMNode *aCurrentNode nsresult nsCaretAccessible::AddDocSelectionListener(nsIDOMDocument *aDoc) { + NS_ENSURE_TRUE(mRootAccessible, NS_ERROR_FAILURE); + nsCOMPtr doc = do_QueryInterface(aDoc); NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE); nsCOMPtr selCon = do_QueryInterface(doc->GetPrimaryShell());