WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
117526
“input” event is not fired when changing a <select> element’s value
https://bugs.webkit.org/show_bug.cgi?id=117526
Summary
“input” event is not fired when changing a <select> element’s value
felipe
Reported
2013-06-11 16:10:37 PDT
http://www.w3.org/TR/html5/index.html#events-0
Per the above, changes to a <select> element should be firing “oninput”; however, WebKit seems simply to ignore these changes. No other browser appears to implement this as I’m describing, but per the spec, this still appears to be a bug that DEFINITELY should be fixed. I can’t check this on a WebKit nightly because I have Snow Leopard.
Attachments
Patch
(6.49 KB, patch)
2014-03-18 04:32 PDT
,
Lorenzo Tilve
no flags
Details
Formatted Diff
Diff
Patch
(6.49 KB, patch)
2014-03-18 05:11 PDT
,
Lorenzo Tilve
koivisto
: review+
Details
Formatted Diff
Diff
"input" event is not fired when changing a select element's value
(6.70 KB, patch)
2014-03-20 05:24 PDT
,
Lorenzo Tilve
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2013-06-12 16:22:16 PDT
Could you please attach a test case?
felipe
Comment 2
2013-06-15 17:19:18 PDT
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <form action="javascript:void(0)" oninput="console.log(this)"> <label>Changing this doesn’t fire “oninput”: <select name="foo"><option>1</option><option>2</option></select> </label> <br> <br> <label>… but changing this does: <input type="text" name="bar"> </label> </form> </body> </html>
felipe
Comment 3
2013-06-15 17:24:21 PDT
I also was able to confirm the bug in the latest nightly.
Lorenzo Tilve
Comment 4
2014-03-18 04:32:43 PDT
Created
attachment 227032
[details]
Patch Add a call to dispatch input event when listbox or menulist values are modified. These changes have been already applied for the same bug on Blink here
http://crbug.com/349472
Xabier Rodríguez Calvar
Comment 5
2014-03-18 04:39:38 PDT
Comment on
attachment 227032
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=227032&action=review
My informal review.
> LayoutTests/ChangeLog:3 > + "oninput" doesnât fire when changing a select elementâs value
Encoding problem?
> Source/WebCore/ChangeLog:3 > + "oninput" doesnât fire when changing a select elementâs value
Ditto.
Lorenzo Tilve
Comment 6
2014-03-18 05:11:23 PDT
Created
attachment 227038
[details]
Patch Fixed encoding issue.
Antti Koivisto
Comment 7
2014-03-20 02:58:05 PDT
Comment on
attachment 227038
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=227038&action=review
Reading the spec it sounds like the intention is that input event only fires for <input> elements. "When the input and change events apply (which is the case for all input controls other than buttons and those with the type attribute in the Hidden state), the events are fired to indicate that the user has interacted with the control. The input event fires whenever the user has modified the data of the control. The change event fires when the value is committed, if that makes sense for the control, or else when the control loses focus. In all cases, the input event comes before the corresponding change event (if any)."
> Source/WebCore/html/HTMLSelectElement.cpp:700 > + RefPtr<HTMLSelectElement> protector(this);
This seems like a separate bug fix. Could you make a test case for it and land separately?
Antti Koivisto
Comment 8
2014-03-20 03:08:51 PDT
No I'm wrong. There is specific text for firing these: "When the user agent is to send select update notifications, queue a task to first fire a simple event that bubbles named input at the select element, and then fire a simple event that bubbles named change at the select element, using the user interaction task source as the task source."
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-select-element
Antti Koivisto
Comment 9
2014-03-20 03:11:59 PDT
Comment on
attachment 227038
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=227038&action=review
Ok.
> LayoutTests/ChangeLog:3 > + "oninput" doesn't fire when changing a select element's value
The event is called "input" no "oninput"
Antti Koivisto
Comment 10
2014-03-20 03:12:41 PDT
Please also point to the spec test in the ChangeLog
Antti Koivisto
Comment 11
2014-03-20 03:12:58 PDT
*text
Lorenzo Tilve
Comment 12
2014-03-20 05:24:33 PDT
Created
attachment 227283
[details]
"input" event is not fired when changing a select element's value Applied suggested corrections.
WebKit Commit Bot
Comment 13
2014-03-20 08:10:05 PDT
Comment on
attachment 227283
[details]
"input" event is not fired when changing a select element's value Clearing flags on attachment: 227283 Committed
r165965
: <
http://trac.webkit.org/changeset/165965
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug