diff --git a/content/base/public/nsIMutationObserver.h b/content/base/public/nsIMutationObserver.h index 97a8434d810c..3eca382591a6 100644 --- a/content/base/public/nsIMutationObserver.h +++ b/content/base/public/nsIMutationObserver.h @@ -139,6 +139,12 @@ public: * @param aDocument The owner-document of aContent. Can be null. * @param aContent The piece of content that changed. Is never null. * @param aInfo The structure with information details about the change. + * + * @note Callers of this method might not hold a strong reference to the + * observer. The observer is responsible for making sure it stays + * alive for the duration of the call as needed. The observer may + * assume that this call will happen when there are script blockers on + * the stack. */ virtual void CharacterDataChanged(nsIDocument *aDocument, nsIContent* aContent, diff --git a/content/base/src/nsNodeUtils.cpp b/content/base/src/nsNodeUtils.cpp index 866093c6f66e..9a27a5f657c9 100644 --- a/content/base/src/nsNodeUtils.cpp +++ b/content/base/src/nsNodeUtils.cpp @@ -123,7 +123,7 @@ nsNodeUtils::CharacterDataChanged(nsIContent* aContent, CharacterDataChangeInfo* aInfo) { nsIDocument* doc = aContent->GetOwnerDoc(); - IMPL_STRONGREF_MUTATION_NOTIFICATION(CharacterDataChanged, aContent, + IMPL_MUTATION_NOTIFICATION(CharacterDataChanged, aContent, (doc, aContent, aInfo)); } diff --git a/content/html/content/src/nsHTMLTextAreaElement.cpp b/content/html/content/src/nsHTMLTextAreaElement.cpp index 3807085ce0bb..e51706c0b884 100644 --- a/content/html/content/src/nsHTMLTextAreaElement.cpp +++ b/content/html/content/src/nsHTMLTextAreaElement.cpp @@ -986,6 +986,9 @@ nsHTMLTextAreaElement::ContentChanged(nsIContent* aContent) { if (!mValueChanged && mDoneAddingChildren && nsContentUtils::IsInSameAnonymousTree(this, aContent)) { + // Hard to say what the reset can trigger, so be safe pending + // further auditing. + nsCOMPtr kungFuDeathGrip(this); Reset(); } } diff --git a/content/xslt/src/xpath/nsXPathResult.cpp b/content/xslt/src/xpath/nsXPathResult.cpp index 14edcc60601d..abb467011627 100644 --- a/content/xslt/src/xpath/nsXPathResult.cpp +++ b/content/xslt/src/xpath/nsXPathResult.cpp @@ -381,11 +381,12 @@ nsXPathResult::Invalidate(const nsIContent* aChangeRoot) } } + mInvalidIteratorState = PR_TRUE; + // Make sure nulling out mDocument is the last thing we do. if (mDocument) { mDocument->RemoveMutationObserver(this); mDocument = nsnull; } - mInvalidIteratorState = PR_TRUE; } nsresult