Adopt NSTextCheckingSuppressInitialCapitalizationKey
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2019 21:12:12 +0000 (21:12 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2019 21:12:12 +0000 (21:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193545

Reviewed by Dean Jackson.

Source/WebCore/PAL:

* pal/spi/mac/NSSpellCheckerSPI.h:

Source/WebKit:

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

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

Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/mac/NSSpellCheckerSPI.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/mac/TextCheckerMac.mm

index c4ca14c..dceed04 100644 (file)
@@ -1,3 +1,12 @@
+2019-01-17  Tim Horton  <timothy_horton@apple.com>
+
+        Adopt NSTextCheckingSuppressInitialCapitalizationKey
+        https://bugs.webkit.org/show_bug.cgi?id=193545
+
+        Reviewed by Dean Jackson.
+
+        * pal/spi/mac/NSSpellCheckerSPI.h:
+
 2019-01-17  Jer Noble  <jer.noble@apple.com>
 
         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
index 5c21447..2f6030e 100644 (file)
@@ -35,6 +35,8 @@
 extern NSString *NSTextCheckingInsertionPointKey;
 #endif
 
+extern NSString *NSTextCheckingSuppressInitialCapitalizationKey;
+
 @interface NSSpellChecker ()
 
 #if HAVE(ADVANCED_SPELL_CHECKING)
index e771d13..98a98f2 100644 (file)
@@ -1,3 +1,14 @@
+2019-01-17  Tim Horton  <timothy_horton@apple.com>
+
+        Adopt NSTextCheckingSuppressInitialCapitalizationKey
+        https://bugs.webkit.org/show_bug.cgi?id=193545
+
+        Reviewed by Dean Jackson.
+
+        * UIProcess/mac/TextCheckerMac.mm:
+        (WebKit::TextChecker::checkTextOfParagraph):
+        (WebKit::TextChecker::getGuessesForWord):
+
 2019-01-17  Jer Noble  <jer.noble@apple.com>
 
         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
index c4e9c25..3b84f25 100644 (file)
@@ -48,11 +48,6 @@ static NSString* const WebAutomaticDashSubstitutionEnabled = @"WebAutomaticDashS
 static NSString* const WebAutomaticLinkDetectionEnabled = @"WebAutomaticLinkDetectionEnabled";
 static NSString* const WebAutomaticTextReplacementEnabled = @"WebAutomaticTextReplacementEnabled";
 
-// FIXME: this needs to be removed and replaced with NSTextCheckingSuppressInitialCapitalizationKey as soon as
-// rdar://problem/26800924 is fixed.
-
-static NSString* const WebTextCheckingSuppressInitialCapitalizationKey = @"SuppressInitialCapitalization";
-
 namespace WebKit {
 using namespace WebCore;
 
@@ -328,10 +323,12 @@ Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(SpellDocumentTag sp
     RetainPtr<NSString> textString = text.createNSStringWithoutCopying();
     NSDictionary *options = nil;
 #if HAVE(ADVANCED_SPELL_CHECKING)
-    options = @{ NSTextCheckingInsertionPointKey : @(insertionPoint),
-                 WebTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled) };
+    options = @{
+        NSTextCheckingInsertionPointKey : @(insertionPoint),
+        NSTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled)
+    };
 #else
-    options = @{ WebTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled) };
+    options = @{ NSTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled) };
 #endif
     NSArray *incomingResults = [[NSSpellChecker sharedSpellChecker] checkString:textString.get()
                                                                           range:NSMakeRange(0, text.length())
@@ -470,10 +467,12 @@ void TextChecker::getGuessesForWord(SpellDocumentTag spellDocumentTag, const Str
     NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker];
     NSDictionary *options = nil;
 #if HAVE(ADVANCED_SPELL_CHECKING)
-    options = @{ NSTextCheckingInsertionPointKey : @(insertionPoint),
-                 WebTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled) };
+    options = @{
+        NSTextCheckingInsertionPointKey : @(insertionPoint),
+        NSTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled)
+    };
 #else
-    options = @{ WebTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled) };
+    options = @{ NSTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled) };
 #endif
     if (context.length()) {
         [checker checkString:context range:NSMakeRange(0, context.length()) types:NSTextCheckingTypeOrthography options:options inSpellDocumentWithTag:spellDocumentTag orthography:&orthography wordCount:0];