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.

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

mercurial