[Mac] Enable spellchecking tests added in r141471
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Apr 2013 16:52:38 +0000 (16:52 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Apr 2013 16:52:38 +0000 (16:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=108525

Reviewed by Darin Adler.

Source/WebCore:

Made automatic quote substitution, dash substitution, text replacement, and spelling correction
togglable via internals object. These functions are no-op when text replacement is not used.

This allows us to disable automatic spelling correction in spellcheck tests.

Enabled several tests added in r141471.

* WebCore.exp.in:
* testing/Internals.cpp:
(WebCore::Internals::setContinuousSpellCheckingEnabled): Don't null check editor() since it's not
null whenever frame() is not null.
(WebCore::Internals::setAutomaticQuoteSubstitutionEnabled): Added.
(WebCore::Internals::setAutomaticLinkDetectionEnabled): Added.
(WebCore::Internals::setAutomaticDashSubstitutionEnabled): Added.
(WebCore::Internals::setAutomaticTextReplacementEnabled): Added.
(WebCore::Internals::setAutomaticSpellingCorrectionEnabled): Added.
* testing/Internals.h:
* testing/Internals.idl:

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow):
(resetDefaultsToConsistentValues):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):

LayoutTests:

Updated the tests not to assume spelling correction suggestions were listed in a context menu since
only Chromium port did this.

* editing/spelling/resources/util.js:
(initSpellTest): Disable automatic text replacements.

* editing/spelling/spelling-with-underscore-selection-expected.txt: Removed.
* editing/spelling/spelling-with-underscore-selection.html: Removed.

This test erroneously assumed a specific word breaking behavior that doesn't include the underscore
when selecting a word especially since Chromium was the only port that was running these tests.

* editing/spelling/spelling-double-clicked-word-with-underscores-expected.txt: Removed.
* editing/spelling/spelling-double-clicked-word-with-underscores.html: Removed.

Ditto.

* editing/spelling/spelling-should-select-single-word-expected.txt: Removed.
* editing/spelling/spelling-should-select-single-word.html: Removed.

Removed since this test doesn't do anything useful without the assertion for the context menu.

* editing/spelling/spelling-double-clicked-word-expected.txt:
* editing/spelling/spelling-double-clicked-word.html:
* editing/spelling/spelling-exactly-selected-word-expected.txt:
* editing/spelling/spelling-exactly-selected-word.html:
* editing/spelling/spelling-with-punctuation-selection-expected.txt:
* editing/spelling/spelling-with-punctuation-selection.html:
* editing/spelling/spelling-with-whitespace-selection-expected.txt:
* editing/spelling/spelling-with-whitespace-selection.html:

* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148282 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/spelling/resources/util.js
LayoutTests/editing/spelling/spelling-double-clicked-word-expected.txt
LayoutTests/editing/spelling/spelling-double-clicked-word-with-underscores-expected.txt [deleted file]
LayoutTests/editing/spelling/spelling-double-clicked-word-with-underscores.html [deleted file]
LayoutTests/editing/spelling/spelling-double-clicked-word.html
LayoutTests/editing/spelling/spelling-exactly-selected-word-expected.txt
LayoutTests/editing/spelling/spelling-exactly-selected-word.html
LayoutTests/editing/spelling/spelling-should-select-single-word-expected.txt [deleted file]
LayoutTests/editing/spelling/spelling-should-select-single-word.html [deleted file]
LayoutTests/editing/spelling/spelling-with-punctuation-selection-expected.txt
LayoutTests/editing/spelling/spelling-with-punctuation-selection.html
LayoutTests/editing/spelling/spelling-with-underscore-selection-expected.txt [deleted file]
LayoutTests/editing/spelling/spelling-with-underscore-selection.html [deleted file]
LayoutTests/editing/spelling/spelling-with-whitespace-selection-expected.txt
LayoutTests/editing/spelling/spelling-with-whitespace-selection.html
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/platform/wincairo/TestExpectations
LayoutTests/platform/wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/WebKitTestRunner/TestController.cpp

index 638630b23be97e1fcd2ee783f9ab960180168b04..025f8fc912d795a94361a4d9fc034a74768dd92d 100644 (file)
@@ -1,3 +1,49 @@
+2013-04-12  Ryosuke Niwa  <rniwa@webkit.org>
+
+        [Mac] Enable spellchecking tests added in r141471
+        https://bugs.webkit.org/show_bug.cgi?id=108525
+
+        Reviewed by Darin Adler.
+
+        Updated the tests not to assume spelling correction suggestions were listed in a context menu since
+        only Chromium port did this.
+
+        * editing/spelling/resources/util.js:
+        (initSpellTest): Disable automatic text replacements.
+
+        * editing/spelling/spelling-with-underscore-selection-expected.txt: Removed.
+        * editing/spelling/spelling-with-underscore-selection.html: Removed.
+
+        This test erroneously assumed a specific word breaking behavior that doesn't include the underscore
+        when selecting a word especially since Chromium was the only port that was running these tests.
+
+        * editing/spelling/spelling-double-clicked-word-with-underscores-expected.txt: Removed.
+        * editing/spelling/spelling-double-clicked-word-with-underscores.html: Removed.
+
+        Ditto.
+
+        * editing/spelling/spelling-should-select-single-word-expected.txt: Removed.
+        * editing/spelling/spelling-should-select-single-word.html: Removed.
+
+        Removed since this test doesn't do anything useful without the assertion for the context menu.
+
+        * editing/spelling/spelling-double-clicked-word-expected.txt:
+        * editing/spelling/spelling-double-clicked-word.html:
+        * editing/spelling/spelling-exactly-selected-word-expected.txt:
+        * editing/spelling/spelling-exactly-selected-word.html:
+        * editing/spelling/spelling-with-punctuation-selection-expected.txt:
+        * editing/spelling/spelling-with-punctuation-selection.html:
+        * editing/spelling/spelling-with-whitespace-selection-expected.txt:
+        * editing/spelling/spelling-with-whitespace-selection.html:
+
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+        * platform/mac/TestExpectations:
+        * platform/qt/TestExpectations:
+        * platform/win/TestExpectations:
+        * platform/wincairo/TestExpectations:
+        * platform/wk2/TestExpectations:
+
 2013-04-12  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
 
         [Qt] Unreviewed gardening.
