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