[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
morrita at google.com
morrita at google.com
Wed Dec 22 14:51:14 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 1f6a9cc7d0cedbb222f4eb8d7692bd710c82b337
Author: morrita at google.com <morrita at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Oct 22 05:35:17 2010 +0000
2010-10-21 MORITA Hajime <morrita at google.com>
Reviewed by Kent Tamura.
[Win][DRT] should have LayoutTestController.hasSpellingMarker()
https://bugs.webkit.org/show_bug.cgi?id=47885
Added IWebFramePrivate::hasSpellingMarker() and impelmented it for
LayoutTestController.
* Interfaces/IWebFramePrivate.idl:
* WebFrame.cpp:
(WebFrame::hasSpellingMarker):
* WebFrame.h:
2010-10-21 MORITA Hajime <morrita at google.com>
Reviewed by Kent Tamura.
[Win][DRT] should have LayoutTestController.hasSpellingMarker()
https://bugs.webkit.org/show_bug.cgi?id=47885
- Implemented LayoutTestController.hasSpellingMarker(),
- Added fake spellcheck implementation.
* DumpRenderTree/win/DumpRenderTree.cpp:
(main):
* DumpRenderTree/win/EditingDelegate.cpp:
(indexOfFirstWordCharacter):
(wordLength):
(EditingDelegate::checkSpellingOfString):
* DumpRenderTree/win/EditingDelegate.h:
* DumpRenderTree/win/LayoutTestControllerWin.cpp:
(LayoutTestController::hasSpellingMarker):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 0f4c32c..aa4a665 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,18 @@
+2010-10-21 MORITA Hajime <morrita at google.com>
+
+ Reviewed by Kent Tamura.
+
+ [Win][DRT] should have LayoutTestController.hasSpellingMarker()
+ https://bugs.webkit.org/show_bug.cgi?id=47885
+
+ Added IWebFramePrivate::hasSpellingMarker() and impelmented it for
+ LayoutTestController.
+
+ * Interfaces/IWebFramePrivate.idl:
+ * WebFrame.cpp:
+ (WebFrame::hasSpellingMarker):
+ * WebFrame.h:
+
2010-10-20 Dumitru Daniliuc <dumi at chromium.org>
Reviewed by David Levin.
diff --git a/WebKit/win/Interfaces/IWebFramePrivate.idl b/WebKit/win/Interfaces/IWebFramePrivate.idl
index 190681c..279cbbf 100644
--- a/WebKit/win/Interfaces/IWebFramePrivate.idl
+++ b/WebKit/win/Interfaces/IWebFramePrivate.idl
@@ -117,4 +117,6 @@ interface IWebFramePrivate : IUnknown
HRESULT resumeAnimations();
HRESULT loadPlainTextString([in] BSTR string, [in] BSTR url);
+
+ HRESULT hasSpellingMarker([in] UINT from, [in] UINT length, [out, retval] BOOL* result);
}
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index 8dfe8bb..192b528 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -1019,6 +1019,18 @@ HRESULT STDMETHODCALLTYPE WebFrame::unused2()
return E_NOTIMPL;
}
+HRESULT STDMETHODCALLTYPE WebFrame::hasSpellingMarker(
+ /* [in] */ UINT from,
+ /* [in] */ UINT length,
+ /* [retval][out] */ BOOL* result)
+{
+ Frame* coreFrame = core(this);
+ if (!coreFrame)
+ return E_FAIL;
+ *result = coreFrame->editor()->selectionStartHasSpellingMarkerFor(from, length);
+ return S_OK;
+}
+
// IWebDocumentText -----------------------------------------------------------
HRESULT STDMETHODCALLTYPE WebFrame::supportsTextEncoding(
diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h
index 147daa8..37cb205 100644
--- a/WebKit/win/WebFrame.h
+++ b/WebKit/win/WebFrame.h
@@ -273,6 +273,11 @@ public:
virtual HRESULT STDMETHODCALLTYPE layerTreeAsText(BSTR*);
+ virtual HRESULT STDMETHODCALLTYPE hasSpellingMarker(
+ /* [in] */ UINT from,
+ /* [in] */ UINT length,
+ /* [retval][out] */ BOOL *result);
+
// IWebDocumentText
virtual HRESULT STDMETHODCALLTYPE supportsTextEncoding(
/* [retval][out] */ BOOL* result);
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 3f3aa08..86ba72f 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,23 @@
+2010-10-21 MORITA Hajime <morrita at google.com>
+
+ Reviewed by Kent Tamura.
+
+ [Win][DRT] should have LayoutTestController.hasSpellingMarker()
+ https://bugs.webkit.org/show_bug.cgi?id=47885
+
+ - Implemented LayoutTestController.hasSpellingMarker(),
+ - Added fake spellcheck implementation.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (main):
+ * DumpRenderTree/win/EditingDelegate.cpp:
+ (indexOfFirstWordCharacter):
+ (wordLength):
+ (EditingDelegate::checkSpellingOfString):
+ * DumpRenderTree/win/EditingDelegate.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::hasSpellingMarker):
+
2010-10-21 Mihai Parparita <mihaip at chromium.org>
Unreviewed. Re-enable test that was mistakenly disabled by r67974.
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
index 67e5d4b..2bfe660 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
@@ -1302,6 +1302,7 @@ int main(int argc, char* argv[])
standardPreferences->setJavaScriptEnabled(TRUE);
standardPreferences->setDefaultFontSize(16);
standardPreferences->setAcceleratedCompositingEnabled(true);
+ standardPreferences->setContinuousSpellCheckingEnabled(TRUE);
if (printSupportedFeatures) {
BOOL acceleratedCompositingAvailable;
diff --git a/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp b/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp
index 32c02bd..71859cb 100644
--- a/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp
+++ b/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp
@@ -353,3 +353,72 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeSelection(
}
return S_OK;
}
+
+static int indexOfFirstWordCharacter(const TCHAR* text)
+{
+ const TCHAR* cursor = text;
+ while (*cursor && !isalpha(*cursor))
+ ++cursor;
+ return *cursor ? (cursor - text) : -1;
+};
+
+static int wordLength(const TCHAR* text)
+{
+ const TCHAR* cursor = text;
+ while (*cursor && isalpha(*cursor))
+ ++cursor;
+ return cursor - text;
+};
+
+HRESULT STDMETHODCALLTYPE EditingDelegate::checkSpellingOfString(
+ /* [in] */ IWebView* view,
+ /* [in] */ LPCTSTR text,
+ /* [in] */ int length,
+ /* [out] */ int* misspellingLocation,
+ /* [out] */ int* misspellingLength)
+{
+ static const TCHAR* misspelledWords[] = {
+ // These words are known misspelled words in webkit tests.
+ // If there are other misspelled words in webkit tests, please add them in
+ // this array.
+ TEXT("foo"),
+ TEXT("Foo"),
+ TEXT("baz"),
+ TEXT("fo"),
+ TEXT("LibertyF"),
+ TEXT("chello"),
+ TEXT("xxxtestxxx"),
+ TEXT("XXxxx"),
+ TEXT("Textx"),
+ TEXT("blockquoted"),
+ TEXT("asd"),
+ TEXT("Lorem"),
+ TEXT("Nunc"),
+ TEXT("Curabitur"),
+ TEXT("eu"),
+ TEXT("adlj"),
+ TEXT("adaasj"),
+ TEXT("sdklj"),
+ TEXT("jlkds"),
+ TEXT("jsaada"),
+ TEXT("jlda"),
+ TEXT("zz"),
+ TEXT("contentEditable"),
+ 0,
+ };
+
+ wstring textString(text, length);
+ int wordStart = indexOfFirstWordCharacter(textString.c_str());
+ if (-1 == wordStart)
+ return S_OK;
+ wstring word = textString.substr(wordStart, wordLength(textString.c_str() + wordStart));
+ for (size_t i = 0; misspelledWords[i]; ++i) {
+ if (word == misspelledWords[i]) {
+ *misspellingLocation = wordStart;
+ *misspellingLength = word.size();
+ break;
+ }
+ }
+
+ return S_OK;
+}
diff --git a/WebKitTools/DumpRenderTree/win/EditingDelegate.h b/WebKitTools/DumpRenderTree/win/EditingDelegate.h
index 6dba675..7b7f418 100644
--- a/WebKitTools/DumpRenderTree/win/EditingDelegate.h
+++ b/WebKitTools/DumpRenderTree/win/EditingDelegate.h
@@ -127,7 +127,7 @@ public:
/* [in] */ LPCTSTR text,
/* [in] */ int length,
/* [out] */ int *misspellingLocation,
- /* [out] */ int *misspellingLength) { return E_NOTIMPL; }
+ /* [out] */ int *misspellingLength);
virtual HRESULT STDMETHODCALLTYPE checkGrammarOfString(
/* [in] */ IWebView *view,
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index d2140d1..9e8ed1e 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -1391,8 +1391,13 @@ void LayoutTestController::abortModal()
{
}
-bool LayoutTestController::hasSpellingMarker(int, int)
+bool LayoutTestController::hasSpellingMarker(int from, int length)
{
- // FIXME: Implement this.
- return false;
+ COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+ if (!framePrivate)
+ return false;
+ BOOL ret = FALSE;
+ if (FAILED(framePrivate->hasSpellingMarker(from, length, &ret)))
+ return false;
+ return ret;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list