layout/reftests/forms/input/number/show-value.html
author Jonathan Watt <jwatt@jwatt.org>
Tue, 21 Jun 2011 16:17:10 +0200
changeset 157385 582687f6eaba5aeb4ab5df370f7447130658444b
child 164012 259c34b488f7a81f27dd59b24ce9e958bbfd58da
permissions -rw-r--r--
Bug 638293 - When the value of <input type=number> changes, keep its anonymous text input field child in sync as appropriate. r=smaug

<!DOCTYPE html>
<html class='reftest-wait'>
  <head>
    <meta charset="utf-8">
    <style>

input {
  -moz-appearance: none;
}

    </style>
    <script>

function run() {
  var numbers = document.getElementsByTagName('input');
  numbers[2].style.display = 'inline-block'; // none -> inline-block
  numbers[3].setAttribute('value', '42');
  numbers[4].value = '42';
  numbers[5].varue = '1337'; // deliberately misspelt - should not set value
  document.forms[0].reset(); // numbers[5] value should be 42 again.
  document.documentElement.className = '';
}

document.addEventListener("MozReftestInvalidate", run);

    </script>
  </head>
  <body onload="run();">
    <input type='number' value='42'><br>
    <input value='42' type='number'><br>
    <input type='number' value='42' style="display: none;"><br>
    <input type='number' value='1337'><br>
    <input type='number' value='1337'><br>
    <form>
      <input type='number' value='42'>
    </form>
    <!-- div to cover spin box area for type=number to type=text comparison -->
    <div style="display:block; position:absolute; background-color:black; width:200px; height:400px; top:0px; left:100px;">
  </body>
</html>