WebKit Bugzilla
Attachment 340481 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-20180516175149.patch (text/plain), 2.79 KB, created by
Fujii Hironori
on 2018-05-16 01:51:50 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2018-05-16 01:51:50 PDT
Size:
2.79 KB
patch
obsolete
>Subversion Revision: 231839 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index f2d6e6efc47eb0b5b11a5cc1f9c8129e19eaa39d..6904ab75ee89fdf7cd29f5f7ee66b5357eee7d92 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,13 @@ >+2018-05-16 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-15 Yusuke Suzuki <utatane.tea@gmail.com> > > [JSC] Check TypeInfo first before calling getCallData when we would like to check whether given object is a function >diff --git a/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp b/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp >index ee8e8dfcf9787641f00fb513eed7d31aa1951ed8..ef40c8a0983d7d3e18b439bc17bd56d4e1c560f9 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