Bug 537041 "ASSERTION: Wrong document somewhere" with contenteditable, stylesheet r=bz

This commit is contained in:
Masayuki Nakano 2010-01-06 14:55:54 +09:00
parent a39475d204
commit 868cf51bc8

View File

@ -115,6 +115,15 @@ nsContentEventHandler::Init(nsQueryContentEvent* aEvent)
nsINode* startNode = mFirstSelectedRange->GetStartParent();
NS_ENSURE_TRUE(startNode, NS_ERROR_FAILURE);
nsINode* endNode = mFirstSelectedRange->GetEndParent();
NS_ENSURE_TRUE(endNode, NS_ERROR_FAILURE);
// See bug 537041 comment 5, the range could have removed node.
NS_ENSURE_TRUE(startNode->GetCurrentDoc() == mPresShell->GetDocument(),
NS_ERROR_NOT_AVAILABLE);
NS_ASSERTION(startNode->GetCurrentDoc() == endNode->GetCurrentDoc(),
"mFirstSelectedRange crosses the document boundary");
mRootContent = startNode->GetSelectionRootContent(mPresShell);
NS_ENSURE_TRUE(mRootContent, NS_ERROR_FAILURE);