New issue
Advanced search Search tips

Issue 659499 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

INPUT element: Changing default value confuses 'change' event detection

Project Member Reported by tkent@chromium.org, Oct 26 2016

Issue description

Version: 56 canary
OS: All

What steps will reproduce the problem?
(1) Load the following HTML

<input value=abc autofocus>
<script>
var i = document.querySelector('input');
i.addEventListener('change', function() { alert('change'); });
i.setAttribute('value', 'def');
</script>

(2) Change 'def' with 'abc', then press TAB key

What is the expected output?
An alert dialog should be shown. It means a 'change' event was dispatched.

What do you see instead?
An alert dialog isn't shown.


Please use labels and text to provide additional information.

 

Comment 1 by tkent@chromium.org, Oct 26 2016

Status: Started (was: Assigned)
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3393d5c2830af28ce61500bf66cdae94cddfc028

commit 3393d5c2830af28ce61500bf66cdae94cddfc028
Author: tkent <tkent@chromium.org>
Date: Wed Oct 26 13:28:37 2016

INPUT element: Updating value to the previous defaultValue should dispatch "change" event.

We have set defaultValue to m_textAsOfLastFormControlChangeEvent only when input
type was determined, and updating defalutValue after it didn't update
m_textAsOfLastFormControlChangeEvent. So, 'change' event was not dispatched in
some cases.

BUG= 659499 

Review-Url: https://codereview.chromium.org/2452903002
Cr-Commit-Position: refs/heads/master@{#427675}

[add] https://crrev.com/3393d5c2830af28ce61500bf66cdae94cddfc028/third_party/WebKit/LayoutTests/fast/forms/text/text-change-event-after-updating-default.html
[modify] https://crrev.com/3393d5c2830af28ce61500bf66cdae94cddfc028/third_party/WebKit/Source/core/html/HTMLInputElement.cpp

Comment 3 by tkent@chromium.org, Oct 26 2016

Labels: M-56
Status: Fixed (was: Started)

Sign in to add a comment