Closed Bug 408533 Opened 18 years ago Closed 18 years ago

Incremental find in the Find bar should not jump to the next match

Categories

(Camino Graveyard :: Toolbars & Menus, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Camino1.6

People

(Reporter: alqahira, Assigned: stuart.morgan+bugzilla)

References

()

Details

(Keywords: fixed1.8.1.13)

Attachments

(1 file)

"- Trying to fix the fact that incremental search should start again from the beginning of the current range, rather than skipping to the next word" STR: 1. Visit URL above 2. Cmd-F 3. Type Cami 4. Observe selection 5. Type no 6. Observe selection ER: First instance of "Camino" on the page is (partially/wholly) selected in both step 4 and step 6 AR: First instance of "Camino" on the page is selected in step 4, second instance is selected in step 6.
Attached patch fix — — Splinter Review
Collapses the selection range just before searching, so that the search will extend in place as expected. As a side-effect, a search with no matches will clear the current selection, but I view that as reasonable (if not improved) behavior. I also chained the initial search method through the find-again method so that I didn't need to duplicate the code.
Assignee: nobody → stuart.morgan
Status: NEW → ASSIGNED
Attachment #299517 - Flags: superreview?(mark)
Target Milestone: --- → Camino1.6
Comment on attachment 299517 [details] [diff] [review] fix >+ //nsCOMPtr<nsIDOMWindow> domWindow = [self contentWindow]; >+ nsCOMPtr<nsIDOMWindow> domWindow = [self focussedDOMWindow]; Get rid of the commented-out line, or give a comment explaining why it's there but commented out. >+ domWindow->GetSelection(getter_AddRefs(selection)); >+ if (selection) >+ selection->CollapseToStart(); What BS that nsIDOMWindow::GetSelection's nsresult return value can't be relied upon. [s]r=me
Attachment #299517 - Flags: superreview?(mark) → superreview+
Landed on trunk and MOZILLA_1_8_BRANCH with the cruft commented line removed.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1.13
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: