Closed Bug 760780 Opened 12 years ago Closed 5 years ago

'Highlight all' feature highlights old phrase occurrences when switching between tabs

Categories

(Toolkit :: Find Toolbar, defect, P5)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: josef, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/15.0 Firefox/15.0a1
Build ID: 20120601030520

Steps to reproduce:

1. Visit http://www.mozilla.org/en-US/
2. Press CTRL+F to raise the search bar.
3. Type 'a' to the search field.
4. Click on 'Highlight all'.
5. Press CTRL+T  to open a new tab.
6. Close the new tab or switch back to the previous tab.
7. Press CTRL+F to focus the search field.
8. Type 'b' to the search field (only 'b' should be in the search field right now).
9. Click on 'Highlight all'.


Actual results:

All occurrences of 'a' and 'b' are highlighted.


Expected results:

Only occurrences of 'b' are highlighted.

The feature works as expected (meaning occurrences of 'a' cease to be highlighted) if steps 5, 6 and 9 are skipped.
Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/15.0 Firefox/15.0a1

Reproducible with the steps from description on the above build.
Issue is reproducible since Firefox 4:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:2.0b1) Gecko/20100630 Firefox/4.0b1
Status: UNCONFIRMED → NEW
Component: Untriaged → Toolbars
Ever confirmed: true
QA Contact: untriaged → toolbars
Hardware: x86_64 → All
Also happens on OSX.  I've also randomly triggered this myself in the course of normal browsing.
OS: Linux → All
This should fix the bug; any assistance and feedback would be appreciated.
Attachment #640847 - Flags: review?(dao)
Component: Toolbars → Find Toolbar
Product: Firefox → Toolkit
Attachment #640847 - Flags: review?(mano)
Comment on attachment 640847 [details] [diff] [review]
Remove all existing highlighting when highlighting is requested

Review of attachment 640847 [details] [diff] [review]:
-----------------------------------------------------------------

Hrm, what about the editors part of the removal?
Try this:
1. Load data:text/html,<textarea>ab</textarea>
2. Find "a" and highlight
3. Switch to another tab
4. Switch back
2. Find "b" and highlight

Result: both "a" and "b" are highlighted.

Now, while your solution could be extended to fix this case, this is just a workaround. The key bug here is that the highlight state isn't "restored" when you switch back to the tab (note that the highlight button isn't in "pressed" state).

It shouldn't be too hard to fix that (I'm surprised this is broken for so long!), so, imo, this workaround isn't the way to go.
Attachment #640847 - Flags: review?(mano)
Attachment #640847 - Flags: review?(dao)
Attachment #640847 - Flags: review-
Priority: -- → P5

Not reproducible anymore.

Mozilla/5.0 (X11; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0
Build ID: 20190409155332

Nice! Thanks for noting this here.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: