Closed Bug 184858 Opened 22 years ago Closed 22 years ago

Find not finding all matches

Categories

(Core :: DOM: Editor, defect, P3)

x86
All
defect

Tracking

()

VERIFIED FIXED
mozilla1.3beta

People

(Reporter: neil, Assigned: kinmoz)

References

()

Details

(Keywords: regression)

Attachments

(2 files)

I wanted to search the patch for "ClearMenulist" but find would only find 4 of 11 matches. Even when viewing the patch in its own window only 9 matches are found.
Visited http://bugzilla.mozilla.org/attachment.cgi?id=108902&action=edit was able to find "ClearMenulist" 11 times. Used Win98 with Mozilla 1.2.1
Found only 4 matches with OS/2 build 2002121112
OS -> All
OS: Windows 95 → All
Aaron says this may be related to bug 175046.
Flags: blocking1.3b+
Keywords: nsbeta1, regression
This seems like a major bug. I'll bet the problem is in nsFind.cpp Here are the recent checkins to nsFind.cpp: 1.16 kin%netscape.com Nov 21 07:07 Fix for bug #176251 (Problems with nsContentIterator PRE traversal) 1.15 aaronl%netscape.com Nov 5 18:59 Bug 175046, bug 172991, bug 166471. Can someone look to see if it broke right after Nov 5 or Nov 21?
Severity: normal → major
-> Kin The test case works after I back out these changes in my local tree: 1.16 kin%netscape.com Nov 21 07:07 Fix for bug #176251 (Problems with nsContentIterator PRE traversal)
Assignee: akkana → kin
I have a feeling that post-order is being assumed in other parts of the find code even though the code I modified hinted that pre-order may be wanted in the forward search case. The temporary fix may be to just use a post-iterator in both the forward and backward search cases, which should restore it back to what it was doing prior to my changes.
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.3beta
yay, mid-air collisions. anyhow, my testing confirms what aaron found. using linux comm trunk builds (rh8) this regressed sometime btwn 2002.11.20.22 (works fine) and 2002.11.21.08 (broken).
QA Contact: sujay → pmac
Ok looks like the problem is in |nsContentIterator::Init(nsRange*)| and is specific to the case where one of the range end points is in a text node, and the other is in the text node's parent right next to the text node ... this results in a case where |mFirst| and |mLast| should be the same text node, but we're making an empty iterator because the |ContentIsInTraversalRange()| is failing. Patch coming up.
Attached patch Patch Rev 1Splinter Review
This makes |ContentIsInTraversalRange()| handles the special case where aContent is one of the traversal range end points.
Attachment #109564 - Flags: superreview?(sfraser)
Attachment #109564 - Flags: review?(jfrancis)
assuming that was a nomination and setting the ? (only drivers can set the blocking.1.3b + flag)
Flags: blocking1.3b+ → blocking1.3b?
Comment on attachment 109564 [details] [diff] [review] Patch Rev 1 Is there any reason not to QI startContent and endContent to nsIDOMCharacterData, instead of nsIContent?
Attachment #109564 - Flags: review?(jfrancis) → review+
Ignore my comment - misread patch and though we were comparing pointers on different interfaces.
QA Contact: pmac → sairuh
Attachment #109564 - Flags: superreview?(sfraser) → superreview+
Fix checked into TRUNK: mozilla/content/base/src/nsContentIterator.cpp revision 1.55
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Blocks: 173046
WFM, debug linux built 6 hours ago.
Status: RESOLVED → VERIFIED
Flags: blocking1.3b?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: