| <!doctype html> |
| <meta charset="utf-8"> |
| <title>Dragging on a text-selectable canvas should not select it</title> |
| <link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez"> |
| <link rel="author" href="https://mozilla.com" title="Mozilla"> |
| <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1969829"> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script src="/resources/testdriver.js"></script> |
| <script src="/resources/testdriver-actions.js"></script> |
| <script src="/resources/testdriver-vendor.js"></script> |
| <style> |
| canvas { |
| outline: 2px solid hotpink; |
| background-color: green; |
| width: 200px; |
| height: 200px; |
| } |
| </style> |
| Dragging across the green square should not select it.<br> |
| <canvas></canvas> |
| <script> |
| promise_test(async function() { |
| let canvas = document.querySelector("canvas"); |
| let rect = canvas.getBoundingClientRect(); |
| await new test_driver.Actions() |
| .pointerMove(rect.left + 2, rect.top + 2) |
| .pointerDown() |
| .pointerMove(rect.right - 2, rect.top + 2) |
| .pointerUp() |
| .send(); |
| assert_true(getSelection().isCollapsed, "Dragging a canvas shouldn't generate a non-collapsed selection"); |
| }); |
| </script> |