input-stepdown-weekmonth.html (806B)
1 <!DOCTYPE HTML> 2 <html> 3 <title>Forms</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <h3>input_stepDown</h3> 7 <input type="month" id="month_input" min="2011-02" step="1" value="2010-02"> 8 <input type="week" id="week_input" min="2011-W02" step="1" value="2010-W02"> 9 10 <script> 11 function testStepDownOverflow(id, value, type) { 12 test(function() { 13 var input = document.getElementById(id); 14 input.stepDown(); 15 assert_equals(input.value, value, "value shouldn't change."); 16 }, "Calling stepDown() on input - " + type + " - where value < min should not modify value."); 17 } 18 19 testStepDownOverflow("month_input", "2010-02", "month"); 20 testStepDownOverflow("week_input", "2010-W02", "week"); 21 </script> 22 </html>