https://github.com/web-platform-tests/wpt
Raw File
Tip revision: e374afb5a85092671d65fd8e0906b14f50d264c8 authored by Emilio Cobos Álvarez on 11 April 2018, 13:24:18 UTC
Stop generating stylo expectations.
Tip revision: e374afb
pointerlock_remove_target_on_mouseup-manual.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Remove PointerLock target on mouseup</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<p>Click anywhere to run the test. If a "PASS" result appears the test passes, otherwise it fails</p>
<div id="target"></div>
<script>
async_test(t => {
    const target = document.getElementById('target');
    document.addEventListener('mousedown', t.step_func(() => {
        target.requestPointerLock();
        document.addEventListener('mouseup', t.step_func(() => {
            target.remove();
            assert_true(document.pointerLockElement === null, 'Pointer lock exited!');
            t.done();
        }));
    }));
})
</script>
back to top