Fix for bug #83946 (Crash/freeze when backspacing over signature lines)

Fixed infinite loop in PriorVisibleNode() and NextVisibleNode() which would
happen when aNode was a node that could have children, but didn't have any,
and it's prior/next siblings weren't  eNormalWS.

r=jfrancis@netscape.com  sr=sfraser@netscape.com  a=asa@mozilla.org


git-svn-id: svn://10.0.0.236/trunk@96964 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kin%netscape.com
2001-06-12 20:46:57 +00:00
parent ccc914c61a
commit 2ea1e201ca
2 changed files with 12 additions and 20 deletions

View File

@@ -536,11 +536,7 @@ nsWSRunObject::PriorVisibleNode(nsIDOMNode *aNode,
// is there a visible run there or earlier?
while (run)
{
if (run->mType != eNormalWS)
{
run = run->mLeft;
}
else
if (run->mType == eNormalWS)
{
WSPoint point;
res = GetCharBefore(aNode, aOffset, &point);
@@ -566,6 +562,8 @@ nsWSRunObject::PriorVisibleNode(nsIDOMNode *aNode,
}
// else if no text node then keep looking. We should eventually fall out of loop
}
run = run->mLeft;
}
// if we get here then nothing in ws data to find. return start reason
@@ -594,11 +592,7 @@ nsWSRunObject::NextVisibleNode (nsIDOMNode *aNode,
// is there a visible run there or later?
while (run)
{
if (run->mType != eNormalWS)
{
run = run->mRight;
}
else
if (run->mType == eNormalWS)
{
WSPoint point;
res = GetCharAfter(aNode, aOffset, &point);
@@ -624,6 +618,8 @@ nsWSRunObject::NextVisibleNode (nsIDOMNode *aNode,
}
// else if no text node then keep looking. We should eventually fall out of loop
}
run = run->mRight;
}
// if we get here then nothing in ws data to find. return end reason