element.setPointerCapture should not make a draggable element to be undraggable
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox84 | --- | fixed |
People
(Reporter: edgar, Assigned: edgar)
References
Details
Attachments
(3 files)
Gecko seems intent to do that, https://searchfox.org/mozilla-central/rev/1a973762afcbc5066f73f1508b0c846872fe3952/dom/events/PointerEventHandler.cpp#126? But it doesn't do what it intends to do, because the CapturFlag would not be reset correctly, given the sCapturingContentInfo.mAllowed
is true
only during processing mousedown event, https://searchfox.org/mozilla-central/rev/1a973762afcbc5066f73f1508b0c846872fe3952/layout/base/PresShell.cpp#8060.
Chrome and safari doesn't do that, and I also did not find spec mention that we need to make draggable element to be undraggable.
Assignee | ||
Comment 1•5 years ago
|
||
(In reply to Edgar Chen [:edgar] from comment #0)
because the CapturFlag would not be reset correctly, given the
sCapturingContentInfo.mAllowed
istrue
only during processing mousedown event, https://searchfox.org/mozilla-central/rev/1a973762afcbc5066f73f1508b0c846872fe3952/layout/base/PresShell.cpp#8060.
So if we set pointer capture in mousedown
handler, then we will make the draggable element to be undraggable, for example, https://codepen.io/edgarchen-the-decoder/pen/ZEOGmLP.
Assignee | ||
Comment 2•5 years ago
|
||
File https://github.com/w3c/pointerevents/issues/338. I plan to fix mousedown
case, to make it behave consistent with others.
Assignee | ||
Comment 3•5 years ago
•
|
||
There is a manual wpt test for drag interaction, https://github.com/web-platform-tests/wpt/blob/07eb92b7cd5b99e80f949a91ff93a8cf57b85cd2/pointerevents/html/pointerevent_drag_interaction-manual.html. I could try to convert it to an automatic test by using webdriver.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
•
|
||
Spec do define the behavior in https://w3c.github.io/pointerevents/#the-pointercancel-event: we should not make a draggable element to be undraggable.
Assignee | ||
Comment 5•5 years ago
|
||
Assignee | ||
Comment 6•5 years ago
|
||
Depends on D93294
Assignee | ||
Comment 7•5 years ago
|
||
Depends on D93295
Assignee | ||
Comment 8•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 9•5 years ago
|
||
Comment 10•5 years ago
|
||
Comment 11•5 years ago
•
|
||
Backed out 3 changesets (bug 1669673) for test_pointerevent_drag_interaction-manual.html failures.
Backout link: https://hg.mozilla.org/integration/autoland/rev/bf559699af4912bcccf7520d7cf895c611cd70c8
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=318843044&repo=autoland&lineNumber=3696
[task 2020-10-16T14:53:50.993Z] 14:53:50 INFO - 1826 INFO TEST-START | dom/events/test/pointerevents/test_pointerevent_drag_interaction-manual.html
[task 2020-10-16T14:53:50.993Z] 14:53:50 INFO - 1827 INFO executeTest
[task 2020-10-16T14:53:50.993Z] 14:53:50 INFO - 1828 INFO TEST-PASS | dom/events/test/pointerevents/test_pointerevent_drag_interaction-manual.html | Mismatched event.pointerId recieved. (Get: 7, Expect: 7)
[task 2020-10-16T14:53:50.993Z] 14:53:50 INFO - 1829 INFO TEST-PASS | dom/events/test/pointerevents/test_pointerevent_drag_interaction-manual.html | Mismatched event.pointerId recieved. (Get: 7, Expect: 7)
[task 2020-10-16T14:53:50.994Z] 14:53:50 INFO - 1830 INFO TEST-PASS | dom/events/test/pointerevents/test_pointerevent_drag_interaction-manual.html | Mismatched event.pointerId recieved. (Get: 7, Expect: 7)
[task 2020-10-16T14:53:50.994Z] 14:53:50 INFO - 1831 INFO TEST-PASS | dom/events/test/pointerevents/test_pointerevent_drag_interaction-manual.html | Mismatched event.pointerId recieved. (Get: 7, Expect: 7)
[task 2020-10-16T14:53:50.994Z] 14:53:50 INFO - 1832 INFO TEST-PASS | dom/events/test/pointerevents/test_pointerevent_drag_interaction-manual.html | Mismatched event.pointerId recieved. (Get: 7, Expect: 7)
[task 2020-10-16T14:59:04.699Z] 14:59:04 WARNING - 1833 INFO TEST-UNEXPECTED-FAIL | dom/events/test/pointerevents/test_pointerevent_drag_interaction-manual.html | Test timed out.
[task 2020-10-16T14:59:04.699Z] 14:59:04 INFO - SimpleTest.ok@SimpleTest/SimpleTest.js:417:16
[task 2020-10-16T14:59:04.699Z] 14:59:04 INFO - reportError@SimpleTest/TestRunner.js:143:22
[task 2020-10-16T14:59:04.700Z] 14:59:04 INFO - TestRunner._checkForHangs@SimpleTest/TestRunner.js:165:18
[task 2020-10-16T14:59:04.700Z] 14:59:04 INFO - 1834 INFO TEST-OK | dom/events/test/pointerevents/test_pointerevent_drag_interaction-manual.html | took 317782ms
Assignee | ||
Comment 12•5 years ago
•
|
||
Okay, it is because android has a larger drag threshold, see https://searchfox.org/mozilla-central/rev/819be4899a92213abf121b449779ced662f2ce13/mobile/android/app/mobile.js#378-381.
Assignee | ||
Comment 13•5 years ago
|
||
Comment 14•5 years ago
|
||
Comment 15•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2f8c365d9b8d
https://hg.mozilla.org/mozilla-central/rev/c93bfc007e3c
https://hg.mozilla.org/mozilla-central/rev/b7aa7ad24533
Assignee | ||
Updated•5 years ago
|
Description
•