WebKit Bugzilla
Attachment 339599 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.diff (text/plain), 2.56 KB, created by
Don Olmstead
on 2018-05-04 15:01:03 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Don Olmstead
Created:
2018-05-04 15:01:03 PDT
Size:
2.56 KB
patch
obsolete
>diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 32aceca8de4..ea7893536cb 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,13 @@ >+2018-05-04 Don Olmstead <don.olmstead@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): >+ > 2018-05-04 Chris Dumez <cdumez@apple.com> > > [iOS] Apps that are not visible may not get suspended if they trigger page loads while in the background >diff --git a/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp b/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp >index ee8e8dfcf97..7a4641cf7dd 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,33 @@ 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