Summary: | <input type=number> UI: Support wheel event | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Kent Tamura <tkent> | ||||||
Component: | Forms | Assignee: | Kent Tamura <tkent> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | adele, dglazkov, ojan | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 27968 | ||||||||
Attachments: |
|
Description
Kent Tamura
2010-07-16 01:46:47 PDT
Created attachment 61780 [details]
Patch
Comment on attachment 61780 [details]
Patch
Is it possible to add a layout test for this? If not, can you add a manual test?
> 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().
Created attachment 62382 [details]
Patch 2
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 <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). 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 <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. |