3 <body spellcheck=
"false">
4 <script src=
"../editing.js"></script>
5 <script src=
"../../resources/js-test.js"></script>
6 <div id=
"misspelled" onmouseup=
"checkSpellingMarker()">asd is misspelled.
</div>
8 description("This tests whether WebKit does not spell check in 'designMode' "
9 + "when spellcheck='false'. To test manually, click 'asd' and move cursor until '.'. "
10 + "There should be no spelling marker for 'asd'.");
14 if (window
.internals
) {
15 internals
.settings
.setUnifiedTextCheckerEnabled(true);
16 internals
.settings
.setAsynchronousSpellCheckingEnabled(true);
19 document
.designMode
= "on";
21 function checkSpellingMarker()
23 if (!window
.internals
)
26 // First, verify spelling with spellcheck attribute off.
27 // Move selection to the next word to notify WebKit that "asd" has been typed/changed
28 // to give a chance to spellcheck.
29 moveSelectionForwardByWordCommand();
31 shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 3)', 'false', function() {
32 evalAndLog('document.body.setAttribute("spellcheck", "true")');
33 // Do any selection change to force spellchecking after attribute change.
34 moveSelectionForwardByLineCommand();
35 shouldBecomeDifferent('internals.hasSpellingMarker(document, 0, 3)', 'false', finishJSTest
);
39 if (window
.eventSender
) {
40 var misspelledDiv
= document
.getElementById("misspelled");
41 var x
= misspelledDiv
.offsetLeft
;
42 var y
= misspelledDiv
.offsetTop
;
43 eventSender
.mouseMoveTo(x
, y
);
44 eventSender
.mouseDown();
45 eventSender
.mouseUp();