Closed Bug 173350 Opened 23 years ago Closed 23 years ago

nsIDOMTreeWalker crashes with XUL documents

Categories

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

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.2beta

People

(Reporter: aaronlev, Assigned: aaronlev)

References

Details

Attachments

(1 file, 2 obsolete files)

I believe it is crashing because it is getting an incorrect result from IndexOF(). The IndexOf() function calls nsXULDocument::IndexOF() which is not implemented, and has the NS_NOTREACHED assertion. Eventually this causes nsTreeWalker::TestNode() to crash because it has a null pointer for the node.
nice! will be an easy fix, hrm.. why is there no 1.2 final target?
Assignee: anthonyd → bugmail
Target Milestone: --- → mozilla1.2beta
This is blocking my fix for bug 161410. There are a lot of NS_NOT_IMPLEMENTED methods in nsXULDocument. Shouldn't we fix all of them at once? At least, if there is a pure out param, we should zero it out.
Blocks: 161410
Hmm, I have fixes cloggin up my tree waiting for this. Sicking, do you want me to take it?
I think we'll get this fixed for free when bug 124412 is fixed, because we'll inherit an IndexOf() impl from nsDocument.
Have patch.
Assignee: bugmail → aaronl
Blocks: 84308
+ NS_IF_ADDREF(aResult = mRootContent); + return NS_OK; Should this throw if mRootContent is null? + aIndex = (aPossibleChild == mRootContent)? 0 : -1; What if aPossibleChild == mRootContent == nsnull? + aCount = 1; What if mRootContent is null? If mRootContent is never null, why not just use NS_ADDREF?
Seeking r=
Attachment #104427 - Attachment is obsolete: true
That addressed concerns 1 and 4 out of 4... returning "1" for the count when we have no kids seems wrong. IndexOf(nsnull) returning "0" seems wrong.
Attachment #104446 - Attachment is obsolete: true
Comment on attachment 104447 [details] [diff] [review] Sorry bz, here you go. much better. ;)
Attachment #104447 - Flags: superreview+
Comment on attachment 104447 [details] [diff] [review] Sorry bz, here you go. r/sr=jst
Attachment #104447 - Flags: review+
checked in
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment on attachment 104447 [details] [diff] [review] Sorry bz, here you go. a=asa for checkin to the 1.2 branch (on behalf of drivers)
Attachment #104447 - Flags: approval+
Checked into 1.2 branch.
Component: DOM: Traversal-Range → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: