Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<head>
<title>Test dragging still occurs when mousedown moves the inner element</title>
</head>
<body>
<div id="element" draggable="true" style="width: 40px; height: 40px; background-color:red;">
<div id="inner" style="width: 30px; height: 30px; background-color:black;"></div>
</div>
<div id="element2"></div>
<script>
promise_test(function() {
return new Promise(r => {
element.addEventListener("dragstart", function(e) {
assert_equals(e.target, element);
r();
});
element.addEventListener("mousedown", function() {
element2.appendChild(inner);
});
new test_driver.Actions()
.pointerMove(0, 0, {origin: inner})
.pointerDown()
.pointerMove(10, 10, {origin:inner})
.pointerUp()
.send();
});
}, "dragstart should still fire when the mousedown event moves the inner element around");
</script>
</body>
</html>