Bug 538466 "ASSERTION: Wrong document somewhere" with contenteditable r=bz
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 08 Jan 2010 13:59:23 +0900
changeset 36945 500e3dbc7d35c92e04342672dd7c80536a868b44
parent 36944 0c8d99d73f0912970718a4b2039807d0ee02d76a
child 36946 b919e8a488903207396e0502bba1051a30f11528
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbz
bugs538466
milestone1.9.3a1pre
Bug 538466 "ASSERTION: Wrong document somewhere" with contenteditable r=bz
content/base/src/nsGenericElement.cpp
--- a/content/base/src/nsGenericElement.cpp
+++ b/content/base/src/nsGenericElement.cpp
@@ -391,18 +391,18 @@ nsINode::GetSelectionRootContent(nsIPres
 {
   NS_ENSURE_TRUE(aPresShell, nsnull);
 
   if (IsNodeOfType(eDOCUMENT))
     return static_cast<nsIDocument*>(this)->GetRootContent();
   if (!IsNodeOfType(eCONTENT))
     return nsnull;
 
-  NS_ASSERTION(GetCurrentDoc() == aPresShell->GetDocument(),
-               "Wrong document somewhere");
+  NS_ENSURE_TRUE(GetCurrentDoc() == aPresShell->GetDocument(), nsnull);
+
   nsIFrame* frame = static_cast<nsIContent*>(this)->GetPrimaryFrame();
   if (frame && frame->GetStateBits() & NS_FRAME_INDEPENDENT_SELECTION) {
     // This node should be a descendant of input/textarea editor.
     nsIContent* content = GetTextEditorRootContent();
     if (content)
       return content;
   }