diff --git a/editor/libeditor/html/nsHTMLEditRules.cpp b/editor/libeditor/html/nsHTMLEditRules.cpp index 4a2949c349c7..ae43e0c89c7c 100644 --- a/editor/libeditor/html/nsHTMLEditRules.cpp +++ b/editor/libeditor/html/nsHTMLEditRules.cpp @@ -547,6 +547,13 @@ nsHTMLEditRules::AfterEditInner(PRInt32 action, nsIEditor::EDirection aDirection } } + // Ensure range offsets are up to date. + if (mDocChangeRange) { + mDocChangeRange->GetStartContainer(getter_AddRefs(rangeStartParent)); + mDocChangeRange->GetEndContainer(getter_AddRefs(rangeEndParent)); + mDocChangeRange->GetStartOffset(&rangeStartOffset); + mDocChangeRange->GetEndOffset(&rangeEndOffset); + } res = mHTMLEditor->HandleInlineSpellCheck(action, selection, mRangeItem.startNode, mRangeItem.startOffset, rangeStartParent, rangeStartOffset, diff --git a/editor/txtsvc/src/nsTextServicesDocument.cpp b/editor/txtsvc/src/nsTextServicesDocument.cpp index e9f1ec10e438..b77aa94cea5f 100644 --- a/editor/txtsvc/src/nsTextServicesDocument.cpp +++ b/editor/txtsvc/src/nsTextServicesDocument.cpp @@ -2626,9 +2626,9 @@ nsTextServicesDocument::JoinNodes(nsIDOMNode *aLeftNode, if (!leftHasEntry) { - // XXX: Not sure if we should be throwing an error here! - NS_ASSERTION(0, "JoinNode called with node not listed in offset table."); - return NS_ERROR_FAILURE; + // It's okay if the node isn't in the offset table, the + // editor could be cleaning house. + return NS_OK; } result = NodeHasOffsetEntry(&mOffsetTable, aRightNode, &rightHasEntry, &rightIndex); @@ -2638,7 +2638,9 @@ nsTextServicesDocument::JoinNodes(nsIDOMNode *aLeftNode, if (!rightHasEntry) { - return NS_ERROR_FAILURE; + // It's okay if the node isn't in the offset table, the + // editor could be cleaning house. + return NS_OK; } NS_ASSERTION(leftIndex < rightIndex, "Indexes out of order.");