Bug 1518121 - Part 2: Update ExplicitChildIterator correctly when we are at the end of child list of a slot parent; r=smaug

The mIndexInInserted keeps pointing to the last assigned node of a slot parent
when we are at the end of child list. So when we calles GetPreviousChild when we
are at the end of child list, ExplicitChildIterator will skip last assigned node.

Differential Revision: https://phabricator.services.mozilla.com/D19651

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Edgar Chen 2019-02-14 10:14:33 +00:00
Родитель d2d97dd768
Коммит 89cf3fb922
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -40,6 +40,9 @@ nsIContent* ExplicitChildIterator::GetNextChild() {
mChild = (mIndexInInserted < assignedNodes.Length())
? assignedNodes[mIndexInInserted++]->AsContent()
: nullptr;
if (!mChild) {
mIndexInInserted = 0;
}
return mChild;
}