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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/spelling/spelling-insert-html.html

Issue 2224103003: Convert some spell-checking layout tests to use unified text checker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SpellCheckerDebugInfo
Patch Set: add setUnifiedTextCheckerEnabled(true) in util.js 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 <pre id="description"></pre>
8 <pre id="console"></pre>
9 <div id="container">
10 <div id="destination" contentEditable>food.</div>
11 </div>
12
13 <script>
14 description("The spellchecker shouldn't mark substrings of words after pasting." );
15
16 var sel = window.getSelection();
17 var destination = document.getElementById("destination");
18 var destinationText = destination.firstChild;
19 sel.setBaseAndExtent(destinationText, 2, destinationText, 2);
20
21 document.execCommand("InsertHTML", false, "<div>o zz</div><div>fo</div>");
22
23 if (window.internals) {
24 // The destination node has multiple text nodes,
25 // so we need concatenate the marked text.
26 var texts = destination.childNodes;
27 var markedText = "";
28 for (var i = 0; i < texts.length; ++i) {
29 var marked = internals.markerRangeForNode(texts[i], "spelling", 0);
30 if (marked)
31 markedText += marked.toString()
32 }
33
34 // The first "foo" isn't checked because it crosses the pasted and base html .
35 // See http://webkit.org/b/66450.
36 shouldBeEqualToString("markedText", "zz");
37 }
38
39 </script>
40 </body>
41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698