Bug 1959352 - Make WhiteSpaceVisibilityKeeper::NormalizeWhiteSpacesToSplitTextNodeAt() return end of its parent when it deletes a last Text r=m_kato
I'm not sure how to make this appear as an unexpected result. I just found these mistakes when I was debugging bug 1959323 Depends on D244876 Differential Revision: https://phabricator.services.mozilla.com/D244879
This commit is contained in:
@@ -1419,7 +1419,8 @@ WhiteSpaceVisibilityKeeper::NormalizeWhiteSpacesToSplitTextNodeAt(
|
|||||||
if (NS_WARN_IF(nextSibling && nextSibling->GetParentNode() != parentNode)) {
|
if (NS_WARN_IF(nextSibling && nextSibling->GetParentNode() != parentNode)) {
|
||||||
return Err(NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE);
|
return Err(NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE);
|
||||||
}
|
}
|
||||||
return EditorDOMPoint(nextSibling);
|
return nextSibling ? EditorDOMPoint(nextSibling)
|
||||||
|
: EditorDOMPoint::AtEndOf(*parentNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
const HTMLEditor::ReplaceWhiteSpacesData replacePrecedingWhiteSpacesData =
|
const HTMLEditor::ReplaceWhiteSpacesData replacePrecedingWhiteSpacesData =
|
||||||
@@ -1461,7 +1462,8 @@ WhiteSpaceVisibilityKeeper::NormalizeWhiteSpacesToSplitTextNodeAt(
|
|||||||
if (NS_WARN_IF(nextSibling && nextSibling->GetParentNode() != parentNode)) {
|
if (NS_WARN_IF(nextSibling && nextSibling->GetParentNode() != parentNode)) {
|
||||||
return Err(NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE);
|
return Err(NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE);
|
||||||
}
|
}
|
||||||
return EditorDOMPoint(nextSibling);
|
return nextSibling ? EditorDOMPoint(nextSibling)
|
||||||
|
: EditorDOMPoint::AtEndOf(*parentNode);
|
||||||
}
|
}
|
||||||
Result<InsertTextResult, nsresult> replaceWhiteSpacesResultOrError =
|
Result<InsertTextResult, nsresult> replaceWhiteSpacesResultOrError =
|
||||||
aHTMLEditor.ReplaceTextWithTransaction(textNode, replaceWhiteSpacesData);
|
aHTMLEditor.ReplaceTextWithTransaction(textNode, replaceWhiteSpacesData);
|
||||||
|
|||||||
Reference in New Issue
Block a user