RESOLVED FIXED Bug 42441
<input type=number> UI: Support wheel event
https://bugs.webkit.org/show_bug.cgi?id=42441
Summary <input type=number> UI: Support wheel event
Kent Tamura
Reported 2010-07-16 01:46:47 PDT
<input type=number> UI: Support wheel event
Attachments
Patch (1.96 KB, patch)
2010-07-16 01:49 PDT, Kent Tamura
no flags
Patch 2 (5.40 KB, patch)
2010-07-22 22:30 PDT, Kent Tamura
no flags
Kent Tamura
Comment 1 2010-07-16 01:49:58 PDT
Ojan Vafai
Comment 2 2010-07-22 15:58:53 PDT
Comment on attachment 61780 [details] Patch Is it possible to add a layout test for this? If not, can you add a manual test?
Kent Tamura
Comment 3 2010-07-22 22:21:47 PDT
> Is it possible to add a layout test for this? If not, can you add a manual test? I thought we didn't have a way to produce wheel events with eventSender. But it is not needed. We can produce it by document.createEvent('WheelEvent').initWebKitWheelEvent().
Kent Tamura
Comment 4 2010-07-22 22:30:44 PDT
Created attachment 62382 [details] Patch 2
Ojan Vafai
Comment 5 2010-08-03 11:38:56 PDT
Comment on attachment 62382 [details] Patch 2 > +++ b/LayoutTests/fast/forms/script-tests/input-number-wheel.js > @@ -0,0 +1,31 @@ > +description('Test for wheel operations for &lt;input type=number>'); > +var parent = document.createElement('div'); > +document.body.appendChild(parent); > +parent.innerHTML = '<input type=number id=number value=0>'; No need for parent. Can just do the following, no? document.body.innerHTML = '<input type=number id=number value=0>'; > +var input = document.getElementById('number'); > +input.focus(); > + > +function dispatchWheelEvent(element, deltaX, deltaY) { open bracket should be on the following line. > + var event = document.createEvent('WheelEvent'); > + var DontCare = 0; Should be camelCase (i.e. dontCare).
Kent Tamura
Comment 6 2010-08-03 19:09:37 PDT
Landed as r64616. (In reply to comment #5) > (From update of attachment 62382 [details]) > > +++ b/LayoutTests/fast/forms/script-tests/input-number-wheel.js > > @@ -0,0 +1,31 @@ > > +description('Test for wheel operations for &lt;input type=number>'); > > +var parent = document.createElement('div'); > > +document.body.appendChild(parent); > > +parent.innerHTML = '<input type=number id=number value=0>'; > > No need for parent. Can just do the following, no? > document.body.innerHTML = '<input type=number id=number value=0>'; It doesn't work. documet.body has other elements for description, console, scripts. > > +function dispatchWheelEvent(element, deltaX, deltaY) { > open bracket should be on the following line. > > > + var event = document.createEvent('WheelEvent'); > > + var DontCare = 0; > > Should be camelCase (i.e. dontCare). Fixed them. We don't have a standard style for JavaScript, but we had better follow C++ style.
Note You need to log in before you can comment on or make changes to this bug.