mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 715056 - Use GetNodeParent(), not GetParent(), because ranges deals with any node, not just content nodes. r=smaug
This commit is contained in:
parent
ab6a921c63
commit
161bbbfcd1
@ -497,7 +497,7 @@ nsRange::CharacterDataChanged(nsIDocument* aDocument,
|
||||
// did so too (otherwise the range would end up with disconnected nodes).
|
||||
if (aContent == mEndParent &&
|
||||
aInfo->mChangeStart < static_cast<PRUint32>(mEndOffset)) {
|
||||
if (aInfo->mDetails && (aContent->GetParent() || newStartNode)) {
|
||||
if (aInfo->mDetails && (aContent->GetNodeParent() || newStartNode)) {
|
||||
// splitText(), aInfo->mDetails->mNextSibling is the new text node
|
||||
NS_ASSERTION(aInfo->mDetails->mType ==
|
||||
CharacterDataChangeInfo::Details::eSplit,
|
||||
@ -511,7 +511,7 @@ nsRange::CharacterDataChanged(nsIDocument* aDocument,
|
||||
if (isCommonAncestor && !newStartNode) {
|
||||
// The split occurs inside the range.
|
||||
UnregisterCommonAncestor(mStartParent);
|
||||
RegisterCommonAncestor(mStartParent->GetParent());
|
||||
RegisterCommonAncestor(mStartParent->GetNodeParent());
|
||||
newEndNode->SetDescendantOfCommonAncestorForRangeInSelection();
|
||||
} else if (mEndParent->IsDescendantOfCommonAncestorForRangeInSelection()) {
|
||||
newEndNode->SetDescendantOfCommonAncestorForRangeInSelection();
|
||||
@ -555,7 +555,7 @@ nsRange::CharacterDataChanged(nsIDocument* aDocument,
|
||||
}
|
||||
DoSetRange(newStartNode, newStartOffset, newEndNode, newEndOffset,
|
||||
newRoot ? newRoot : mRoot.get(),
|
||||
!newEndNode->GetParent() || !newStartNode->GetParent());
|
||||
!newEndNode->GetNodeParent() || !newStartNode->GetNodeParent());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user