blob: 6ee798da721bdc873addcce66089d2dbc29e4ee1 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body spellcheck="false">
<script src="../editing.js"></script>
<script src="../../resources/js-test-pre.js"></script>
<div id="misspelled" onmouseup="checkSpellingMarker()">asdf is misspelled.</div>
<script>
description("This tests whether WebKit does not spell check in 'designMode' "
+ "when spellcheck='false'. To test manually, click arround 'asdf'. "
+ "There should be no spelling marker for 'asdf' after the click.");
jsTestIsAsync = true;
if (window.internals) {
internals.settings.setUnifiedTextCheckerEnabled(true);
internals.settings.setAsynchronousSpellCheckingEnabled(true);
}
document.designMode = "on";
function checkSpellingMarker()
{
// First, verify spelling with spellcheck attribute off.
// Move selection to the next word to notify WebKit that "asdf" has been typed/changed
// to give a chance to spellcheck.
moveSelectionForwardByWordCommand();
if (window.internals) {
shouldBecomeEqual('internals.hasSpellingMarker(0, 4)', 'false', function() {
evalAndLog('document.body.setAttribute("spellcheck", "true")');
// Do any selection change to force spellchecking after attribute change.
moveSelectionForwardByLineCommand();
shouldBecomeDifferent('internals.hasSpellingMarker(0, 4)', 'false', finishJSTest);
});
}
}
if (window.eventSender) {
var misspelledDiv = document.getElementById("misspelled");
var x = misspelledDiv.offsetLeft;
var y = misspelledDiv.offsetTop;
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>