Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for window.onmove #49390

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions css/cssom-view/onmove.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<meta charset=utf-8>
<title>window.onmove event handling</title>
<link rel="help" href="https://drafts.csswg.org/cssom-view/#moving-viewports">
<link rel="help" href="https://html.spec.whatwg.org/#windoweventhandlers">
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var t = async_test("windowOnMove");
function registerResult(success) {
t.step(function() {
assert_true(success, "Coordinates of a moved window should have changed");
});
t.done();
}
window.open("resources/onmove-child.html","_blank","popup,width=200,height=100");
</script>
18 changes: 18 additions & 0 deletions css/cssom-view/resources/onmove-child.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<meta charset=utf-8>
Waiting for move event…
<script>
var base_x = window.screenX;
var base_y = window.screenY;
window.onmove = function() {
var new_x = window.screenX;
var new_y = window.screenY;
if (new_x != base_x || new_y != base_y) {
window.opener.registerResult(true);
} else {
window.opener.registerResult(false);
}
window.close();
};
window.moveBy(150,150);
</script>