summaryrefslogtreecommitdiffstats
path: root/dom/events/test/test_bug443985.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/events/test/test_bug443985.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/events/test/test_bug443985.html')
-rw-r--r--dom/events/test/test_bug443985.html76
1 files changed, 76 insertions, 0 deletions
diff --git a/dom/events/test/test_bug443985.html b/dom/events/test/test_bug443985.html
new file mode 100644
index 000000000..0ed4138be
--- /dev/null
+++ b/dom/events/test/test_bug443985.html
@@ -0,0 +1,76 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=443985
+-->
+<head>
+ <title>Test for Bug 443985</title>
+ <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=443985">Mozilla Bug 443985</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+
+/** Test for Bug 443985 **/
+
+
+function listenerForNoScroll(evt) {
+ is(evt.clientX, evt.pageX, "Wrong .pageX");
+ is(evt.clientY, evt.pageY, "Wrong .pageY");
+ is(evt.screenX, 0, "Wrong .screenX");
+ is(evt.screenY, 0, "Wrong .screenY");
+ is(evt.clientX, 10, "Wrong .clientX");
+ is(evt.clientY, 10, "Wrong .clientY");
+}
+
+function listenerForScroll(evt) {
+ isnot(evt.clientX, evt.pageX, "Wrong .pageX");
+ isnot(evt.clientY, evt.pageY, "Wrong .pageY");
+ ok(evt.pageX > 3000, "Wrong .pageX");
+ ok(evt.pageY > 3000, "Wrong .pageY");
+ is(evt.screenX, 0, "Wrong .screenX");
+ is(evt.screenY, 0, "Wrong .screenY");
+ is(evt.clientX, 10, "Wrong .clientX");
+ is(evt.clientY, 10, "Wrong .clientY");
+}
+
+function doTest() {
+ window.scrollTo(0, 0);
+ var target = document.getElementById("testTarget");
+ target.addEventListener("click", listenerForNoScroll, true);
+ var me = document.createEvent("MouseEvent");
+ me.initMouseEvent("click", true, true, window, 0, 0, 0, 10, 10,
+ false, false, false, false, 0, null);
+ target.dispatchEvent(me);
+ target.removeEventListener("click", listenerForNoScroll, true);
+
+ target.scrollIntoView(true);
+ target.addEventListener("click", listenerForScroll, true);
+ me = document.createEvent("MouseEvent");
+ me.initMouseEvent("click", true, true, window, 0, 0, 0, 10, 10,
+ false, false, false, false, 0, null);
+ target.dispatchEvent(me);
+ target.addEventListener("click", listenerForNoScroll, true);
+
+ document.getElementsByTagName("a")[0].scrollIntoView(true);
+ SimpleTest.finish();
+}
+
+SimpleTest.waitForExplicitFinish();
+addLoadEvent(doTest);
+
+</script>
+</pre>
+<div style="min-height: 4000px; min-width: 4000px;"></div>
+<div style="min-width: 4000px; text-align: right;">
+ <span id="testTarget" style="border: 1px solid black;">testTarget</span>
+</div>
+</body>
+</html>
+