OLD | NEW |
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 </head> | 26 </head> |
27 <body> | 27 <body> |
28 | 28 |
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 </script> | 38 </script> |
39 | 39 |
40 LTR | 40 LTR |
(...skipping 20 matching lines...) Expand all Loading... |
61 moveSelectionForwardByWordCommand(); | 61 moveSelectionForwardByWordCommand(); |
62 | 62 |
63 verifyMarkers(); | 63 verifyMarkers(); |
64 } | 64 } |
65 | 65 |
66 function verifyMarkers() | 66 function verifyMarkers() |
67 { | 67 { |
68 if (!window.internals) | 68 if (!window.internals) |
69 return done(); | 69 return done(); |
70 | 70 |
| 71 // Take care of spelling markers first. |
71 shouldBecomeEqual('internals.hasSpellingMarker(document, 8, 4)', 'true', fun
ction() { // Verifies 'adlj'. | 72 shouldBecomeEqual('internals.hasSpellingMarker(document, 8, 4)', 'true', fun
ction() { // Verifies 'adlj'. |
72 shouldBecomeEqual('internals.hasSpellingMarker(document, 13, 6)', 'true'
, function() { // Verifies 'adaasj'. | 73 shouldBecomeEqual('internals.hasSpellingMarker(document, 13, 6)', 'true'
, function() { // Verifies 'adaasj'. |
73 shouldBecomeEqual('internals.hasSpellingMarker(document, 20, 5)', 't
rue', function() { // Verifies 'sdklj'. | 74 shouldBecomeEqual('internals.hasSpellingMarker(document, 20, 5)', 't
rue', verifyGrammarMarkers) // Verifies 'sdklj'. |
| 75 }) |
| 76 }); |
| 77 |
| 78 function verifyGrammarMarkers() { |
| 79 shouldBecomeEqual('internals.hasGrammarMarker(document, 4, 3)', 'true',
function() { // Verifies second 'the'. |
| 80 shouldBecomeEqual('internals.hasGrammarMarker(document, 33, 5)', 'tr
ue', function() { // Verifies second 'there'. |
74 // Markers of next element can not be found after modification s
election without blur event. | 81 // Markers of next element can not be found after modification s
election without blur event. |
75 div.blur(); | 82 div.blur(); |
76 done(); | 83 done(); |
77 }) | 84 }) |
78 }) | 85 }); |
79 }); | 86 } |
80 } | 87 } |
81 | 88 |
82 var tests = [ function() { moveCursorOverAllWords('testLTR'); }, | 89 var tests = [ function() { moveCursorOverAllWords('testLTR'); }, |
83 function() { moveCursorOverAllWords('testRTL'); }, | 90 function() { moveCursorOverAllWords('testRTL'); }, |
84 function() { moveCursorOverAllWords('testLTREllipses'); }, | 91 function() { moveCursorOverAllWords('testLTREllipses'); }, |
85 function() { moveCursorOverAllWords('testRTLEllipses'); } ]; | 92 function() { moveCursorOverAllWords('testRTLEllipses'); } ]; |
86 | 93 |
87 function done() | 94 function done() |
88 { | 95 { |
89 var next = tests.shift(); | 96 var next = tests.shift(); |
90 if (next) | 97 if (next) |
91 return window.setTimeout(next, 0); | 98 return window.setTimeout(next, 0); |
92 | 99 |
93 finishJSTest(); | 100 finishJSTest(); |
94 } | 101 } |
95 | 102 |
96 if (window.testRunner) { | 103 if (window.testRunner) { |
97 testRunner.dumpAsTextWithPixelResults(); | 104 testRunner.dumpAsTextWithPixelResults(); |
98 testRunner.setBackingScaleFactor(2, function () { | 105 testRunner.setBackingScaleFactor(2, function () { |
99 done(); | 106 done(); |
100 }); | 107 }); |
101 } | 108 } |
102 </script> | 109 </script> |
103 </body> | 110 </body> |
104 </html> | 111 </html> |
OLD | NEW |