Issue #1513 - Bail on orphan node

This was refactored by Mozilla into doing effectively the same thing so
it aligns with them re: behavior.
Resolves #1513
This commit is contained in:
wolfbeast 2020-04-13 12:55:47 +02:00 committed by Roy Tam
commit 788e24053a

View file

@ -4641,7 +4641,11 @@ HTMLEditRules::WillAlign(Selection& aSelection,
}
nsCOMPtr<nsINode> curParent = curNode->GetParentNode();
int32_t offset = curParent ? curParent->IndexOf(curNode) : -1;
if (!curParent) {
continue;
}
int32_t offset = curParent->IndexOf(curNode);
// Skip insignificant formatting text nodes to prevent unnecessary
// structure splitting!