3 <script src=
"../../../resources/js-test.js"></script>
5 <p id=
"description"></p>
7 <input id=
"slider" type=
"range" min=
"0" max=
"100" value=
"30">
8 <input id=
"defaults" type=
"range">
9 <input id=
"step" type=
"range" step=
"20">
11 <div id=
"console"></div>
13 description("<a href='http://bugs.webkit.org/show_bug.cgi?id=15251'>Bug 15251: REGRESSION: <input type=range> doesn't respond to form.reset() or setting input.value</a>");
15 function quoteNumber(n
)
17 return "\"" + n
+ "\"";
20 var slider
; // Global needed for eval in shouldBe calls.
21 function testSliderReset(id
)
23 slider
= document
.getElementById(id
);
24 var originalValue
= quoteNumber(slider
.value
);
25 debug("Current value is: " + originalValue
);
28 shouldBe("slider.value", quoteNumber(80));
30 debug("Resetting form");
31 document
.forms
[0].reset();
32 shouldBe("slider.value", originalValue
);
37 debug("Slider with explicit limits");
38 testSliderReset("slider");
40 debug("Slider with default limits, and no explicit value");
41 testSliderReset("defaults");
43 debug("Slider with default limits, and a step value");
44 testSliderReset("step");