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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/spelling/spellcheck-attribute-settings-default.html

Issue 2316303006: Make default spellchecking behavior in html elements configurable via WebSettings. (Closed)
Patch Set: remove setting of spellcheck default in render_view_impl Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/spellcheck-attribute-settings-default-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Spellcheck Attribute Settings Default Test</title>
5 <script src="../editing.js"></script>
6 <script src="resources/util.js"></script>
7 <script src="../../resources/js-test.js"></script>
8 </head>
9 <body>
10 <div id="testRoot">
11 <label>1.1.</label><input id="test1_1" type="text"></input><br/>
12 <label>1.2.</label><input id="test1_2" type="text" spellcheck="true"></input><br />
13 <label>1.3.</label><input id="test1_3" type="text" spellcheck="false"></input><b r/>
14 <label>1.4.</label><input id="test1_4" type="text" spellcheck="InvalidValue"></i nput><br/>
15 <label>1.5.</label><input id="test1_5" type="text" spellcheck></input><br/>
16 </div>
17 <script>
18 description('This tests that the spellcheck default value is as specified in '
19 + 'internal blink settings. This allows embedders to specify spellchecking '
20 + 'behavior when the spellcheck attribute is not explicitly set.');
21
22 jsTestIsAsync = true;
23 if (window.testRunner)
24 testRunner.setMockSpellCheckerEnabled(true);
25
26 // Type misspelling to all input elements.
27 var inputs = document.getElementsByTagName('input');
28 for (var i = 0; i < inputs.length; i++)
29 typeText(inputs[i], 'zz ');
30
31 var shouldBeMarked;
32
33 function testMarkerForMisspelledWord(id, isMisspelled, enabled_by_default) {
34 if (!window.internals)
35 return done();
36
37 internals.settings.setSpellCheckEnabledByDefault(enabled_by_default);
38
39 var inputElement = document.getElementById(id);
40 // Spelling markers for input will appear if it's focused.
41 inputElement.focus();
42
43 debug("id=" + id + " type=" + inputElement.type + " spellcheck=" + inputElem ent.spellcheck + " enabled_by_default=" + enabled_by_default);
44
45 shouldBeMarked = isMisspelled;
46 shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 2)', 'shouldBeMa rked', done);
47 }
48
49 var tests = [
50 // spellcheck enabled by default
51 function() { testMarkerForMisspelledWord('test1_1', true, true); },
52 function() { testMarkerForMisspelledWord('test1_2', true, true); },
53 function() { testMarkerForMisspelledWord('test1_3', false, true); },
54 function() { testMarkerForMisspelledWord('test1_4', true, true); },
55 function() { testMarkerForMisspelledWord('test1_5', true, true); },
56 // spellcheck disabled by default
57 function() { testMarkerForMisspelledWord('test1_1', false, false); },
58 function() { testMarkerForMisspelledWord('test1_2', true, false); },
59 function() { testMarkerForMisspelledWord('test1_3', false, false); },
60 function() { testMarkerForMisspelledWord('test1_4', false, false); },
61 function() { testMarkerForMisspelledWord('test1_5', false, false); },
62 ];
63
64 function done()
65 {
66 var next = tests.shift();
67 if (next)
68 return window.setTimeout(next, 0);
69
70 if (window.testRunner) {
71 // Cleaning up for expectation text if running on DRT.
72 document.getElementById("testRoot").style.display = "none";
73 }
74 finishJSTest();
75 }
76 done();
77
78 </script>
79 </body>
80 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/spellcheck-attribute-settings-default-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698