[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 15:58:06 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit d4d0582b427070329419cb1eae0fe0f15124416b
Author: morrita at google.com <morrita at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Nov 17 10:49:32 2010 +0000
2010-11-17 MORITA Hajime <morrita at google.com>
Reviewed by Kent Tamura.
[Chromium][DRT] EventSender.contextClick() should aware spellchecking
https://bugs.webkit.org/show_bug.cgi?id=49366
- EvenSender: Checked WebContextMenuData.misspelledWord and added extra context menu entries
according to the spellchecker suggestion
- MockSpellCheck: add fillSuggestionList to provide fake suggestions.
test_expectations.txt will be changed after this change is ported to test_shell.
* DumpRenderTree/chromium/EventSender.cpp:
(makeMenuItemStringsFor):
(EventSender::contextClick):
* DumpRenderTree/chromium/MockSpellCheck.cpp:
(MockSpellCheck::fillSuggestionList):
(MockSpellCheck::initializeIfNeeded):
* DumpRenderTree/chromium/MockSpellCheck.h:
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::mockSpellCheck):
* DumpRenderTree/chromium/WebViewHost.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 52e24db..c2d8571 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,27 @@
+2010-11-17 MORITA Hajime <morrita at google.com>
+
+ Reviewed by Kent Tamura.
+
+ [Chromium][DRT] EventSender.contextClick() should aware spellchecking
+ https://bugs.webkit.org/show_bug.cgi?id=49366
+
+ - EvenSender: Checked WebContextMenuData.misspelledWord and added extra context menu entries
+ according to the spellchecker suggestion
+ - MockSpellCheck: add fillSuggestionList to provide fake suggestions.
+
+ test_expectations.txt will be changed after this change is ported to test_shell.
+
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (makeMenuItemStringsFor):
+ (EventSender::contextClick):
+ * DumpRenderTree/chromium/MockSpellCheck.cpp:
+ (MockSpellCheck::fillSuggestionList):
+ (MockSpellCheck::initializeIfNeeded):
+ * DumpRenderTree/chromium/MockSpellCheck.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::mockSpellCheck):
+ * DumpRenderTree/chromium/WebViewHost.h:
+
2010-11-16 Dave Hyatt <hyatt at apple.com>
Reviewed by Sam Weinig.
diff --git a/WebKitTools/DumpRenderTree/chromium/EventSender.cpp b/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
index b0385a3..6104a90 100644
--- a/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
@@ -736,7 +736,7 @@ void EventSender::replaySavedEvents()
// also makes sense. This function is doing such for some flags.
// - Some test even checks actual string content. So providing it would be also helpful.
//
-static Vector<WebString> makeMenuItemStringsFor(WebContextMenuData* contextMenu)
+static Vector<WebString> makeMenuItemStringsFor(WebContextMenuData* contextMenu, MockSpellCheck* spellcheck)
{
// These constants are based on Safari's context menu because tests are made for it.
static const char* nonEditableMenuStrings[] = { "Back", "Reload Page", "Open in Dashbaord", "<separator>", "View Source", "Save Page As", "Print Page", "Inspect Element", 0 };
@@ -751,6 +751,10 @@ static Vector<WebString> makeMenuItemStringsFor(WebContextMenuData* contextMenu)
if (contextMenu->isEditable) {
for (const char** item = editableMenuStrings; *item; ++item)
strings.append(WebString::fromUTF8(*item));
+ Vector<WebString> suggestions;
+ spellcheck->fillSuggestionList(contextMenu->misspelledWord, &suggestions);
+ for (size_t i = 0; i < suggestions.size(); ++i)
+ strings.append(suggestions[i]);
} else {
for (const char** item = nonEditableMenuStrings; *item; ++item)
strings.append(WebString::fromUTF8(*item));
@@ -782,7 +786,7 @@ void EventSender::contextClick(const CppArgumentList& arguments, CppVariant* res
pressedButton = WebMouseEvent::ButtonNone;
WebContextMenuData* lastContextMenu = m_shell->webViewHost()->lastContextMenuData();
- result->set(WebBindings::makeStringArray(makeMenuItemStringsFor(lastContextMenu)));
+ result->set(WebBindings::makeStringArray(makeMenuItemStringsFor(lastContextMenu, m_shell->webViewHost()->mockSpellCheck())));
}
class MouseDownTask: public MethodTask<EventSender> {
diff --git a/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp
index bf39f60..7243152 100644
--- a/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp
@@ -91,6 +91,12 @@ bool MockSpellCheck::spellCheckWord(const WebString& text, int* misspelledOffset
return false;
}
+void MockSpellCheck::fillSuggestionList(const WebString& word, Vector<WebString>* suggestions)
+{
+ if (word == WebString::fromUTF8("wellcome"))
+ suggestions->append(WebString::fromUTF8("welcome"));
+}
+
bool MockSpellCheck::initializeIfNeeded()
{
// Exit if we have already initialized this object.
@@ -133,6 +139,7 @@ bool MockSpellCheck::initializeIfNeeded()
"ifmmp",
"qwertyuiopasd",
"qwertyuiopasdf",
+ "wellcome"
};
m_misspelledWords.clear();
diff --git a/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.h b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.h
index c680340..dcd37f3 100644
--- a/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.h
+++ b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.h
@@ -62,6 +62,7 @@ public:
int* misspelledOffset,
int* misspelledLength);
+ void fillSuggestionList(const WebKit::WebString& word, Vector<WebKit::WebString>* suggestions);
private:
// Initialize the internal resources if we need to initialize it.
// Initializing this object may take long time. To prevent from hurting
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
index c4e4a76..942a5bd 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -591,6 +591,11 @@ WebDeviceOrientationClientMock* WebViewHost::deviceOrientationClientMock()
return m_deviceOrientationClientMock.get();
}
+MockSpellCheck* WebViewHost::mockSpellCheck()
+{
+ return &m_spellcheck;
+}
+
WebDeviceOrientationClient* WebViewHost::deviceOrientationClient()
{
return deviceOrientationClientMock();
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
index 5fc00f1..c9a90ff 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
@@ -201,6 +201,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
virtual void openFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, long long size, bool create, WebKit::WebFileSystemCallbacks*);
WebKit::WebDeviceOrientationClientMock* deviceOrientationClientMock();
+ MockSpellCheck* mockSpellCheck();
private:
LayoutTestController* layoutTestController() const;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list