w3c / webdriver-bidi

Bidirectional WebDriver protocol for browser automation
https://w3c.github.io/webdriver-bidi/
336 stars 35 forks source link

Remove pointer event defaults #666

Open jrandolf opened 4 months ago

jrandolf commented 4 months ago

We enforce default pointer properties although the WebDriver spec does not specify any.


Preview | Diff

OrKoN commented 4 months ago

@jrandolf is it in the spec that the properties can be inferred? (could you please add a link)

jrandolf commented 4 months ago

@jrandolf is it in the spec that the properties can be inferred? (could you please add a link)

This is implementation-defined. See https://www.w3.org/TR/webdriver2/#dfn-dispatch-a-pointerdown-action

jgraham commented 4 months ago

The defaults match the defaults if you construct an event in the DOM API, per: https://www.w3.org/TR/pointerevents/#pointer-events-and-interfaces. I think that's what's intended by classic, and saying "this is just implementation defined" is not OK (authors should be able to depend on event properties being consistent between browsers for a given input).

jrandolf commented 4 months ago

https://www.w3.org/TR/pointerevents/#pointer-events-and-interfaces

The defaults don't really make sense for a lot of events. For example, for pointer, the default pressure is always 0.5 (try it on any browser)

jgraham commented 4 months ago

That seems like a reason to update those specs, rather than a reason to throw our hands up and say "implementation defined".

jrandolf commented 4 months ago

https://www.w3.org/TR/pointerevents/#pointer-events-and-interfaces

PointerEventInit is used for custom events built from the DOM. It does not reflect what is expected from the automation side. We could take your arguments and apply them to keyboard events and etc, but this wouldn't benefit an automation user. In particular, keyboard events, e.g., allow setting the ctrl state, but we know for automation they probably want to integrate with the browser state.

As an alternative, we can try to specify the defaults within WebDriver in detail. WDYT?