Issue #2135 - Bug 1419803: Use GetComposedDoc instead of GetUncomposedDoc in ContentEventHandler

This commit is contained in:
FranklinDM 2023-03-04 20:47:05 +08:00 committed by roytam1
commit 70d493586d

View file

@ -170,11 +170,11 @@ ContentEventHandler::InitRootContent(Selection* aNormalSelection)
}
// See bug 537041 comment 5, the range could have removed node.
if (NS_WARN_IF(startNode->GetUncomposedDoc() != mPresShell->GetDocument())) {
if (NS_WARN_IF(startNode->GetComposedDoc() != mPresShell->GetDocument())) {
return NS_ERROR_FAILURE;
}
NS_ASSERTION(startNode->GetUncomposedDoc() == endNode->GetUncomposedDoc(),
NS_ASSERTION(startNode->GetComposedDoc() == endNode->GetComposedDoc(),
"firstNormalSelectionRange crosses the document boundary");
mRootContent = startNode->GetSelectionRootContent(mPresShell);