| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body spellcheck="false"> | 3 <head> |
| 4 <script src="../../fast/js/resources/js-test-pre.js"></script> |
| 5 </head> |
| 6 <body spellcheck="false"> |
| 4 asdf is misspelled. | 7 asdf is misspelled. |
| 5 <p>To test this manually, click "asdf" above. There should be no spelling marker
for "asdf" after the click.</p> | |
| 6 <script> | 8 <script> |
| 9 description("This tests whether WebKit does not spell check in 'designMode' " |
| 10 + "when spellcheck='false'. To test manually, click 'asdf' above. " |
| 11 + "There should be no spelling marker for 'asdf' after the click."); |
| 7 | 12 |
| 8 if (window.testRunner) | 13 jsTestIsAsync = true; |
| 9 testRunner.dumpAsText(); | 14 |
| 15 if (window.internals) { |
| 16 internals.settings.setUnifiedTextCheckerEnabled(true); |
| 17 internals.settings.setAsynchronousSpellCheckingEnabled(true); |
| 18 } |
| 10 | 19 |
| 11 document.designMode = "on"; | 20 document.designMode = "on"; |
| 12 | 21 |
| 13 if (document.activeElement != document.body) | 22 document.body.addEventListener('mousedown', function() { |
| 14 document.body.appendChild(document.createTextNode('FAIL: active element befo
re click is not body element')); | 23 if (document.activeElement != document.body) { |
| 15 else if (window.testRunner && window.eventSender) { | 24 testFailed('Active element after click is not body element'); |
| 16 testRunner.waitUntilDone(); | 25 finishJSTest(); |
| 26 } |
| 17 | 27 |
| 18 document.body.addEventListener('mousedown', function() { | 28 if (window.internals) |
| 19 if (document.activeElement != document.body) | 29 shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 4)', 'false'
, finishJSTest); |
| 20 document.body.appendChild(document.createTextNode('FAIL: active elem
ent after click is not body element')); | 30 }); |
| 21 else if (internals.hasSpellingMarker(document, 0, 4)) | |
| 22 document.body.appendChild(document.createTextNode('FAIL: spell check
was invoked')); | |
| 23 else | |
| 24 document.body.appendChild(document.createTextNode('PASS')); | |
| 25 testRunner.notifyDone(); | |
| 26 }); | |
| 27 | 31 |
| 32 if (window.eventSender) { |
| 28 var x = document.body.offsetLeft + 10; | 33 var x = document.body.offsetLeft + 10; |
| 29 var y = document.body.offsetTop + 10; | 34 var y = document.body.offsetTop + 17; |
| 30 eventSender.mouseMoveTo(x, y); | 35 eventSender.mouseMoveTo(x, y); |
| 31 eventSender.mouseDown(); | 36 eventSender.mouseDown(); |
| 32 eventSender.mouseUp(); | 37 eventSender.mouseUp(); |
| 33 setTimeout("testRunner.notifyDone();document.body.appendChild(document.creat
eTextNode('FAIL: timeout'));", 500); | 38 } |
| 34 } else | |
| 35 document.body.appendChild(document.createTextNode('PASS')); | |
| 36 | 39 |
| 37 </script> | 40 </script> |
| 41 <script src="../../fast/js/resources/js-test-post.js"></script> |
| 38 </body> | 42 </body> |
| 39 </html> | 43 </html> |
| OLD | NEW |