Re: Action for moving a pointer device by an offset

Sent from my iPhone
> On 8 Jan 2017, at 08:35, James Graham <james@hoppipolla.co.uk> wrote:
> 
>> On 07/01/17 21:50, Simon Stewart wrote:
>> Hi,
>> 
>> I'm busy implementing a local end for the Actions part of the spec. In
>> Selenium, there's a method for moving the primary pointer input source by a
>> given offset:
>> 
>> https://github.com/SeleniumHQ/selenium/blob/selenium-3.0.1/java/client/src/org/openqa/selenium/interactions/Actions.java#L286
>> 
>> The interesting thing to note is that this simply updates the current input
>> state for the pointer input source --- it doesn't need an target webelement
>> to be set.
>> 
>> In the spec
>> <https://www.w3.org/TR/webdriver/#dfn-process-a-pointer-move-action>, it's
>> considered an error if the element is not specified, which means that the
>> existing selenium API can't be implemented.
> 
> That certainly isn't the intent, and I can't immediately see why you think that's the case, although it's certainly possible that there's a bug I'm missing.

Because I misread step 5 of the algorithm I linked to. *facepalm*

> What is true is that we only support absolute x and y coordinates, not coordinates relative to the current pointer position. This was agreed in Seattle, although I don't remember all the detailed arguments offhand. Maybe the meeting minutes are illuminating?

I missed the Seattle F2F but I'll check the meeting minutes.

From the local end, relative coordinates are easier to use as it allows constructs that target specific points within an element of known size without an additional call to figure out the coordinate (eg. drag this element to 10px from the centre of this other one) This is even more useful if there's some animation as the actions are being executed, causing elements to move. 

For a remote end implementer, relative coordinates are hopefully low-overhead provided the current input state is tracked. You obviously have more context than I do about that, though. 

Simon

Received on Sunday, 8 January 2017 09:27:13 UTC