Paste button for clipboard.readText() doesn't showed on touched position on Windows
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox104 | --- | fixed |
People
(Reporter: edgar, Assigned: edgar)
References
Details
(Whiteboard: [fission:android:m2])
Attachments
(1 file)
STR:
a) Flipping the pref "dom.events.asyncClipboard.readText" to true.
b) Open https://jsfiddle.net/68hng59s/.
c) Touch the "X" button and check where a "Paste" button shows.
Expected:
Paste button is showed near the touched position.
Actually:
Paste buttons is showed near the last mouse position instead.
Assignee | ||
Comment 1•2 years ago
|
||
It is because nsIDOMWindowUtils.getLastOverWindowMouseLocationInCSSPixels
doesn't record the touch position in parent process.
And the recording of nsIDOMWindowUtils.getLastOverWindowMouseLocationInCSSPixels
rely on the synthesized mouse event for touch which is fired from APZ. Hi :botond, I am not sure whether it is expected that the synthesized mouse event for touch isn't fired on parent process, could you shed some light here? Thanks!
Assignee | ||
Comment 2•2 years ago
|
||
Even though synthesized mouse was fired on parent, this still might not be enough, because the synthesized mouse event is dispatched after touch and pointer event, the recorded position will not be accurate if clipboard.readText
is called from pointer/touch event handler. I think we could record the pointer event instead, which will be fired for all input (mouse, touch or pen).
Assignee | ||
Comment 3•2 years ago
|
||
Assignee | ||
Comment 4•2 years ago
|
||
Comment on attachment 9284592 [details]
Bug 1778486 - Use Pointer event to record last user input position; r=smaug
Hi Makoto, would you mind trying whether this patch fixes the issue you encounter in bug 1776843 comment# 7 on Android? Thanks!
Comment 5•2 years ago
|
||
Hi Makoto, would you mind trying whether this patch fixes the issue you encounter in bug 1776843 comment# 7 on Android? Thanks!
Yes, it works as expected.
Updated•2 years ago
|
Comment 6•2 years ago
|
||
(In reply to Edgar Chen [:edgar] (PTO 07/09 ~ 07/17) from comment #1)
Hi :botond, I am not sure whether it is expected that the synthesized mouse event for touch isn't fired on parent process, could you shed some light here? Thanks!
I believe this is expected. The mouse events are synthesized in the content process, and, as far as I know, we have not implemented a code path which dispatches them in the parent process (I guess we never needed one).
We could consider adding that, though it may introduce some latency (if we wait for the round-trip back from the parent process before the dispatching the event in the content) or some complexity / dealing with edge cases (if we dispatch in the content first and then the parent), so if your current patch fixes the bug. I would say let's not make changes to how the synthesized events work.
Comment 7•2 years ago
|
||
Makoto says Android Fission will need this touchevent fix.
Updated•2 years ago
|
Comment 9•2 years ago
|
||
Backed out for causing mochitest-crash failures on test_getLastOverWindowPointerLocationInCSSPixels.html.
[task 2022-07-20T15:38:11.571Z] 15:38:11 INFO - TEST-START | dom/base/test/test_getLastOverWindowPointerLocationInCSSPixels.html
[task 2022-07-20T15:38:11.575Z] 15:38:11 INFO - GECKO(2295) | [Parent 2295, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/chrome/nsChromeRegistry.cpp:180
[task 2022-07-20T15:38:11.575Z] 15:38:11 INFO - GECKO(2295) | [Parent 2295, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/dom/security/nsCSPService.cpp:190
[task 2022-07-20T15:38:11.586Z] 15:38:11 INFO - GECKO(2295) | [Parent 2295, Main Thread] WARNING: early callback, or time went backwards: '!aAllowIdleDispatch', file /builds/worker/checkouts/gecko/xpcom/threads/IdleTaskRunner.cpp:198
[task 2022-07-20T15:38:11.620Z] 15:38:11 INFO - GECKO(2295) | [Parent 2295, Main Thread] WARNING: Failed to retarget HTML data delivery to the parser thread.: file /builds/worker/checkouts/gecko/parser/html/nsHtml5StreamParser.cpp:1234
[task 2022-07-20T15:38:11.707Z] 15:38:11 INFO - GECKO(2295) | [Parent 2295, Main Thread] WARNING: early callback, or time went backwards: '!aAllowIdleDispatch', file /builds/worker/checkouts/gecko/xpcom/threads/IdleTaskRunner.cpp:198
[task 2022-07-20T15:38:11.735Z] 15:38:11 INFO - GECKO(2295) | WaitUntilApzStable: done promiseFocus
[task 2022-07-20T15:38:11.737Z] 15:38:11 INFO - GECKO(2295) | WaitUntilApzStable: done promiseAllPaintsDone
[task 2022-07-20T15:38:11.738Z] 15:38:11 INFO - GECKO(2295) | PromiseApzRepaintsFlushed: Flushing APZ repaints was a no-op, triggering callback directly...
[task 2022-07-20T15:38:11.739Z] 15:38:11 INFO - GECKO(2295) | PromiseApzRepaintsFlushed: APZ flush done
[task 2022-07-20T15:38:11.741Z] 15:38:11 INFO - GECKO(2295) | WaitUntilApzStable: all done
[task 2022-07-20T15:38:11.818Z] 15:38:11 INFO - GECKO(2295) | [Parent 2295, Main Thread] WARNING: early callback, or time went backwards: '!aAllowIdleDispatch', file /builds/worker/checkouts/gecko/xpcom/threads/IdleTaskRunner.cpp:198
<...>
[task 2022-07-20T15:38:12.090Z] 15:38:12 INFO - GECKO(2295) | [Parent 2295, Main Thread] WARNING: early callback, or time went backwards: '!aAllowIdleDispatch', file /builds/worker/checkouts/gecko/xpcom/threads/IdleTaskRunner.cpp:198
[task 2022-07-20T15:43:23.146Z] 15:43:23 INFO - TEST-INFO | started process screentopng
[task 2022-07-20T15:43:23.288Z] 15:43:23 INFO - TEST-INFO | screentopng: exit 0
[task 2022-07-20T15:43:23.290Z] 15:43:23 INFO - Buffered messages logged at 15:38:11
[task 2022-07-20T15:43:23.292Z] 15:43:23 INFO - add_task | Entering test init
[task 2022-07-20T15:43:23.293Z] 15:43:23 INFO - add_task | Leaving test init
[task 2022-07-20T15:43:23.294Z] 15:43:23 INFO - add_task | Entering test test_mouse
[task 2022-07-20T15:43:23.294Z] 15:43:23 INFO - TEST-PASS | dom/base/test/test_getLastOverWindowPointerLocationInCSSPixels.html | check last pointer location
[task 2022-07-20T15:43:23.295Z] 15:43:23 INFO - add_task | Leaving test test_mouse
[task 2022-07-20T15:43:23.296Z] 15:43:23 INFO - add_task | Entering test test_touch
[task 2022-07-20T15:43:23.296Z] 15:43:23 INFO - Buffered messages finished
[task 2022-07-20T15:43:23.297Z] 15:43:23 INFO - TEST-UNEXPECTED-FAIL | dom/base/test/test_getLastOverWindowPointerLocationInCSSPixels.html | Test timed out. -
[task 2022-07-20T15:43:24.149Z] 15:43:24 INFO - GECKO(2295) | MEMORY STAT | vsize 3072MB | residentFast 407MB | heapAllocated 160MB
[task 2022-07-20T15:43:24.155Z] 15:43:24 INFO - TEST-OK | dom/base/test/test_getLastOverWindowPointerLocationInCSSPixels.html | took 312583ms
[task 2022-07-20T15:43:24.162Z] 15:43:24 INFO - GECKO(2295) | [Parent 2295, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/chrome/nsChromeRegistry.cpp:180
[task 2022-07-20T15:43:24.164Z] 15:43:24 INFO - GECKO(2295) | [Parent 2295, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/dom/security/nsCSPService.cpp:190
[task 2022-07-20T15:43:24.203Z] 15:43:24 INFO - GECKO(2295) | [Parent 2295, Main Thread] WARNING: Failed to retarget HTML data delivery to the parser thread.: file /builds/worker/checkouts/gecko/parser/html/nsHtml5StreamParser.cpp:1234
[task 2022-07-20T15:43:24.245Z] 15:43:24 INFO - TEST-START | dom/base/test/test_messagemanager_send_principal.html
Assignee | ||
Updated•2 years ago
|
Comment 10•2 years ago
|
||
Comment 11•2 years ago
|
||
Assignee | ||
Comment 12•2 years ago
|
||
Comment 13•2 years ago
|
||
Comment 14•2 years ago
|
||
bugherder |
Description
•