Chromium Code Reviews| 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(); | |
| 17 | 25 |
| 18 document.body.addEventListener('mousedown', function() { | 26 if (window.internals) |
| 19 if (document.activeElement != document.body) | 27 shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 4)', 'false' , finishJSTest); |
| 20 document.body.appendChild(document.createTextNode('FAIL: active elem ent after click is not body element')); | 28 }); |
| 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 | 29 |
| 28 var x = document.body.offsetLeft + 10; | 30 var x = document.body.offsetLeft + 30; |
|
groby-ooo-7-16
2013/10/24 16:47:49
Curious - why the offset changes?
grzegorz
2013/10/25 09:41:08
Chrome's "Inspect Element" shows that description(
| |
| 29 var y = document.body.offsetTop + 10; | 31 var y = document.body.offsetTop + 30; |
| 30 eventSender.mouseMoveTo(x, y); | 32 eventSender.mouseMoveTo(x, y); |
| 31 eventSender.mouseDown(); | 33 eventSender.mouseDown(); |
| 32 eventSender.mouseUp(); | 34 eventSender.mouseUp(); |
| 33 setTimeout("testRunner.notifyDone();document.body.appendChild(document.creat eTextNode('FAIL: timeout'));", 500); | |
| 34 } else | |
| 35 document.body.appendChild(document.createTextNode('PASS')); | |
| 36 | 35 |
| 37 </script> | 36 </script> |
| 37 <script src="../../fast/js/resources/js-test-post.js"></script> | |
| 38 </body> | 38 </body> |
| 39 </html> | 39 </html> |
| OLD | NEW |