[puppeteer] Specifying only "altitudeAngle" for synthesized touch event causes a NS_ERROR_ILLEGAL_VALUE error
Categories
(Remote Protocol :: WebDriver BiDi, defect, P3)
Tracking
(firefox151 fixed)
| Tracking | Status | |
|---|---|---|
| firefox151 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
()
Details
(Whiteboard: [webdriver:m19])
Attachments
(1 file)
Platform support for both of these parameters was added on bug 2013990. When adding support for them to WebDriver I noticed that some Puppeteer tests are failing with the following error when only one of both parameters is set:
[task 2026-03-12T16:25:01.875+00:00] PID 336 | 1773332701875 RemoteAgent DEBUG WebDriverBiDiConnection 73b48b0c-1e44-4ff5-8016-c2605e723d92 -> {"id":3336,"method":"input.performActions","params":{"context":"b9176558-29c0-49b2-a481-1da72b8e18fe","actions":[{"type":"pointer","id":"__puppeteer_finger_1","parameters":{"pointerType":"touch"},"actions":[{"type":"pointerMove","x":105,"y":75},{"width":1,"height":1,"pressure":0.5,"altitudeAngle":1.5707963267948966,"type":"pointerDown","button":0}]}]}}
[task 2026-03-12T16:25:01.875+00:00] PID 336 | 1773332701875 RemoteAgent TRACE Received command input.performActions for destination ROOT
[task 2026-03-12T16:25:01.875+00:00] PID 336 | 1773332701875 RemoteAgent TRACE Dispatching tick 1/2
[task 2026-03-12T16:25:01.875+00:00] PID 336 | 1773332701875 RemoteAgent DEBUG Grouping action pointer __puppeteer_finger_1 pointerMove
[task 2026-03-12T16:25:01.875+00:00] PID 336 | 1773332701875 RemoteAgent TRACE Dispatch PointerMoveTouchActionGroup with
[task 2026-03-12T16:25:01.876+00:00] PID 336 | 1773332701875 RemoteAgent TRACE Received command input._assertInViewPort for destination WINDOW_GLOBAL
[task 2026-03-12T16:25:01.878+00:00] PID 336 | 1773332701878 RemoteAgent TRACE moveOverTime start: 0,0 target: 105,75 duration: 0
[task 2026-03-12T16:25:01.879+00:00] PID 336 | 1773332701879 RemoteAgent TRACE Received command input._dispatchEvent for destination WINDOW_GLOBAL
[task 2026-03-12T16:25:01.884+00:00] PID 336 | 1773332701883 RemoteAgent TRACE Dispatching tick 2/2
[task 2026-03-12T16:25:01.884+00:00] PID 336 | 1773332701883 RemoteAgent DEBUG Grouping action pointer __puppeteer_finger_1 pointerDown
[task 2026-03-12T16:25:01.884+00:00] PID 336 | 1773332701883 RemoteAgent TRACE Dispatch PointerDownTouchActionGroup with __puppeteer_finger_1
[task 2026-03-12T16:25:01.884+00:00] PID 336 | 1773332701884 RemoteAgent TRACE Received command input._dispatchEvent for destination WINDOW_GLOBAL
[task 2026-03-12T16:25:01.884+00:00] PID 336 | 1773332701884 RemoteAgent DEBUG WebDriverBiDiConnection 73b48b0c-1e44-4ff5-8016-c2605e723d92 <- {"type":"error","id":3336,"error":"unknown error","message":"[Exception... \"(null)\" nsresult: \"0x80070057 (NS_ERROR_ILLEGAL_VALUE)\" location: \"JS frame :: chrome://remote/content/external/EventUtils.js :: synthesizeTouchAtPoint :: line 1082\" data: no]","stacktrace":"synthesizeTouchAtPoint@chrome://remote/content/external/EventUtils.js:1082:35\nevent.synthesizeMultiTouch@chrome://remote/cont ... eiveMessage@chrome://remote/content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameChild.sys.mjs:78:37\n"}
[task 2026-03-12T16:25:01.894+00:00] TEST-UNEXPECTED-FAIL | ElementHandle specs ElementHandle.touchStart should work (elementhandle.spec.js) | expected PASS
[task 2026-03-12T16:25:01.894+00:00] TEST-INFO took 307ms
[task 2026-03-12T16:25:01.894+00:00] PID 336 | ["fail",{"title":"should work","fullTitle":"ElementHandle specs ElementHandle.touchStart should work","file":"/builds/worker/checkouts/gecko/remote/test/puppeteer/test/build/elementhandle.spec.js","duration":298,"currentRetry":0,"err":"Protocol error (input.performActions): unknown error [Exception... \"(null)\" nsresult: \"0x80070057 (NS_ERROR_ILLEGAL_VALUE)\" location: \"JS frame :: chrome://remote/content/external/EventUtils.js :: synthesizeTouchAtPoint :: line 1082\" data: no] synthesizeTouchAtPoint@chrome://remote/content/external/EventUtils.js:1082:35\nevent.synthesizeMultiTouch@chrome://remote/content/shared/webdriver/Event.sys.mjs:156:23\n_dispatchEvent@chrome://remote/content/webdriver-bidi/modules/windowglobal/input.sys.mjs:242:22\nhandleCommand@chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs:285:33\nreceiveMessage@chrome://remote/content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameChild.sys.mjs:78:37\n","stack":"ProtocolError: Protocol error (input.performActions): unknown error [Exception... \"(null)\" nsresult: \"0x80070057 (NS_ERROR_ILLEGAL_VALUE)\" location: \"JS frame :: chrome://remote/content/external/EventUtils.js :: synthesizeTouchAtPoint :: line 1082\" data: no] synthesizeTouchAtPoint@chrome://remote/content/external/EventUtils.js:1082:35\nevent.synthesizeMultiTouch@chrome://remote/content/shared/webdriver/Event.sys.mjs:156:23\n_dispatchEvent@chrome://remote/content/webdriver-bidi/modules/windowglobal/input.sys.mjs:242:22\nhandleCommand@chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs:285:33\nreceiveMessage@chrome://remote/content/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameChild.sys.mjs:78:37\n\n at Callback.<instance_members_initializer> (file:///builds/worker/checkouts/gecko/remote/test/puppeteer/packages/puppeteer-core/src/common/CallbackRegistry.ts:129:12)\n at new Callback (file:///builds/worker/checkouts/gecko/remote/test/puppeteer/packages/puppeteer-core/src/common/CallbackRegistry.ts:134:3)\n at CallbackRegistry.create (file:///builds/worker/checkouts/gecko/remote/test/puppeteer/packages/puppeteer-core/src/common/CallbackRegistry.ts:32:22)\n at BidiConnection.send (file:///builds/worker/checkouts/gecko/remote/test/puppeteer/packages/puppeteer-core/src/bidi/Connection.ts:128:28)\n at Session.send (file:///builds/worker/checkouts/gecko/remote/test/puppeteer/packages/puppeteer-core/src/bidi/core/Session.ts:111:34)\n at Session.<anonymous> (file:///builds/worker/checkouts/gecko/remote/test/puppeteer/packages/puppeteer-core/src/util/decorators.ts:63:21)\n at BrowsingContext.performActions (file:///builds/worker/checkouts/gecko/remote/test/puppeteer/packages/puppeteer-core/src/bidi/core/BrowsingContext.ts:516:25)\n at BrowsingContext.<anonymous> (file:///builds/worker/checkouts/gecko/remote/test/puppeteer/packages/puppeteer-core/src/util/decorators.ts:63:21)\n at BidiTouchHandle.start (file:///builds/worker/checkouts/gecko/remote/test/puppeteer/packages/puppeteer-core/src/bidi/Input.ts:647:50)\n at BidiTouchscreen.touchStart (file:///builds/worker/checkouts/gecko/remote/test/puppeteer/packages/puppeteer-core/src/bidi/Input.ts:738:17)\n at BidiElementHandle.touchStart (file:///builds/worker/checkouts/gecko/remote/test/puppeteer/packages/puppeteer-core/src/api/ElementHandle.ts:1060:48)\n at BidiElementHandle.<anonymous> (file:///builds/worker/checkouts/gecko/remote/test/puppeteer/packages/puppeteer-core/src/api/ElementHandle.ts:149:20)\n at Context.<anonymous> (file:///builds/worker/checkouts/gecko/remote/test/puppeteer/test/src/elementhandle.spec.ts:433:7)"}]
It can easily be reproduced by calling this platform API directly via EventUtils.js. Given that both parameters have default values as defined in the pointerevents specification, we should use such default value instead of bailing out.
Edgar, would that make sense?
Comment 1•24 days ago
|
||
I guess it is from https://searchfox.org/firefox-main/rev/a86d8293217bbdc69abd541c9c7f8a4c6e227a8c/remote/test/puppeteer/packages/puppeteer-core/src/bidi/Input.ts#735.
Hmm, I think it is weird that only altitudeAngle is specified, it should always come with azimuthAngle in pair from system.
I look other place that specified altitudeAngle , most of them also specify azimuthAngle, e.g. https://searchfox.org/firefox-main/search?q=altitudeAngle%3A+&path=remote%2Ftest%2Fpuppeteer&case=false®exp=false.
Would it make sense that always specify them together which also matches with system behavior? Or maybe just leave them all undefined let platform to handle the default value if the test isn’t meant to verify the synthesized values?
| Comment hidden (Intermittent Failures Robot) |
| Assignee | ||
Comment 3•21 days ago
|
||
Edgar, I think that should work for Puppeteer but I would have to ask the maintainers first - maybe there is some reasoning for that.
As such a question to you for now. I do not see in the pointer-events specification that there is a requirement that both properties need to be specified. Given that there is a default value for both of them, should we fallback to that one instead of having an assertion?
Comment 4•21 days ago
|
||
The default value is used when
For hardware and platforms that do not report tilt or angle, the value MUST be 0"
per https://w3c.github.io/pointerevents/#converting-between-tiltx-tilty-and-altitudeangle-azimuthangle. My interpretation of the spec is that the default value is used when all angle and tilt values are missing. And also https://w3c.github.io/pointerevents/#converting-between-tiltx-tilty-and-altitudeangle-azimuthangle says
Depending on the specific hardware and platform, user agents will likely only receive one set of values for the transducer orientation relative to the screen plane — either tiltX / tiltY or altitudeAngle / azimuthAngle.
that also indicate the value should be shown in pair, which also make sense, otherwise we are in the situation that the angle is partially support, which I don't think it is a realistic case.
| Assignee | ||
Comment 5•21 days ago
|
||
(In reply to Edgar Chen [:edgar] from comment #4)
Depending on the specific hardware and platform, user agents will likely only receive one set of values for the transducer orientation relative to the screen plane — either tiltX / tiltY or altitudeAngle / azimuthAngle.
that also indicate the value should be shown in pair, which also make sense, otherwise we are in the situation that the angle is partially support, which I don't think it is a realistic case.
Ok, that makes sense. Thank you for the details. Let me propose the change to Puppeteer which seems to work pretty fine at least with Firefox:
https://treeherder.mozilla.org/jobs?repo=try&revision=cb63cddee7a1606dea6a89cd25ec0c3822b28ec1
| Assignee | ||
Comment 6•21 days ago
|
||
Moving back the bug to Remote Protocol which is closer to Puppeteer. I've created an upstream PR at https://github.com/puppeteer/puppeteer/pull/14781 and it works well for Chrome as well. So lets see if it is getting accepted. If yes, I'll provide a patch for our copy of Puppeteer as well.
| Assignee | ||
Updated•21 days ago
|
Updated•20 days ago
|
| Assignee | ||
Comment 7•14 days ago
|
||
The upstream PR got accepted and is merged now. I'll provide a patch for our vendored copy to move forward with bug 2022644.
| Assignee | ||
Comment 8•14 days ago
|
||
The upstream PR got accepted and is merged now. I'll provide a patch for our vendored copy to move forward with bug 2022644.
| Assignee | ||
Comment 9•14 days ago
|
||
Patch is up on Phabricator but there is a bug so it's not getting attached to the bug: https://phabricator.services.mozilla.com/D289193
| Assignee | ||
Comment 10•14 days ago
|
||
Comment 11•13 days ago
|
||
| Assignee | ||
Comment 13•13 days ago
|
||
The patch is fine but we need a fix for generating the puppeteer artifact that the job is fetching. Work for this is done on bug 2025846.
Comment 14•12 days ago
|
||
Comment 15•12 days ago
|
||
| bugherder | ||
Description
•