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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/spelling/grammar-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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <div id="source" contenteditable="true" spellcheck="false">You has the right.</d iv>
8 <div id="target" contenteditable="true" spellcheck="true"></div>
9
10 <script>
11 description('This tests whether WebKit can render grammar markers when pasting t ext if it has a grammar-checker. To test manually, copy the text in the first di v element and paste it to the second div element. This test succeeds when WebKit renders a grammar marker under a word "has".');
12
13 jsTestIsAsync = true;
14
15 if (window.testRunner)
16 testRunner.dumpAsTextWithPixelResults();
17
18 function verifyGrammarMarker(destination, ungrammaticalPhrase)
19 {
20 if (window.internals && internals.hasGrammarMarker(document, destination.inn erHTML.indexOf(ungrammaticalPhrase), ungrammaticalPhrase.length)) {
21 testPassed("ungrammatical phrase '" + ungrammaticalPhrase + "' on '" + d estination.innerHTML + "'");
22 return true;
23 } else
24 return false;
25 }
26
27 var source = document.getElementById('source');
28 window.getSelection().selectAllChildren(source);
29 document.execCommand('Copy');
30 var target = document.getElementById('target');
31 window.getSelection().selectAllChildren(target);
32 document.execCommand('Paste');
33
34 shouldBecomeEqual('verifyGrammarMarker(target, "has")', 'true', finishJSTest);
35
36 </script>
37 </body>
38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698