- From: Andreas Tolfsen <ato@mozilla.com>
- Date: Wed, 27 Apr 2016 12:15:16 +0100
- To: public-browser-tools-testing@w3.org
Wed, 27 Apr 2016 11:51:13 +0100 James Graham <james@hoppipolla.co.uk>: > On 27/04/16 11:43, Andreas Tolfsen wrote: > > Whilst it is possible to fake holding down a key by factoring in the > > frame rate and the OS key repeat rate to generate x DOM events over > > the course of y seconds, this quickly gets us into the realm of > > reproducing realistic time frames. > > Based on http://unixpapa.com/js/testkey.html it seems like holding > down a key generates a number of keydown+keypress events, but a > single keyup event. So it seems quite reasonable to model this with > multiple actions as long the spec doesn't have anything special to > coalesce multiple keyDown actions without an intervening keyUp action. Because we generate synthetic DOM events for actions, we would need an off-thread state system sufficiently capable to perform this. The number of events that are created when you hold down a key depends on browser IME management and your keyboard device’s repeat rate. Because there are no sufficiently advanced cross-browser event injection APIs in the platform, we would need to create a whole new framework to deal with this. The alternatives are to do something simplistic: At the next tick generate two more keyDown and keyPress events for each key that is held down, confusing the spatial- and time dimensions of ticks/slices. Or to be deliberately hand-wavy and let browsers use their internal unspecified event injection subsystems, possibly causing interoperability issues. (The only browser I know of that has one that is sufficiently capable of doing this is Presto-Opera.) A further point is that whilst we can specify this level of granularity for (desktop) keyboard- and mouse input, what about specifics of other, more esoteric input devices, such as force touch or stylus pressure? My point is that this quickly escalates to something that adds a lot of complexity for something that I’m not sure there is much value in, considering it’s not been a huge demand from Selenium users.
Received on Wednesday, 27 April 2016 11:15:48 UTC