diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /layout/base/tests/bug977003_inner_2.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-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 'layout/base/tests/bug977003_inner_2.html')
-rw-r--r-- | layout/base/tests/bug977003_inner_2.html | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/layout/base/tests/bug977003_inner_2.html b/layout/base/tests/bug977003_inner_2.html new file mode 100644 index 000000000..0282bd01c --- /dev/null +++ b/layout/base/tests/bug977003_inner_2.html @@ -0,0 +1,75 @@ +<!DOCTYPE HTML> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=977003 +--> +<head> + <meta charset="utf-8"> + <title>Test for Bug 977003</title> + <meta name="author" content="Maksim Lebedev" /> + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> + <style> + #target, #listener { background: yellow; } + </style> + <script type="application/javascript"> + var target = undefined; + var listener = undefined; + var test_down_got = false; + var test_listener = false; + + function TargetDownHandler(event) { + logger("Target receive event: " + event.type); + logger("Send setPointerCapture to listener"); + listener.setPointerCapture(event.pointerId); + logger("Send releasePointerCapture from listener"); + listener.releasePointerCapture(event.pointerId); + logger("set/release was executed"); + test_down_got = true; + } + function ListenerHandler(event) { + logger("Receive event on Listener: " + event.type); + test_listener = true; + } + function logger(message) { + console.log(message); + var log = document.getElementById('log'); + log.innerHTML = message + "<br>" + log.innerHTML; + } + + function prepareTest() { + parent.turnOnPointerEvents(executeTest); + } + function executeTest() + { + logger("executeTest"); + target = document.getElementById("target"); + listener = document.getElementById("listener"); + target.addEventListener("pointerdown", TargetDownHandler, false); + listener.addEventListener("gotpointercapture", ListenerHandler, false); + listener.addEventListener("lostpointercapture", ListenerHandler, false); + var rect = target.getBoundingClientRect(); + synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointerdown"}); + synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointerup"}); + finishTest(); + } + function finishTest() { + parent.is(test_down_got, true, "Part 2: pointerdown event should be received by target"); + parent.is(test_listener, false, "Part 2: listener should not receive any events"); + logger("finishTest"); + parent.finishTest(); + } + </script> +</head> +<body onload="prepareTest()"> + <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=977003">Mozilla Bug 977003 Test 2</a> + <p id="display"></p> + <div id="content" style="display: none"> + </div> + <div id="listener">div id=listener</div> + <div id="target">div id=target</div> + <pre id="log"> + </pre> +</body> +</html> |