dom/tests/mochitest/pointerlock/file_removedFromDOM.html

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=633602
michael@0 5
michael@0 6 Test DOM tree in full screen
michael@0 7 -->
michael@0 8 <head>
michael@0 9 <title>Bug 633602 - file_DOMtree.html</title>
michael@0 10 <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js">
michael@0 11 </script>
michael@0 12 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
michael@0 13 </script>
michael@0 14 <script type="application/javascript" src="pointerlock_utils.js"></script>
michael@0 15 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
michael@0 16 <style>
michael@0 17 </style>
michael@0 18 </head>
michael@0 19 <body>
michael@0 20 <a target="_blank"
michael@0 21 href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
michael@0 22 Mozilla Bug 633602
michael@0 23 </a>
michael@0 24 <div id="div"></div>
michael@0 25 <pre id="test">
michael@0 26 <script type="text/javascript">
michael@0 27 /*
michael@0 28 * Test for Bug 633602
michael@0 29 * Checks if pointer is unlocked when element is removed from
michael@0 30 * the DOM Tree
michael@0 31 */
michael@0 32
michael@0 33 SimpleTest.waitForExplicitFinish();
michael@0 34
michael@0 35 var div = document.getElementById("div")
michael@0 36 , removedDOM = false;
michael@0 37
michael@0 38 function runTests() {
michael@0 39 ok(removedDOM, "Pointer should be unlocked when " +
michael@0 40 "an element is removed the DOM Tree");
michael@0 41 }
michael@0 42
michael@0 43 document.addEventListener("mozpointerlockchange", function (e) {
michael@0 44 if (document.mozPointerLockElement === div) {
michael@0 45 document.body.removeChild(div);
michael@0 46 removedDOM = !document.mozPointerLockElement;
michael@0 47 document.mozCancelFullScreen();
michael@0 48 }
michael@0 49
michael@0 50 }, false);
michael@0 51
michael@0 52 document.addEventListener("mozfullscreenchange", function (e) {
michael@0 53 if (document.mozFullScreenElement === div) {
michael@0 54 div.mozRequestPointerLock();
michael@0 55 }
michael@0 56 else {
michael@0 57 runTests();
michael@0 58 SimpleTest.finish();
michael@0 59 }
michael@0 60 }, false);
michael@0 61
michael@0 62 function start() {
michael@0 63 div.mozRequestFullScreen();
michael@0 64 }
michael@0 65 </script>
michael@0 66 </pre>
michael@0 67 </body>
michael@0 68 </html>

mercurial