index bc15e0eb96960cb65aa6f5efb0b14ad941fb44ad..3b77a39218e8cfeb53ea29d6eb46dd7a215fb3b7 100644 (file)
@@ -26,11 +26,15 @@ function initSpellTest(testElementId, testText, testFunction)
     }
     testFunctionCallback = testFunction;
     jsTestIsAsync = true;
+
+    internals.setAutomaticSpellingCorrectionEnabled(false);
+
     internals.settings.setAsynchronousSpellCheckingEnabled(true);
     internals.settings.setSmartInsertDeleteEnabled(true);
     internals.settings.setSelectTrailingWhitespaceEnabled(false);
     internals.settings.setUnifiedTextCheckerEnabled(true);
     internals.settings.setEditingBehavior("win");
+
     var destination = document.getElementById(testElementId);
     destination.focus();
     document.execCommand("InsertText", false, testText);
index ff54cd92c31269301e9a13d42a1f991be0958ef1..81e1880184f3dcfe845142eb3309e9f313a337dd 100644 (file)
@@ -8,12 +8,10 @@ PASS window.getSelection().toString() is ""
 PASS window.getSelection().toString() is "wellcome"
 PASS spellingMarkerRange.toString() is "wellcome"
 PASS window.getSelection().toString() is "wellcome"
-PASS contextMenuElements[contextMenuElements.length - 1] is "welcome"
 PASS window.getSelection().toString() is ""
 PASS window.getSelection().toString() is "wellcome "
 PASS spellingMarkerRange.toString() is "wellcome"
 PASS window.getSelection().toString() is "wellcome "
-PASS contextMenuElements[contextMenuElements.length - 1] is "welcome"
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/editing/spelling/spelling-double-clicked-word-with-underscores-expected.txt b/LayoutTests/editing/spelling/spelling-double-clicked-word-with-underscores-expected.txt
deleted file mode 100644 (file)
index 4e5b56f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-Spelling should work for double-clicked misspelled words with underscores. To test manually, type 'wellcome_ home.', double-click on 'wellcome_', and context-click on the selection. The test succeeds when the context menu shows spell check suggestions.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS spellingMarkerRange.toString() is "wellcome"
-PASS window.getSelection().toString() is ""
-PASS window.getSelection().toString() is "wellcome_"
-PASS spellingMarkerRange.toString() is "wellcome"
-PASS window.getSelection().toString() is "wellcome_"
-PASS contextMenuElements[contextMenuElements.length - 1] is "welcome"
-PASS window.getSelection().toString() is ""
-PASS window.getSelection().toString() is "wellcome_ "
-PASS spellingMarkerRange.toString() is "wellcome"
-PASS window.getSelection().toString() is "wellcome_ "
-PASS contextMenuElements[contextMenuElements.length - 1] is "welcome"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-wellcome_ home.
diff --git a/LayoutTests/editing/spelling/spelling-double-clicked-word-with-underscores.html b/LayoutTests/editing/spelling/spelling-double-clicked-word-with-underscores.html
deleted file mode 100644 (file)
index 4060718..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../fast/js/resources/js-test-pre.js"></script>
-<script src="resources/util.js"></script>
-</head>
-<body>
-<div id="container">
-  <div id="destination" contentEditable></div>
-</div>
-
-<script>
-
-description("Spelling should work for double-clicked misspelled words with underscores. " +
-            "To test manually, type 'wellcome_ home.', double-click on 'wellcome_', and context-click on the selection. " +
-            "The test succeeds when the context menu shows spell check suggestions.");
-
-initSpellTest("destination", "wellcome_ home.",  function(textNode) {
-    spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
-    shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
-    shouldBeEqualToString("window.getSelection().toString()", "");
-
-    // Double-click the misspelled word without the trailing whitespace.
-    internals.settings.setSmartInsertDeleteEnabled(true);
-    internals.settings.setSelectTrailingWhitespaceEnabled(false);
-    var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40;
-    var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
-    eventSender.mouseMoveTo(x, y);
-    eventSender.mouseDown();
-    eventSender.mouseUp();
-    eventSender.mouseDown();
-    eventSender.mouseUp();
-
-    shouldBeEqualToString("window.getSelection().toString()", "wellcome_");
-
-    // Context click on "wellcome_" to show the context menu.
-    x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40;
-    y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
-    eventSender.mouseMoveTo(x, y);
-    contextMenuElements = eventSender.contextClick();
-    // Esc key to hide the context menu.
-    eventSender.keyDown(String.fromCharCode(0x001B), null);
-
-    spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
-    shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
-    shouldBeEqualToString("window.getSelection().toString()", "wellcome_");
-    shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "welcome");
-
-    window.getSelection().removeAllRanges();
-    shouldBeEqualToString("window.getSelection().toString()", "");
-
-    // Double-click the misspelled word with the trailing whitespace.
-    internals.settings.setSmartInsertDeleteEnabled(false);
-    internals.settings.setSelectTrailingWhitespaceEnabled(true);
-    var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40;
-    var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
-    eventSender.mouseMoveTo(x, y);
-    eventSender.mouseDown();
-    eventSender.mouseUp();
-    eventSender.mouseDown();
-    eventSender.mouseUp();
-
-    shouldBeEqualToString("window.getSelection().toString()", "wellcome_ ");
-
-    // Context click on "wellcome_ " to show the context menu.
-    x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40;
-    y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
-    eventSender.mouseMoveTo(x, y);
-    contextMenuElements = eventSender.contextClick();
-    // Esc key to hide the context menu.
-    eventSender.keyDown(String.fromCharCode(0x001B), null);
-
-    spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
-    shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
-    shouldBeEqualToString("window.getSelection().toString()", "wellcome_ ");
-    shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "welcome");
-});
-
-</script>
-<script src="../../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
index 9d249fd7f0efee243bc6b0fb29e5cee5956ec4ea..0e4c7244b9817c519536f32b914e3c20a9d9d94a 100644 (file)
@@ -44,7 +44,6 @@ initSpellTest("destination", "wellcome home.", function(textNode) {
     spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
     shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
     shouldBeEqualToString("window.getSelection().toString()", "wellcome");
-    shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "welcome");
 
     window.getSelection().removeAllRanges();
     shouldBeEqualToString("window.getSelection().toString()", "");
@@ -72,7 +71,6 @@ initSpellTest("destination", "wellcome home.", function(textNode) {
     spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
     shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
     shouldBeEqualToString("window.getSelection().toString()", "wellcome ");
-    shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "welcome");
 });
 
 </script>
