diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-09 19:34:58 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-09 19:34:58 +0000 |
commit | f38f8a69dec4bbd77624f6a8332da7e996f91a41 (patch) | |
tree | 9d2b693682b9fa289beba79922261ab7b3ff8bae /webkit | |
parent | 48d33655b38f1d170f93557996a53b64d64f3a4e (diff) | |
download | chromium_src-f38f8a69dec4bbd77624f6a8332da7e996f91a41.zip chromium_src-f38f8a69dec4bbd77624f6a8332da7e996f91a41.tar.gz chromium_src-f38f8a69dec4bbd77624f6a8332da7e996f91a41.tar.bz2 |
revert commit 6607.
tbr=ojan
Review URL: http://codereview.chromium.org/13675
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6609 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/editor_client_impl.cc | 1 | ||||
-rw-r--r-- | webkit/glue/event_conversion.cc | 11 | ||||
-rw-r--r-- | webkit/glue/webview_impl.cc | 8 | ||||
-rw-r--r-- | webkit/port/platform/graphics/skia/GdkSkia.cc | 5 | ||||
-rw-r--r-- | webkit/tools/layout_tests/test_lists/tests_fixable.txt | 13 | ||||
-rw-r--r-- | webkit/tools/test_shell/event_sending_controller.cc | 53 | ||||
-rw-r--r-- | webkit/tools/test_shell/event_sending_controller.h | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_gtk.cc | 11 |
9 files changed, 76 insertions, 30 deletions
diff --git a/webkit/glue/editor_client_impl.cc b/webkit/glue/editor_client_impl.cc index 7fe4a52..abf2ecf 100644 --- a/webkit/glue/editor_client_impl.cc +++ b/webkit/glue/editor_client_impl.cc @@ -603,6 +603,7 @@ void EditorClientImpl::handleKeyboardEvent(WebCore::KeyboardEvent* evt) { } void EditorClientImpl::handleInputMethodKeydown(WebCore::KeyboardEvent* keyEvent) { + NOTIMPLEMENTED(); } void EditorClientImpl::textFieldDidBeginEditing(WebCore::Element*) { diff --git a/webkit/glue/event_conversion.cc b/webkit/glue/event_conversion.cc index 881cdae..5de8271 100644 --- a/webkit/glue/event_conversion.cc +++ b/webkit/glue/event_conversion.cc @@ -283,8 +283,10 @@ MakePlatformKeyboardEvent::MakePlatformKeyboardEvent(const WebKeyboardEvent& e) m_text = "\x9"; m_unmodifiedText = "\x9"; } -#elif defined(OS_WIN) || defined(OS_LINUX) +#elif defined(OS_WIN) m_text = m_unmodifiedText = ToSingleCharacterString(e.key_code); +#elif defined(OS_LINUX) + m_text = m_unmodifiedText = ToSingleCharacterString(e.text); #endif } #if defined(OS_WIN) || defined(OS_LINUX) @@ -305,13 +307,10 @@ MakePlatformKeyboardEvent::MakePlatformKeyboardEvent(const WebKeyboardEvent& e) m_metaKey = (e.modifiers & WebInputEvent::META_KEY) != 0; #if defined(OS_WIN) m_isSystemKey = e.system_key; -// TODO(port): set this field properly for linux and mac. -#elif defined(OS_LINUX) - m_isSystemKey = m_altKey; #else - m_isSystemKey = false; + m_isSystemKey = false; // TODO(port): make this proper. #endif -} +} void MakePlatformKeyboardEvent::SetKeyType(Type type) { // According to the behavior of Webkit in Windows platform, diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc index c07825c..67285ff 100644 --- a/webkit/glue/webview_impl.cc +++ b/webkit/glue/webview_impl.cc @@ -513,12 +513,12 @@ bool WebViewImpl::CharEvent(const WebKeyboardEvent& event) { if (!evt.IsCharacterKey()) return true; - // Safari 3.1 does not pass off windows system key messages (WM_SYSCHAR) to - // the eventHandler::keyEvent. We mimic this behavior on all platforms since - // for now we are converting other platform's key events to windows key - // events. +#if defined(OS_WIN) + // Safari 3.1 does not pass off WM_SYSCHAR messages to the + // eventHandler::keyEvent. We mimic this behavior. if (evt.isSystemKey()) return handler->handleAccessKey(evt); +#endif if (!handler->keyEvent(evt)) return KeyEventDefault(event); diff --git a/webkit/port/platform/graphics/skia/GdkSkia.cc b/webkit/port/platform/graphics/skia/GdkSkia.cc index 3adf710..b4c8ce5 100644 --- a/webkit/port/platform/graphics/skia/GdkSkia.cc +++ b/webkit/port/platform/graphics/skia/GdkSkia.cc @@ -436,7 +436,10 @@ static void gdk_skia_real_get_size(GdkDrawable *drawable, gint *width, gint *height) { - NOTIMPLEMENTED; + GdkSkiaObject *const skia = (GdkSkiaObject *) drawable; + SkDevice *const dev = skia->canvas->getDevice(); + *width = dev->width(); + *height = dev->height(); } static GdkImage* diff --git a/webkit/tools/layout_tests/test_lists/tests_fixable.txt b/webkit/tools/layout_tests/test_lists/tests_fixable.txt index 7adf29c..9930068 100644 --- a/webkit/tools/layout_tests/test_lists/tests_fixable.txt +++ b/webkit/tools/layout_tests/test_lists/tests_fixable.txt @@ -847,10 +847,11 @@ LINUX MAC : LayoutTests/fast/dom/object-embed-plugin-scripting.html = FAIL LINUX MAC : LayoutTests/fast/dynamic/flash-replacement-test.html = FAIL LINUX : LayoutTests/fast/encoding/denormalised-voiced-japanese-chars.html = FAIL LINUX MAC : LayoutTests/fast/events/access-key-self-destruct.html = FAIL -MAC : LayoutTests/fast/events/arrow-keys-on-body.html = FAIL -MAC : LayoutTests/fast/events/key-events-in-input-text.html = FAIL -MAC : LayoutTests/fast/events/keypress-focus-change.html = FAIL -MAC : LayoutTests/fast/events/keypress-insert-tab.html = FAIL +LINUX MAC : LayoutTests/fast/events/arrow-keys-on-body.html = FAIL +LINUX MAC : LayoutTests/fast/events/arrow-navigation.html = FAIL +LINUX MAC : LayoutTests/fast/events/key-events-in-input-text.html = FAIL +LINUX MAC : LayoutTests/fast/events/keypress-focus-change.html = FAIL +LINUX MAC : LayoutTests/fast/events/keypress-insert-tab.html = FAIL LINUX MAC : LayoutTests/fast/events/onchange-passwordfield.html = FAIL LINUX MAC : LayoutTests/fast/events/onchange-searchfield.html = FAIL LINUX MAC : LayoutTests/fast/events/onchange-select-popup.html = FAIL @@ -863,8 +864,8 @@ LINUX MAC : LayoutTests/fast/forms/access-key.html = FAIL LINUX MAC : LayoutTests/fast/forms/button-enter-click.html = FAIL LINUX MAC : LayoutTests/fast/forms/check-box-enter-key.html = FAIL LINUX MAC : LayoutTests/fast/forms/enter-clicks-buttons.html = FAIL -MAC : LayoutTests/fast/forms/focus-selection-input.html = FAIL -MAC : LayoutTests/fast/forms/focus-selection-textarea.html = FAIL +LINUX MAC : LayoutTests/fast/forms/focus-selection-input.html = FAIL +LINUX MAC : LayoutTests/fast/forms/focus-selection-textarea.html = FAIL LINUX MAC : LayoutTests/fast/forms/hidden-listbox.html = FAIL LINUX MAC : LayoutTests/fast/forms/input-appearance-height.html = FAIL LINUX MAC : LayoutTests/fast/forms/input-baseline.html = FAIL diff --git a/webkit/tools/test_shell/event_sending_controller.cc b/webkit/tools/test_shell/event_sending_controller.cc index b027c94..24aff94 100644 --- a/webkit/tools/test_shell/event_sending_controller.cc +++ b/webkit/tools/test_shell/event_sending_controller.cc @@ -18,8 +18,6 @@ #include <queue> -#include "KeyboardCodes.h" - #include "base/logging.h" #include "base/ref_counted.h" #include "base/string_util.h" @@ -27,6 +25,41 @@ #include "webkit/glue/webview.h" #include "webkit/tools/test_shell/test_shell.h" +#if defined(OS_LINUX) +#include <gdk/gdkkeysyms.h> +#endif + +namespace { +#if defined(OS_WIN) +const wchar_t kKeyCodeReturn = VK_RETURN; +const wchar_t kKeyCodeRight = VK_RIGHT; +const wchar_t kKeyCodeDown = VK_DOWN; +const wchar_t kKeyCodeLeft = VK_LEFT; +const wchar_t kKeyCodeUp = VK_UP; +const wchar_t kKeyCodeDelete = VK_BACK; +#elif defined(OS_MACOSX) +// I don't quite understand this code enough to change the way it works. As +// for the keycodes, they were documented once in Inside Macintosh and +// haven't been documented since, either on paper or in a header. The +// reference I'm going by is http://www.meandmark.com/keycodes.html . +// TODO(avi): Find someone who knows keyboard handling in WebCore and have +// them take a look at this. +const wchar_t kKeyCodeReturn = 0x24; +const wchar_t kKeyCodeRight = 0x7C; +const wchar_t kKeyCodeDown = 0x7D; +const wchar_t kKeyCodeLeft = 0x7B; +const wchar_t kKeyCodeUp = 0x7E; +const wchar_t kKeyCodeDelete = 0x33; +#elif defined(OS_LINUX) +const wchar_t kKeyCodeReturn = GDK_Return; +const wchar_t kKeyCodeRight = GDK_Right; +const wchar_t kKeyCodeDown = GDK_Down; +const wchar_t kKeyCodeLeft = GDK_Left; +const wchar_t kKeyCodeUp = GDK_Up; +const wchar_t kKeyCodeDelete = GDK_Delete; +#endif +} + // TODO(mpcomplete): layout before each event? // TODO(mpcomplete): do we need modifiers for mouse events? @@ -329,21 +362,21 @@ int EventSendingController::GetButtonNumberFromSingleArg( // Convert \n -> VK_RETURN. Some layout tests use \n to mean "Enter", when // Windows uses \r for "Enter". - int code; + wchar_t code; bool needs_shift_key_modifier = false; if (L"\n" == code_str) { generate_char = true; - code = WebCore::VKEY_RETURN; + code = kKeyCodeReturn; } else if (L"rightArrow" == code_str) { - code = WebCore::VKEY_RIGHT; + code = kKeyCodeRight; } else if (L"downArrow" == code_str) { - code = WebCore::VKEY_DOWN; + code = kKeyCodeDown; } else if (L"leftArrow" == code_str) { - code = WebCore::VKEY_LEFT; + code = kKeyCodeLeft; } else if (L"upArrow" == code_str) { - code = WebCore::VKEY_UP; + code = kKeyCodeUp; } else if (L"delete" == code_str) { - code = WebCore::VKEY_BACK; + code = kKeyCodeDelete; } else { DCHECK(code_str.length() == 1); code = code_str[0]; @@ -427,7 +460,7 @@ int EventSendingController::GetButtonNumberFromSingleArg( } } - bool EventSendingController::NeedsShiftModifer(int key_code) { + bool EventSendingController::NeedsShiftModifer(wchar_t key_code) { // If code is an uppercase letter, assign a SHIFT key to // event_down.modifier, this logic comes from // WebKit/WebKitTools/DumpRenderTree/Win/EventSender.cpp diff --git a/webkit/tools/test_shell/event_sending_controller.h b/webkit/tools/test_shell/event_sending_controller.h index e5602935..004cc82 100644 --- a/webkit/tools/test_shell/event_sending_controller.h +++ b/webkit/tools/test_shell/event_sending_controller.h @@ -75,7 +75,7 @@ class EventSendingController : public CppBoundClass { // Returns true if the key_code passed in needs a shift key modifier to // be passed into the generated event. - bool NeedsShiftModifer(int key_code); + bool NeedsShiftModifer(wchar_t key_code); // Non-owning pointer. The LayoutTestController is owned by the host. static TestShell* shell_; diff --git a/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj b/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj index 3124720..3ec6d8e 100644 --- a/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj +++ b/webkit/tools/test_shell/mac/TestShell.xcodeproj/project.pbxproj @@ -1758,7 +1758,6 @@ ../../../../third_party/icu38/public/i18n, ../../../../third_party/npapi, ../../../pending, - ../../../port/platform/chromium, ../../../../third_party/WebKit/WebCore, ../../../../third_party/WebKit/WebKit/mac/WebCoreSupport, ../../../../third_party/WebKit/JavaScriptCore, @@ -1797,7 +1796,6 @@ ../../../../third_party/icu38/public/i18n, ../../../../third_party/npapi, ../../../pending, - ../../../port/platform/chromium, ../../../../third_party/WebKit/WebCore, ../../../../third_party/WebKit/WebKit/mac/WebCoreSupport, ../../../../third_party/WebKit/JavaScriptCore, diff --git a/webkit/tools/test_shell/webwidget_host_gtk.cc b/webkit/tools/test_shell/webwidget_host_gtk.cc index 389fd61..5fd76ff 100644 --- a/webkit/tools/test_shell/webwidget_host_gtk.cc +++ b/webkit/tools/test_shell/webwidget_host_gtk.cc @@ -50,6 +50,7 @@ gboolean ExposeEvent(GtkWidget* widget, GdkEventExpose* expose, } gboolean WindowDestroyed(GtkWidget* widget, WebWidgetHost* host) { + LOG(INFO) << "Destroy Evented"; host->WindowDestroyed(); return FALSE; } @@ -200,8 +201,10 @@ WebWidgetHost::WebWidgetHost() } WebWidgetHost::~WebWidgetHost() { + LOG(INFO) << "shutting down webwidgethost"; webwidget_->Close(); webwidget_->Release(); + webwidget_ = NULL; } void WebWidgetHost::Resize(const gfx::Size &newsize) { @@ -212,8 +215,16 @@ void WebWidgetHost::Resize(const gfx::Size &newsize) { } void WebWidgetHost::Paint() { + if (!webwidget_) + return; + int width = view_->allocation.width; int height = view_->allocation.height; + + // Avert a segfault during shutdown. +// if (width < 0 || height < 0) +// return; + gfx::Rect client_rect(width, height); // Allocate a canvas if necessary |