Support configurable autocapitalization.
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jul 2016 16:32:21 +0000 (16:32 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jul 2016 16:32:21 +0000 (16:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=158860
rdar://problem/27536113

Reviewed by Tim Horton.

Autocapitalization should be enabled/disabled regardless of whether
we are using advance spelling feature.

* UIProcess/mac/TextCheckerMac.mm:
(WebKit::TextChecker::checkTextOfParagraph):
(WebKit::TextChecker::getGuessesForWord):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/TextCheckerMac.mm

index 599356f..2ecf0c6 100644 (file)
@@ -1,3 +1,19 @@
+2016-07-26  Enrica Casucci  <enrica@apple.com>
+
+        Support configurable autocapitalization.
+        https://bugs.webkit.org/show_bug.cgi?id=158860
+        rdar://problem/27536113
+
+        Reviewed by Tim Horton.
+
+        Autocapitalization should be enabled/disabled regardless of whether
+        we are using advance spelling feature.
+
+        * UIProcess/mac/TextCheckerMac.mm:
+        (WebKit::TextChecker::checkTextOfParagraph):
+        (WebKit::TextChecker::getGuessesForWord):
+
+
 2016-07-26  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [Coordinated Graphics] Test fast/fixed-layout/fixed-layout.html crashes in debug
index 1f7528e..0cddb40 100644 (file)
@@ -47,12 +47,10 @@ static NSString* const WebAutomaticDashSubstitutionEnabled = @"WebAutomaticDashS
 static NSString* const WebAutomaticLinkDetectionEnabled = @"WebAutomaticLinkDetectionEnabled";
 static NSString* const WebAutomaticTextReplacementEnabled = @"WebAutomaticTextReplacementEnabled";
 
-#if HAVE(ADVANCED_SPELL_CHECKING)
 // FIXME: this needs to be removed and replaced with NSTextCheckingSuppressInitialCapitalizationKey as soon as
 // rdar://problem/26800924 is fixed.
 
 static NSString* const WebTextCheckingSuppressInitialCapitalizationKey = @"SuppressInitialCapitalization";
-#endif
 
 using namespace WebCore;
 
@@ -308,7 +306,7 @@ Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocume
     options = @{ NSTextCheckingInsertionPointKey : @(insertionPoint),
                  WebTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled) };
 #else
-    UNUSED_PARAM(initialCapitalizationEnabled);
+    options = @{ WebTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled) };
 #endif
     NSArray *incomingResults = [[NSSpellChecker sharedSpellChecker] checkString:textString.get()
                                                                           range:NSMakeRange(0, text.length())
@@ -449,6 +447,8 @@ void TextChecker::getGuessesForWord(int64_t spellDocumentTag, const String& word
 #if HAVE(ADVANCED_SPELL_CHECKING)
     options = @{ NSTextCheckingInsertionPointKey : @(insertionPoint),
                  WebTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled) };
+#else
+    options = @{ WebTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled) };
 #endif
     if (context.length()) {
         [checker checkString:context range:NSMakeRange(0, context.length()) types:NSTextCheckingTypeOrthography options:options inSpellDocumentWithTag:spellDocumentTag orthography:&orthography wordCount:0];