2011-03-01 15:04:42 -08:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<?xml-stylesheet href="chrome://global/skin"
|
|
|
|
type="text/css"?>
|
|
|
|
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
|
|
|
type="text/css"?>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=636465
|
|
|
|
-->
|
|
|
|
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
|
|
title="Mozilla Bug 636465" onload="runTest();">
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"/>
|
|
|
|
|
|
|
|
<body xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=636465"
|
|
|
|
target="_blank">Mozilla Bug 636465</a>
|
|
|
|
<p/>
|
|
|
|
<p/>
|
|
|
|
<pre id="test">
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
<textbox id="x" value="foobarbaz" spellcheck="true"/>
|
|
|
|
<script class="testbody" type="application/javascript">
|
|
|
|
<![CDATA[
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
|
|
|
function runTest() {
|
2013-06-05 17:07:54 -07:00
|
|
|
Components.utils.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm");
|
2011-10-16 19:06:24 -07:00
|
|
|
var x = document.getElementById("x");
|
|
|
|
x.focus();
|
2013-06-05 17:07:54 -07:00
|
|
|
onSpellCheck(x, function () {
|
2011-10-16 19:06:24 -07:00
|
|
|
x.blur();
|
2013-06-05 17:07:54 -07:00
|
|
|
var spellCheckTrue = snapshotWindow(window);
|
|
|
|
x.setAttribute("spellcheck", "false");
|
|
|
|
var spellCheckFalse = snapshotWindow(window);
|
|
|
|
x.setAttribute("spellcheck", "true");
|
|
|
|
x.focus();
|
|
|
|
onSpellCheck(x, function () {
|
|
|
|
x.blur();
|
|
|
|
var spellCheckTrueAgain = snapshotWindow(window);
|
|
|
|
x.removeAttribute("spellcheck");
|
|
|
|
var spellCheckNone = snapshotWindow(window);
|
|
|
|
var after = snapshotWindow(window);
|
|
|
|
ok(compareSnapshots(spellCheckTrue, spellCheckFalse, false)[0],
|
|
|
|
"Setting the spellcheck attribute to false should work");
|
|
|
|
ok(compareSnapshots(spellCheckTrue, spellCheckTrueAgain, true)[0],
|
|
|
|
"Setting the spellcheck attribute back to true should work");
|
|
|
|
ok(compareSnapshots(spellCheckNone, spellCheckFalse, true)[0],
|
|
|
|
"Unsetting the spellcheck attribute should work");
|
|
|
|
SimpleTest.finish();
|
|
|
|
});
|
|
|
|
});
|
2011-03-01 15:04:42 -08:00
|
|
|
}
|
|
|
|
]]>
|
|
|
|
</script>
|
|
|
|
</window>
|