WebKit Bugzilla
Attachment 340065 Details for
Bug 185327
: [Win] Implement WebPage::handleEditingKeyboardEvent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185327-20180510121247.patch (text/plain), 2.71 KB, created by
Fujii Hironori
on 2018-05-09 20:12:48 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2018-05-09 20:12:48 PDT
Size:
2.71 KB
patch
obsolete
>Subversion Revision: 231628 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index d61d891c256b5b11c08f0de8743c7915d92e2689..9b9d2b498d264b28b9816b21868f6b700f9c59e7 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,13 @@ >+2018-05-09 Fujii Hironori <Hironori.Fujii@sony.com> >+ >+ [Win] Implement WebPage::handleEditingKeyboardEvent >+ https://bugs.webkit.org/show_bug.cgi?id=185327 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebProcess/WebPage/win/WebPageWin.cpp: >+ (WebKit::WebPage::handleEditingKeyboardEvent): Copied from WebKitLegacy. >+ > 2018-05-09 Tim Horton <timothy_horton@apple.com> > > Remove the unused HAVE_OS_ACTIVITY >diff --git a/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp b/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp >index ee8e8dfcf9787641f00fb513eed7d31aa1951ed8..1f40c2e1c734fb38cde230a3eeb5a24ef465eb41 100644 >--- a/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp >+++ b/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp >@@ -33,6 +33,7 @@ > #include "WebPageProxyMessages.h" > #include "WebProcess.h" > #include <WebCore/BackForwardController.h> >+#include <WebCore/Editor.h> > #include <WebCore/EventHandler.h> > #include <WebCore/EventNames.h> > #include <WebCore/FocusController.h> >@@ -260,4 +261,36 @@ const char* WebPage::interpretKeyEvent(const WebCore::KeyboardEvent* evt) > int mapKey = modifiers << 16 | evt->charCode(); > return mapKey ? keyPressCommandsMap->get(mapKey) : 0; > } >+ >+bool WebPage::handleEditingKeyboardEvent(WebCore::KeyboardEvent* event) >+{ >+ auto* frame = downcast<Node>(event->target())->document().frame(); >+ ASSERT(frame); >+ >+ auto* keyEvent = event->underlyingPlatformEvent(); >+ if (!keyEvent || keyEvent->isSystemKey()) // Do not treat this as text input if it's a system key event. >+ return false; >+ >+ auto command = frame->editor().command(interpretKeyEvent(event)); >+ >+ if (keyEvent->type() == PlatformEvent::RawKeyDown) { >+ // WebKit doesn't have enough information about mode to decide >+ // how commands that just insert text if executed via Editor >+ // should be treated, so we leave it upon WebCore to either >+ // handle them immediately (e.g. Tab that changes focus) or >+ // let a keypress event be generated (e.g. Tab that inserts a >+ // Tab character, or Enter). >+ return !command.isTextInsertion() && command.execute(event); >+ } >+ >+ if (command.execute(event)) >+ return true; >+ >+ // Don't insert null or control characters as they can result in unexpected behaviour >+ if (event->charCode() < ' ') >+ return false; >+ >+ return frame->editor().insertText(keyEvent->text(), event); >+} >+ > } // namespace WebKit
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185327
:
339599
|
339603
|
340065
|
340481