diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/html/test/test_bug617528.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/html/test/test_bug617528.html')
-rw-r--r-- | dom/html/test/test_bug617528.html | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/dom/html/test/test_bug617528.html b/dom/html/test/test_bug617528.html new file mode 100644 index 000000000..c8cd62568 --- /dev/null +++ b/dom/html/test/test_bug617528.html @@ -0,0 +1,73 @@ +<!DOCTYPE HTML> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=617528 +--> +<head> + <title>Test for Bug 617528</title> + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> +</head> +<body> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=617528">Mozilla Bug 617528</a> +<p id="display"></p> +<div id="content"> + <menu> + <menuitem id="checkbox" type="checkbox" label="Checkbox" checked></menuitem> + <menuitem id="radio1" type="radio" label="Radio1" checked></menuitem> + <menuitem id="radio2" type="radio" label="Radio2"></menuitem> + </menu> +</div> +<pre id="test"> +<script type="application/javascript"> + +/** Test for Bug 617528 **/ + +SimpleTest.waitForExplicitFinish(); +addLoadEvent(function() { + function click(element, preventDefault, checked) { + function handleClick(event) { + is(this.checked, checked, + "checking .checked (" + this.id + ")"); + if (preventDefault) + event.preventDefault(); + } + element.addEventListener("click", handleClick); + element.click(); + element.removeEventListener("click", handleClick); + } + + function verify(elements, data) { + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + is(element.checked, data[i*2], + "checking .checked (" + element.id + ")"); + is(element.defaultChecked, data[i*2+1], + 'checking .defaultChecked (' + element.id + ")"); + } + } + + var checkbox = document.getElementById("checkbox"); + click(checkbox, false, false); + verify([checkbox], [false, true]); + + click(checkbox, true, true); + verify([checkbox], [false, true]); + + var radio1 = document.getElementById("radio1"); + var radio2 = document.getElementById("radio2"); + click(radio2, false, true); + verify([radio1, radio2], [false, true, + true, false]); + + click(radio1, true, true); + verify([radio1, radio2], [false, true, + true, false]); + + SimpleTest.finish(); +}); + +</script> +</pre> +</body> +</html> |