index 34e36cf0439104996f0caf156b3e9931a188e383..f608bbe501df50f4942790cb9c9f07d54f182ad7 100644 (file)
@@ -8,10 +8,8 @@ PASS window.getSelection().toString() is ""
 PASS window.getSelection().toString() is "wellcome"
 PASS spellingMarkerRange.toString() is "wellcome"
 PASS window.getSelection().toString() is "wellcome"
-PASS contextMenuElements[contextMenuElements.length - 1] is "welcome"
 PASS window.getSelection().toString() is "home"
 PASS window.getSelection().toString() is "home"
-PASS contextMenuElements[contextMenuElements.length - 1] is "<separator>"
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 221d96d87c04d9731abcb0fa357cb27578ed86cb..1927e3b36d64cc11c2bfc6c53d5ec28a2cadb44a 100644 (file)
@@ -33,14 +33,12 @@ initSpellTest("destination", "wellcome home.", function(textNode) {
     var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40;
     var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
     eventSender.mouseMoveTo(x, y);
-    contextMenuElements = eventSender.contextClick();
     // Esc key to hide the context menu.
     eventSender.keyDown(String.fromCharCode(0x001B), null);
 
     spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
     shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
     shouldBeEqualToString("window.getSelection().toString()", "wellcome");
-    shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "welcome");
     
     // Select a correctly spelled word without surrounding whitespace or punctuation.
     wordRange.setStart(textNode, 9);
@@ -53,12 +51,10 @@ initSpellTest("destination", "wellcome home.", function(textNode) {
     var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 80;
     var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
     eventSender.mouseMoveTo(x, y);
-    contextMenuElements = eventSender.contextClick();
     // Esc key to hide the context menu.
     eventSender.keyDown(String.fromCharCode(0x001B), null);
 
     shouldBeEqualToString("window.getSelection().toString()", "home");
-    shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "<separator>");
 });
 
 </script>
