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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/spelling/inline_spelling_markers.html

Issue 2211813002: Revert removal of grammar checking and marking code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor fix Created 4 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
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../resources/js-test.js"></script> 3 <script src="../../resources/js-test.js"></script>
4 <script src="../../editing/editing.js"></script> 4 <script src="../../editing/editing.js"></script>
5 <style> 5 <style>
6 body { overflow:hidden; } 6 body { overflow:hidden; }
7 7
8 .testDiv { 8 .testDiv {
9 width: 200px; 9 width: 200px;
10 height: 20px; 10 height: 20px;
11 border: 1px solid black; 11 border: 1px solid black;
12 white-space: nowrap; 12 white-space: nowrap;
13 overflow: hidden; 13 overflow: hidden;
14 } 14 }
15 15
16 .forcertl { 16 .forcertl {
17 direction: rtl; 17 direction: rtl;
18 unicode-bidi: bidi-override; 18 unicode-bidi: bidi-override;
19 } 19 }
20 20
21 .ellipses { 21 .ellipses {
22 text-overflow:ellipsis; 22 text-overflow:ellipsis;
23 } 23 }
24 24
25 </style> 25 </style>
26 26
27 </head> 27 </head>
28 <body> 28 <body>
29 <script> 29 <script>
30 description("This tests the correct placement of inline spelling " 30 description("This tests the correct placement of inline spelling and grammar "
31 + "markers in text. Spelling markers should line up exactly under misspelled " 31 + "markers in text. Spelling markers should line up exactly under misspelled "
32 + "words in all cases."); 32 + "words in all cases.");
33 33
34 jsTestIsAsync = true; 34 jsTestIsAsync = true;
35 35
36 if (window.internals) 36 if (window.internals)
37 internals.settings.setUnifiedTextCheckerEnabled(true); 37 internals.settings.setUnifiedTextCheckerEnabled(true);
38 38
39 if (window.testRunner) 39 if (window.testRunner)
40 testRunner.dumpAsTextWithPixelResults(); 40 testRunner.dumpAsTextWithPixelResults();
(...skipping 24 matching lines...) Expand all
65 moveSelectionForwardByWordCommand(); 65 moveSelectionForwardByWordCommand();
66 66
67 verifyMarkers(); 67 verifyMarkers();
68 } 68 }
69 69
70 function verifyMarkers() 70 function verifyMarkers()
71 { 71 {
72 if (!window.internals) 72 if (!window.internals)
73 return done(); 73 return done();
74 74
75 // Take care of spelling markers first.
75 shouldBecomeEqual('internals.hasSpellingMarker(document, 8, 4)', 'true', fun ction() { // Verifies 'adlj'. 76 shouldBecomeEqual('internals.hasSpellingMarker(document, 8, 4)', 'true', fun ction() { // Verifies 'adlj'.
76 shouldBecomeEqual('internals.hasSpellingMarker(document, 13, 6)', 'true' , function() { // Verifies 'adaasj'. 77 shouldBecomeEqual('internals.hasSpellingMarker(document, 13, 6)', 'true' , function() { // Verifies 'adaasj'.
77 shouldBecomeEqual('internals.hasSpellingMarker(document, 20, 5)', 't rue', function() { // Verifies 'sdklj'. 78 shouldBecomeEqual('internals.hasSpellingMarker(document, 20, 5)', 't rue', verifyGrammarMarkers) // Verifies 'sdklj'.
79 })
80 });
81
82 function verifyGrammarMarkers() {
83 shouldBecomeEqual('internals.hasGrammarMarker(document, 4, 3)', 'true', function() { // Verifies second 'the'.
84 shouldBecomeEqual('internals.hasGrammarMarker(document, 33, 5)', 'tr ue', function() { // Verifies second 'there'.
78 // Markers of next element can not be found after modification s election without blur event. 85 // Markers of next element can not be found after modification s election without blur event.
79 div.blur(); 86 div.blur();
80 done(); 87 done();
81 }) 88 })
82 }) 89 });
83 }); 90 }
84 } 91 }
85 92
86 var tests = [ function() { moveCursorOverAllWords('testLTR'); }, 93 var tests = [ function() { moveCursorOverAllWords('testLTR'); },
87 function() { moveCursorOverAllWords('testRTL'); }, 94 function() { moveCursorOverAllWords('testRTL'); },
88 function() { moveCursorOverAllWords('testLTREllipses'); }, 95 function() { moveCursorOverAllWords('testLTREllipses'); },
89 function() { moveCursorOverAllWords('testRTLEllipses'); } ]; 96 function() { moveCursorOverAllWords('testRTLEllipses'); } ];
90 97
91 function done() 98 function done()
92 { 99 {
93 var next = tests.shift(); 100 var next = tests.shift();
94 if (next) 101 if (next)
95 return window.setTimeout(next, 0); 102 return window.setTimeout(next, 0);
96 103
97 finishJSTest(); 104 finishJSTest();
98 } 105 }
99 done(); 106 done();
100 </script> 107 </script>
101 </body> 108 </body>
102 </html> 109 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698