WebKit Bugzilla
Attachment 359535 Details for
Bug 193592
: Get rid of ADVANCED_SPELL_CHECKING
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193592-20190118135146.patch (text/plain), 13.79 KB, created by
Tim Horton
on 2019-01-18 13:51:47 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tim Horton
Created:
2019-01-18 13:51:47 PST
Size:
13.79 KB
patch
obsolete
>Subversion Revision: 240171 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 24ab7db194c5282dd0822fdef4dc0457b4a3449e..39d96c793d38d920f85d6f853ded53f6d9e01c1c 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,12 @@ >+2019-01-18 Tim Horton <timothy_horton@apple.com> >+ >+ Get rid of ADVANCED_SPELL_CHECKING >+ https://bugs.webkit.org/show_bug.cgi?id=193592 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/Platform.h: >+ > 2019-01-18 Matt Lewis <jlewis3@apple.com> > > Unreviewed, rolling out r240160. >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index d45d8ba058d296f431ffc859870e619feb21cf92..610bd81292e1530b05d76a00e7b8f4120f083e67 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-18 Tim Horton <timothy_horton@apple.com> >+ >+ Get rid of ADVANCED_SPELL_CHECKING >+ https://bugs.webkit.org/show_bug.cgi?id=193592 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * pal/spi/mac/NSSpellCheckerSPI.h: >+ It's always true on macOS, and all but one use of it is already inside PLATFORM(MAC) >+ > 2019-01-18 David Kilzer <ddkilzer@apple.com> > > Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h} >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 9f789b9159c85bcb40ece3ab92afb61a85e0fff3..2d8615e762cb7addcc4722a4ff57ab27d03fcef6 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2019-01-18 Tim Horton <timothy_horton@apple.com> >+ >+ Get rid of ADVANCED_SPELL_CHECKING >+ https://bugs.webkit.org/show_bug.cgi?id=193592 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/Cocoa/WebViewImpl.mm: >+ (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded): >+ (WebKit::WebViewImpl::insertText): >+ * UIProcess/mac/TextCheckerMac.mm: >+ (WebKit::TextChecker::checkTextOfParagraph): >+ (WebKit::TextChecker::getGuessesForWord): >+ > 2019-01-18 Antti Koivisto <antti@apple.com> > > Implement asynchronous frame scrolling for iOS >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index fbc2236d606c486b11554942187b64e9f657e061..1b4eae8e1831bafc35993eaf2f850c779ebef31e 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,19 @@ >+2019-01-18 Tim Horton <timothy_horton@apple.com> >+ >+ Get rid of ADVANCED_SPELL_CHECKING >+ https://bugs.webkit.org/show_bug.cgi?id=193592 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCoreSupport/WebEditorClient.mm: >+ (insertionPointFromCurrentSelection): >+ (WebEditorClient::checkTextOfParagraph): >+ (WebEditorClient::getGuessesForWord): >+ (WebEditorClient::requestCandidatesForSelection): >+ (WebEditorClient::requestCheckingOfString): >+ * WebView/WebHTMLView.mm: >+ (-[WebHTMLView insertText:]): >+ > 2019-01-18 David Kilzer <ddkilzer@apple.com> > > Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h} >diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h >index c8fe6ba767e21b790224e18d9cd4547209f94dd1..49b172fdfa1db0e6b6187cd6d46ed1561aff7939 100644 >--- a/Source/WTF/wtf/Platform.h >+++ b/Source/WTF/wtf/Platform.h >@@ -1340,7 +1340,6 @@ > > #if PLATFORM(MAC) > #define HAVE_TOUCH_BAR 1 >-#define HAVE_ADVANCED_SPELL_CHECKING 1 > #define USE_DICTATION_ALTERNATIVES 1 > > #if defined(__LP64__) >diff --git a/Source/WebCore/PAL/pal/spi/mac/NSSpellCheckerSPI.h b/Source/WebCore/PAL/pal/spi/mac/NSSpellCheckerSPI.h >index 2f6030ea25cfba1ee158868ec77632cac374a342..f13b1c71589c14d4058206eee8a71c0c7a85f973 100644 >--- a/Source/WebCore/PAL/pal/spi/mac/NSSpellCheckerSPI.h >+++ b/Source/WebCore/PAL/pal/spi/mac/NSSpellCheckerSPI.h >@@ -31,18 +31,12 @@ > > #else > >-#if HAVE(ADVANCED_SPELL_CHECKING) > extern NSString *NSTextCheckingInsertionPointKey; >-#endif >- > extern NSString *NSTextCheckingSuppressInitialCapitalizationKey; > > @interface NSSpellChecker () > >-#if HAVE(ADVANCED_SPELL_CHECKING) > - (BOOL)deletesAutospaceBeforeString:(NSString *)string language:(NSString *)language; >-#endif >- > - (void)_preflightChosenSpellServer; > > @end >diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >index 5dd15355cbd4ae4f84e860bf60abc579d40f3b30..7d2b12a088ce0e42cff31fc5ebae2923bc0820ec 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >@@ -3229,7 +3229,6 @@ void WebViewImpl::requestCandidatesForSelectionIfNeeded() > auto& postLayoutData = editorState.postLayoutData(); > m_lastStringForCandidateRequest = postLayoutData.stringForCandidateRequest; > >-#if HAVE(ADVANCED_SPELL_CHECKING) > NSRange selectedRange = NSMakeRange(postLayoutData.candidateRequestStartPosition, postLayoutData.selectedTextLength); > NSTextCheckingTypes checkingTypes = NSTextCheckingTypeSpelling | NSTextCheckingTypeReplacement | NSTextCheckingTypeCorrection; > auto weakThis = makeWeakPtr(*this); >@@ -3240,7 +3239,6 @@ void WebViewImpl::requestCandidatesForSelectionIfNeeded() > weakThis->handleRequestedCandidates(sequenceNumber, candidates); > }); > }]; >-#endif // HAVE(ADVANCED_SPELL_CHECKING) > } > > void WebViewImpl::handleRequestedCandidates(NSInteger sequenceNumber, NSArray<NSTextCheckingResult *> *candidates) >@@ -4756,12 +4754,10 @@ void WebViewImpl::insertText(id string, NSRange replacementRange) > text = string; > > m_isTextInsertionReplacingSoftSpace = false; >-#if HAVE(ADVANCED_SPELL_CHECKING) > if (m_softSpaceRange.location != NSNotFound && (replacementRange.location == NSMaxRange(m_softSpaceRange) || replacementRange.location == NSNotFound) && replacementRange.length == 0 && [[NSSpellChecker sharedSpellChecker] deletesAutospaceBeforeString:text language:nil]) { > replacementRange = m_softSpaceRange; > m_isTextInsertionReplacingSoftSpace = true; > } >-#endif > m_softSpaceRange = NSMakeRange(NSNotFound, 0); > > // insertText can be called for several reasons: >diff --git a/Source/WebKit/UIProcess/mac/TextCheckerMac.mm b/Source/WebKit/UIProcess/mac/TextCheckerMac.mm >index 3b84f2564d004fd15155259b92d3ba5d04732ee6..d003ea9e577c8c42ce12f7fdfcca4b073836b6b1 100644 >--- a/Source/WebKit/UIProcess/mac/TextCheckerMac.mm >+++ b/Source/WebKit/UIProcess/mac/TextCheckerMac.mm >@@ -321,15 +321,10 @@ Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(SpellDocumentTag sp > Vector<TextCheckingResult> results; > > RetainPtr<NSString> textString = text.createNSStringWithoutCopying(); >- NSDictionary *options = nil; >-#if HAVE(ADVANCED_SPELL_CHECKING) >- options = @{ >+ NSDictionary *options = @{ > NSTextCheckingInsertionPointKey : @(insertionPoint), > NSTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled) > }; >-#else >- options = @{ NSTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled) }; >-#endif > NSArray *incomingResults = [[NSSpellChecker sharedSpellChecker] checkString:textString.get() > range:NSMakeRange(0, text.length()) > types:nsTextCheckingTypes(checkingTypes) | NSTextCheckingTypeOrthography >@@ -465,15 +460,10 @@ void TextChecker::getGuessesForWord(SpellDocumentTag spellDocumentTag, const Str > NSString* language = nil; > NSOrthography* orthography = nil; > NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker]; >- NSDictionary *options = nil; >-#if HAVE(ADVANCED_SPELL_CHECKING) >- options = @{ >+ NSDictionary *options = @{ > NSTextCheckingInsertionPointKey : @(insertionPoint), > NSTextCheckingSuppressInitialCapitalizationKey : @(!initialCapitalizationEnabled) > }; >-#else >- 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]; > language = [checker languageForWordRange:NSMakeRange(0, context.length()) inString:context orthography:orthography]; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >index 69b767ae7d74de1e6d27d9b169226fcedcb4c719..ccc33f940fbc9e631fdd98d2ea16b97e156bd0b3 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >@@ -1032,21 +1032,16 @@ static Vector<TextCheckingResult> core(NSArray *incomingResults, OptionSet<TextC > return results; > } > >-#if HAVE(ADVANCED_SPELL_CHECKING) > static int insertionPointFromCurrentSelection(const VisibleSelection& currentSelection) > { > VisiblePosition selectionStart = currentSelection.visibleStart(); > VisiblePosition paragraphStart = startOfParagraph(selectionStart); > return TextIterator::rangeLength(makeRange(paragraphStart, selectionStart).get()); > } >-#endif > > Vector<TextCheckingResult> WebEditorClient::checkTextOfParagraph(StringView string, OptionSet<TextCheckingType> coreCheckingTypes, const VisibleSelection& currentSelection) > { >- NSDictionary *options = nil; >-#if HAVE(ADVANCED_SPELL_CHECKING) >- options = @{ NSTextCheckingInsertionPointKey : [NSNumber numberWithUnsignedInteger:insertionPointFromCurrentSelection(currentSelection)] }; >-#endif >+ NSDictionary *options = @{ NSTextCheckingInsertionPointKey : [NSNumber numberWithUnsignedInteger:insertionPointFromCurrentSelection(currentSelection)] }; > return core([[NSSpellChecker sharedSpellChecker] checkString:string.createNSStringWithoutCopying().get() range:NSMakeRange(0, string.length()) types:(nsTextCheckingTypes(coreCheckingTypes) | NSTextCheckingTypeOrthography) options:options inSpellDocumentWithTag:spellCheckerDocumentTag() orthography:NULL wordCount:NULL], coreCheckingTypes); > } > >@@ -1089,10 +1084,7 @@ void WebEditorClient::getGuessesForWord(const String& word, const String& contex > NSString* language = nil; > NSOrthography* orthography = nil; > NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker]; >- NSDictionary *options = nil; >-#if HAVE(ADVANCED_SPELL_CHECKING) >- options = @{ NSTextCheckingInsertionPointKey : [NSNumber numberWithUnsignedInteger:insertionPointFromCurrentSelection(currentSelection)] }; >-#endif >+ NSDictionary *options = @{ NSTextCheckingInsertionPointKey : [NSNumber numberWithUnsignedInteger:insertionPointFromCurrentSelection(currentSelection)] }; > if (context.length()) { > [checker checkString:context range:NSMakeRange(0, context.length()) types:NSTextCheckingTypeOrthography options:options inSpellDocumentWithTag:spellCheckerDocumentTag() orthography:&orthography wordCount:0]; > language = [checker languageForWordRange:NSMakeRange(0, context.length()) inString:context orthography:orthography]; >@@ -1135,7 +1127,6 @@ void WebEditorClient::requestCandidatesForSelection(const VisibleSelection& sele > > m_lastSelectionForRequestedCandidates = selection; > >-#if HAVE(ADVANCED_SPELL_CHECKING) > VisiblePosition selectionStart = selection.visibleStart(); > VisiblePosition selectionEnd = selection.visibleEnd(); > VisiblePosition paragraphStart = startOfParagraph(selectionStart); >@@ -1155,7 +1146,6 @@ void WebEditorClient::requestCandidatesForSelection(const VisibleSelection& sele > weakEditor->handleRequestedCandidates(sequenceNumber, candidates); > }); > }]; >-#endif // HAVE(ADVANCED_SPELL_CHECKING) > } > > void WebEditorClient::handleRequestedCandidates(NSInteger sequenceNumber, NSArray<NSTextCheckingResult *> *candidates) >@@ -1267,10 +1257,7 @@ void WebEditorClient::requestCheckingOfString(WebCore::TextCheckingRequest& requ > int sequence = m_textCheckingRequest->data().sequence(); > NSRange range = NSMakeRange(0, m_textCheckingRequest->data().text().length()); > NSRunLoop* currentLoop = [NSRunLoop currentRunLoop]; >- NSDictionary *options = nil; >-#if HAVE(ADVANCED_SPELL_CHECKING) >- options = @{ NSTextCheckingInsertionPointKey : [NSNumber numberWithUnsignedInteger:insertionPointFromCurrentSelection(currentSelection)] }; >-#endif >+ NSDictionary *options = @{ NSTextCheckingInsertionPointKey : [NSNumber numberWithUnsignedInteger:insertionPointFromCurrentSelection(currentSelection)] }; > [[NSSpellChecker sharedSpellChecker] requestCheckingOfString:m_textCheckingRequest->data().text() range:range types:NSTextCheckingAllSystemTypes options:options inSpellDocumentWithTag:0 completionHandler:^(NSInteger, NSArray* results, NSOrthography*, NSInteger) { > [currentLoop performSelector:@selector(perform) > target:[[[WebEditorSpellCheckResponder alloc] initWithClient:this sequence:sequence results:results] autorelease] >diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >index ff740ee90efffb1f742832ea2a0d78ae88d3b856..512934a7e5fd64c60dc97306a3a1df363f71f89a 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >@@ -6712,13 +6712,11 @@ IGNORE_WARNINGS_END > return; > > BOOL needToRemoveSoftSpace = NO; >-#if HAVE(ADVANCED_SPELL_CHECKING) >+#if PLATFORM(MAC) > if (_private->softSpaceRange.location != NSNotFound && (replacementRange.location == NSMaxRange(_private->softSpaceRange) || replacementRange.location == NSNotFound) && !replacementRange.length && [[NSSpellChecker sharedSpellChecker] deletesAutospaceBeforeString:text language:nil]) { > replacementRange = _private->softSpaceRange; > needToRemoveSoftSpace = YES; > } >-#endif >-#if PLATFORM(MAC) > _private->softSpaceRange = NSMakeRange(NSNotFound, 0); > #endif >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193592
: 359535