зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1488877 [wpt PR 12853] - Send pointerrawmove when in pointerlock, a=testonly
Automatic update from web-platform-testsSend pointerrawmove when in pointerlock Unify the path for sending pointerrawmove in pointerlock mode with the normal event processing path. Bug: 880524 Change-Id: I021261e0107b6172da02684cf82e0f46df304eba Reviewed-on: https://chromium-review.googlesource.com/1205476 Reviewed-by: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Ella Ge <eirage@chromium.org> Reviewed-by: Mustaq Ahmed <mustaq@chromium.org> Commit-Queue: Navid Zolghadr <nzolghadr@chromium.org> Cr-Commit-Position: refs/heads/master@{#591347} -- wpt-commits: d38e236415083a25b4c4fbcedd9bd3b191553fb8 wpt-pr: 12853
This commit is contained in:
Родитель
5ea66aed74
Коммит
c7d85a221c
|
@ -13585,6 +13585,12 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"pointerevents/extension/pointerevent_pointerrawmove_in_pointerlock-manual.html": [
|
||||
[
|
||||
"/pointerevents/extension/pointerevent_pointerrawmove_in_pointerlock-manual.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"pointerevents/extension/pointerevent_touch-action-pan-down-css_touch-manual.html": [
|
||||
[
|
||||
"/pointerevents/extension/pointerevent_touch-action-pan-down-css_touch-manual.html",
|
||||
|
@ -295599,6 +295605,11 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"pointerevents/resources/pointerevent_pointerrawmove_in_pointerlock-iframe.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"pointerlock/META.yml": [
|
||||
[
|
||||
{}
|
||||
|
@ -630666,6 +630677,10 @@
|
|||
"0c4ccf9ad48d49c62b3d138845dfa3ac631a8e4e",
|
||||
"manual"
|
||||
],
|
||||
"pointerevents/extension/pointerevent_pointerrawmove_in_pointerlock-manual.html": [
|
||||
"30fff15bd92f536de826b7ef98419b6a30284d41",
|
||||
"manual"
|
||||
],
|
||||
"pointerevents/extension/pointerevent_touch-action-pan-down-css_touch-manual.html": [
|
||||
"592139f9f41abb2a3fe6bf1b99af87d1c5e651f3",
|
||||
"manual"
|
||||
|
@ -631002,6 +631017,10 @@
|
|||
"ab33560b35216ea0976d1c037650122d9336ae39",
|
||||
"support"
|
||||
],
|
||||
"pointerevents/resources/pointerevent_pointerrawmove_in_pointerlock-iframe.html": [
|
||||
"505fc2cae40b80612fdd67ba98918aafad2f1b0a",
|
||||
"support"
|
||||
],
|
||||
"pointerlock/META.yml": [
|
||||
"bb639b4417ef4975e0f5a1649d010f6a7565e87c",
|
||||
"support"
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>pointerrawmove</title>
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="stylesheet" type="text/css" href="../pointerevent_styles.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<!-- Additional helper script for common checks across event types -->
|
||||
<script type="text/javascript" src="../pointerevent_support.js"></script>
|
||||
</head>
|
||||
<body onload="run()">
|
||||
<h2>pointerrawmove</h2>
|
||||
<h4>Test Description: This test checks if pointerrawmove is dispatched correctly while in pointerlock mode. </h4>
|
||||
<p>Click in the box (and accept the pointerlock permission if asked).</p>
|
||||
<p>Move your mouse.</p>
|
||||
<div id="target0"></div>
|
||||
<iframe id="innerframe" src="../resources/pointerevent_pointerrawmove_in_pointerlock-iframe.html"></iframe>
|
||||
<script>
|
||||
window.name="outerframe";
|
||||
var test_pointerrawmove = async_test("pointerrawmove event received");
|
||||
|
||||
var outerframe_pointerrawmoveReceived = false;
|
||||
var innerframe_pointerrawmoveReceived = false;
|
||||
|
||||
function run() {
|
||||
var target0 = document.getElementById("target0");
|
||||
var innerframe = document.getElementById('innerframe');
|
||||
var target1 = innerframe.contentDocument.getElementById('target1');
|
||||
innerframe.contentWindow.name = "innerframe";
|
||||
|
||||
on_event(document, "pointerlockchange", function(event) {
|
||||
if (document.pointerLockElement == target0) {
|
||||
on_event(target0, "pointerrawmove", function (event) {
|
||||
outerframe_pointerrawmoveReceived = true;
|
||||
test_pointerrawmove.step(function() {
|
||||
assert_equals(event.view.name, "outerframe", "View attribute of pointerrawmove should be the target frame.");
|
||||
}, "View attribute of pointerrawmove should be the target frame.");
|
||||
});
|
||||
on_event(target0, "pointermove", function (event) {
|
||||
test_pointerrawmove.step(function() {
|
||||
assert_true(outerframe_pointerrawmoveReceived,
|
||||
"Pointerrawmove event should have been received before pointermove while in pointerlock mode.");
|
||||
assert_equals(event.view.name, "outerframe", "View attribute of pointerrawmove should be the target frame.");
|
||||
}, "Pointerrawmove event should have been received before pointermove while in pointerlock mode.");
|
||||
document.exitPointerLock();
|
||||
|
||||
on_event(target1, "click", function(event) {
|
||||
target1.requestPointerLock();
|
||||
});
|
||||
|
||||
on_event(innerframe.contentDocument, "pointerlockchange", function(event) {
|
||||
if (innerframe.contentDocument.pointerLockElement == target1) {
|
||||
on_event(target1, "pointerrawmove", function (event) {
|
||||
innerframe_pointerrawmoveReceived = true;
|
||||
test_pointerrawmove.step(function() {
|
||||
assert_equals(event.view.name, "innerframe", "View attribute of pointerrawmove should be the target frame.");
|
||||
}, "View attribute of pointerrawmove should be the target frame.");
|
||||
});
|
||||
on_event(target1, "pointermove", function (event) {
|
||||
test_pointerrawmove.step(function() {
|
||||
assert_true(innerframe_pointerrawmoveReceived,
|
||||
"Pointerrawmove event should have been received before pointermove while in pointerlock mode.");
|
||||
}, "Pointerrawmove event should have been received before pointermove while in pointerlock mode.");
|
||||
innerframe.contentDocument.exitPointerLock();
|
||||
test_pointerrawmove.done();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
on_event(target0, "click", function(event) {
|
||||
target0.requestPointerLock();
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<div id="complete-notice">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,10 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="stylesheet" type="text/css" href="../pointerevent_styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="target1"></div>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче