[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
ap at apple.com
ap at apple.com
Wed Jan 6 00:19:23 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 2369b43a6014e49fd8ec60eca673a05b6e7470aa
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Jan 4 21:27:10 2010 +0000
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=33157
Implement TextInput logging channel on Windows
* WebKitLogging.cpp: (WebKitInitializeLoggingChannelsIfNecessary):
* WebKitLogging.h:
Added a TextInput channel in place of unused Network one.
* WebView.cpp:
(WebView::WebViewWndProc): Changed onIMERequest to return result directly. We never forward
it to DefWindowProc, so there is no need to return an unused boolean result for "handled".
(WebView::onIMEStartComposition): Added logging.
(imeCompositionArgumentNames): A helper function for detailed logging in onIMEComposition.
(imeNotificationName): A helper function for detailed logging in onIMENotify.
(imeRequestName): A helper function for detailed logging in onIMERequest.
(WebView::onIMEComposition): Added logging.
(WebView::onIMEEndComposition): Ditto.
(WebView::onIMEChar): Ditto.
(WebView::onIMENotify): Ditto.
(WebView::onIMERequestCharPosition): Changed to return result directly.
(WebView::onIMERequestReconvertString): Ditto.
(WebView::onIMERequest): Changed to return result directly. Added logging.
(WebView::onIMESelect): Added logging.
(WebView::onIMESetContext): Added logging.
* WebView.h: onIMERequest functions now return result directly.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 969671f..9df5b67 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,33 @@
+2010-01-04 Alexey Proskuryakov <ap at apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33157
+ Implement TextInput logging channel on Windows
+
+ * WebKitLogging.cpp: (WebKitInitializeLoggingChannelsIfNecessary):
+ * WebKitLogging.h:
+ Added a TextInput channel in place of unused Network one.
+
+ * WebView.cpp:
+ (WebView::WebViewWndProc): Changed onIMERequest to return result directly. We never forward
+ it to DefWindowProc, so there is no need to return an unused boolean result for "handled".
+ (WebView::onIMEStartComposition): Added logging.
+ (imeCompositionArgumentNames): A helper function for detailed logging in onIMEComposition.
+ (imeNotificationName): A helper function for detailed logging in onIMENotify.
+ (imeRequestName): A helper function for detailed logging in onIMERequest.
+ (WebView::onIMEComposition): Added logging.
+ (WebView::onIMEEndComposition): Ditto.
+ (WebView::onIMEChar): Ditto.
+ (WebView::onIMENotify): Ditto.
+ (WebView::onIMERequestCharPosition): Changed to return result directly.
+ (WebView::onIMERequestReconvertString): Ditto.
+ (WebView::onIMERequest): Changed to return result directly. Added logging.
+ (WebView::onIMESelect): Added logging.
+ (WebView::onIMESetContext): Added logging.
+
+ * WebView.h: onIMERequest functions now return result directly.
+
2010-01-04 Adam Roben <aroben at apple.com>
Add WebKitAPITest
diff --git a/WebKit/win/WebKitLogging.cpp b/WebKit/win/WebKitLogging.cpp
index f7a333c..273ab56 100644
--- a/WebKit/win/WebKitLogging.cpp
+++ b/WebKit/win/WebKitLogging.cpp
@@ -29,7 +29,7 @@
#include "config.h"
#include "WebKitLogging.h"
-WTFLogChannel WebKitLogNetwork = { 0x00000010, "WebKitLogLevel", WTFLogChannelOff };
+WTFLogChannel WebKitLogTextInput = { 0x00000010, "WebKitLogLevel", WTFLogChannelOff };
WTFLogChannel WebKitLogTiming = { 0x00000020, "WebKitLogLevel", WTFLogChannelOff };
WTFLogChannel WebKitLogLoading = { 0x00000040, "WebKitLogLevel", WTFLogChannelOff };
WTFLogChannel WebKitLogFontCache = { 0x00000100, "WebKitLogLevel", WTFLogChannelOff };
@@ -78,6 +78,7 @@ void WebKitInitializeLoggingChannelsIfNecessary()
return;
haveInitializedLoggingChannels = true;
+ initializeLogChannel(&WebKitLogTextInput);
initializeLogChannel(&WebKitLogTiming);
initializeLogChannel(&WebKitLogLoading);
initializeLogChannel(&WebKitLogFontCache);
diff --git a/WebKit/win/WebKitLogging.h b/WebKit/win/WebKitLogging.h
index 0aafb51..d19933d 100644
--- a/WebKit/win/WebKitLogging.h
+++ b/WebKit/win/WebKitLogging.h
@@ -36,7 +36,7 @@
#endif
-extern WTFLogChannel WebKitLogNetwork;
+extern WTFLogChannel WebKitLogTextInput;
extern WTFLogChannel WebKitLogTiming;
extern WTFLogChannel WebKitLogLoading;
extern WTFLogChannel WebKitLogFontCache;
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index 9225150..20633d7 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -46,6 +46,7 @@
#include "WebInspector.h"
#include "WebInspectorClient.h"
#include "WebKit.h"
+#include "WebKitLogging.h"
#include "WebKitStatisticsPrivate.h"
#include "WebKitSystemBits.h"
#include "WebMutableURLRequest.h"
@@ -2100,7 +2101,7 @@ LRESULT CALLBACK WebView::WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam,
handled = webView->onIMEStartComposition();
break;
case WM_IME_REQUEST:
- webView->onIMERequest(wParam, lParam, &lResult);
+ lResult = webView->onIMERequest(wParam, lParam);
break;
case WM_IME_COMPOSITION:
handled = webView->onIMEComposition(lParam);
@@ -5072,6 +5073,7 @@ void WebView::selectionChanged()
bool WebView::onIMEStartComposition()
{
+ LOG(TextInput, "onIMEStartComposition");
m_inIMEComposition++;
Frame* targetFrame = m_page->focusController()->focusedOrMainFrame();
if (!targetFrame)
@@ -5114,8 +5116,100 @@ static void compositionToUnderlines(const Vector<DWORD>& clauses, const Vector<B
}
}
+#if !LOG_DISABLED
+#define APPEND_ARGUMENT_NAME(name) \
+ if (lparam & name) { \
+ if (needsComma) \
+ result += ", "; \
+ result += #name; \
+ needsComma = true; \
+ }
+
+static String imeCompositionArgumentNames(LPARAM lparam)
+{
+ String result;
+ bool needsComma = false;
+ if (lparam & GCS_COMPATTR) {
+ result = "GCS_COMPATTR";
+ needsComma = true;
+ }
+ APPEND_ARGUMENT_NAME(GCS_COMPCLAUSE);
+ APPEND_ARGUMENT_NAME(GCS_COMPREADSTR);
+ APPEND_ARGUMENT_NAME(GCS_COMPREADATTR);
+ APPEND_ARGUMENT_NAME(GCS_COMPREADCLAUSE);
+ APPEND_ARGUMENT_NAME(GCS_COMPSTR);
+ APPEND_ARGUMENT_NAME(GCS_CURSORPOS);
+ APPEND_ARGUMENT_NAME(GCS_DELTASTART);
+ APPEND_ARGUMENT_NAME(GCS_RESULTCLAUSE);
+ APPEND_ARGUMENT_NAME(GCS_RESULTREADCLAUSE);
+ APPEND_ARGUMENT_NAME(GCS_RESULTREADSTR);
+ APPEND_ARGUMENT_NAME(GCS_RESULTSTR);
+ APPEND_ARGUMENT_NAME(CS_INSERTCHAR);
+ APPEND_ARGUMENT_NAME(CS_NOMOVECARET);
+
+ return result;
+}
+
+static String imeNotificationName(WPARAM wparam)
+{
+ switch (wparam) {
+ case IMN_CHANGECANDIDATE:
+ return "IMN_CHANGECANDIDATE";
+ case IMN_CLOSECANDIDATE:
+ return "IMN_CLOSECANDIDATE";
+ case IMN_CLOSESTATUSWINDOW:
+ return "IMN_CLOSESTATUSWINDOW";
+ case IMN_GUIDELINE:
+ return "IMN_GUIDELINE";
+ case IMN_OPENCANDIDATE:
+ return "IMN_OPENCANDIDATE";
+ case IMN_OPENSTATUSWINDOW:
+ return "IMN_OPENSTATUSWINDOW";
+ case IMN_SETCANDIDATEPOS:
+ return "IMN_SETCANDIDATEPOS";
+ case IMN_SETCOMPOSITIONFONT:
+ return "IMN_SETCOMPOSITIONFONT";
+ case IMN_SETCOMPOSITIONWINDOW:
+ return "IMN_SETCOMPOSITIONWINDOW";
+ case IMN_SETCONVERSIONMODE:
+ return "IMN_SETCONVERSIONMODE";
+ case IMN_SETOPENSTATUS:
+ return "IMN_SETOPENSTATUS";
+ case IMN_SETSENTENCEMODE:
+ return "IMN_SETSENTENCEMODE";
+ case IMN_SETSTATUSWINDOWPOS:
+ return "IMN_SETSTATUSWINDOWPOS";
+ default:
+ return "Unknown (" + String::number(wparam) + ")";
+ }
+}
+
+static String imeRequestName(WPARAM wparam)
+{
+ switch (wparam) {
+ case IMR_CANDIDATEWINDOW:
+ return "IMR_CANDIDATEWINDOW";
+ case IMR_COMPOSITIONFONT:
+ return "IMR_COMPOSITIONFONT";
+ case IMR_COMPOSITIONWINDOW:
+ return "IMR_COMPOSITIONWINDOW";
+ case IMR_CONFIRMRECONVERTSTRING:
+ return "IMR_CONFIRMRECONVERTSTRING";
+ case IMR_DOCUMENTFEED:
+ return "IMR_DOCUMENTFEED";
+ case IMR_QUERYCHARPOSITION:
+ return "IMR_QUERYCHARPOSITION";
+ case IMR_RECONVERTSTRING:
+ return "IMR_RECONVERTSTRING";
+ default:
+ return "Unknown (" + String::number(wparam) + ")";
+ }
+}
+#endif
+
bool WebView::onIMEComposition(LPARAM lparam)
{
+ LOG(TextInput, "onIMEComposition %s", imeCompositionArgumentNames(lparam).latin1().data());
HIMC hInputContext = getIMMContext();
if (!hInputContext)
return true;
@@ -5160,22 +5254,28 @@ bool WebView::onIMEComposition(LPARAM lparam)
bool WebView::onIMEEndComposition()
{
+ LOG(TextInput, "onIMEEndComposition");
if (m_inIMEComposition)
m_inIMEComposition--;
return true;
}
-bool WebView::onIMEChar(WPARAM, LPARAM)
+bool WebView::onIMEChar(WPARAM wparam, LPARAM lparam)
{
+ UNUSED_PARAM(wparam);
+ UNUSED_PARAM(lparam);
+ LOG(TextInput, "onIMEChar U+%04X %08X", wparam, lparam);
return true;
}
-bool WebView::onIMENotify(WPARAM, LPARAM, LRESULT*)
+bool WebView::onIMENotify(WPARAM wparam, LPARAM, LRESULT*)
{
+ UNUSED_PARAM(wparam);
+ LOG(TextInput, "onIMENotify %s", imeNotificationName(wparam).latin1().data());
return false;
}
-bool WebView::onIMERequestCharPosition(Frame* targetFrame, IMECHARPOSITION* charPos, LRESULT* result)
+LRESULT WebView::onIMERequestCharPosition(Frame* targetFrame, IMECHARPOSITION* charPos)
{
IntRect caret;
ASSERT(charPos->dwCharPos == 0 || targetFrame->editor()->hasComposition());
@@ -5191,56 +5291,55 @@ bool WebView::onIMERequestCharPosition(Frame* targetFrame, IMECHARPOSITION* char
::ClientToScreen(m_viewWindow, &charPos->pt);
charPos->cLineHeight = caret.height();
::GetWindowRect(m_viewWindow, &charPos->rcDocument);
- *result = TRUE;
return true;
}
-bool WebView::onIMERequestReconvertString(Frame* targetFrame, RECONVERTSTRING* reconvertString, LRESULT* result)
+LRESULT WebView::onIMERequestReconvertString(Frame* targetFrame, RECONVERTSTRING* reconvertString)
{
RefPtr<Range> selectedRange = targetFrame->selection()->toNormalizedRange();
String text = selectedRange->text();
- if (!reconvertString) {
- *result = sizeof(RECONVERTSTRING) + text.length() * sizeof(UChar);
- return true;
- }
+ if (!reconvertString)
+ return sizeof(RECONVERTSTRING) + text.length() * sizeof(UChar);
unsigned totalSize = sizeof(RECONVERTSTRING) + text.length() * sizeof(UChar);
- *result = totalSize;
- if (totalSize > reconvertString->dwSize) {
- *result = 0;
- return false;
- }
+ if (totalSize > reconvertString->dwSize)
+ return 0;
reconvertString->dwCompStrLen = text.length();
reconvertString->dwStrLen = text.length();
reconvertString->dwTargetStrLen = text.length();
reconvertString->dwStrOffset = sizeof(RECONVERTSTRING);
memcpy(reconvertString + 1, text.characters(), text.length() * sizeof(UChar));
- return true;
+ return totalSize;
}
-bool WebView::onIMERequest(WPARAM request, LPARAM data, LRESULT* result)
+LRESULT WebView::onIMERequest(WPARAM request, LPARAM data)
{
+ LOG(TextInput, "onIMERequest %s", imeRequestName(request).latin1().data());
Frame* targetFrame = m_page->focusController()->focusedOrMainFrame();
if (!targetFrame || !targetFrame->editor()->canEdit())
- return true;
+ return 0;
switch (request) {
case IMR_RECONVERTSTRING:
- return onIMERequestReconvertString(targetFrame, (RECONVERTSTRING*)data, result);
+ return onIMERequestReconvertString(targetFrame, (RECONVERTSTRING*)data);
case IMR_QUERYCHARPOSITION:
- return onIMERequestCharPosition(targetFrame, (IMECHARPOSITION*)data, result);
+ return onIMERequestCharPosition(targetFrame, (IMECHARPOSITION*)data);
}
- return false;
+ return 0;
}
-bool WebView::onIMESelect(WPARAM, LPARAM)
+bool WebView::onIMESelect(WPARAM wparam, LPARAM lparam)
{
+ UNUSED_PARAM(wparam);
+ UNUSED_PARAM(lparam);
+ LOG(TextInput, "onIMESelect locale %ld %s", lparam, wparam ? "select" : "deselect");
return false;
}
-bool WebView::onIMESetContext(WPARAM, LPARAM)
+bool WebView::onIMESetContext(WPARAM wparam, LPARAM)
{
+ LOG(TextInput, "onIMESetContext %s", wparam ? "active" : "inactive");
return false;
}
diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h
index c9b4e82..7b27293 100644
--- a/WebKit/win/WebView.h
+++ b/WebKit/win/WebView.h
@@ -811,7 +811,7 @@ public:
bool onIMEEndComposition();
bool onIMEChar(WPARAM, LPARAM);
bool onIMENotify(WPARAM, LPARAM, LRESULT*);
- bool onIMERequest(WPARAM, LPARAM, LRESULT*);
+ LRESULT onIMERequest(WPARAM, LPARAM);
bool onIMESelect(WPARAM, LPARAM);
bool onIMESetContext(WPARAM, LPARAM);
void selectionChanged();
@@ -904,8 +904,8 @@ protected:
void closeWindowTimerFired(WebCore::Timer<WebView>*);
void prepareCandidateWindow(WebCore::Frame*, HIMC);
void updateSelectionForIME();
- bool onIMERequestCharPosition(WebCore::Frame*, IMECHARPOSITION*, LRESULT*);
- bool onIMERequestReconvertString(WebCore::Frame*, RECONVERTSTRING*, LRESULT*);
+ LRESULT onIMERequestCharPosition(WebCore::Frame*, IMECHARPOSITION*);
+ LRESULT onIMERequestReconvertString(WebCore::Frame*, RECONVERTSTRING*);
bool developerExtrasEnabled() const;
// AllWebViewSet functions
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list