Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /pointerevents/pointerevent_bubble_mousedown_mouseup_different_target.html - WPT Dashboard Interop Dashboard
<!doctype html>
<html>
<head>
<title>PointerEvent: Events still bubble to ancestors with mousedown causes mouseup to be a different target</title>
<meta name="viewport" content="width=device-width">
<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>
<style>
#wrapper {
display: none;
}
#parent {
width: 100px;
height: 100px;
background-color: green;
}
button {
width: 200px;
height: 200px;
}
</style>
</head>
<body>
<div id="parent">
<div id="wrapper">
<button>click me</button>
</div>
</div>
<script>
promise_test(function() {
const parentClickedPromise = new Promise(r => {
document.getElementById("parent").addEventListener("click", r);
});
document.getElementById("parent").addEventListener("mousedown", function() {
document.getElementById("wrapper").style.display = "block";
});
const click = test_driver.click(document.getElementById("parent"));
return Promise.all([click, parentClickedPromise]);
})
</script>
</body>