WebKit Bugzilla
Attachment 347700 Details for
Bug 188817
: Cleanup: Add type alias for spell document tag
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188817-20180821143918.patch (text/plain), 27.76 KB, created by
Daniel Bates
on 2018-08-21 14:39:18 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2018-08-21 14:39:18 PDT
Size:
27.76 KB
patch
obsolete
>Subversion Revision: 234848 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 7a8054f51c4f73af3598d56340e77fa076476916..17b8bea6d3c23947195a8cdf1ed7a559ccafd8b5 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,74 @@ >+2018-08-21 Daniel Bates <dabates@apple.com> >+ >+ Cleanup: Add type alias for spell document tag >+ https://bugs.webkit.org/show_bug.cgi?id=188817 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/TextChecker.h: >+ * UIProcess/TextCheckerCompletion.h: >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::~WebPageProxy): >+ (WebKit::WebPageProxy::spellDocumentTag): >+ * UIProcess/WebPageProxy.h: Also addressed FIXME comment and modernized the code to use a std::optional >+ while I am here. >+ * UIProcess/gtk/TextCheckerGtk.cpp: >+ (WebKit::TextChecker::uniqueSpellDocumentTag): >+ (WebKit::TextChecker::closeSpellDocumentWithTag): >+ (WebKit::TextChecker::checkSpellingOfString): >+ (WebKit::TextChecker::checkGrammarOfString): >+ (WebKit::TextChecker::updateSpellingUIWithMisspelledWord): >+ (WebKit::TextChecker::updateSpellingUIWithGrammarString): >+ (WebKit::TextChecker::getGuessesForWord): >+ (WebKit::TextChecker::learnWord): >+ (WebKit::TextChecker::ignoreWord): >+ (WebKit::TextChecker::checkTextOfParagraph): >+ * UIProcess/ios/TextCheckerIOS.mm: >+ (WebKit::spellDocumentTagMap): >+ (WebKit::TextChecker::uniqueSpellDocumentTag): >+ (WebKit::TextChecker::closeSpellDocumentWithTag): >+ (WebKit::textCheckerFor): >+ (WebKit::TextChecker::checkTextOfParagraph): >+ (WebKit::TextChecker::checkSpellingOfString): >+ (WebKit::TextChecker::checkGrammarOfString): >+ (WebKit::TextChecker::updateSpellingUIWithMisspelledWord): >+ (WebKit::TextChecker::updateSpellingUIWithGrammarString): >+ (WebKit::TextChecker::getGuessesForWord): >+ (WebKit::TextChecker::learnWord): >+ (WebKit::TextChecker::ignoreWord): >+ * UIProcess/mac/TextCheckerMac.mm: >+ (WebKit::TextChecker::uniqueSpellDocumentTag): >+ (WebKit::TextChecker::closeSpellDocumentWithTag): >+ (WebKit::TextChecker::checkTextOfParagraph): >+ (WebKit::TextChecker::checkSpellingOfString): >+ (WebKit::TextChecker::checkGrammarOfString): >+ (WebKit::TextChecker::updateSpellingUIWithMisspelledWord): >+ (WebKit::TextChecker::updateSpellingUIWithGrammarString): >+ (WebKit::TextChecker::getGuessesForWord): >+ (WebKit::TextChecker::learnWord): >+ (WebKit::TextChecker::ignoreWord): >+ * UIProcess/win/TextCheckerWin.cpp: >+ (WebKit::TextChecker::uniqueSpellDocumentTag): >+ (WebKit::TextChecker::closeSpellDocumentWithTag): >+ (WebKit::TextChecker::checkSpellingOfString): >+ (WebKit::TextChecker::checkGrammarOfString): >+ (WebKit::TextChecker::updateSpellingUIWithMisspelledWord): >+ (WebKit::TextChecker::updateSpellingUIWithGrammarString): >+ (WebKit::TextChecker::getGuessesForWord): >+ (WebKit::TextChecker::learnWord): >+ (WebKit::TextChecker::ignoreWord): >+ (WebKit::TextChecker::checkTextOfParagraph): >+ * UIProcess/wpe/TextCheckerWPE.cpp: >+ (WebKit::TextChecker::uniqueSpellDocumentTag): >+ (WebKit::TextChecker::closeSpellDocumentWithTag): >+ (WebKit::TextChecker::checkSpellingOfString): >+ (WebKit::TextChecker::checkGrammarOfString): >+ (WebKit::TextChecker::updateSpellingUIWithMisspelledWord): >+ (WebKit::TextChecker::updateSpellingUIWithGrammarString): >+ (WebKit::TextChecker::getGuessesForWord): >+ (WebKit::TextChecker::learnWord): >+ (WebKit::TextChecker::ignoreWord): >+ > 2018-08-21 Daniel Bates <dabates@apple.com> > > [iOS][WK2] Misspelled words are not underlined >diff --git a/Source/WebKit/UIProcess/TextChecker.h b/Source/WebKit/UIProcess/TextChecker.h >index 9588b64fcbd72f5c018ce8a0611f14fefddcc702..e4f05e53cfd908f4ac0fda6b8f4761795200a9c4 100644 >--- a/Source/WebKit/UIProcess/TextChecker.h >+++ b/Source/WebKit/UIProcess/TextChecker.h >@@ -34,6 +34,8 @@ namespace WebKit { > class WebPageProxy; > struct TextCheckerState; > >+using SpellDocumentTag = int64_t; >+ > class TextChecker { > public: > static const TextCheckerState& state(); >@@ -71,20 +73,21 @@ public: > > static void continuousSpellCheckingEnabledStateChanged(bool); > static void grammarCheckingEnabledStateChanged(bool); >- static int64_t uniqueSpellDocumentTag(WebPageProxy*); >- static void closeSpellDocumentWithTag(int64_t); >+ >+ static SpellDocumentTag uniqueSpellDocumentTag(WebPageProxy*); >+ static void closeSpellDocumentWithTag(SpellDocumentTag); > #if USE(UNIFIED_TEXT_CHECKING) >- static Vector<WebCore::TextCheckingResult> checkTextOfParagraph(int64_t spellDocumentTag, StringView, int32_t insertionPoint, OptionSet<WebCore::TextCheckingType>, bool initialCapitalizationEnabled); >+ static Vector<WebCore::TextCheckingResult> checkTextOfParagraph(SpellDocumentTag, StringView, int32_t insertionPoint, OptionSet<WebCore::TextCheckingType>, bool initialCapitalizationEnabled); > #endif >- static void checkSpellingOfString(int64_t spellDocumentTag, StringView text, int32_t& misspellingLocation, int32_t& misspellingLength); >- static void checkGrammarOfString(int64_t spellDocumentTag, StringView text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength); >+ static void checkSpellingOfString(SpellDocumentTag, StringView text, int32_t& misspellingLocation, int32_t& misspellingLength); >+ static void checkGrammarOfString(SpellDocumentTag, StringView text, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength); > static bool spellingUIIsShowing(); > static void toggleSpellingUIIsShowing(); >- static void updateSpellingUIWithMisspelledWord(int64_t spellDocumentTag, const String& misspelledWord); >- static void updateSpellingUIWithGrammarString(int64_t spellDocumentTag, const String& badGrammarPhrase, const WebCore::GrammarDetail&); >- static void getGuessesForWord(int64_t spellDocumentTag, const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses, bool initialCapitalizationEnabled); >- static void learnWord(int64_t spellDocumentTag, const String& word); >- static void ignoreWord(int64_t spellDocumentTag, const String& word); >+ static void updateSpellingUIWithMisspelledWord(SpellDocumentTag, const String& misspelledWord); >+ static void updateSpellingUIWithGrammarString(SpellDocumentTag, const String& badGrammarPhrase, const WebCore::GrammarDetail&); >+ static void getGuessesForWord(SpellDocumentTag, const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses, bool initialCapitalizationEnabled); >+ static void learnWord(SpellDocumentTag, const String& word); >+ static void ignoreWord(SpellDocumentTag, const String& word); > static void requestCheckingOfString(Ref<TextCheckerCompletion>&&, int32_t insertionPoint); > }; > >diff --git a/Source/WebKit/UIProcess/TextCheckerCompletion.h b/Source/WebKit/UIProcess/TextCheckerCompletion.h >index 0eb59bea727bd06da6a43ccc9f19ebfea1c7167b..eab2aebbb1f8cd63bbe153566b04d12b63d008b9 100644 >--- a/Source/WebKit/UIProcess/TextCheckerCompletion.h >+++ b/Source/WebKit/UIProcess/TextCheckerCompletion.h >@@ -36,7 +36,7 @@ public: > static Ref<TextCheckerCompletion> create(uint64_t requestID, const WebCore::TextCheckingRequestData&, WebPageProxy*); > > const WebCore::TextCheckingRequestData& textCheckingRequestData() const; >- int64_t spellDocumentTag(); >+ SpellDocumentTag spellDocumentTag(); > void didFinishCheckingText(const Vector<WebCore::TextCheckingResult>&) const; > void didCancelCheckingText() const; > >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index d4d70251058abcdfdf3b9c7bd099ad5ba1561170..d91350835b06e1421ec0a49afd94526763b2f0e5 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -488,8 +488,8 @@ WebPageProxy::~WebPageProxy() > > WebProcessPool::statistics().wkPageCount--; > >- if (m_hasSpellDocumentTag) >- TextChecker::closeSpellDocumentWithTag(m_spellDocumentTag); >+ if (m_spellDocumentTag) >+ TextChecker::closeSpellDocumentWithTag(m_spellDocumentTag.value()); > > m_preferences->removePage(*this); > m_pageGroup->removePage(this); >@@ -5376,14 +5376,11 @@ bool WebPageProxy::isValidEditCommand(WebEditCommandProxy* command) > return m_editCommandSet.find(command) != m_editCommandSet.end(); > } > >-int64_t WebPageProxy::spellDocumentTag() >+SpellDocumentTag WebPageProxy::spellDocumentTag() > { >- if (!m_hasSpellDocumentTag) { >+ if (!m_spellDocumentTag) > m_spellDocumentTag = TextChecker::uniqueSpellDocumentTag(this); >- m_hasSpellDocumentTag = true; >- } >- >- return m_spellDocumentTag; >+ return m_spellDocumentTag.value(); > } > > #if USE(UNIFIED_TEXT_CHECKING) >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index f41a786de228518ceef74534b3443dac0626f5dc..86b106287f093bd0c0ccfc313af53bb7d40c70fb 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -327,6 +327,8 @@ typedef GenericCallback<const WTF::MachSendRight&> MachSendRightCallback; > typedef GenericCallback<bool, bool, String, double, double, uint64_t> NowPlayingInfoCallback; > #endif > >+using SpellDocumentTag = int64_t; >+ > class WebPageProxy : public API::ObjectImpl<API::Object::Type::Page> > #if ENABLE(INPUT_TYPE_COLOR) > , public WebColorPicker::Client >@@ -1125,7 +1127,8 @@ public: > > void didReceiveAuthenticationChallengeProxy(uint64_t frameID, Ref<AuthenticationChallengeProxy>&&); > >- int64_t spellDocumentTag(); >+ SpellDocumentTag spellDocumentTag(); >+ > void didFinishCheckingText(uint64_t requestID, const Vector<WebCore::TextCheckingResult>&); > void didCancelCheckingText(uint64_t requestID); > >@@ -2083,8 +2086,6 @@ private: > WebCore::Color m_backgroundColor { WebCore::Color::white }; > #endif > >- int64_t m_spellDocumentTag { 0 }; // FIXME: use std::optional<>. >- bool m_hasSpellDocumentTag { false }; > unsigned m_pendingLearnOrIgnoreWordMessageCount { 0 }; > > bool m_mainFrameHasCustomContentProvider { false }; >@@ -2217,6 +2218,8 @@ private: > std::unique_ptr<DisplayLink> m_displayLink; > #endif > >+ std::optional<SpellDocumentTag> m_spellDocumentTag; >+ > std::optional<MonotonicTime> m_pageLoadStart; > > // FIXME: Support more than one suspended page per WebPageProxy, >diff --git a/Source/WebKit/UIProcess/gtk/TextCheckerGtk.cpp b/Source/WebKit/UIProcess/gtk/TextCheckerGtk.cpp >index b477a3d5fff727581dde5fd49e69d4135dd1301d..cdf1d77aec3b7ccb6720f57e56efbb02c0ebabfa 100644 >--- a/Source/WebKit/UIProcess/gtk/TextCheckerGtk.cpp >+++ b/Source/WebKit/UIProcess/gtk/TextCheckerGtk.cpp >@@ -127,16 +127,16 @@ void TextChecker::grammarCheckingEnabledStateChanged(bool enabled) > #endif > } > >-int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*) >+SpellDocumentTag TextChecker::uniqueSpellDocumentTag(WebPageProxy*) > { >- return 0; >+ return { }; > } > >-void TextChecker::closeSpellDocumentWithTag(int64_t /* tag */) >+void TextChecker::closeSpellDocumentWithTag(SpellDocumentTag) > { > } > >-void TextChecker::checkSpellingOfString(int64_t /* spellDocumentTag */, StringView text, int32_t& misspellingLocation, int32_t& misspellingLength) >+void TextChecker::checkSpellingOfString(SpellDocumentTag, StringView text, int32_t& misspellingLocation, int32_t& misspellingLength) > { > #if ENABLE(SPELLCHECK) > misspellingLocation = -1; >@@ -149,7 +149,7 @@ void TextChecker::checkSpellingOfString(int64_t /* spellDocumentTag */, StringVi > #endif > } > >-void TextChecker::checkGrammarOfString(int64_t /* spellDocumentTag */, StringView /* text */, Vector<WebCore::GrammarDetail>& /* grammarDetails */, int32_t& /* badGrammarLocation */, int32_t& /* badGrammarLength */) >+void TextChecker::checkGrammarOfString(SpellDocumentTag, StringView /* text */, Vector<WebCore::GrammarDetail>& /* grammarDetails */, int32_t& /* badGrammarLocation */, int32_t& /* badGrammarLength */) > { > } > >@@ -162,15 +162,15 @@ void TextChecker::toggleSpellingUIIsShowing() > { > } > >-void TextChecker::updateSpellingUIWithMisspelledWord(int64_t /* spellDocumentTag */, const String& /* misspelledWord */) >+void TextChecker::updateSpellingUIWithMisspelledWord(SpellDocumentTag, const String& /* misspelledWord */) > { > } > >-void TextChecker::updateSpellingUIWithGrammarString(int64_t /* spellDocumentTag */, const String& /* badGrammarPhrase */, const GrammarDetail& /* grammarDetail */) >+void TextChecker::updateSpellingUIWithGrammarString(SpellDocumentTag, const String& /* badGrammarPhrase */, const GrammarDetail& /* grammarDetail */) > { > } > >-void TextChecker::getGuessesForWord(int64_t /* spellDocumentTag */, const String& word, const String& /* context */, int32_t /* insertionPoint */, Vector<String>& guesses, bool) >+void TextChecker::getGuessesForWord(SpellDocumentTag, const String& word, const String& /* context */, int32_t /* insertionPoint */, Vector<String>& guesses, bool) > { > #if ENABLE(SPELLCHECK) > guesses = TextCheckerEnchant::singleton().getGuessesForWord(word); >@@ -180,7 +180,7 @@ void TextChecker::getGuessesForWord(int64_t /* spellDocumentTag */, const String > #endif > } > >-void TextChecker::learnWord(int64_t /* spellDocumentTag */, const String& word) >+void TextChecker::learnWord(SpellDocumentTag, const String& word) > { > #if ENABLE(SPELLCHECK) > TextCheckerEnchant::singleton().learnWord(word); >@@ -189,7 +189,7 @@ void TextChecker::learnWord(int64_t /* spellDocumentTag */, const String& word) > #endif > } > >-void TextChecker::ignoreWord(int64_t /* spellDocumentTag */, const String& word) >+void TextChecker::ignoreWord(SpellDocumentTag, const String& word) > { > #if ENABLE(SPELLCHECK) > TextCheckerEnchant::singleton().ignoreWord(word); >@@ -240,7 +240,7 @@ static unsigned nextWordOffset(StringView text, unsigned currentOffset) > #endif > > #if USE(UNIFIED_TEXT_CHECKING) >-Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocumentTag, StringView text, int32_t insertionPoint, OptionSet<TextCheckingType> checkingTypes, bool) >+Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(SpellDocumentTag spellDocumentTag, StringView text, int32_t insertionPoint, OptionSet<TextCheckingType> checkingTypes, bool) > { > UNUSED_PARAM(insertionPoint); > #if ENABLE(SPELLCHECK) >diff --git a/Source/WebKit/UIProcess/ios/TextCheckerIOS.mm b/Source/WebKit/UIProcess/ios/TextCheckerIOS.mm >index 415492dc7a064bb2df83b304c01f731febd5dd0b..beb1fe74f0d5b9c4306d1318f26b646dc94cce68 100644 >--- a/Source/WebKit/UIProcess/ios/TextCheckerIOS.mm >+++ b/Source/WebKit/UIProcess/ios/TextCheckerIOS.mm >@@ -150,25 +150,25 @@ void TextChecker::grammarCheckingEnabledStateChanged(bool) > > #if USE(UNIFIED_TEXT_CHECKING) > >-static HashMap<int64_t, RetainPtr<UITextChecker>>& spellDocumentTagMap() >+static HashMap<SpellDocumentTag, RetainPtr<UITextChecker>>& spellDocumentTagMap() > { >- static NeverDestroyed<HashMap<int64_t, RetainPtr<UITextChecker>>> tagMap; >+ static NeverDestroyed<HashMap<SpellDocumentTag, RetainPtr<UITextChecker>>> tagMap; > return tagMap; > } > > #endif > >-int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*) >+SpellDocumentTag TextChecker::uniqueSpellDocumentTag(WebPageProxy*) > { > #if USE(UNIFIED_TEXT_CHECKING) >- static int64_t nextSpellDocumentTag; >+ static SpellDocumentTag nextSpellDocumentTag; > return ++nextSpellDocumentTag; > #else >- return 0; >+ return { }; > #endif > } > >-void TextChecker::closeSpellDocumentWithTag(int64_t spellDocumentTag) >+void TextChecker::closeSpellDocumentWithTag(SpellDocumentTag spellDocumentTag) > { > #if USE(UNIFIED_TEXT_CHECKING) > spellDocumentTagMap().remove(spellDocumentTag); >@@ -179,7 +179,7 @@ void TextChecker::closeSpellDocumentWithTag(int64_t spellDocumentTag) > > #if USE(UNIFIED_TEXT_CHECKING) > >-static RetainPtr<UITextChecker> textCheckerFor(int64_t spellDocumentTag) >+static RetainPtr<UITextChecker> textCheckerFor(SpellDocumentTag spellDocumentTag) > { > auto addResult = spellDocumentTagMap().add(spellDocumentTag, nullptr); > if (addResult.isNewEntry) >@@ -187,7 +187,7 @@ static RetainPtr<UITextChecker> textCheckerFor(int64_t spellDocumentTag) > return addResult.iterator->value; > } > >-Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocumentTag, StringView text, int32_t /* insertionPoint */, OptionSet<TextCheckingType> checkingTypes, bool /* initialCapitalizationEnabled */) >+Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(SpellDocumentTag spellDocumentTag, StringView text, int32_t /* insertionPoint */, OptionSet<TextCheckingType> checkingTypes, bool /* initialCapitalizationEnabled */) > { > Vector<TextCheckingResult> results; > if (!checkingTypes.contains(TextCheckingType::Spelling)) >@@ -225,13 +225,13 @@ Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocume > > #endif > >-void TextChecker::checkSpellingOfString(int64_t, StringView, int32_t&, int32_t&) >+void TextChecker::checkSpellingOfString(SpellDocumentTag, StringView, int32_t&, int32_t&) > { > // iOS uses checkTextOfParagraph() instead. > notImplemented(); > } > >-void TextChecker::checkGrammarOfString(int64_t, StringView, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&) >+void TextChecker::checkGrammarOfString(SpellDocumentTag, StringView, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&) > { > // iOS uses checkTextOfParagraph() instead. > notImplemented(); >@@ -248,27 +248,27 @@ void TextChecker::toggleSpellingUIIsShowing() > notImplemented(); > } > >-void TextChecker::updateSpellingUIWithMisspelledWord(int64_t, const String&) >+void TextChecker::updateSpellingUIWithMisspelledWord(SpellDocumentTag, const String&) > { > notImplemented(); > } > >-void TextChecker::updateSpellingUIWithGrammarString(int64_t, const String&, const GrammarDetail&) >+void TextChecker::updateSpellingUIWithGrammarString(SpellDocumentTag, const String&, const GrammarDetail&) > { > notImplemented(); > } > >-void TextChecker::getGuessesForWord(int64_t, const String&, const String&, int32_t, Vector<String>&, bool) >+void TextChecker::getGuessesForWord(SpellDocumentTag, const String&, const String&, int32_t, Vector<String>&, bool) > { > notImplemented(); > } > >-void TextChecker::learnWord(int64_t, const String&) >+void TextChecker::learnWord(SpellDocumentTag, const String&) > { > notImplemented(); > } > >-void TextChecker::ignoreWord(int64_t, const String&) >+void TextChecker::ignoreWord(SpellDocumentTag, const String&) > { > notImplemented(); > } >diff --git a/Source/WebKit/UIProcess/mac/TextCheckerMac.mm b/Source/WebKit/UIProcess/mac/TextCheckerMac.mm >index 9a0d517a189c0117fc2494a03179099ecde95c60..2f7b4774ce8013e1a82892c29e867ee1ac0fa3dc 100644 >--- a/Source/WebKit/UIProcess/mac/TextCheckerMac.mm >+++ b/Source/WebKit/UIProcess/mac/TextCheckerMac.mm >@@ -314,19 +314,19 @@ void TextChecker::grammarCheckingEnabledStateChanged(bool enabled) > textCheckerState.isGrammarCheckingEnabled = enabled; > } > >-int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*) >+SpellDocumentTag TextChecker::uniqueSpellDocumentTag(WebPageProxy*) > { > return [NSSpellChecker uniqueSpellDocumentTag]; > } > >-void TextChecker::closeSpellDocumentWithTag(int64_t tag) >+void TextChecker::closeSpellDocumentWithTag(SpellDocumentTag tag) > { > [[NSSpellChecker sharedSpellChecker] closeSpellDocumentWithTag:tag]; > } > > #if USE(UNIFIED_TEXT_CHECKING) > >-Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocumentTag, StringView text, int32_t insertionPoint, OptionSet<TextCheckingType> checkingTypes, bool initialCapitalizationEnabled) >+Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(SpellDocumentTag spellDocumentTag, StringView text, int32_t insertionPoint, OptionSet<TextCheckingType> checkingTypes, bool initialCapitalizationEnabled) > { > Vector<TextCheckingResult> results; > >@@ -422,13 +422,13 @@ Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocume > > #endif // USE(UNIFIED_TEXT_CHECKING) > >-void TextChecker::checkSpellingOfString(int64_t, StringView, int32_t&, int32_t&) >+void TextChecker::checkSpellingOfString(SpellDocumentTag, StringView, int32_t&, int32_t&) > { > // Mac uses checkTextOfParagraph instead. > notImplemented(); > } > >-void TextChecker::checkGrammarOfString(int64_t, StringView, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&) >+void TextChecker::checkGrammarOfString(SpellDocumentTag, StringView, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&) > { > // Mac uses checkTextOfParagraph instead. > notImplemented(); >@@ -448,12 +448,12 @@ void TextChecker::toggleSpellingUIIsShowing() > [spellingPanel orderFront:nil]; > } > >-void TextChecker::updateSpellingUIWithMisspelledWord(int64_t, const String& misspelledWord) >+void TextChecker::updateSpellingUIWithMisspelledWord(SpellDocumentTag, const String& misspelledWord) > { > [[NSSpellChecker sharedSpellChecker] updateSpellingPanelWithMisspelledWord:misspelledWord]; > } > >-void TextChecker::updateSpellingUIWithGrammarString(int64_t, const String& badGrammarPhrase, const GrammarDetail& grammarDetail) >+void TextChecker::updateSpellingUIWithGrammarString(SpellDocumentTag, const String& badGrammarPhrase, const GrammarDetail& grammarDetail) > { > RetainPtr<NSMutableArray> corrections = adoptNS([[NSMutableArray alloc] init]); > for (size_t i = 0; i < grammarDetail.guesses.size(); ++i) { >@@ -468,7 +468,7 @@ void TextChecker::updateSpellingUIWithGrammarString(int64_t, const String& badGr > [[NSSpellChecker sharedSpellChecker] updateSpellingPanelWithGrammarString:badGrammarPhrase detail:grammarDetailDict.get()]; > } > >-void TextChecker::getGuessesForWord(int64_t spellDocumentTag, const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses, bool initialCapitalizationEnabled) >+void TextChecker::getGuessesForWord(SpellDocumentTag spellDocumentTag, const String& word, const String& context, int32_t insertionPoint, Vector<String>& guesses, bool initialCapitalizationEnabled) > { > NSString* language = nil; > NSOrthography* orthography = nil; >@@ -490,12 +490,12 @@ void TextChecker::getGuessesForWord(int64_t spellDocumentTag, const String& word > guesses.append(guess); > } > >-void TextChecker::learnWord(int64_t, const String& word) >+void TextChecker::learnWord(SpellDocumentTag, const String& word) > { > [[NSSpellChecker sharedSpellChecker] learnWord:word]; > } > >-void TextChecker::ignoreWord(int64_t spellDocumentTag, const String& word) >+void TextChecker::ignoreWord(SpellDocumentTag spellDocumentTag, const String& word) > { > [[NSSpellChecker sharedSpellChecker] ignoreWord:word inSpellDocumentWithTag:spellDocumentTag]; > } >diff --git a/Source/WebKit/UIProcess/win/TextCheckerWin.cpp b/Source/WebKit/UIProcess/win/TextCheckerWin.cpp >index 2e76b754e58b791ffee278eb7b54400293d319f0..0cabe640777732190e529880eb521edb3f12b810 100644 >--- a/Source/WebKit/UIProcess/win/TextCheckerWin.cpp >+++ b/Source/WebKit/UIProcess/win/TextCheckerWin.cpp >@@ -78,20 +78,20 @@ void TextChecker::grammarCheckingEnabledStateChanged(bool) > { > } > >-int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*) >+SpellDocumentTag TextChecker::uniqueSpellDocumentTag(WebPageProxy*) > { >- return 0; >+ return { }; > } > >-void TextChecker::closeSpellDocumentWithTag(int64_t) >+void TextChecker::closeSpellDocumentWithTag(SpellDocumentTag) > { > } > >-void TextChecker::checkSpellingOfString(int64_t /* spellDocumentTag */, StringView, int32_t&, int32_t&) >+void TextChecker::checkSpellingOfString(SpellDocumentTag, StringView, int32_t&, int32_t&) > { > } > >-void TextChecker::checkGrammarOfString(int64_t /* spellDocumentTag */, StringView /* text */, Vector<WebCore::GrammarDetail>& /* grammarDetails */, int32_t& /* badGrammarLocation */, int32_t& /* badGrammarLength */) >+void TextChecker::checkGrammarOfString(SpellDocumentTag, StringView /* text */, Vector<WebCore::GrammarDetail>& /* grammarDetails */, int32_t& /* badGrammarLocation */, int32_t& /* badGrammarLength */) > { > } > >@@ -104,23 +104,23 @@ void TextChecker::toggleSpellingUIIsShowing() > { > } > >-void TextChecker::updateSpellingUIWithMisspelledWord(int64_t /* spellDocumentTag */, const String& /* misspelledWord */) >+void TextChecker::updateSpellingUIWithMisspelledWord(SpellDocumentTag, const String& /* misspelledWord */) > { > } > >-void TextChecker::updateSpellingUIWithGrammarString(int64_t /* spellDocumentTag */, const String& /* badGrammarPhrase */, const GrammarDetail& /* grammarDetail */) >+void TextChecker::updateSpellingUIWithGrammarString(SpellDocumentTag, const String& /* badGrammarPhrase */, const GrammarDetail& /* grammarDetail */) > { > } > >-void TextChecker::getGuessesForWord(int64_t /* spellDocumentTag */, const String&, const String& /* context */, int32_t /* insertionPoint */, Vector<String>&, bool) >+void TextChecker::getGuessesForWord(SpellDocumentTag, const String&, const String& /* context */, int32_t /* insertionPoint */, Vector<String>&, bool) > { > } > >-void TextChecker::learnWord(int64_t /* spellDocumentTag */, const String&) >+void TextChecker::learnWord(SpellDocumentTag, const String&) > { > } > >-void TextChecker::ignoreWord(int64_t /* spellDocumentTag */, const String&) >+void TextChecker::ignoreWord(SpellDocumentTag, const String&) > { > } > >@@ -130,7 +130,7 @@ void TextChecker::requestCheckingOfString(Ref<TextCheckerCompletion>&&, int32_t) > > #if USE(UNIFIED_TEXT_CHECKING) > >-Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t, StringView, int32_t, OptionSet<TextCheckingType>, bool) >+Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(SpellDocumentTag, StringView, int32_t, OptionSet<TextCheckingType>, bool) > { > return { }; > } >diff --git a/Source/WebKit/UIProcess/wpe/TextCheckerWPE.cpp b/Source/WebKit/UIProcess/wpe/TextCheckerWPE.cpp >index 5b5595fb1a3322f49a8f6124be8d2426535f65d5..cdaac719f3bfadeeb77afa6b250aa87c014da813 100644 >--- a/Source/WebKit/UIProcess/wpe/TextCheckerWPE.cpp >+++ b/Source/WebKit/UIProcess/wpe/TextCheckerWPE.cpp >@@ -76,23 +76,23 @@ void TextChecker::grammarCheckingEnabledStateChanged(bool) > notImplemented(); > } > >-int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*) >+SpellDocumentTag TextChecker::uniqueSpellDocumentTag(WebPageProxy*) > { > notImplemented(); > return false; > } > >-void TextChecker::closeSpellDocumentWithTag(int64_t) >+void TextChecker::closeSpellDocumentWithTag(SpellDocumentTag) > { > notImplemented(); > } > >-void TextChecker::checkSpellingOfString(int64_t, StringView, int32_t&, int32_t&) >+void TextChecker::checkSpellingOfString(SpellDocumentTag, StringView, int32_t&, int32_t&) > { > notImplemented(); > } > >-void TextChecker::checkGrammarOfString(int64_t, StringView, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&) >+void TextChecker::checkGrammarOfString(SpellDocumentTag, StringView, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&) > { > notImplemented(); > } >@@ -108,27 +108,27 @@ void TextChecker::toggleSpellingUIIsShowing() > notImplemented(); > } > >-void TextChecker::updateSpellingUIWithMisspelledWord(int64_t, const String&) >+void TextChecker::updateSpellingUIWithMisspelledWord(SpellDocumentTag, const String&) > { > notImplemented(); > } > >-void TextChecker::updateSpellingUIWithGrammarString(int64_t, const String&, const GrammarDetail&) >+void TextChecker::updateSpellingUIWithGrammarString(SpellDocumentTag, const String&, const GrammarDetail&) > { > notImplemented(); > } > >-void TextChecker::getGuessesForWord(int64_t, const String&, const String&, int32_t, Vector<String>&, bool) >+void TextChecker::getGuessesForWord(SpellDocumentTag, const String&, const String&, int32_t, Vector<String>&, bool) > { > notImplemented(); > } > >-void TextChecker::learnWord(int64_t, const String&) >+void TextChecker::learnWord(SpellDocumentTag, const String&) > { > notImplemented(); > } > >-void TextChecker::ignoreWord(int64_t, const String&) >+void TextChecker::ignoreWord(SpellDocumentTag, const String&) > { > notImplemented(); > }
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 188817
: 347700 |
347782