Open Bug 1512755 Opened 5 years ago Updated 2 years ago

Should not auto-scroll to auto-focused input (or password input) when switching tab

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P2)

60 Branch
defect

Tracking

()

Tracking Status
firefox64 --- wontfix
firefox65 --- fix-optional
firefox66 --- fix-optional
firefox67 --- ?

People

(Reporter: poltron54, Unassigned)

References

Details

(Keywords: regression)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Steps to reproduce:

Go to:
- an HTTP (not HTTPS) web page with password field (<input type="password">) and give focus to password field (e.g. http://linuxmao.org/Accueil )
- or a page with a field which automatically gets focus on page loading (e.g. http://gdt.oqlf.gouv.qc.ca/index.aspx )
Scroll down in order to don’t see password field anymore.
Go to another tab.
Come back to previous tab.


Actual results:

Browser scrolls by itself in order to show focused input.


Expected results:

Let the scroll where the user previously left it.
Reproducible on Firefox Nightly 66.0a1 (2018-12-10), Firefox 65.0b3 and Firefox 64 on Windows 10 x64, Ubuntu 16.04 and Mac OS X 10.13.
Status: UNCONFIRMED → NEW
Component: Untriaged → Tabbed Browser
Ever confirmed: true
Component: Tabbed Browser → Event Handling
Product: Firefox → Core
I could not reproduce on Firefox 53 or older version, so it looks like a regression.
Hani, could you help to find a regression window? Thanks.
Flags: needinfo?(hani.yacoub)
Alice0775 White provided a regression window. I will clear the needinfo request.
Flags: needinfo?(hani.yacoub)
(In reply to Alice0775 White from comment #3)
> regression window:
> https://hg.mozilla.org/integration/mozilla-inbound/
> pushloghtml?fromchange=f4b3cc1c100caaf6a0d6e332cebf1ba5969cea7b&tochange=bc1c
> 406e17c8fab7d7af812b64d714fc8af0c127

Yea, I don't see this issue if I disable "security.insecure_field_warning.contextual.enabled".

Hi Tanvi, this looks like something related to bug 1217152, could you maybe take a look? Thanks.
Flags: needinfo?(tanvi)
Disabling that setting doesn’t fix case with auto-focused input. Both given link in comment 0 still let me reproduce the issue at home even if security.insecure_field_warning.contextual.enabled==false.
(In reply to Pols12 from comment #6)
> Disabling that setting doesn’t fix case with auto-focused input. Both given
> link in comment 0 still let me reproduce the issue at home even if
> security.insecure_field_warning.contextual.enabled==false.

I experience the same: toggling that pref doesn't affecting whether or not http://gdt.oqlf.gouv.qc.ca/index.aspx returns to the input field -- which I've scrolled out of view -- when I go back to the page. Note that the input field has focus upon first load and retains it throughout (i.e. I'm not clicking anywhere else on the page). I'm experiencing this with Nightly on Windows 10 and I restarted after flipping the pref to ensure it took effect.

While this may indeed be a regression, it's not something we'd spin a new 64 dot release for so I'm setting the appropriate flags. I'm also clearing Tanvi's needinfo since it seems unrelated to bug 1217152.

Edgar, can you take another look? I wonder if it's platform-specific?
Flags: needinfo?(tanvi) → needinfo?(echen)
Priority: -- → P2
(In reply to Andrew Overholt [:overholt] from comment #7)
> I experience the same: toggling that pref doesn't affecting whether or not
> http://gdt.oqlf.gouv.qc.ca/index.aspx returns to the input field -- which
> I've scrolled out of view -- when I go back to the page.

Hmm, it is weird, I could not reproduce it on Mac and Linux with recent Nightly. I will try Windows again.
I still could not reproduce http://gdt.oqlf.gouv.qc.ca/index.aspx case with Windows 10 + latest Nightly.

We have two test cases:
- http://linuxmao.org/Accueil
  I could reproduce with security.insecure_field_warning.contextual.enabled==true, but not with false.
- http://gdt.oqlf.gouv.qc.ca/index.aspx 
  I could NOT reproduce with/without flipping the pref.

It looks like to me that we have two factors here,
- something related to bug 1217152 (per my test result)
- something related to auto-focused input (per comment 6 and comment 7), but I could not reproduce this on my side. :(

Alice, Hani, could you help to test what is the result of both link on your side with clean profile? Thanks
Flags: needinfo?(hani.yacoub)
Flags: needinfo?(echen)
Flags: needinfo?(alice0775)
(a) http://linuxmao.org/Accueil
  1. Reduce browser width as much as possible
  2. Open http://linuxmao.org/Accueil
  
  --- The "Nom d'utilisateur" input field is scrolled into view automatically. 
      I think this is not a bug. This is an expected behavior.

  3. Scroll page so that The "Nom d'utilisateur" input filed will out of view port.
  4. Switch to other tab and back to the original tab.
  
  --- The input field is scrolled into view automatically.
      I think this is a bug.
      I can reproduce with security.insecure_field_warning.contextual.enabled==true, but not with false.



(b) http://gdt.oqlf.gouv.qc.ca/index.aspx 
  1. Reduce browser width as much as possible
  2. Open http://gdt.oqlf.gouv.qc.ca/index.aspx
   
  --- The input field is scrolled into view automatically.
      I think this is not a bug. This is an expected behavior.

  3. Scroll page so that The "Nom d'utilisateur" input filed will out of view port.
  4. Switch to other tab and back to original tab.
  
  --- Scroll position is persisted. I cannot reproduce the problem.
Flags: needinfo?(hani.yacoub)
Flags: needinfo?(alice0775)
Sorry, 
Hani, see comment #9
Flags: needinfo?(hani.yacoub)
I got the same results as Alice.
Flags: needinfo?(hani.yacoub)
(In reply to Alice0775 White from comment #10)
> (b) http://gdt.oqlf.gouv.qc.ca/index.aspx 
> [...]
>   4. Switch to other tab and back to original tab.

I see the difference now with what I was doing and what you're saying: I was navigating in the same tab and then going back using the Back button as opposed to switching tabs.
(In reply to Andrew Overholt [:overholt] (Back Jan 2) from comment #13)
> (In reply to Alice0775 White from comment #10)
> > (b) http://gdt.oqlf.gouv.qc.ca/index.aspx 
> > [...]
> >   4. Switch to other tab and back to original tab.
> 
> I see the difference now with what I was doing and what you're saying: I was
> navigating in the same tab and then going back using the Back button as
> opposed to switching tabs.

In this case, I can reproduce it on Chrome as well as Firefox. If you think this is a Bug, I think it needs to file a separate bug.

Too late for 66 but we could still take a patch for 67.
Hsin-Yi, Can you help find someone to investigate?

Flags: needinfo?(htsai)

I'll get back on this. Thanks!

Flags: needinfo?(htsai)
Component: Event Handling → User events and focus handling
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.