w3c / webdriver-bidi

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

Define a default value for "width" and "height" on pointer input sources #646

Closed whimboo closed 5 months ago

whimboo commented 5 months ago

There is currently a discrepancy between Chrome and Firefox which results in different radius values for x and y for the touch related events as fired by the browser. While Chrome reports 0.5 in Firefox 1 is reported because it's getting set here.

As such a default value would be good to have.

CC @jgraham

whimboo commented 5 months ago

In WebDriver BiDi we actually have the default set to 1 in the input.PointerCommonProperties type definition. I think that this satisfies the need here.

Not sure why Chrome uses 0.5 but maybe it does it on HiRes devices? We should figure out what to do in case of emulating the device pixel ratio.

CC @OrKoN @sadym-chromium

OrKoN commented 5 months ago

@whimboo could you please link the test you used that demonstrates the difference?

whimboo commented 5 months ago

Sure it's https://github.com/puppeteer/puppeteer/blob/b53de4e0942e93cbc5a5dd7a46b59bab56f06c92/test/src/touchscreen.spec.ts#L40. The other test in this file fails because no click event is sent (but that's a different issue).

jrandolf commented 5 months ago

We already have a default set to 1 for width and height. Firefox is incorrectly implementing the radiusX and radiusY; in particular, the radius is half the diameter which in this case is 1, so the radiusX and radiusY should be 0.5