| 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 and grammar " | 30 description("This tests the correct placement of inline spelling " |
| 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. | |
| 72 shouldBecomeEqual('internals.hasSpellingMarker(document, 8, 4)', 'true', fun
ction() { // Verifies 'adlj'. | 71 shouldBecomeEqual('internals.hasSpellingMarker(document, 8, 4)', 'true', fun
ction() { // Verifies 'adlj'. |
| 73 shouldBecomeEqual('internals.hasSpellingMarker(document, 13, 6)', 'true'
, function() { // Verifies 'adaasj'. | 72 shouldBecomeEqual('internals.hasSpellingMarker(document, 13, 6)', 'true'
, function() { // Verifies 'adaasj'. |
| 74 shouldBecomeEqual('internals.hasSpellingMarker(document, 20, 5)', 't
rue', verifyGrammarMarkers) // Verifies 'sdklj'. | 73 shouldBecomeEqual('internals.hasSpellingMarker(document, 20, 5)', 't
rue', function() { // 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'. | |
| 81 // Markers of next element can not be found after modification s
election without blur event. | 74 // Markers of next element can not be found after modification s
election without blur event. |
| 82 div.blur(); | 75 div.blur(); |
| 83 done(); | 76 done(); |
| 84 }) | 77 }) |
| 85 }); | 78 }) |
| 86 } | 79 }); |
| 87 } | 80 } |
| 88 | 81 |
| 89 var tests = [ function() { moveCursorOverAllWords('testLTR'); }, | 82 var tests = [ function() { moveCursorOverAllWords('testLTR'); }, |
| 90 function() { moveCursorOverAllWords('testRTL'); }, | 83 function() { moveCursorOverAllWords('testRTL'); }, |
| 91 function() { moveCursorOverAllWords('testLTREllipses'); }, | 84 function() { moveCursorOverAllWords('testLTREllipses'); }, |
| 92 function() { moveCursorOverAllWords('testRTLEllipses'); } ]; | 85 function() { moveCursorOverAllWords('testRTLEllipses'); } ]; |
| 93 | 86 |
| 94 function done() | 87 function done() |
| 95 { | 88 { |
| 96 var next = tests.shift(); | 89 var next = tests.shift(); |
| 97 if (next) | 90 if (next) |
| 98 return window.setTimeout(next, 0); | 91 return window.setTimeout(next, 0); |
| 99 | 92 |
| 100 finishJSTest(); | 93 finishJSTest(); |
| 101 } | 94 } |
| 102 | 95 |
| 103 if (window.testRunner) { | 96 if (window.testRunner) { |
| 104 testRunner.dumpAsTextWithPixelResults(); | 97 testRunner.dumpAsTextWithPixelResults(); |
| 105 testRunner.setBackingScaleFactor(2, function () { | 98 testRunner.setBackingScaleFactor(2, function () { |
| 106 done(); | 99 done(); |
| 107 }); | 100 }); |
| 108 } | 101 } |
| 109 </script> | 102 </script> |
| 110 </body> | 103 </body> |
| 111 </html> | 104 </html> |
| OLD | NEW |