Bug 1848957 Comment 11 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I had a look into performing actions within the parent process. Overall I had some difficulty to convert the relevant positions for mouse and scroll events to screen coordinates. But with [`LayoutUtils.sys.mjs`](https://searchfox.org/mozilla-central/source/toolkit/modules/LayoutUtils.sys.mjs) this was actually not that hard. At least it works now for DPR settings of `1`, but still fails on HiRes displays.

While I was happy that everything works I missed to also check for the key actions, and adding tests for those last I was faced with an error from EventUtils.sys.mjs:

```
ERROR _a/test_minimized.py TestMinimizedTestCase.test_actions - marionette_driver.errors.UnknownException: [Exception... "Failure arg 0 [nsITextInputProcessor.beginInputTransactionForTests]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://remote/content/external/EventUtils.js :: _getTIP :: line 1955"  data: no]
stacktrace:
```

I assume that [`beginInputTransactionForTests()` is not meant to work from Chrome scope](https://searchfox.org/mozilla-central/rev/e7b8d13b7513b6fbd97d69e882d7faeed05309d0/dom/base/TextInputProcessor.cpp#339)? In that case we probably would have to send key events still via the content process and need a special check to circumvent the `Cu.isInAutomation` check. If we cannot change that, or not short term I will have to keep using content process dispatching for now by using extra checks in the IPC code.

Masayuki, could you please share some further information given that you might know most from that area. Thanks.
I had a look into performing actions within the parent process. Overall I had some difficulty to convert the relevant positions for mouse and scroll events to screen coordinates. But with [`LayoutUtils.sys.mjs`](https://searchfox.org/mozilla-central/source/toolkit/modules/LayoutUtils.sys.mjs) this was actually not that hard. At least it works now for DPR settings of `1`, but still fails on HiRes displays.

While I was happy that everything works I missed to also check for the key actions, and adding tests for those last I was faced with an error from EventUtils.sys.mjs:

```
[Exception... "Failure arg 0 [nsITextInputProcessor.beginInputTransactionForTests]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://remote/content/external/EventUtils.js :: _getTIP :: line 1955"  data: no]
stacktrace:
```

I assume that [`beginInputTransactionForTests()` is not meant to work from Chrome scope](https://searchfox.org/mozilla-central/rev/e7b8d13b7513b6fbd97d69e882d7faeed05309d0/dom/base/TextInputProcessor.cpp#339)? In that case we probably would have to send key events still via the content process and need a special check to circumvent the `Cu.isInAutomation` check. If we cannot change that, or not short term I will have to keep using content process dispatching for now by using extra checks in the IPC code.

Masayuki, could you please share some further information given that you might know most from that area. Thanks.
I had a look into performing actions within the parent process. Overall I had some difficulty to convert the relevant positions for mouse and scroll events to screen coordinates. But with [`LayoutUtils.sys.mjs`](https://searchfox.org/mozilla-central/source/toolkit/modules/LayoutUtils.sys.mjs) this was actually not that hard. At least it works now for DPR settings of `1`, but still fails on HiRes displays.

While I was happy that everything works I missed to also check for the key actions, and adding tests for those last I was faced with an error from EventUtils.sys.mjs:

> [Exception... "Failure arg 0 [nsITextInputProcessor.beginInputTransactionForTests]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://remote/content/external/EventUtils.js :: _getTIP :: line 1955"  data: no]
stacktrace:

I assume that [`beginInputTransactionForTests()` is not meant to work from Chrome scope](https://searchfox.org/mozilla-central/rev/e7b8d13b7513b6fbd97d69e882d7faeed05309d0/dom/base/TextInputProcessor.cpp#339)? In that case we probably would have to send key events still via the content process and need a special check to circumvent the `Cu.isInAutomation` check. If we cannot change that, or not short term I will have to keep using content process dispatching for now by using extra checks in the IPC code.

Masayuki, could you please share some further information given that you might know most from that area. Thanks.

Back to Bug 1848957 Comment 11