Closed Bug 463294 Opened 16 years ago Closed 13 years ago

link only preference not handled correctly

Categories

(Toolkit :: Find Toolbar, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2

People

(Reporter: neil, Assigned: neil)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(2 files, 7 obsolete files)

OK, so I'm having trouble thinking of a good summary.

Obviously the idea here is to try to replace Suite's typeaheadfind, which uses internal linkage. Unfortunately I soon discovered that toolkit's typeaheadfind clears the selection even on a failed search, which is not the behaviour we're used to. Additionally, on Windows, typeaheadfind cancels the sound when you do another find, (except when using the system beep, but again that's not default for Suite) so I can't even restore the selection that way.

So, there are two options which would resolve the problem for me:
1. Don't unconditionally clear the selection. There is already code to clear the selection on a successful match in a frame. The caller (find bar) could always call CollapseSelection should you deem it necessary.
2. Don't release the sound instance. This doesn't hurt Firefox because it beeps by default.
(In reply to comment #0)
> 1. Don't unconditionally clear the selection. There is already code to clear
> the selection on a successful match in a frame. The caller (find bar) could
> always call CollapseSelection should you deem it necessary.
I've since noticed that there is a test for a collapsed selection. Unfortunately the test is done after the selection is collapsed, so it always returns true...

I've now also noticed another new bogus behaviour: the parameter for whether to find links is ignored on the very first character; if the preference is set to find links then you always find links whether you like it or not.

It would be really nice if we could get these fixed for 1.9.1 for SeaMonkey.
Flags: wanted1.9.1?
Attached patch Excise broken code (obsolete) — Splinter Review
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #365172 - Flags: review?(gavin.sharp)
Attached patch Real selection fix (obsolete) — Splinter Review
OK, so it turns out that the bogus Collapse is to work around a bug in GetSearchContainers; the XPFE version collapses the selection to the start except when a) doing a find again forwards or b) to support #ifdef-ed out code that tries to repeat the find for a character when it is repeated (e.g. finding "ff" finds the second "f" rather than the first "ff"). The toolkit version unfortunately only collapses the selection when doing a find again backwards, which is why the Collapse was added to take care of the non-repeating case.
Attachment #365172 - Attachment is obsolete: true
Attachment #365868 - Flags: review?(gavin.sharp)
Attachment #365172 - Flags: review?(gavin.sharp)
Attached patch Just the links only fix (obsolete) — Splinter Review
As I guess the other patch might be too bug for 1.9.1 :-(
Attachment #365869 - Flags: review?(gavin.sharp)
Attachment #365869 - Flags: review?(gavin.sharp) → review-
Comment on attachment 365869 [details] [diff] [review]
Just the links only fix

This is the only use of mLinksOnlyPref. Since find/findAgain callers can already control this behavior, seems like we should remove all traces of this pref in typeaheadfind code and leave it up to consumers (e.g. findbar.xml), no?
Attached patch Excise mLinksOnlyPref (obsolete) — Splinter Review
Attachment #365869 - Attachment is obsolete: true
Attachment #366187 - Flags: review?(gavin.sharp)
Attached patch Fixed selection fix (obsolete) — Splinter Review
Find again didn't wrap forwards with the previous patch :-(

The bogus CollapseToStart must have been added because it was too difficult to work out what was really going on, so I added a couple more comments.
Attachment #365868 - Attachment is obsolete: true
Attachment #367226 - Flags: review?(gavin.sharp)
Attachment #365868 - Flags: review?(gavin.sharp)
Comment on attachment 366187 [details] [diff] [review]
Excise mLinksOnlyPref

With this it now appears that mLinksOnly is unnecessary... you could just replace it with  aLinksOnly in both cases right?
Attached patch Excise mLinksOnly* (obsolete) — Splinter Review
Attachment #366187 - Attachment is obsolete: true
Attachment #371120 - Flags: review?(gavin.sharp)
Attachment #366187 - Flags: review?(gavin.sharp)
I neatened the constructor slightly.
Attachment #371120 - Attachment is obsolete: true
Attachment #371122 - Flags: review?(gavin.sharp)
Attachment #371120 - Flags: review?(gavin.sharp)
Attached patch Combined patch (obsolete) — Splinter Review
Including the selection fixes.
Attachment #367226 - Attachment is obsolete: true
Attachment #371124 - Flags: review?(gavin.sharp)
Attachment #367226 - Flags: review?(gavin.sharp)
Attachment #371122 - Flags: review?(gavin.sharp) → review+
Comment on attachment 371122 [details] [diff] [review]
Excise mLinksOnly*

Pushed changeset 9bec56d42d2e to mozilla-central.
(i.e. without the changes in attachment 371122 [details] [diff] [review])
Attachment #371124 - Attachment is obsolete: true
Attachment #371175 - Flags: review?(gavin.sharp)
Attachment #371124 - Flags: review?(gavin.sharp)
Comment on attachment 371175 [details] [diff] [review]
Fix selection collapsing only

I'm sorry I've let this linger for a long time. Do you still need these changes? If you still need them re-request review and I'll find someone to do it. It might be best to do that in a new bug, since this one has been used to track a different fix already.
Attachment #371175 - Flags: review?(gavin.sharp)
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Summary: toolkit typeaheadfind isn't useful → link only preference not handled correctly
Target Milestone: --- → mozilla1.9.2
Blocks: 719767
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: