A number input fields with a bad input string should make validity.badInput true and have :invalid style. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". Initial state. The element has no value. PASS colorOf(number) is not invalidStyleColor PASS number.validity.badInput is false Type '-'. The element becomes badInput. PASS colorOf(number) is invalidStyleColor PASS number.validity.valid is false PASS number.validity.badInput is true PASS number.value is "" Type '1' additionally. The element becomes valid. PASS colorOf(number) is not invalidStyleColor PASS number.validity.badInput is false PASS number.value is "-1" Type 'e' additionally. The element becomes badInput again. PASS colorOf(number) is invalidStyleColor PASS number.validity.badInput is true PASS number.value is "" The element losts focus. The element state should not be changed. PASS colorOf(number) is invalidStyleColor PASS number.validity.badInput is true PASS document.getSelection().toString() is "-1e" PASS number.value is "" The element losts a renderer. The element state should not be changed. PASS number.style.display = "none"; number.validity.badInput is true A bad input should be cleared by value="". PASS number.value = ""; document.execCommand("SelectAll"); document.getSelection().toString() is "" Setting a valid value via |value| IDL attribute should clear badInput. PASS number.validity.badInput is true PASS number.checkValidity() is false PASS number.validity.badInput is false PASS number.checkValidity() is true ' ' is not a badInput. PASS number.validity.badInput is false PASS number.value is "" ' +' is a badInput. PASS number.validity.badInput is true PASS number.value is "" ' +1' is not a badInput. PASS number.validity.badInput is false PASS number.value is "1" ' +1.' is not a badInput. PASS number.validity.badInput is false PASS number.value is "1" ' +1. ' is not a badInput. PASS number.validity.badInput is false PASS number.value is "1" Arabic number is not a badInput. PASS number_ar.validity.badInput is false PASS number_ar.value is "1.1" Arabic number with two decimal separators is a badInput. PASS number_ar.validity.badInput is true PASS number_ar.value is "" Croatian number with negative decimal value is valid. PASS croatianInput.checkValidity() is true PASS successfullyParsed is true TEST COMPLETE