Closed Bug 1233727 Opened 9 years ago Closed 8 years ago

Label "Phrase not found" in findbar twitches every time I try to switch to next found string

Categories

(Toolkit :: Find Toolbar, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla46
Tracking Status
firefox45 --- affected
firefox46 --- verified

People

(Reporter: arni2033, Assigned: mbrubeck)

References

()

Details

(Keywords: regression)

Attachments

(1 file)

>>>   My Info:   Win7_64, Nightly 46, 32bit, ID 20151217030207
STR:
1. Open this "data:" url in a new tab
>   data:,bcdef
2. Open findbar, type "a" without quotes in findbar
3. Press Enter / Ctr+G / F3 several times

Result:       Label "Phrase not found" twitches every time   (request a screencast if it's necessary)
Expectations: It should stay still == not to twitch

Somehow I couldn't get more precise regression range, because mozregression GUI returned errors
> pushlog_url:   https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=3835b568092ae3b71adc931d24928670ad7141a7&tochange=1b2e15608f34fef0f23369731c80138f55f00cf2
Summary: Label "Phrase not found" in findbar twitches every time I'm trying to switch to next found string → Label "Phrase not found" in findbar twitches every time I try to switch to next found string
Attached patch patchSplinter Review
This happens because findbar.open() calls _updateFindUI() which un-hides the #found-matches label.  Then when onMatchesCountResult is called, the #found-matches label is re-hidden.

The steps in comment 0 are a regression from bug 967982, but there were other ways to trigger this, prior to that patch.  For example:

1. Press Ctrl-F to open the findbar
2. Type some text that is not found on the page
3. Press Ctrl-F again

This patch fixes all such cases by making sure #found-matches remains hidden when it contains no text.

(Side note: I feel like the best way to prevent such bugs would be to massively refactor this code to use a React-style mapping from state to rendering.  Unfortunately I don't think I'm motivated enough to do this myself.)
Assignee: nobody → mbrubeck
Status: NEW → ASSIGNED
Attachment #8702637 - Flags: review?(mdeboer)
Has STR: --- → yes
Comment on attachment 8702637 [details] [diff] [review]
patch

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

LGTM! Thanks for the patch, Matt!
Attachment #8702637 - Flags: review?(mdeboer) → review+
https://hg.mozilla.org/integration/fx-team/rev/5eec88560653613a325bd083dc9a5d95528a3685
Bug 1233727 - Don't show found-matches label when it's empty [r=mikedeboer]
https://hg.mozilla.org/mozilla-central/rev/5eec88560653
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
QA Whiteboard: [good first verify]
Could reproduce the bug in Firefox Stable 45 Debian 8 GNU/Linux 

Verified as Fixed in Firefox Beta 46.0b1 Debian 8 GNU/Linux
Status: RESOLVED → VERIFIED
QA Whiteboard: [good first verify] → [good first verify][bugday-20160316]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: