New issue
Advanced search Search tips

Issue 769496 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows
Pri: 2
Type: Bug



Sign in to add a comment

Using insertBefore can mess up auto-completing inputs

Reported by amot...@jumptech.com, Sep 27 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

Steps to reproduce the problem:
1. Set link path in page1.html to point to page2.html
2. Open page1.html in browser
3. Follow link to page2.html
4. Type "foobar" into first text input
5. Use browser back button to navigate to page1.html
6. Use browser forward button to navigate to page2.html

What is the expected behavior?
The text "foobar" should be auto-filled in the first text input.

What went wrong?
The text "foobar" is auto-filled in the second text input. Repeating steps 5 & 6 will show "foobar" alternating between the text inputs.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 61.0.3163.100  Channel: stable
OS Version: 4.4.0-96-generic
Flash Version: 

This behavior only happens when using the browser back and forward buttons.

Adding the attribute `autocomplete="off"` to the first text input stops this behavior.
 
page1.html
149 bytes View Download
page2.html
345 bytes View Download

Comment 1 by hayato@chromium.org, Sep 28 2017

Components: -Blink>DOM UI>Browser>Autofill
This same bug occurs even when line 12 of page2.html is changed to

```
var insertedNode = document.body.insertBefore(first, first)
```

The flip-flopping also happens when this is

```
var insertedNode
setTimeout(function() {
  insertedNode = document.body.insertBefore(first, first)
})
```

except this time the console.log() on the next line logs `false`.
Labels: Needs-Triage-M61
Labels: OS-Windows
Status: Untriaged (was: Unconfirmed)

Sign in to add a comment