Endless loop encountered in nsHTMLEditor::CollapseAdjacentTextNodes

NEW
Unassigned

Status

()

Core
Editor
14 years ago
11 years ago

People

(Reporter: David Bradley, Unassigned)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

14 years ago
mCurNode was null, this causes Next to just return NS_OK, but doesn't advance
anything. The loop isn't checking the return value for GetCurrentNode, and I
think that's where the problem lies.

I got this while replying to a message with an attachment. It might be other
factors, but the issue in the code seems to be pretty clear.

I was using a build from a pull of CVS around 7/28/03.
(Reporter)

Comment 1

14 years ago
Created attachment 129204 [details] [diff] [review]
Addresses CurrentNode failure resulting in an endless loop and reorganizes things a bit

I reorganized this a bit, removing the extra call to CurrentNode. I think
moving this to a for loop pattern makes it a little more straightforward.
Someone who's a little more familiar with nsIContentIterator needs to double
check the changes.

The one difference is that IsDone is going to get called before the
CurrentNode, but I don't think that's going to hurt anything.

Comment 2

14 years ago
ait a minute.  Yuo found a case where the the iterator is inited, says there is
no current node, but also says it is not done?  That's an iterator bug.  We
should fix that instead of changing this code.  

Can you provide a testcase?

Comment 3

14 years ago
ugh.  my typing....
(Reporter)

Comment 4

14 years ago
I'm not sure I have a definitive test case. I was replying to a message
containing HMTL and had an attachment. Replying to a plain text message didn't
cause a problem. It may very well be a timing issue.
QA Contact: bugzilla → editor
Assignee: mozeditor → nobody
You need to log in before you can comment on or make changes to this bug.