diff --git a/LayoutTests/editing/spelling/spelling-should-select-single-word-expected.txt b/LayoutTests/editing/spelling/spelling-should-select-single-word-expected.txt
deleted file mode 100644 (file)
index 6a8d086..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-Spell check selects the misspelled word on context click. To test manually, type 'wellcome home.' and context-click on 'wellcome'. The test succeeds when 'wellcome' is selected after the context click.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS spellingMarkerRange.toString() is "wellcome"
-PASS window.getSelection().toString() is ""
-PASS spellingMarkerRange.toString() is "wellcome"
-PASS window.getSelection().toString() is "wellcome"
-PASS contextMenuElements[contextMenuElements.length - 1] is "welcome"
-PASS window.getSelection().toString() is ""
-PASS window.getSelection().toString() is ""
-PASS contextMenuElements[contextMenuElements.length - 1] is "<separator>"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-wellcome home.
diff --git a/LayoutTests/editing/spelling/spelling-should-select-single-word.html b/LayoutTests/editing/spelling/spelling-should-select-single-word.html
deleted file mode 100644 (file)
index 0b8284a..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../fast/js/resources/js-test-pre.js"></script>
-<script src="resources/util.js"></script>
-</head>
-<body>
-<div id="container">
-  <div id="destination" contentEditable></div>
-</div>
-
-<script>
-
-description("Spell check selects the misspelled word on context click. " +
-            "To test manually, type 'wellcome home.' and context-click on 'wellcome'. " +
-            "The test succeeds when 'wellcome' is selected after the context click.");
-
-initSpellTest("destination", "wellcome home.", function(textNode) {
-    spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
-    shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
-    shouldBeEqualToString("window.getSelection().toString()", "");
-
-    // Context click on "wellcome" to show the context menu.
-    var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40;
-    var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
-    eventSender.mouseMoveTo(x, y);
-    contextMenuElements = eventSender.contextClick();
-    // Esc key to hide the context menu.
-    eventSender.keyDown(String.fromCharCode(0x001B), null);
-
-    spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
-    shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
-    shouldBeEqualToString("window.getSelection().toString()", "wellcome");
-    shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "welcome");
-
-    window.getSelection().removeAllRanges();
-    shouldBeEqualToString("window.getSelection().toString()", "");
-
-    // Context click on "home" to show the context menu.
-    var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 80;
-    var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
-    eventSender.mouseMoveTo(x, y);
-    contextMenuElements = eventSender.contextClick();
-    // Esc key to hide the context menu.
-    eventSender.keyDown(String.fromCharCode(0x001B), null);
-
-    // Context click should not select correctly spelled words with "win" editing behavior.
-    shouldBeEqualToString("window.getSelection().toString()", "");
-    shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "<separator>");
-});
-
-</script>
-<script src="../../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
index 822180d0fb01fd512f39d29591917239f6d3f8dc..7baaaf2c45da2a3a70afb00d68635048a8237a45 100644 (file)
@@ -8,7 +8,6 @@ PASS window.getSelection().toString() is ""
 PASS window.getSelection().toString() is "wellcome!"
 PASS spellingMarkerRange.toString() is "wellcome"
 PASS window.getSelection().toString() is "wellcome!"
-PASS contextMenuElements[contextMenuElements.length - 1] is "welcome"
 PASS successfullyParsed is true
 
 TEST COMPLETE
index eb565b70fae1b643be18bdcd886e8e438112f97c..57bca37b0e9cccf53b3977a1e89b1f1349cafc32 100644 (file)
@@ -33,14 +33,12 @@ initSpellTest("destination", "wellcome!", function(textNode) {
     var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40;
     var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
     eventSender.mouseMoveTo(x, y);
-    contextMenuElements = eventSender.contextClick();
     // Esc key to hide the context menu.
     eventSender.keyDown(String.fromCharCode(0x001B), null);
 
     spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
     shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
     shouldBeEqualToString("window.getSelection().toString()", "wellcome!");
-    shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "welcome");
 });
 
 </script>
diff --git a/LayoutTests/editing/spelling/spelling-with-underscore-selection-expected.txt b/LayoutTests/editing/spelling/spelling-with-underscore-selection-expected.txt
deleted file mode 100644 (file)
index 3e14461..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-Underscores should be treated as whitespace: spelling should ignore them. To test manually, type 'Hi, _wellcome_ home.', select '_wellcome_', and context-click on the selection. The test succeeds when the context menu has spell check suggestions.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS spellingMarkerRange.toString() is "wellcome"
-PASS window.getSelection().toString() is ""
-PASS window.getSelection().toString() is "_wellcome_"
-PASS spellingMarkerRange.toString() is "wellcome"
-PASS window.getSelection().toString() is "_wellcome_"
-PASS contextMenuElements[contextMenuElements.length - 1] is "welcome"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-Hi, _wellcome_ home.
diff --git a/LayoutTests/editing/spelling/spelling-with-underscore-selection.html b/LayoutTests/editing/spelling/spelling-with-underscore-selection.html
deleted file mode 100644 (file)
index ab036bb..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../fast/js/resources/js-test-pre.js"></script>
-<script src="resources/util.js"></script>
-</head>
-<body>
-<div id="container">
-  <div id="destination" contentEditable></div>
-</div>
-
-<script>
-
-description("Underscores should be treated as whitespace: spelling should ignore them. " +
-            "To test manually, type 'Hi, _wellcome_ home.', select '_wellcome_', and context-click on the selection. " +
-            "The test succeeds when the context menu has spell check suggestions.");
-
-initSpellTest("destination", "Hi, _wellcome_ home.", function(textNode) {
-    spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
-    shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
-    shouldBeEqualToString("window.getSelection().toString()", "");
-
-    // Select the text "_wellcome_".
-    var rangeWithUnderscores = document.createRange();
-    rangeWithUnderscores.setStart(textNode, 4);
-    rangeWithUnderscores.setEnd(textNode, 14);
-    window.getSelection().removeAllRanges();
-    window.getSelection().addRange(rangeWithUnderscores);
-
-    shouldBeEqualToString("window.getSelection().toString()", "_wellcome_");
-
-    // Context click on "_wellcome_" to show the context menu.
-    var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 80;
-    var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
-    eventSender.mouseMoveTo(x, y);
-    contextMenuElements = eventSender.contextClick();
-    // Esc key to hide the context menu.
-    eventSender.keyDown(String.fromCharCode(0x001B), null);
-
-    spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
-    shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
-    shouldBeEqualToString("window.getSelection().toString()", "_wellcome_");
-    shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "welcome");
-});
-
-</script>
-<script src="../../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
index 84355173a73879fe45b49a298a3cf0c5cf4d5672..56cf16914534ea926fd45dbb9c5defec6e2718a7 100644 (file)
@@ -7,7 +7,6 @@ PASS spellingMarkerRange.toString() is "wellcome"
 PASS window.getSelection().toString() is " wellcome "
 PASS spellingMarkerRange.toString() is "wellcome"
 PASS window.getSelection().toString() is " wellcome "
