mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1649121: part 72) Rename mEndNodes
to mInclusiveAncestorsOfEndContainer
. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D84834
This commit is contained in:
parent
70847b14fc
commit
1f712acadc
@ -782,12 +782,12 @@ nsresult ContentSubtreeIterator::Init(const RawRangeBoundary& aStartBoundary,
|
||||
}
|
||||
|
||||
void ContentSubtreeIterator::CacheInclusiveAncestorsOfEndContainer() {
|
||||
mEndNodes.Clear();
|
||||
mInclusiveAncestorsOfEndContainer.Clear();
|
||||
nsINode* const endContainer = mRange->GetEndContainer();
|
||||
nsIContent* endNode =
|
||||
endContainer->IsContent() ? endContainer->AsContent() : nullptr;
|
||||
while (endNode) {
|
||||
mEndNodes.AppendElement(endNode);
|
||||
mInclusiveAncestorsOfEndContainer.AppendElement(endNode);
|
||||
endNode = endNode->GetParent();
|
||||
}
|
||||
}
|
||||
@ -980,7 +980,7 @@ void ContentSubtreeIterator::Next() {
|
||||
nsINode* nextNode = ContentIteratorBase::GetNextSibling(mCurNode);
|
||||
NS_ASSERTION(nextNode, "No next sibling!?! This could mean deadlock!");
|
||||
|
||||
int32_t i = mEndNodes.IndexOf(nextNode);
|
||||
int32_t i = mInclusiveAncestorsOfEndContainer.IndexOf(nextNode);
|
||||
while (i != -1) {
|
||||
// as long as we are finding ancestors of the endpoint of the range,
|
||||
// dive down into their children
|
||||
@ -991,7 +991,7 @@ void ContentSubtreeIterator::Next() {
|
||||
// down the child chain to the bottom without finding an interior node,
|
||||
// then the previous node should have been the last, which was
|
||||
// was tested at top of routine.
|
||||
i = mEndNodes.IndexOf(nextNode);
|
||||
i = mInclusiveAncestorsOfEndContainer.IndexOf(nextNode);
|
||||
}
|
||||
|
||||
mCurNode = nextNode;
|
||||
@ -1004,7 +1004,7 @@ void ContentSubtreeIterator::Next() {
|
||||
|
||||
void ContentSubtreeIterator::Prev() {
|
||||
// Prev should be optimized to use the mStartNodes, just as Next
|
||||
// uses mEndNodes.
|
||||
// uses mInclusiveAncestorsOfEndContainer.
|
||||
if (mIsDone || !mCurNode) {
|
||||
return;
|
||||
}
|
||||
|
@ -258,7 +258,8 @@ class ContentSubtreeIterator final : public ContentIteratorBase {
|
||||
|
||||
RefPtr<nsRange> mRange;
|
||||
|
||||
AutoTArray<nsIContent*, 8> mEndNodes;
|
||||
// See <https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor>.
|
||||
AutoTArray<nsIContent*, 8> mInclusiveAncestorsOfEndContainer;
|
||||
};
|
||||
|
||||
inline void ImplCycleCollectionTraverse(
|
||||
|
Loading…
Reference in New Issue
Block a user