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

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

Powered by Google App Engine
This is Rietveld 408576698