WebCore/manual-tests/onblur-remove.html
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     1 <html>
       
     2   <head>
       
     3     <script>
       
     4         var numBlurs = 0;
       
     5 
       
     6         function debug(str) {
       
     7             var c = document.getElementById('console')
       
     8             c.innerHTML += str + "<br>"
       
     9 
       
    10         }
       
    11 
       
    12         function finish() {
       
    13             var f = document.getElementById('f')
       
    14 
       
    15             f.innerHTML = '';
       
    16 
       
    17             if (numBlurs)
       
    18                 debug('FAILURE: Onblur handler called!')
       
    19             else
       
    20                 debug('SUCCESS!')
       
    21         }
       
    22     </script>
       
    23   </head>
       
    24 <body>
       
    25     <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>
       
    26     <form id='f'>
       
    27       <input onblur="numBlurs++" onfocus="setTimeout('finish()', 0)">
       
    28     </form>
       
    29     <pre id="console"></pre>
       
    30   </body>
       
    31 </html>