Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: LayoutTests/editing/spelling/spellcheck-editable-on-focus.html

Issue 21694005: Spell check whole content of an editable element when it gets focused. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../editing.js"></script>
5 <script src="resources/util.js"></script>
6 <script src="../../fast/js/resources/js-test-pre.js"></script>
7 </head>
8 <body onload="test();">
9 <pre id="console"></pre>
10 <div id="container">
11 <div id="test_editable" contentEditable>zz zz zz.</div>
12 <textarea>zz zz zz.</textarea>
please use gerrit instead 2013/08/02 16:48:46 Could you please add <input type="text"> here, too
13 </div>
14 <script>
15 description("Spell checking should be triggered on focus of an editable. " +
16 "To test manually type focus above editable and textarea. Misspellings in them " +
17 "should be marked on focus.");
18
19 var testEditable = document.getElementById('test_editable');
20 var testTextArea = document.getElementsByTagName('textarea')[0];
please use gerrit instead 2013/08/02 16:48:46 It's best to be consistent. Assign an id to the te
21
22 function test()
23 {
24 if (!window.internals)
25 {
26 document.getElementById("console").innerHTML = "Automatic testing imposs ible. Test manually.\n";
please use gerrit instead 2013/08/02 16:48:46 There's an easier way to write this: log("Autom
27 return;
28 }
29
30 function waitForMarkersToAppear(node, nretry)
31 {
32 if (nretry && !internals.markerCountForNode(node, "spelling")) {
33 window.setTimeout(function() { waitForMarkersToAppear(node, nretry - 1); }, 0);
34 }
35 }
36
37 waitForMarkersToAppear(findFirstTextNode(testEditable), 10);
38 shouldBe('internals.markerCountForNode(findFirstTextNode(testEditable), "spe lling")', '0');
39 testEditable.focus();
40 waitForMarkersToAppear(findFirstTextNode(testEditable), 10);
41 shouldBe('internals.markerCountForNode(findFirstTextNode(testEditable), "spe lling")', '3');
42 waitForMarkersToAppear(findFirstTextNode(testTextArea), 10);
43 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '0');
44 testTextArea.focus();
45 waitForMarkersToAppear(findFirstTextNode(testTextArea), 10);
46 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '3');
47 }
48
49 </script>
50 <script src="../../fast/js/resources/js-test-post.js"></script>
51 </body>
52 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/editing/spelling/spellcheck-editable-on-focus-expected.txt » ('j') | Source/core/editing/Editor.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698