https://github.com/web-platform-tests/wpt
Revision cf94be3b1a0f78b0ecb5e812ecc81f9d5f561cef authored by Eric Willigers on 03 October 2017, 02:38:14 UTC, committed by Chromium WPT Sync on 03 October 2017, 02:38:14 UTC
The length of the ray depends on the distance from offset-position
to the boundary of the containing box.

Spec:
https://drafts.fxtf.org/motion-1/#valdef-offsetpath-ray

BUG=641245

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I05157521c98b50fc3816932045a13f6b0eefc9f0
1 parent 85a1716
Raw File
Tip revision: cf94be3b1a0f78b0ecb5e812ecc81f9d5f561cef authored by Eric Willigers on 03 October 2017, 02:38:14 UTC
CSS Motion Path: support <size> for ray paths
Tip revision: cf94be3
pointerlock_leave_UA-manual.html
<!DOCTYPE html>
<html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name='flags' content='interact'>
<meta name="timeout" content="long">
<style type="text/css">
    button {
        color: blue;
    }

    #target-wrap {
        position: relative;
        background-color: lightgrey;
        width: 200px;
        height: 100px;
        border: grey 1px solid;
    }

    #target {
        position: relative;
        background-color: lightyellow;
        width: 100px;
        height: 30px;
        border: yellow 1px solid;
    }

    #status-log {
        margin: 10px 0;
        color: green;
    }
</style>
</head>
<body>
    <h2>Description</h2>
    <p>This test validates that pointer lock will be lost the user agent / window loses focus.</p>
    <hr/>

    <h2>Manual Test Steps:</h2>
    <p>
        <ol>
            <li>Click the "lockTarget" button to request a pointer lock.</li>
            <li>Focus to another window with keyboard (ALT-TAB).</li>
            <li>Test is done.</li>
        </ol>
    </p>
    <hr/>

    <button onclick="lockTarget();">lockTarget</button>

    <div id="target-wrap">
        <div id="status-log">Click the "lockTarget" button.</div>
        <div id="target">Target</div>
    </div>
    <hr/>

    <div id="log"></div>

    <script type="text/javascript" >
        var target = document.querySelector('#target'),
            status_log = document.querySelector('#status-log');

        var leaveUATest = async_test("Test that pointer lock will be lost when the user agent / window loses focus.");

    document.addEventListener("pointerlockchange", function() {
        if(document.pointerLockElement) {
            status_log.innerHTML = "Please leave the current window.";
        } else {
            status_log.innerHTML = "Pointer lock exited!";

            leaveUATest.step(function() {
                assert_true(document.pointerLockElement === null, "Pointer lock exited!");
            });

            leaveUATest.done();
        }
    });

    function lockTarget() {
        target.requestPointerLock();
    }
    </script>
    </body>
</html>
back to top