layout/reftests/css-invalid/input/input-radio-focus-click.html

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 <!DOCTYPE html>
     2 <html>
     3   <body class="reftest-wait">
     4     <!-- See bug 658282. -->
     5   <link rel='stylesheet' type='text/css' href='style.css'>
     6   <script>
     7     function loadHandler() {
     8       var button = document.getElementsByTagName('button')[0];
     9       var radios = document.getElementsByName('foo');
    11       button.onclick = function() {
    12         for (var i = 0; i < radios.length; i++) {
    13           radios[i].checked = false;
    14         }
    15         button.parentNode.removeChild(button);
    16         document.documentElement.className='';
    17       };
    19       radios[0].focus();
    20       radios[0].checked = true;
    21       button.focus();
    22       button.click();
    23     }
    24   </script>
    25   <body onload="loadHandler();">
    26     <input class='invalid' id='i1' name='foo' type='radio' required>
    27     <input class='invalid' id='i2' name='foo' type='radio' required>
    28     <button></button>
    29   </body>
    30 </html>

mercurial