Closed Bug 327694 Opened 20 years ago Closed 16 years ago

"ASSERTION: Failed to position iterator!" getting link.text for link that has been removed from document

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla1.9.3a1

People

(Reporter: jruderman, Assigned: MatsPalmgren_bugz)

Details

(Keywords: assertion, testcase)

Attachments

(2 files, 2 obsolete files)

###!!! ASSERTION: Failed to position iterator!: 'NS_SUCCEEDED(rv)', file mozilla/content/base/src/nsContentIterator.cpp, line 991
Attached file testcase
Assignee: general → mats.palmgren
Severity: normal → minor
OS: Mac OS X → All
Hardware: Macintosh → All
Attached patch Patch rev. 1 (obsolete) — Splinter Review
The "Check to see if the node falls within the traversal range" part of nsContentIterator::PositionAt requires that the node has a parent, if not then we bail put at line 1106 and Last() will assert: http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/content/base/src/nsContentIterator.cpp&rev=1.74&root=/cvsroot&mark=1063-1107#1046 http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/content/base/src/nsContentIterator.cpp&rev=1.74&root=/cvsroot&mark=130-145#130
Attached patch Patch rev. 2 (obsolete) — Splinter Review
Same as first patch with some additional cleanups: * prune #includes * avoid QI to nsIDOMNode * use nsPreContentIterator in nsHTMLAnchorElement::GetText() which avoids finding the deepest node of the first child which we're not interested in anyway http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/content/base/src/nsContentIterator.cpp&rev=1.74&root=/cvsroot&mark=361-362#346
Attachment #269052 - Flags: superreview?(jst)
Attachment #269052 - Flags: review?(jst)
BTW, maybe we should wrap the whole "Check to see if the node falls within the traversal range" block in #NS_DEBUG since we assert on it?
Attachment #269052 - Flags: superreview?(jst)
Attachment #269052 - Flags: superreview+
Attachment #269052 - Flags: review?(jst)
Attachment #269052 - Flags: review+
But that block of code also sets iterator state (mIsDone), so we don't want that whole block of code to be debug only do we?
Mats, are you planning to request approval and check this in?
###!!! ASSERTION: Failed to position iterator!: 'NS_SUCCEEDED(rv)', file c:/Debug/mozilla/content/base/src/nsContentIterator.cpp, line 997 was just running into this assertion while abcnews.com was loaded on windows debug build.
QA Contact: ian → general
Still happens on trunk. Mats, you don't need a= to land stuff now ;)
The deCOMtamination part of the patch has already been done in trunk code, otherwise it's the same.
Attachment #269051 - Attachment is obsolete: true
Attachment #269052 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: