Closed whimboo closed 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
@whimboo could you please link the test you used that demonstrates the difference?
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).
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
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 reports0.5
in Firefox1
is reported because it's getting set here.As such a default value would be good to have.
CC @jgraham