Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / range / range-reset.html
blob385160f8ef2f0498cc6f9aa5a70762421321f085
1 <html
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 <body>
5 <p id="description"></p>
6 <form>
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">
10 </form>
11 <div id="console"></div>
12 <script>
13 description("<a href='http://bugs.webkit.org/show_bug.cgi?id=15251'>Bug 15251: REGRESSION: &lt;input type=range&gt; 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);
27 slider.value = 80;
28 shouldBe("slider.value", quoteNumber(80));
30 debug("Resetting form");
31 document.forms[0].reset();
32 shouldBe("slider.value", originalValue);
34 debug("");
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");
45 </script>
46 </body>
47 </html>