Repeatingly looking for the next occurrence of a word search in a webpage misses one occurrence.

Bug #1835467 reported by Martin Constantino–Bodin
2
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Invalid
Medium
firefox (Ubuntu)
New
Low
Unassigned

Bug Description

Hi,
This is probably the most unexpected bug that I have ever seen. Fortunately, it is benign.

How to reproduce:
- Go to the webpage https://www.w3schools.com/howto/howto_js_autocomplete.asp
- Type Ctrl+f to look for a word through the webpage.
- Search for addEventListener. Firefox successfully found 4 occurrences on the webpage.
- Using the arrows next to the search box, loop through all occurrences. Firefox then jumps to the following occurrences, in order:
1. inp.addEventListener("input", function(e) {
2. b.addEventListener("click", function(e) {
3. inp.addEventListener("keydown", function(e) { (In my screen is, it was hidden by the message about cookies: scrolling down by 1cm makes it appear.)
4. document.addEventListener("click", function (e) {
5. First occurrence again: inp.addEventListener("input", function(e) {
6. Second occurrence again: b.addEventListener("click", function(e) {
7. Firefox then directly jumps to the fourth occurrence, missing the third one: document.addEventListener("click", function (e) {
8. (goes back to 5).

In other words, although the first cycle through all occurrences was correct, the following cycles completely miss the third occurrence! I have restarted Firefox and still get this behaviour.

If instead of clicking on the “down” arrow to look for the second occurrence one looks backwards with the “up” arrow, then it is “b.addEventListener("click", function(e) {” instead of “inp.addEventListener("keydown", function(e) {” which is missing from the loop: it seems that whenever cycling through all occurrences of a search in a webpage, if there are only four occurrences, then the third one is never reached except in the first cycle.

I am sending a screenshot of the situation.

This is a very unexpected behaviour, but of very minor consequence: there is no need to place a high level of importance for this bug, I guess.

Regards,
Martin.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: firefox 67.0.4+build1-0ubuntu0.18.04.1
ProcVersionSignature: Ubuntu 4.15.0-54.58-generic 4.15.18
Uname: Linux 4.15.0-54-generic x86_64
AddonCompatCheckDisabled: False
AlsaVersion: Advanced Linux Sound Architecture Driver Version k4.15.0-54-generic.
ApportVersion: 2.20.9-0ubuntu7.6
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: PCH [HDA Intel PCH], device 0: ALC233 Analog [ALC233 Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: martin 1585 F.... pulseaudio
BuildID: 20190620092152
Card0.Amixer.info:
 Card hw:0 'PCH'/'HDA Intel PCH at 0x90910000 irq 95'
   Mixer name : 'Realtek ALC233'
   Components : 'HDA:10ec0235,17aa3825,00100002 HDA:80862882,80860101,00100000'
   Controls : 33
   Simple ctrls : 14
Channel: Unavailable
CurrentDesktop: LXDE
Date: Thu Jul 4 23:24:35 2019
Extensions: extensions.sqlite corrupt or missing
ForcedLayersAccel: False
IfupdownConfig:
 # interfaces(5) file used by ifup(8) and ifdown(8)
 auto lo
 iface lo inet loopback
IncompatibleExtensions: Unavailable (corrupt or non-existant compatibility.ini or extensions.sqlite)
InstallationDate: Installed on 2016-12-05 (941 days ago)
InstallationMedia: Lubuntu 16.10 "Yakkety Yak" - Release amd64 (20161012.1)
IpRoute:
 default via 192.168.1.1 dev wlp4s0 proto dhcp metric 600
 192.168.1.0/24 dev wlp4s0 proto kernel scope link src 192.168.1.3 metric 600
Locales: extensions.sqlite corrupt or missing
MostRecentCrashID: bp-7e1f310f-034d-4a7b-b742-54df41180319
Plugins: Shockwave Flash - /usr/lib/flashplugin-installer/libflashplayer.so
PrefErrors: Unexpected character ',' before close parenthesis @ /usr/lib/firefox/omni.ja:greprefs.js:1151
PrefSources: prefs.js
Profiles: Profile0 (Default) - LastVersion=67.0.4/20190620092152 (In use)
RunningIncompatibleAddons: False
SourcePackage: firefox
SubmittedCrashIDs:
 bp-7e1f310f-034d-4a7b-b742-54df41180319
 bp-daebd85b-34c2-4ab9-88ea-1fc091180208
 bp-dd2282e2-f0cb-47f7-a13a-a16c20180102
Themes: extensions.sqlite corrupt or missing
UpgradeStatus: Upgraded to bionic on 2018-08-29 (309 days ago)
dmi.bios.date: 01/12/2016
dmi.bios.vendor: LENOVO
dmi.bios.version: CCCN19WW(V2.05)
dmi.board.asset.tag: NO Asset Tag
dmi.board.name: Lenovo B50-10
dmi.board.vendor: LENOVO
dmi.board.version: SDK0J40700 WIN
dmi.chassis.asset.tag: NO Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Lenovo B50-10
dmi.modalias: dmi:bvnLENOVO:bvrCCCN19WW(V2.05):bd01/12/2016:svnLENOVO:pn80QR:pvrLenovoB50-10:rvnLENOVO:rnLenovoB50-10:rvrSDK0J40700WIN:cvnLENOVO:ct10:cvrLenovoB50-10:
dmi.product.family: IDEAPAD
dmi.product.name: 80QR
dmi.product.version: Lenovo B50-10
dmi.sys.vendor: LENOVO

Revision history for this message
Martin Constantino–Bodin (martin-bodin) wrote :
description: updated
description: updated
description: updated
summary: - Loop through search occurrences in a wegpage misses one item.
+ Repeatingly looking for the next occurrence of a word search in a
+ webpage misses one occurrence.
Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for the report Martin.

I am unable to observe the issue you describe, I tested in an up-to-date stock Ubuntu 18.04 virtual machine with the same version of firefox, and cycling through the search results for "addEventListener" on that page works normally here.

Can you try cycling through the results with the Ctrl+G keyboard shortcut instead of clicking on the down arrow, and let us know whether you're seeing a different behaviour?

Changed in firefox (Ubuntu):
status: New → Incomplete
Revision history for this message
Martin Constantino–Bodin (martin-bodin) wrote :

Thanks for the response.

To be fair, this behaviour is so unexpected (like, why is it the third occurrence and not the second?) that I really thought that I was very tired yesterday evening, and hoped that the bug would have disappeared today. But… no. It is still there. Sorry.

I tried to reproduce the behaviour at work, and with Firefox on my phone, and it behaved normally in these other devices. I guess that it’s not the same version of Firefox (and/or language settings, or even system). On my home computer, it’s still there.

By the way, the index of the occurrence is correctly given: it starts with “Occurrence 1 sur 4”, then “Occurrence 2 sur 4”, then “Occurrence 4 sur 4”, then “Occurrence 1 sur 4 Bas de la page atteint, poursuite au début”. This time, it did not reach occurrence 3 even at the first cycle.

I wasn’t aware of the Ctrl+G shortcut ☺ Thanks! The behaviour is the same with it than by clicking on the down arrow in the interface.

I also tried with other searches (on the same webpage), like “function”. This time, there are 17 occurrences, and there are more misses (using Ctrl+G): it misses this time the 8th, 13th, and 16th occurrences. It is even less expected than before ☹

It is very difficult to understand the pattern there. When I try looking for “Sw”, I get 9 occurrences, and no miss: all 9 occurrences get to be reached one after the other.

The fact that the bug does not appear on other systems or on a fresh install as you did seems to indicate that something is wrong with my system :-\ I did not remember having changed any behaviours of Firefox in a strange way. I did install some plug-ins in Firefox, though: maybe the bug comes from one of these?

The stranger thing is that the bug seems to be deterministic in my computer: it’s always the third occurrence for the “addEventListener” search and the 8, 13, 16th occurrences for the “function” search. This seems to indicate that it’s not an issue with my keyboard accidentally pressing twice Ctrl+G or something like that. This is strange :-\

If I can help, don’t hesitate to ask for more details. But again, this bug is actually more funny than harmful.

Regards,
Martin.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for the details!

Can you test for that bug after restarting firefox in safe mode? ("Help" menu > "Restart with Add-ons Disabled…")

Revision history for this message
Martin Constantino–Bodin (martin-bodin) wrote :

I just restarted Firefox with add-ons disabled. The behaviour is the same: it misses the third occurrence of “addEventListener” (using Ctrl+g), and the 8th, 13th, and 16th for “function”, but no miss for “Sw”. As far as I can tell, the behaviour is the same whether add-ons are on or not. This was unexpected.

Something interesting that I did not notice before: I searched for “addEventListener” three times, to get to the fourth occurrence of it, then started searching for “function”. The next occurrence of “function” is then the 16th one, and it did reach it. When pressing Ctrl+G, it however missed the 17th to go directly to the first. Then, going through the loop of Ctrl+G reaches all occurrences except the 8th, 13th, and 16th, as before. So there is nothing special about the number 16 when looking for “function”: it only misses it when starting from the first occurrence.

Revision history for this message
Martin Constantino–Bodin (martin-bodin) wrote :

There have been a system update recently (I’m now in Firefox 67.0.4 (64 bits)), so I tried to reproduce the bug on the new version. I’m sorry to say that it is still present, with the same characteristics (“addEventListener” missing the third occurrence, and “function” missing the 8th, 13th, and 16th occurrences). (The importance of the bug hasn’t increase in any way, of course: it’s still a minor bug.)

Revision history for this message
Olivier Tilloy (osomon) wrote :

This remains very puzzling!
Could you, by any chance, try an upstream build of firefox (download from https://www.mozilla.org/firefox/download/thanks/, unpack and run), and share here whether it's also affected? If so, would you mind filing a bug report at https://bugzilla.mozilla.org/enter_bug.cgi#h=dupes%7CFirefox and sharing the link to it here?

Thanks!

Revision history for this message
Martin Constantino–Bodin (martin-bodin) wrote :

I just download the upstream build of Firefox, and it does display the same behaviour. So I guess that it’s not due to an issue of the installation of Firefox in my system. Maybe it’s an issue with a package that Firefox is using that happens to have a bug in my computer? It’s very difficult to diagnose and the fact that it seems that only one computer is affected makes it even more difficult (but at the same time makes it less important too, I guess).
If I can run something that can help diagnose this, I would be happy to help (although not next month: I will be moving and unfortunately won’t have much time for this, sorry).
I’m going to open a bug in Bugzilla.

Revision history for this message
In , Martin Constantino–Bodin (martin-bodin) wrote :

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/75.0.3770.90 Chrome/75.0.3770.90 Safari/537.36

Steps to reproduce:

This report has already been reported in this bug report: https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1835467 It seems that it is only reproducible on my personal computer, making its importance quite low. In this computer, it is however deterministic: it reproduces each time.
In the link above, I tested it on my system’s Firefox. In this bug report, I tested it on an upstream Firefox (68.0.1, 64bits). I just downloaded the Firefox proposed, and because I set my Firefox with a language different than in my system, both versions are actually set in a different language: my system Firefox is in French, and the Firefox that I just downloaded is in Esperanto. This did not change the bug in any way, but it changes the word used for “occurrence” to “kongruoj”.

To reproduce on this machine, I just go to the webpage where I noticed the bug: https://www.w3schools.com/howto/howto_js_autocomplete.asp
I then look for (using Ctrl+f) the string “addEventListener”. There are four occurrences.
When pressing either Ctrl+g or by clicking on the “next” arrow in the interface, I get move from occurrence to occurrence, but it misses the third one: it directly jumps from the second occurrence to the fourth.

Actual results:

Before pressing Ctrl+g, I get “1 el 4 kongruoj” (= “1 out of 4 occurrences”). After pressing Ctrl+g the first time, I get “2 el 4 kongruoj”, and the corresponding congruence is indeed well-selected. After pressing Ctrl+g for the third time, I get “4 el 4 kongruoj” and the fourth occurrence is selected.

Expected results:

After the second occurrence, I would have expected to have seen the third one selected: the third one has been missed.

If looking for the string “function”, the 8th, 13th, and 16th occurrences get missed.

Revision history for this message
Martin Constantino–Bodin (martin-bodin) wrote :

Here is a link to the new bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1568174

Revision history for this message
In , Martin Constantino–Bodin (martin-bodin) wrote :

I can see that my User Agent has been written above. Just to avoid confusion: I reported this bug on Chrome, not Firefox. Do you need my Firefox’s user agent?

Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for the upstream report Martin. Let's see if upstream developers have ideas on how to debug this problem.

Changed in firefox (Ubuntu):
status: Incomplete → New
Revision history for this message
In , Liviu-seplecan (liviu-seplecan) wrote :

Hi @martin.bodin, I've checked the issue and here are the results:
[Platform tested]: Mac OS X, Windows 10 & Ubuntu 18.04
[environments]: nightly 70.0a1, beta 69.0b8, release 68.0.1
=> the issue occurs only on Ubuntu system.
In my end it's a little bit different than in reporter's end: pressing CTRL+g = work's fine / pressing left arrow(near to the input- the one pointed with the top up), will skip the no.2 occurrence.
I will add a component, if isn't the right one please fell free to change it.
Thanks.

Revision history for this message
In , Release-mgmt-account-bot (release-mgmt-account-bot) wrote :

The priority flag is not set for this bug.
:mikedeboer, could you have a look please?

For more information, please visit [auto_nag documentation](https://wiki.mozilla.org/Release_Management/autonag#workflow.2Fno_priority.py).

Changed in firefox:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Mdeboer (mdeboer) wrote :

There have been quite a few improvements to the find backend the past couple of months. Feel free to re-open the issue if it occurs again.

Changed in firefox:
status: Confirmed → Invalid
Revision history for this message
Sebastien Bacher (seb128) wrote :

is that still an issue in the current firefox version?

Changed in firefox (Ubuntu):
importance: Undecided → Low
Revision history for this message
Martin Constantino–Bodin (martin-bodin) wrote :

I’m currently in Firefox 76.0.1 and I can no longer reproduce the issue ☺

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.