Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog (190944 => 190945)
--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog 2015-10-13 10:16:12 UTC (rev 190944)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog 2015-10-13 10:17:18 UTC (rev 190945)
@@ -1,3 +1,27 @@
+2015-09-30 Carlos Alberto Lopez Perez <[email protected]>
+
+ [GTK] Build error with -DENABLE_SPELLCHECK=OFF
+ https://bugs.webkit.org/show_bug.cgi?id=146904
+
+ Reviewed by Carlos Garcia Campos.
+
+ Add ifdef guards to allow building when SPELLCHECK is not enabled.
+
+ * UIProcess/gtk/TextCheckerGtk.cpp:
+ (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
+ (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
+ (WebKit::TextChecker::setGrammarCheckingEnabled):
+ (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged):
+ (WebKit::TextChecker::grammarCheckingEnabledStateChanged):
+ (WebKit::TextChecker::checkSpellingOfString):
+ (WebKit::TextChecker::getGuessesForWord):
+ (WebKit::TextChecker::learnWord):
+ (WebKit::TextChecker::ignoreWord):
+ (WebKit::TextChecker::requestCheckingOfString):
+ (WebKit::TextChecker::checkTextOfParagraph):
+ (WebKit::TextChecker::setSpellCheckingLanguages):
+ (WebKit::TextChecker::loadedSpellCheckingLanguages):
+
2015-09-30 Gwang Yoon Hwang <[email protected]>
[GTK] Support HiDPI Properly in WebKitGtk+ with the TextureMapper
Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp (190944 => 190945)
--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp 2015-10-13 10:16:12 UTC (rev 190944)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp 2015-10-13 10:17:18 UTC (rev 190945)
@@ -31,7 +31,6 @@
#include "TextBreakIterator.h"
#include "TextCheckerState.h"
#include "WebProcessPool.h"
-#include "WebTextChecker.h"
#include <WebCore/NotImplemented.h>
#include <WebCore/TextCheckerEnchant.h>
#include <wtf/NeverDestroyed.h>
@@ -40,11 +39,13 @@
namespace WebKit {
+#if ENABLE(SPELLCHECK)
static WebCore::TextCheckerEnchant& enchantTextChecker()
{
static NeverDestroyed<WebCore::TextCheckerEnchant> checker;
return checker;
}
+#endif
TextCheckerState& checkerState()
{
@@ -63,41 +64,63 @@
return checkerState();
}
+#if ENABLE(SPELLCHECK)
static void updateStateForAllProcessPools()
{
for (const auto& processPool : WebProcessPool::allProcessPools())
processPool->textCheckerStateChanged();
}
+#endif
bool TextChecker::isContinuousSpellCheckingAllowed()
{
+#if ENABLE(SPELLCHECK)
return true;
+#else
+ return false;
+#endif
}
void TextChecker::setContinuousSpellCheckingEnabled(bool isContinuousSpellCheckingEnabled)
{
+#if ENABLE(SPELLCHECK)
if (checkerState().isContinuousSpellCheckingEnabled == isContinuousSpellCheckingEnabled)
return;
checkerState().isContinuousSpellCheckingEnabled = isContinuousSpellCheckingEnabled;
updateStateForAllProcessPools();
+#else
+ UNUSED_PARAM(isContinuousSpellCheckingEnabled);
+#endif
}
void TextChecker::setGrammarCheckingEnabled(bool isGrammarCheckingEnabled)
{
+#if ENABLE(SPELLCHECK)
if (checkerState().isGrammarCheckingEnabled == isGrammarCheckingEnabled)
return;
checkerState().isGrammarCheckingEnabled = isGrammarCheckingEnabled;
updateStateForAllProcessPools();
+#else
+ UNUSED_PARAM(isGrammarCheckingEnabled);
+#endif
}
void TextChecker::continuousSpellCheckingEnabledStateChanged(bool enabled)
{
+#if ENABLE(SPELLCHECK)
checkerState().isContinuousSpellCheckingEnabled = enabled;
+#else
+ UNUSED_PARAM(enabled);
+#endif
}
void TextChecker::grammarCheckingEnabledStateChanged(bool enabled)
{
+#if ENABLE(SPELLCHECK)
checkerState().isGrammarCheckingEnabled = enabled;
+#else
+ UNUSED_PARAM(enabled);
+#endif
}
int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
@@ -111,9 +134,15 @@
void TextChecker::checkSpellingOfString(int64_t /* spellDocumentTag */, StringView text, int32_t& misspellingLocation, int32_t& misspellingLength)
{
+#if ENABLE(SPELLCHECK)
misspellingLocation = -1;
misspellingLength = 0;
enchantTextChecker().checkSpellingOfString(text.toStringWithoutCopying(), misspellingLocation, misspellingLength);
+#else
+ UNUSED_PARAM(text);
+ UNUSED_PARAM(misspellingLocation);
+ UNUSED_PARAM(misspellingLength);
+#endif
}
void TextChecker::checkGrammarOfString(int64_t /* spellDocumentTag */, StringView /* text */, Vector<WebCore::GrammarDetail>& /* grammarDetails */, int32_t& /* badGrammarLocation */, int32_t& /* badGrammarLength */)
@@ -139,21 +168,35 @@
void TextChecker::getGuessesForWord(int64_t /* spellDocumentTag */, const String& word, const String& /* context */, Vector<String>& guesses)
{
+#if ENABLE(SPELLCHECK)
guesses = enchantTextChecker().getGuessesForWord(word);
+#else
+ UNUSED_PARAM(word);
+ UNUSED_PARAM(guesses);
+#endif
}
void TextChecker::learnWord(int64_t /* spellDocumentTag */, const String& word)
{
+#if ENABLE(SPELLCHECK)
enchantTextChecker().learnWord(word);
+#else
+ UNUSED_PARAM(word);
+#endif
}
void TextChecker::ignoreWord(int64_t /* spellDocumentTag */, const String& word)
{
+#if ENABLE(SPELLCHECK)
enchantTextChecker().ignoreWord(word);
+#else
+ UNUSED_PARAM(word);
+#endif
}
void TextChecker::requestCheckingOfString(PassRefPtr<TextCheckerCompletion> completion)
{
+#if ENABLE(SPELLCHECK)
if (!completion)
return;
@@ -162,9 +205,12 @@
ASSERT(request.mask() != TextCheckingTypeNone);
completion->didFinishCheckingText(checkTextOfParagraph(completion->spellDocumentTag(), request.text(), request.mask()));
+#else
+ UNUSED_PARAM(completion);
+#endif
}
-#if USE(UNIFIED_TEXT_CHECKING)
+#if USE(UNIFIED_TEXT_CHECKING) && ENABLE(SPELLCHECK)
static unsigned nextWordOffset(StringView text, unsigned currentOffset)
{
// FIXME: avoid creating textIterator object here, it could be passed as a parameter.
@@ -190,9 +236,12 @@
return wordOffset;
}
+#endif
+#if USE(UNIFIED_TEXT_CHECKING)
Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocumentTag, StringView text, uint64_t checkingTypes)
{
+#if ENABLE(SPELLCHECK)
if (!(checkingTypes & TextCheckingTypeSpelling))
return Vector<TextCheckingResult>();
@@ -225,17 +274,31 @@
offset = nextWordOffset(text.substring(0, lengthStrip), offset);
}
return paragraphCheckingResult;
+#else
+ UNUSED_PARAM(spellDocumentTag);
+ UNUSED_PARAM(text);
+ UNUSED_PARAM(checkingTypes);
+ return Vector<TextCheckingResult>();
+#endif // ENABLE(SPELLCHECK)
}
-#endif
+#endif // USE(UNIFIED_TEXT_CHECKING)
void TextChecker::setSpellCheckingLanguages(const Vector<String>& languages)
{
+#if ENABLE(SPELLCHECK)
enchantTextChecker().updateSpellCheckingLanguages(languages);
+#else
+ UNUSED_PARAM(languages);
+#endif
}
Vector<String> TextChecker::loadedSpellCheckingLanguages()
{
+#if ENABLE(SPELLCHECK)
return enchantTextChecker().loadedSpellCheckingLanguages();
+#else
+ return Vector<String>();
+#endif
}
} // namespace WebKit