Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / spelling / spellcheck-disable-enable.html
blobebf4243eb48c87265dbc253af6d6a7f975c423b8
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body onload="test(document.getElementById('destination'), document.getElementById('frame').contentWindow.document);">
7 <div id="container">
8 <div id="destination" contentEditable></div>
9 <iframe id="frame" src="data:text/html,<body contenteditable></body>"></iframe>
10 </div>
12 <script>
13 description("Spell check markers should be removed from the whole page when disabling spell checker "
14 + "but they should be restored in the focused editable if spell checker gets enabled. "
15 + "To test manually, turn spell checker off - misspelling markers should disappear. "
16 + "Having the editable focused, turn spell checker on. Misspellings in the editable should be marked.");
18 jsTestIsAsync = true;
20 function hasSpellingMarkerOnSetting(element, enableSpellChecking)
22 internals.setContinuousSpellCheckingEnabled(enableSpellChecking);
23 return !!internals.markerCountForNode(element.firstChild, "spelling");
26 var editableDiv = null;
27 var editableBodyInFrame = null;
29 function test(div, frameDocument)
31 editableDiv = div;
32 editableBodyInFrame = frameDocument.body;
34 // Type misspellings to trigger spellchecking on editable fields.
35 editableDiv.focus();
36 document.execCommand("InsertText", false, "zz.");
37 editableBodyInFrame.focus();
38 frameDocument.execCommand("InsertText", false, "zz.");
40 if (!window.internals) {
41 debug("Automatic testing impossible. Test manually.");
42 return;
45 internals.settings.setAsynchronousSpellCheckingEnabled(true);
46 internals.settings.setUnifiedTextCheckerEnabled(true);
48 shouldBecomeEqual('hasSpellingMarkerOnSetting(editableDiv, true)', 'true', function() {
49 shouldBecomeEqual('hasSpellingMarkerOnSetting(editableBodyInFrame, true)', 'true', function() {
50 // Turn off spellchecking, all misspellings should disappear.
51 shouldBecomeEqual('hasSpellingMarkerOnSetting(editableDiv, false)', 'false', function() {
52 shouldBecomeEqual('hasSpellingMarkerOnSetting(editableBodyInFrame, false)', 'false', function() {
53 // Focus element and turn on spellchecking.
54 // Only misspellings of the focused element should be restored.
55 editableDiv.focus();
56 shouldBecomeEqual('hasSpellingMarkerOnSetting(editableDiv, true)', 'true', function() {
57 shouldBecomeEqual('hasSpellingMarkerOnSetting(editableBodyInFrame, true)', 'false', finishJSTest);
58 });
59 });
60 });
61 });
62 });
65 </script>
66 </body>
67 </html>