-PASS contextMenuElements[contextMenuElements.length - 1] is "welcome"
 PASS successfullyParsed is true
 
 TEST COMPLETE
index ae91190b79e9f408935ee4ac7a1ff3a722aff80d..85769e1302c7b98735c8b83f8415287a7202b66d 100644 (file)
@@ -32,14 +32,12 @@ initSpellTest("destination", "hello, wellcome home.", function(textNode) {
     var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 80;
     var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
     eventSender.mouseMoveTo(x, y);
-    contextMenuElements = eventSender.contextClick();
     // Esc key to hide the context menu.
     eventSender.keyDown(String.fromCharCode(0x001B), null);
 
     spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
     shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
     shouldBeEqualToString("window.getSelection().toString()", " wellcome ");
-    shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "welcome");
 });
 
 </script>
index aa416aca69ffa9e9a66c13b4c228a7e8ae53c611..438b1c336981e1675a21ebffa0048541186c86c7 100644 (file)
@@ -1741,15 +1741,12 @@ webkit.org/b/67921 [ Release ] perf/show-hide-table-rows.html [ Failure Pass Slo
 
 # Spellchecker behavior tests.
 webkit.org/b/108370 editing/spelling/spelling-double-clicked-word.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-double-clicked-word-with-underscores.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-exactly-selected-multiple-words.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-exactly-selected-word.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-multiword-selection.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-should-select-multiple-words.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-should-select-single-word.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-subword-selection.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-with-punctuation-selection.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-with-underscore-selection.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-with-whitespace-selection.html [ Skip ]
 
 # This test has slightly networking different output on the build bots but the
index 14bb16a9ec62dd4742895098460e61ac2cc5f0f6..9c8f7789f61344a8e8aec611824aa7889a5d5348 100644 (file)
@@ -1310,15 +1310,12 @@ webkit.org/b/108363 fullscreen/full-screen-iframe-legacy.html [ Failure ]
 
 # Spellchecker behavior tests.
 webkit.org/b/108370 editing/spelling/spelling-double-clicked-word.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-double-clicked-word-with-underscores.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-exactly-selected-multiple-words.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-exactly-selected-word.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-multiword-selection.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-should-select-multiple-words.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-should-select-single-word.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-subword-selection.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-with-punctuation-selection.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-with-underscore-selection.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-with-whitespace-selection.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-changed-text.html [ Failure ]
 
index 10b011a1452c02463925bd06ed52b4738d931ac7..a6d94e17eaa99a59cc2e8b41eb4fe9346cd17f40 100644 (file)
@@ -165,6 +165,7 @@ svg/custom/foreignObject-crash-on-hover.xml
 svg/custom/use-events-crash.svg
 
 # [WK2] [Mac] Spellcheck tests don't seem to work
+webkit.org/b/105616 editing/spelling/spelling-changed-text.html
 webkit.org/b/105616 platform/mac/editing/spelling/removing-underline-after-accepting-autocorrection-using-punctuation.html [ Failure ]
 webkit.org/b/105616 platform/mac/editing/spelling/click-autocorrected-word.html
 webkit.org/b/105616 platform/mac/editing/spelling/move-cursor-to-beginning-of-autocorrected-word.html
index 318b0fb84e36582af1c3d3fb24f853df9adbbac8..b87e7c0580e4708421a2b633921f81b2517e57f1 100644 (file)
@@ -1408,19 +1408,8 @@ webkit.org/b/94198 fast/forms/input-value.html [ Failure ]
 webkit.org/b/94198 fast/lists/inlineBoxWrapperNullCheck.html [ Failure ]
 webkit.org/b/94198 tables/mozilla/collapsing_borders/bug41262-3.html [ Failure ]
 
-# Spellchecker behavior tests.
-webkit.org/b/108370 editing/spelling/spelling-double-clicked-word.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-double-clicked-word-with-underscores.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-exactly-selected-multiple-words.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-exactly-selected-word.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-multiword-selection.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-should-select-multiple-words.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-should-select-single-word.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-subword-selection.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-with-punctuation-selection.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-with-underscore-selection.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-with-whitespace-selection.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-changed-text.html [ Skip ]
+webkit.org/b/114470 editing/spelling/spelling-exactly-selected-multiple-words.html [ Skip ]
+webkit.org/b/114470 editing/spelling/spelling-should-select-multiple-words.html [ Skip ]
 
 webkit.org/b/110027 compositing/transitions/transform-on-large-layer.html [ Pass ImageOnlyFailure ]
 
index 1b976749a76fc73454e64f49557ab2fecf71ade6..c57bce282130719899323098dfeb3de0af690caf 100644 (file)
@@ -820,15 +820,12 @@ editing/spelling/grammar-edit-word.html
 # Spellchecker behavior tests.
 # https://bugs.webkit.org/show_bug.cgi?id=108370
 editing/spelling/spelling-double-clicked-word.html
-editing/spelling/spelling-double-clicked-word-with-underscores.html
 editing/spelling/spelling-exactly-selected-multiple-words.html
 editing/spelling/spelling-exactly-selected-word.html
 editing/spelling/spelling-multiword-selection.html
 editing/spelling/spelling-should-select-multiple-words.html
-editing/spelling/spelling-should-select-single-word.html
 editing/spelling/spelling-subword-selection.html
 editing/spelling/spelling-with-punctuation-selection.html
-editing/spelling/spelling-with-underscore-selection.html
 editing/spelling/spelling-with-whitespace-selection.html
 webkit.org/b/108370 editing/spelling/spelling-changed-text.html [ Failure ]
 
index c80263c2a5d756d013bebe6cf1466d21daf75ef0..8d818b392cb3338db248a2226b42e9cde45dbac3 100644 (file)
@@ -2655,15 +2655,12 @@ media/W3C/video/events/event_canplaythrough.html
 
 # Spellchecker behavior tests.
 webkit.org/b/108370 editing/spelling/spelling-double-clicked-word.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-double-clicked-word-with-underscores.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-exactly-selected-multiple-words.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-exactly-selected-word.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-multiword-selection.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-should-select-multiple-words.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-should-select-single-word.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-subword-selection.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-with-punctuation-selection.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-with-underscore-selection.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-with-whitespace-selection.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spellcheck-async-mutation.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spellcheck-async.html [ Skip ]
index a7785740baddadeb5160a997da8714ba4e7644e6..c6d8d260db8d13a41c1aeaab142656a98dd8e5f2 100644 (file)
@@ -2987,15 +2987,12 @@ fast/css3-text/css3-text-indent [ Failure ImageOnlyFailure ]
 
 # Spellchecker behavior tests.
 webkit.org/b/108370 editing/spelling/spelling-double-clicked-word.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-double-clicked-word-with-underscores.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-exactly-selected-multiple-words.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-exactly-selected-word.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-multiword-selection.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-should-select-multiple-words.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-should-select-single-word.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-subword-selection.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-with-punctuation-selection.html [ Skip ]
-webkit.org/b/108370 editing/spelling/spelling-with-underscore-selection.html [ Skip ]
 webkit.org/b/108370 editing/spelling/spelling-with-whitespace-selection.html [ Skip ]
 
 # Need support for ResourceHandle::didChangePriority and DRT support
index b8773cd93418c96b40e1c0fbcb31532a27bda2e0..3bf07cc20a92d2613a43676de50ea6b329685e0b 100644 (file)
@@ -388,17 +388,14 @@ editing/spelling/spellcheck-attribute.html
 editing/spelling/spelling-attribute-at-child.html
 editing/spelling/spelling-attribute-change.html
 editing/spelling/spelling-double-clicked-word.html
-editing/spelling/spelling-double-clicked-word-with-underscores.html
 editing/spelling/spelling-exactly-selected-multiple-words.html
 editing/spelling/spelling-exactly-selected-word.html
 editing/spelling/spelling-hasspellingmarker.html
 editing/spelling/spelling-linebreak.html
 editing/spelling/spelling-multiword-selection.html
 editing/spelling/spelling-should-select-multiple-words.html
-editing/spelling/spelling-should-select-single-word.html
 editing/spelling/spelling-subword-selection.html
 editing/spelling/spelling-with-punctuation-selection.html
-editing/spelling/spelling-with-underscore-selection.html
 editing/spelling/spelling-with-whitespace-selection.html
 platform/mac/editing/spelling/delete-into-misspelled-word.html
 platform/mac/editing/spelling/editing-multiple-words-with-markers.html
index 7d70ec18490eb96c5b9ae6edecc80e9fb7f59da4..2acf6c2499067bca03d9827aa3cebc4312ebd202 100644 (file)
@@ -1,3 +1,29 @@
+2013-04-12  Ryosuke Niwa  <rniwa@webkit.org>
+
+        [Mac] Enable spellchecking tests added in r141471
+        https://bugs.webkit.org/show_bug.cgi?id=108525
+
+        Reviewed by Darin Adler.
+
+        Made automatic quote substitution, dash substitution, text replacement, and spelling correction
+        togglable via internals object. These functions are no-op when text replacement is not used.
+
+        This allows us to disable automatic spelling correction in spellcheck tests.
+
+        Enabled several tests added in r141471.
+
+        * WebCore.exp.in:
+        * testing/Internals.cpp:
+        (WebCore::Internals::setContinuousSpellCheckingEnabled): Don't null check editor() since it's not
+        null whenever frame() is not null.
+        (WebCore::Internals::setAutomaticQuoteSubstitutionEnabled): Added.
+        (WebCore::Internals::setAutomaticLinkDetectionEnabled): Added.
+        (WebCore::Internals::setAutomaticDashSubstitutionEnabled): Added.
+        (WebCore::Internals::setAutomaticTextReplacementEnabled): Added.
+        (WebCore::Internals::setAutomaticSpellingCorrectionEnabled): Added.
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2013-04-12  Alberto Garcia  <agarcia@igalia.com>
 
         [BlackBerry] Upstream the filesystem code
index 409dc6246f665ad2e95004f3523fef790dd53fec..b7e46559ec81ad7f566031f92833fc7306482719 100644 (file)
@@ -925,16 +925,26 @@ __ZN7WebCore6Editor24replaceSelectionWithTextERKN3WTF6StringEbb
 __ZN7WebCore6Editor26decreaseSelectionListLevelEv
 __ZN7WebCore6Editor26increaseSelectionListLevelEv
 __ZN7WebCore6Editor28replaceSelectionWithFragmentEN3WTF10PassRefPtrINS_16DocumentFragmentEEEbbb
+__ZN7WebCore6Editor28toggleAutomaticLinkDetectionEv
 __ZN7WebCore6Editor29canDecreaseSelectionListLevelEv
 __ZN7WebCore6Editor29canIncreaseSelectionListLevelEv
 __ZN7WebCore6Editor29handleAlternativeTextUIResultERKN3WTF6StringE
 __ZN7WebCore6Editor30deleteSelectionWithSmartDeleteEb
 __ZN7WebCore6Editor30pasteAsPlainTextBypassingDHTMLEv
+__ZN7WebCore6Editor30toggleAutomaticTextReplacementEv
+__ZN7WebCore6Editor31isAutomaticLinkDetectionEnabledEv
+__ZN7WebCore6Editor31toggleAutomaticDashSubstitutionEv
 __ZN7WebCore6Editor32guessesForUngrammaticalSelectionEv
+__ZN7WebCore6Editor32toggleAutomaticQuoteSubstitutionEv
 __ZN7WebCore6Editor33increaseSelectionListLevelOrderedEv
+__ZN7WebCore6Editor33isAutomaticTextReplacementEnabledEv
+__ZN7WebCore6Editor33toggleAutomaticSpellingCorrectionEv
+__ZN7WebCore6Editor34isAutomaticDashSubstitutionEnabledEv
 __ZN7WebCore6Editor34setMarkedTextMatchesAreHighlightedEb
 __ZN7WebCore6Editor35increaseSelectionListLevelUnorderedEv
+__ZN7WebCore6Editor35isAutomaticQuoteSubstitutionEnabledEv
 __ZN7WebCore6Editor35setIgnoreCompositionSelectionChangeEb
+__ZN7WebCore6Editor36isAutomaticSpellingCorrectionEnabledEv
 __ZN7WebCore6Editor38commandIsSupportedFromMenuOrKeyBindingERKN3WTF6StringE
 __ZN7WebCore6Editor39insertParagraphSeparatorInQuotedContentEv
 __ZN7WebCore6Editor3cutEv
index 6f64f143755d0255cee4bbf098f92868fee5821a..8420ce8e5289942f9e63108aba06fce3a974487a 100644 (file)
@@ -1513,13 +1513,78 @@ bool Internals::hasAutocorrectedMarker(Document* document, int from, int length,
 
 void Internals::setContinuousSpellCheckingEnabled(bool enabled, ExceptionCode&)
 {
-    if (!contextDocument() || !contextDocument()->frame() || !contextDocument()->frame()->editor())
+    if (!contextDocument() || !contextDocument()->frame())
         return;
 
     if (enabled != contextDocument()->frame()->editor()->isContinuousSpellCheckingEnabled())
         contextDocument()->frame()->editor()->toggleContinuousSpellChecking();
 }
 
+void Internals::setAutomaticQuoteSubstitutionEnabled(bool enabled, ExceptionCode&)
+{
+    if (!contextDocument() || !contextDocument()->frame())
+        return;
+
+#if USE(AUTOMATIC_TEXT_REPLACEMENT)
+    if (enabled != contextDocument()->frame()->editor()->isAutomaticQuoteSubstitutionEnabled())
+        contextDocument()->frame()->editor()->toggleAutomaticQuoteSubstitution();
+#else
+    UNUSED_PARAM(enabled);
+#endif
+}
+
+void Internals::setAutomaticLinkDetectionEnabled(bool enabled, ExceptionCode&)
+{
+    if (!contextDocument() || !contextDocument()->frame())
+        return;
+
+#if USE(AUTOMATIC_TEXT_REPLACEMENT)
+    if (enabled != contextDocument()->frame()->editor()->isAutomaticLinkDetectionEnabled())
+        contextDocument()->frame()->editor()->toggleAutomaticLinkDetection();
+#else
+    UNUSED_PARAM(enabled);
+#endif
+}
+
+void Internals::setAutomaticDashSubstitutionEnabled(bool enabled, ExceptionCode&)
+{
+    if (!contextDocument() || !contextDocument()->frame())
+        return;
+
+#if USE(AUTOMATIC_TEXT_REPLACEMENT)
+    if (enabled != contextDocument()->frame()->editor()->isAutomaticDashSubstitutionEnabled())
+        contextDocument()->frame()->editor()->toggleAutomaticDashSubstitution();
+#else
+    UNUSED_PARAM(enabled);
+#endif
+}
+
+void Internals::setAutomaticTextReplacementEnabled(bool enabled, ExceptionCode&)
+{
+    if (!contextDocument() || !contextDocument()->frame())
+        return;
+
+#if USE(AUTOMATIC_TEXT_REPLACEMENT)
+    if (enabled != contextDocument()->frame()->editor()->isAutomaticTextReplacementEnabled())
+        contextDocument()->frame()->editor()->toggleAutomaticTextReplacement();
+#else
+    UNUSED_PARAM(enabled);
+#endif
+}
+
+void Internals::setAutomaticSpellingCorrectionEnabled(bool enabled, ExceptionCode&)
+{
+    if (!contextDocument() || !contextDocument()->frame())
+        return;
+
+#if USE(AUTOMATIC_TEXT_REPLACEMENT)
+    if (enabled != contextDocument()->frame()->editor()->isAutomaticSpellingCorrectionEnabled())
+        contextDocument()->frame()->editor()->toggleAutomaticSpellingCorrection();
+#else
+    UNUSED_PARAM(enabled);
+#endif
+}
+
 bool Internals::isOverwriteModeEnabled(Document* document, ExceptionCode&)
 {
     if (!document || !document->frame())
index 945cc9ee2d3927156f648477592a85a2693496af..69400de2648308242bd448dd539033a6d7d9046b 100644 (file)
@@ -201,6 +201,11 @@ public:
     bool hasGrammarMarker(Document*, int from, int length, ExceptionCode&);
     bool hasAutocorrectedMarker(Document*, int from, int length, ExceptionCode&);
     void setContinuousSpellCheckingEnabled(bool enabled, ExceptionCode&);
+    void setAutomaticQuoteSubstitutionEnabled(bool enabled, ExceptionCode&);
+    void setAutomaticLinkDetectionEnabled(bool enabled, ExceptionCode&);
+    void setAutomaticDashSubstitutionEnabled(bool enabled, ExceptionCode&);
+    void setAutomaticTextReplacementEnabled(bool enabled, ExceptionCode&);
+    void setAutomaticSpellingCorrectionEnabled(bool enabled, ExceptionCode&);
 
     bool isOverwriteModeEnabled(Document*, ExceptionCode&);
     void toggleOverwriteModeEnabled(Document*, ExceptionCode&);
index 91cf354f124e706bfe7d899589309cf6a08e1cb2..0fc98a68841b981e506d315d144f0a93a457fa8f 100644 (file)
     boolean hasGrammarMarker(in Document document, in long from, in long length) raises (DOMException);
     boolean hasAutocorrectedMarker(in Document document, in long from, in long length) raises (DOMException);
     void setContinuousSpellCheckingEnabled(in boolean enabled) raises (DOMException);
+    void setAutomaticQuoteSubstitutionEnabled(in boolean enabled) raises (DOMException);
+    void setAutomaticLinkDetectionEnabled(in boolean enabled) raises (DOMException);
+    void setAutomaticDashSubstitutionEnabled(in boolean enabled) raises (DOMException);
+    void setAutomaticTextReplacementEnabled(in boolean enabled) raises (DOMException);
+    void setAutomaticSpellingCorrectionEnabled(in boolean enabled) raises (DOMException);
 
     boolean isOverwriteModeEnabled(in Document document) raises (DOMException);
     void toggleOverwriteModeEnabled(in Document document) raises (DOMException);
index e25b36aa3404d9511e8c5d9d8bdf31547c3f4743..b4f5da6d456c0f5ae3ec7aeee54ab0d3e85ea391 100644 (file)
@@ -1,3 +1,16 @@
+2013-04-12  Ryosuke Niwa  <rniwa@webkit.org>
+
+        [Mac] Enable spellchecking tests added in r141471
+        https://bugs.webkit.org/show_bug.cgi?id=108525
+
+        Reviewed by Darin Adler.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (createWebViewAndOffscreenWindow):
+        (resetDefaultsToConsistentValues):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetStateToConsistentValues):
+
 2013-04-12  Manuel Rego Casasnovas  <rego@igalia.com>
 
         [GTK] Enable WebKit2 building on GTK EWSs
index df17c968f8a1982bc279eaee2f7427d350a5bdd3..eb65b6b3d237201404acc4685ce8e9f4147cfaec 100644 (file)
@@ -539,6 +539,11 @@ WebView *createWebViewAndOffscreenWindow()
     [WebView registerURLSchemeAsLocal:@"feedsearch"];
     
     [webView setContinuousSpellCheckingEnabled:YES];
+    [webView setAutomaticQuoteSubstitutionEnabled:NO];
+    [webView setAutomaticLinkDetectionEnabled:NO];
+    [webView setAutomaticDashSubstitutionEnabled:NO];
+    [webView setAutomaticTextReplacementEnabled:NO];
+    [webView setAutomaticSpellingCorrectionEnabled:YES];
     [webView setDefersCallbacks:NO];
     [webView setGrammarCheckingEnabled:YES];
     [webView setInteractiveFormValidationEnabled:YES];
@@ -600,6 +605,8 @@ static void resetDefaultsToConsistentValues()
         @"notational", @"notationl",
         @"message", @"mesage",
         @"would", @"wouldn",
+        @"welcome", @"wellcome",
+        @"uppercase", @"upper case",
         nil] forKey:@"NSTestCorrectionDictionary"];
 #endif
 
index be7620fdf769bdadfab412f5666b6a406310d64c..259c7b053b4039aef00dd081e28a16f293d3d2a5 100644 (file)
@@ -577,6 +577,13 @@ bool TestController::resetStateToConsistentValues()
 #if !PLATFORM(MAC)
     WKTextCheckerContinuousSpellCheckingEnabledStateChanged(true);
 #endif
+#if USE(AUTOMATIC_TEXT_REPLACEMENT)
+    WKTextCheckerAutomaticQuoteSubstitutionEnabledStateChanged(false);
+    WKTextCheckerAutomaticLinkDetectionEnabledStateChanged(false);
+    WKTextCheckerAutomaticDashSubstitutionEnabledStateChanged(false);
+    WKTextCheckerAutomaticTextReplacementEnabledStateChanged(false);
+    WKTextCheckerAutomaticSpellingCorrectionEnabledStateChanged(true);
+#endif
 
     // in the case that a test using the chrome input field failed, be sure to clean up for the next test
     m_mainWebView->removeChromeInputField();