Closed Bug 1669673 Opened 4 years ago Closed 4 years ago

element.setPointerCapture should not make a draggable element to be undraggable

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

RESOLVED FIXED
84 Branch
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.

(In reply to Edgar Chen [:edgar] from comment #0)

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.

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.

File https://github.com/w3c/pointerevents/issues/338. I plan to fix mousedown case, to make it behave consistent with others.

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.

Summary: Should element.setPointerCapture make a draggable element to be undraggable? → element.setPointerCapture shoult not make a draggable element to be undraggable

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: nobody → echen
Status: NEW → ASSIGNED
Attachment #9181170 - Attachment description: Bug 1669673 - Part 3: Add test for setPointerCapture on mousedown event; → Bug 1669673 - Part 2: Add test for setPointerCapture on mousedown event;
Attachment #9181169 - Attachment description: Bug 1669673 - Part 2: Convert wpt pointerevent_drag_interaction-manual.html to an automatic test by using testdriver; → Bug 1669673 - Part 3: Wrap manual wpt pointerevent_drag_interaction-manual.html into mochitest test;
Blocks: 822898
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

Backed out 3 changesets (bug 1669673) for test_pointerevent_drag_interaction-manual.html failures.

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&selectedTaskRun=EZcNzpr7TxmGeVH9hKIlwQ.0&fromchange=3150ac63c05e1b07cd41931dc935643a860f480f&tochange=bf559699af4912bcccf7520d7cf895c611cd70c8&searchStr=android%2Cmochitest

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
Flags: needinfo?(echen)
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
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
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
Summary: element.setPointerCapture shoult not make a draggable element to be undraggable → element.setPointerCapture should not make a draggable element to be undraggable
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: