mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
fix for bug: subtree iterator had bug in init code that could cause iter to be empty.
This commit is contained in:
parent
52037238fa
commit
4b1939dc92
@ -911,6 +911,8 @@ nsresult nsContentSubtreeIterator::Init(nsIDOMRange* aRange)
|
||||
|
||||
// now to find the last node
|
||||
aRange->GetEndOffset(&indx);
|
||||
numChildren = GetNumChildren(endParent);
|
||||
|
||||
if (indx > numChildren) indx = numChildren;
|
||||
if (!indx)
|
||||
{
|
||||
@ -918,8 +920,6 @@ nsresult nsContentSubtreeIterator::Init(nsIDOMRange* aRange)
|
||||
}
|
||||
else
|
||||
{
|
||||
numChildren = GetNumChildren(endParent);
|
||||
|
||||
if (!numChildren) // no children, must be a text node
|
||||
{
|
||||
cN = cEndP;
|
||||
|
@ -911,6 +911,8 @@ nsresult nsContentSubtreeIterator::Init(nsIDOMRange* aRange)
|
||||
|
||||
// now to find the last node
|
||||
aRange->GetEndOffset(&indx);
|
||||
numChildren = GetNumChildren(endParent);
|
||||
|
||||
if (indx > numChildren) indx = numChildren;
|
||||
if (!indx)
|
||||
{
|
||||
@ -918,8 +920,6 @@ nsresult nsContentSubtreeIterator::Init(nsIDOMRange* aRange)
|
||||
}
|
||||
else
|
||||
{
|
||||
numChildren = GetNumChildren(endParent);
|
||||
|
||||
if (!numChildren) // no children, must be a text node
|
||||
{
|
||||
cN = cEndP;
|
||||
|
Loading…
Reference in New Issue
Block a user