1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/states/test_buttons.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,85 @@ 1.4 +<!DOCTYPE html> 1.5 +<html> 1.6 +<head> 1.7 + <title>HTML button accessible states</title> 1.8 + <link rel="stylesheet" type="text/css" 1.9 + href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.10 + 1.11 + <script type="application/javascript" 1.12 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.13 + 1.14 + <script type="application/javascript" 1.15 + src="../common.js"></script> 1.16 + <script type="application/javascript" 1.17 + src="../role.js"></script> 1.18 + <script type="application/javascript" 1.19 + src="../states.js"></script> 1.20 + 1.21 + <script type="application/javascript"> 1.22 + function doTest() 1.23 + { 1.24 + // Default state. 1.25 + testStates("f1_image", STATE_DEFAULT | STATE_FOCUSABLE); 1.26 + testStates("f2_submit", STATE_DEFAULT | STATE_FOCUSABLE); 1.27 + testStates("f3_submitbutton", STATE_DEFAULT | STATE_FOCUSABLE); 1.28 + testStates("f3_disabled_reset", STATE_UNAVAILABLE, 0, STATE_FOCUSABLE, 0); 1.29 + testStates("f4_button", STATE_FOCUSABLE, 0, STATE_DEFAULT); 1.30 + testStates("f4_disabled_button", STATE_UNAVAILABLE, 0, STATE_FOCUSABLE, 0); 1.31 + testStates("f4_image1", STATE_DEFAULT | STATE_FOCUSABLE); 1.32 + testStates("f4_image2", STATE_FOCUSABLE, 0, STATE_DEFAULT); 1.33 + testStates("f4_submit", STATE_FOCUSABLE, 0, STATE_DEFAULT); 1.34 + testStates("f4_submitbutton", STATE_FOCUSABLE, 0, STATE_DEFAULT); 1.35 + 1.36 + SimpleTest.finish(); 1.37 + } 1.38 + 1.39 + SimpleTest.waitForExplicitFinish(); 1.40 + addA11yLoadEvent(doTest); 1.41 + </script> 1.42 +</head> 1.43 + 1.44 +<body> 1.45 + <a target="_blank" 1.46 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=664142" 1.47 + title="DEFAULT state exposed incorrectly for HTML"> 1.48 + Mozilla Bug 664142 1.49 + </a> 1.50 + <p id="display"></p> 1.51 + <div id="content" style="display: none"></div> 1.52 + <pre id="test"> 1.53 + </pre> 1.54 + 1.55 + <p>A form with an image button</p> 1.56 + <form name="form1" method="get"> 1.57 + <input type="text" name="hi"> 1.58 + 1.59 + <input id="f1_image" type="image" value="image-button"> 1.60 + </form> 1.61 + 1.62 + <p>A form with a submit button:</p> 1.63 + <form name="form2" method="get"> 1.64 + <input type="text" name="hi"> 1.65 + <input id="f2_submit" type="submit"> 1.66 + </form> 1.67 + 1.68 + <p>A form with a HTML4 submit button:</p> 1.69 + <form name="form3" method="get"> 1.70 + <input type="text" name="hi"> 1.71 + <button id="f3_submitbutton" type="submit">submit</button> 1.72 + <button id="f3_disabled_reset" type="reset" disabled>reset</button> 1.73 + </form> 1.74 + 1.75 + <p>A form with normal button, two image buttons, submit button, 1.76 + HTML4 submit button:</p> 1.77 + <form name="form4" method="get"> 1.78 + <input type="text" name="hi"> 1.79 + <input id="f4_button" type="button" value="normal" name="normal-button"> 1.80 + <input id="f4_disabled_button" type="button" value="disabled" name="disabled-button" disabled> 1.81 + <input id="f4_image1" type="image" value="image-button1" name="image-button1"> 1.82 + <input id="f4_image2" type="image" value="image-button2" name="image-button2"> 1.83 + <input id="f4_submit" type="submit" value="real-submit" name="real-submit"> 1.84 + <button id="f4_submitbutton" type="submit">submit</button> 1.85 + </form> 1.86 + 1.87 + </body> 1.88 +</html>