WebCore/manual-tests/onblur-remove.html
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 04 Oct 2010 01:32:07 +0300
changeset 2 303757a437d3
parent 0 4f2f89ce4247
permissions -rw-r--r--
Revision: 201037 Kit: 201039

<html>
  <head>
    <script>
        var numBlurs = 0;

        function debug(str) {
            var c = document.getElementById('console')
            c.innerHTML += str + "<br>"

        }

        function finish() {
            var f = document.getElementById('f')

            f.innerHTML = '';

            if (numBlurs)
                debug('FAILURE: Onblur handler called!')
            else
                debug('SUCCESS!')
        }
    </script>
  </head>
<body>
    <p>This tests that elements shouldn't emit any onblur events when they are being removed from the document. To test this, click inside the input field. If If this test is successful, "SUCCESS" should be shown below, otherwise "FAILURE" is shown.</p>
    <form id='f'>
      <input onblur="numBlurs++" onfocus="setTimeout('finish()', 0)">
    </form>
    <pre id="console"></pre>
  </body>
</html>