|
1 <?xml version="1.0"?> |
|
2 <?xml-stylesheet href="chrome://global/skin" |
|
3 type="text/css"?> |
|
4 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" |
|
5 type="text/css"?> |
|
6 <!-- |
|
7 https://bugzilla.mozilla.org/show_bug.cgi?id=636465 |
|
8 --> |
|
9 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
|
10 title="Mozilla Bug 636465" onload="runTest();"> |
|
11 <script type="application/javascript" |
|
12 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/> |
|
13 <script type="application/javascript" |
|
14 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> |
|
15 <script type="application/javascript" |
|
16 src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"/> |
|
17 |
|
18 <body xmlns="http://www.w3.org/1999/xhtml"> |
|
19 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=636465" |
|
20 target="_blank">Mozilla Bug 636465</a> |
|
21 <p/> |
|
22 <p/> |
|
23 <pre id="test"> |
|
24 </pre> |
|
25 </body> |
|
26 <textbox id="x" value="foobarbaz" spellcheck="true"/> |
|
27 <script class="testbody" type="application/javascript"> |
|
28 <![CDATA[ |
|
29 |
|
30 SimpleTest.waitForExplicitFinish(); |
|
31 |
|
32 function runTest() { |
|
33 Components.utils.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm"); |
|
34 var x = document.getElementById("x"); |
|
35 x.focus(); |
|
36 onSpellCheck(x, function () { |
|
37 x.blur(); |
|
38 var spellCheckTrue = snapshotWindow(window); |
|
39 x.setAttribute("spellcheck", "false"); |
|
40 var spellCheckFalse = snapshotWindow(window); |
|
41 x.setAttribute("spellcheck", "true"); |
|
42 x.focus(); |
|
43 onSpellCheck(x, function () { |
|
44 x.blur(); |
|
45 var spellCheckTrueAgain = snapshotWindow(window); |
|
46 x.removeAttribute("spellcheck"); |
|
47 var spellCheckNone = snapshotWindow(window); |
|
48 var after = snapshotWindow(window); |
|
49 ok(compareSnapshots(spellCheckTrue, spellCheckFalse, false)[0], |
|
50 "Setting the spellcheck attribute to false should work"); |
|
51 ok(compareSnapshots(spellCheckTrue, spellCheckTrueAgain, true)[0], |
|
52 "Setting the spellcheck attribute back to true should work"); |
|
53 ok(compareSnapshots(spellCheckNone, spellCheckFalse, true)[0], |
|
54 "Unsetting the spellcheck attribute should work"); |
|
55 SimpleTest.finish(); |
|
56 }); |
|
57 }); |
|
58 } |
|
59 ]]> |
|
60 </script> |
|
61 </window> |