mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 636465 - Reset the spellchecking override status when detaching an editor object from the content node; r,a=roc
This commit is contained in:
parent
2d304df09d
commit
76716122b8
@ -440,6 +440,7 @@ nsEditor::PreDestroy(PRBool aDestroyingFrames)
|
||||
mEditorObservers.Clear();
|
||||
mDocStateListeners.Clear();
|
||||
mInlineSpellChecker = nsnull;
|
||||
mSpellcheckCheckboxState = eTriUnset;
|
||||
mRootElement = nsnull;
|
||||
|
||||
mDidPreDestroy = PR_TRUE;
|
||||
|
@ -69,6 +69,13 @@ _TEST_FILES += \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
_CHROME_TEST_FILES = \
|
||||
test_bug636465.xul \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||
|
||||
libs:: $(_CHROME_TEST_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
|
||||
|
||||
|
70
editor/libeditor/text/tests/test_bug636465.xul
Normal file
70
editor/libeditor/text/tests/test_bug636465.xul
Normal file
@ -0,0 +1,70 @@
|
||||
<?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/MochiKit/packed.js"/>
|
||||
<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() {
|
||||
setTimeout(function(){
|
||||
setTimeout(function(){
|
||||
var x = document.getElementById("x");
|
||||
var spellCheckTrue = snapshotWindow(window);
|
||||
x.setAttribute("spellcheck", "false");
|
||||
setTimeout(function(){
|
||||
setTimeout(function(){
|
||||
var spellCheckFalse = snapshotWindow(window);
|
||||
x.setAttribute("spellcheck", "true");
|
||||
setTimeout(function(){
|
||||
setTimeout(function(){
|
||||
var spellCheckTrueAgain = snapshotWindow(window);
|
||||
x.removeAttribute("spellcheck");
|
||||
setTimeout(function(){
|
||||
setTimeout(function(){
|
||||
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();
|
||||
},0);
|
||||
},0);
|
||||
},0);
|
||||
},0);
|
||||
},0);
|
||||
},0);
|
||||
},0);
|
||||
},0);
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
Loading…
Reference in New Issue
Block a user