Additional fix for bug 462025 as discussed with aaronlev,surkov
authorPhilipp Kewisch <mozilla@kewis.ch>
Wed, 29 Oct 2008 18:03:20 +0100
changeset 21053 a62df7b5b9bb08433501f3651627e32d240b48f5
parent 21052 84a9e53373c72d2ee0f6fc41eecc14813376b84c
child 21054 d0bfac57c9edd5973adf453b9c7638420df273b4
push idunknown
push userunknown
push dateunknown
bugs462025
milestone1.9.1b2pre
Additional fix for bug 462025 as discussed with aaronlev,surkov
accessible/src/base/nsDocAccessible.cpp
--- a/accessible/src/base/nsDocAccessible.cpp
+++ b/accessible/src/base/nsDocAccessible.cpp
@@ -505,21 +505,17 @@ NS_IMETHODIMP nsDocAccessible::GetAssoci
   // Check if document is editable (designMode="on" case). Otherwise check if
   // the html:body (for HTML document case) or document element is editable.
   if (!mDocument->HasFlag(NODE_IS_EDITABLE)) {
     nsCOMPtr<nsIDOMNode> DOMDocument(do_QueryInterface(mDocument));
     nsCOMPtr<nsIDOMElement> DOMElement =
       nsCoreUtils::GetDOMElementFor(DOMDocument);
     nsCOMPtr<nsIContent> content(do_QueryInterface(DOMElement));
 
-    // If this is not a HTML document, then content will be null.
-    if (!content)
-        return NS_OK;
-
-    if (!content->HasFlag(NODE_IS_EDITABLE))
+    if (!content || !content->HasFlag(NODE_IS_EDITABLE))
       return NS_OK;
   }
 
   nsCOMPtr<nsISupports> container = mDocument->GetContainer();
   nsCOMPtr<nsIEditingSession> editingSession(do_GetInterface(container));
   if (!editingSession)
     return NS_OK; // No editing session interface