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•4 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•4 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•4 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•4 years ago
|
Assignee | ||
Comment 4•4 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•4 years ago
|
||
Assignee | ||
Comment 6•4 years ago
|
||
Depends on D93294
Assignee | ||
Comment 7•4 years ago
|
||
Depends on D93295
Assignee | ||
Comment 8•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 9•4 years ago
|
||
Comment 10•4 years ago
|
||
Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a28ad4aebb13 Part 1: setPointerCapture shoult not make a draggable element to be undraggable; r=smaug https://hg.mozilla.org/integration/autoland/rev/6bc4e4281e96 Part 2: Add test for setPointerCapture on mousedown event; r=smaug https://hg.mozilla.org/integration/autoland/rev/3150ac63c05e Part 3: Wrap manual wpt pointerevent_drag_interaction-manual.html into mochitest test; r=smaug
Comment 11•4 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•4 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•4 years ago
|
||
Comment 14•4 years ago
|
||
Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2f8c365d9b8d Part 1: setPointerCapture shoult not make a draggable element to be undraggable; r=smaug https://hg.mozilla.org/integration/autoland/rev/c93bfc007e3c Part 2: Add test for setPointerCapture on mousedown event; r=smaug https://hg.mozilla.org/integration/autoland/rev/b7aa7ad24533 Part 3: Wrap manual wpt pointerevent_drag_interaction-manual.html into mochitest test; r=smaug
Comment 15•4 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
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/26219 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Assignee | ||
Updated•4 years ago
|
Description
•