blob: f3246f13d19ab719095eead06e2bedd537f34198 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body spellcheck="false">
<script src="../editing.js"></script>
<script src="../../resources/js-test.js"></script>
<div id="misspelled" onmouseup="checkSpellingMarker()">asd is misspelled.</div>
<script>
description("This tests whether WebKit does not spell check in 'designMode' "
+ "when spellcheck='false'. To test manually, click 'asd' and move cursor until '.'. "
+ "There should be no spelling marker for 'asd'.");
jsTestIsAsync = true;
if (window.internals)
internals.settings.setUnifiedTextCheckerEnabled(true);
document.designMode = "on";
function checkSpellingMarker()
{
if (!window.internals)
return;
// First, verify spelling with spellcheck attribute off.
// Move selection to the next word to notify WebKit that "asd" has been typed/changed
// to give a chance to spellcheck.
moveSelectionForwardByWordCommand();
shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 3)', 'false', function() {
evalAndLog('document.body.setAttribute("spellcheck", "true")');
// Do any selection change to force spellchecking after attribute change.
moveSelectionForwardByLineCommand();
shouldBecomeDifferent('internals.hasSpellingMarker(document, 0, 3)', '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>
</body>
</html>