Closed Bug 166471 Opened 24 years ago Closed 24 years ago

nsIFind can return bogus ranges

Categories

(SeaMonkey :: UI Design, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.2final

People

(Reporter: aaronlev, Assigned: aaronlev)

References

Details

Attachments

(2 files)

If the search range used with nsIFind coverse the entire document, nsIFind can return bogus ranges where the start and/or end container is null. There are multiple problems here: 1. nsIFind::Find does not check the return values for range SetStart or SetEnd 2. nsIFind should be skipping over all comment nodes, but it doesn't appear to be when they're before the <head>. Test case is the same as for bug 166340, when the fix for that bug is reversed. The only reason this hasn't been a problem so far is becase nsWebBrowserFind uses GetBody(). However, I don't think GetBody() will work with xml content documents.
Apparently layout is treating those comments outside the <html> tag differently from normal comments inside the body, and SkipNode isn't catching them.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.2beta
QA Contact: paw → pmac
Blocks: 175046
The test cases no longer demonstrates anything, since aaron has worked around this, but more error checking is still a good idea. So here it is. Aaron, can you review?
Target Milestone: mozilla1.2beta → mozilla1.2final
Akkana, this fixes the problem of the bogus ranges, but should we find out why the nsFind code sometimes searches comment nodes? The test case in bug 175046 shows that.
.
Assignee: akkana → aaronl
Status: ASSIGNED → NEW
checked in with fix for bug 175046.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
QA Contact: pmac → sairuh
the test case appears fine with 2003.01.08.08 on linux rh8.
Status: RESOLVED → VERIFIED
Product: Core → Mozilla Application Suite
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: