Bug 1413619 - Fix insertion point computation when display: contents pseudos are involved.

Tag #1375
This commit is contained in:
Matt A. Tobin 2020-04-17 07:20:06 -04:00 committed by Roy Tam
commit 5b1452e120
10 changed files with 192 additions and 243 deletions

View file

@ -192,17 +192,17 @@ FlattenedChildIterator::Init(bool aIgnoreXBL)
}
bool
ExplicitChildIterator::Seek(nsIContent* aChildToFind)
ExplicitChildIterator::Seek(const nsIContent* aChildToFind)
{
if (aChildToFind->GetParent() == mParent &&
!aChildToFind->IsRootOfAnonymousSubtree()) {
// Fast path: just point ourselves to aChildToFind, which is a
// normal DOM child of ours.
MOZ_ASSERT(!nsContentUtils::IsContentInsertionPoint(aChildToFind));
mChild = aChildToFind;
mChild = const_cast<nsIContent*>(aChildToFind);
mIndexInInserted = 0;
mDefaultChild = nullptr;
mIsFirst = false;
MOZ_ASSERT(!nsContentUtils::IsContentInsertionPoint(mChild));
return true;
}
@ -348,7 +348,7 @@ AllChildrenIterator::Get() const
bool
AllChildrenIterator::Seek(nsIContent* aChildToFind)
AllChildrenIterator::Seek(const nsIContent* aChildToFind)
{
if (mPhase == eAtBegin || mPhase == eAtBeforeKid) {
mPhase = eAtExplicitKids;