WebKit Bugzilla
Attachment 369010 Details for
Bug 197480
: Pass KeyboardEvent by reference in more places
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
To land
bug-197480-20190503160300.patch (text/plain), 28.20 KB, created by
Daniel Bates
on 2019-05-03 16:03:00 PDT
(
hide
)
Description:
To land
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2019-05-03 16:03:00 PDT
Size:
28.20 KB
patch
obsolete
>Subversion Revision: 244931 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 988c719b2f5f509f642e9e7fedc2669e30800e20..7118722e501031409445ac9e8a7f6f705560307a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2019-05-02 Daniel Bates <dabates@apple.com> >+ >+ Pass KeyboardEvent by reference in more places >+ https://bugs.webkit.org/show_bug.cgi?id=197480 >+ >+ Reviewed by Wenson Hsieh. >+ >+ * editing/Editor.cpp: >+ (WebCore::Editor::handleKeyboardEvent): >+ (WebCore::Editor::handleInputMethodKeydown): >+ * loader/EmptyClients.cpp: >+ * page/EditorClient.h: >+ > 2019-05-03 Chris Dumez <cdumez@apple.com> > > [iOS Sim Debug] ASSERTION FAILED The atomic string comes from an other thread! Layout Test imported/w3c/web-platform-tests/workers/WorkerNavigator_appName.htm is a flaky crash >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 38ce6dde9787a3b8ab6ffef055acfeda6c9a13ec..af11c54becfc03f916d22a798cf10d788b3bf0b5 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,34 @@ >+2019-05-02 Daniel Bates <dabates@apple.com> >+ >+ Pass KeyboardEvent by reference in more places >+ https://bugs.webkit.org/show_bug.cgi?id=197480 >+ >+ Reviewed by Wenson Hsieh. >+ >+ * WebProcess/WebCoreSupport/WebEditorClient.cpp: >+ (WebKit::WebEditorClient::handleKeyboardEvent): >+ (WebKit::WebEditorClient::handleInputMethodKeydown): >+ * WebProcess/WebCoreSupport/WebEditorClient.h: >+ * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: >+ (WebKit::WebEditorClient::handleKeyboardEvent): >+ (WebKit::WebEditorClient::handleInputMethodKeydown): >+ * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm: >+ (WebKit::WebEditorClient::handleKeyboardEvent): >+ (WebKit::WebEditorClient::handleInputMethodKeydown): >+ * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: >+ (WebKit::WebEditorClient::handleKeyboardEvent): >+ (WebKit::WebEditorClient::handleInputMethodKeydown): >+ * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: >+ (WebKit::WebEditorClient::handleKeyboardEvent): >+ (WebKit::WebEditorClient::handleInputMethodKeydown): >+ * WebProcess/WebPage/WebPage.h: >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::handleEditingKeyboardEvent): >+ * WebProcess/WebPage/mac/WebPageMac.mm: >+ (WebKit::WebPage::handleEditingKeyboardEvent): >+ * WebProcess/WebPage/win/WebPageWin.cpp: >+ (WebKit::WebPage::handleEditingKeyboardEvent): >+ > 2019-05-03 Youenn Fablet <youenn@apple.com> > > Enable Fetch Keep Alive by default >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index d924bdf2bc1a51803b18c6edd8252992135bb7d9..a26c319dba7273a239773508ee6051bf054d6d9f 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,15 @@ >+2019-05-02 Daniel Bates <dabates@apple.com> >+ >+ Pass KeyboardEvent by reference in more places >+ https://bugs.webkit.org/show_bug.cgi?id=197480 >+ >+ Reviewed by Wenson Hsieh. >+ >+ * WebCoreSupport/WebEditorClient.h: >+ * WebCoreSupport/WebEditorClient.mm: >+ (WebEditorClient::handleKeyboardEvent): >+ (WebEditorClient::handleInputMethodKeydown): >+ > 2019-05-02 Frederic Wang <fwang@igalia.com> > > [GTK][WPE] Disable "thin", "thick", "medium" values of mfrac@linethickness at runtime >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index 1c8ff84ae057cb745b14d5551bb2a7acab73fb2a..0725924d65d3856366ab5afd24ae6a000f3f3ce5 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,18 @@ >+2019-05-02 Daniel Bates <dabates@apple.com> >+ >+ Pass KeyboardEvent by reference in more places >+ https://bugs.webkit.org/show_bug.cgi?id=197480 >+ >+ Reviewed by Wenson Hsieh. >+ >+ * WebCoreSupport/WebEditorClient.cpp: >+ (WebEditorClient::handleKeyboardEvent): >+ (WebEditorClient::handleInputMethodKeydown): >+ * WebCoreSupport/WebEditorClient.h: >+ * WebView.cpp: >+ (WebView::handleEditingKeyboardEvent): >+ * WebView.h: >+ > 2019-05-02 Frederic Wang <fwang@igalia.com> > > [GTK][WPE] Disable "thin", "thick", "medium" values of mfrac@linethickness at runtime >diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp >index 3c9f6d5425bb3c8e855ef0e44a3c1f4181b5b312..dc50b6c223e803cc5a621dab14d53d7f36021902 100644 >--- a/Source/WebCore/editing/Editor.cpp >+++ b/Source/WebCore/editing/Editor.cpp >@@ -291,14 +291,14 @@ TextCheckerClient* Editor::textChecker() const > > void Editor::handleKeyboardEvent(KeyboardEvent& event) > { >- if (EditorClient* c = client()) >- c->handleKeyboardEvent(&event); >+ if (auto* client = this->client()) >+ client->handleKeyboardEvent(event); > } > > void Editor::handleInputMethodKeydown(KeyboardEvent& event) > { >- if (EditorClient* c = client()) >- c->handleInputMethodKeydown(&event); >+ if (auto* client = this->client()) >+ client->handleInputMethodKeydown(event); > } > > bool Editor::handleTextEvent(TextEvent& event) >diff --git a/Source/WebCore/loader/EmptyClients.cpp b/Source/WebCore/loader/EmptyClients.cpp >index 0e7cfba90f957345156a81cafcae0bf0bc9f3e93..55d083e9412e918ff30d68e1c5044f4d518f5451 100644 >--- a/Source/WebCore/loader/EmptyClients.cpp >+++ b/Source/WebCore/loader/EmptyClients.cpp >@@ -201,8 +201,8 @@ private: > void undo() final { } > void redo() final { } > >- void handleKeyboardEvent(KeyboardEvent*) final { } >- void handleInputMethodKeydown(KeyboardEvent*) final { } >+ void handleKeyboardEvent(KeyboardEvent&) final { } >+ void handleInputMethodKeydown(KeyboardEvent&) final { } > > void textFieldDidBeginEditing(Element*) final { } > void textFieldDidEndEditing(Element*) final { } >diff --git a/Source/WebCore/page/EditorClient.h b/Source/WebCore/page/EditorClient.h >index 1d1c8d042b7c35fee5d1df501003a1196e7cafb8..f9a641406007c0aad8c10d0e6011498a56953a27 100644 >--- a/Source/WebCore/page/EditorClient.h >+++ b/Source/WebCore/page/EditorClient.h >@@ -119,8 +119,8 @@ public: > virtual void undo() = 0; > virtual void redo() = 0; > >- virtual void handleKeyboardEvent(KeyboardEvent*) = 0; >- virtual void handleInputMethodKeydown(KeyboardEvent*) = 0; >+ virtual void handleKeyboardEvent(KeyboardEvent&) = 0; >+ virtual void handleInputMethodKeydown(KeyboardEvent&) = 0; > > virtual void textFieldDidBeginEditing(Element*) = 0; > virtual void textFieldDidEndEditing(Element*) = 0; >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp >index 49d5eb52cffcc464f133be701c4d520bddc83b3d..f428fd2397eddd4d2411770323eb3fa27902d85f 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp >@@ -361,13 +361,13 @@ WebCore::DOMPasteAccessResponse WebEditorClient::requestDOMPasteAccess(const Str > } > > #if PLATFORM(WIN) >-void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event) >+void WebEditorClient::handleKeyboardEvent(KeyboardEvent& event) > { > if (m_page->handleEditingKeyboardEvent(event)) >- event->setDefaultHandled(); >+ event.setDefaultHandled(); > } > >-void WebEditorClient::handleInputMethodKeydown(KeyboardEvent*) >+void WebEditorClient::handleInputMethodKeydown(KeyboardEvent&) > { > notImplemented(); > } >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h b/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h >index 30988ed80f5fc242b5c451e6b16e8871622baee5..1964860a43ecd76185cda789177be2fae335587a 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h >@@ -102,8 +102,8 @@ private: > void undo() final; > void redo() final; > >- void handleKeyboardEvent(WebCore::KeyboardEvent*) final; >- void handleInputMethodKeydown(WebCore::KeyboardEvent*) final; >+ void handleKeyboardEvent(WebCore::KeyboardEvent&) final; >+ void handleInputMethodKeydown(WebCore::KeyboardEvent&) final; > > void textFieldDidBeginEditing(WebCore::Element*) final; > void textFieldDidEndEditing(WebCore::Element*) final; >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp b/Source/WebKit/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp >index 1a63733cf678a6634c32f32b59d923bd9b295318..db99772a1875a15bbf9c41a34b7bfa7e9f8722fe 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp >@@ -52,9 +52,9 @@ bool WebEditorClient::executePendingEditorCommands(Frame* frame, const Vector<WT > return true; > } > >-void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event) >+void WebEditorClient::handleKeyboardEvent(KeyboardEvent& event) > { >- auto* platformEvent = event->underlyingPlatformEvent(); >+ auto* platformEvent = event.underlyingPlatformEvent(); > if (!platformEvent) > return; > >@@ -62,8 +62,8 @@ void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event) > if (platformEvent->handledByInputMethod()) > return; > >- ASSERT(event->target()); >- auto* frame = downcast<Node>(event->target())->document().frame(); >+ ASSERT(event.target()); >+ auto* frame = downcast<Node>(event.target())->document().frame(); > ASSERT(frame); > > const Vector<String> pendingEditorCommands = platformEvent->commands(); >@@ -74,14 +74,14 @@ void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event) > // through the DOM first. > if (platformEvent->type() == PlatformEvent::RawKeyDown) { > if (executePendingEditorCommands(frame, pendingEditorCommands, false)) >- event->setDefaultHandled(); >+ event.setDefaultHandled(); > > return; > } > > // Only allow text insertion commands if the current node is editable. > if (executePendingEditorCommands(frame, pendingEditorCommands, frame->editor().canEdit())) { >- event->setDefaultHandled(); >+ event.setDefaultHandled(); > return; > } > } >@@ -93,26 +93,26 @@ void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event) > // This is just a normal text insertion, so wait to execute the insertion > // until a keypress event happens. This will ensure that the insertion will not > // be reflected in the contents of the field until the keyup DOM event. >- if (event->type() != eventNames().keypressEvent) >+ if (event.type() != eventNames().keypressEvent) > return; > > // Don't insert null or control characters as they can result in unexpected behaviour >- if (event->charCode() < ' ') >+ if (event.charCode() < ' ') > return; > > // Don't insert anything if a modifier is pressed > if (platformEvent->controlKey() || platformEvent->altKey()) > return; > >- if (frame->editor().insertText(platformEvent->text(), event)) >- event->setDefaultHandled(); >+ if (frame->editor().insertText(platformEvent->text(), &event)) >+ event.setDefaultHandled(); > } > >-void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* event) >+void WebEditorClient::handleInputMethodKeydown(KeyboardEvent& event) > { >- auto* platformEvent = event->underlyingPlatformEvent(); >+ auto* platformEvent = event.underlyingPlatformEvent(); > if (platformEvent && platformEvent->handledByInputMethod()) >- event->setDefaultHandled(); >+ event.setDefaultHandled(); > } > > void WebEditorClient::updateGlobalSelection(Frame* frame) >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm b/Source/WebKit/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm >index 2a4a1639c3a58e77fa0525f456bd1d1c2bf0d182..3b595fffd843810ce1744aebfe813192acca7df7 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm >+++ b/Source/WebKit/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm >@@ -36,13 +36,13 @@ > namespace WebKit { > using namespace WebCore; > >-void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event) >+void WebEditorClient::handleKeyboardEvent(KeyboardEvent& event) > { > if (m_page->handleEditingKeyboardEvent(event)) >- event->setDefaultHandled(); >+ event.setDefaultHandled(); > } > >-void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* event) >+void WebEditorClient::handleInputMethodKeydown(KeyboardEvent&) > { > notImplemented(); > } >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm >index 3d1ff849031111151ca2e87c8c4e707c2f13397d..3a793255290c257536480f5259ea93126eb33013 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm >+++ b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm >@@ -45,16 +45,16 @@ > namespace WebKit { > using namespace WebCore; > >-void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event) >+void WebEditorClient::handleKeyboardEvent(KeyboardEvent& event) > { > if (m_page->handleEditingKeyboardEvent(event)) >- event->setDefaultHandled(); >+ event.setDefaultHandled(); > } > >-void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* event) >+void WebEditorClient::handleInputMethodKeydown(KeyboardEvent& event) > { >- if (event->handledByInputMethod()) >- event->setDefaultHandled(); >+ if (event.handledByInputMethod()) >+ event.setDefaultHandled(); > } > > void WebEditorClient::setInsertionPasteboard(const String&) >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp b/Source/WebKit/WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp >index b6f65df6fd21c771ab3bc088117ed73f0434d35c..165dee4a56f01037b803e162e2d966502b4157f9 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp >@@ -205,15 +205,15 @@ static void handleKeyDown(Frame& frame, KeyboardEvent& event, const PlatformKeyb > event.setDefaultHandled(); > } > >-void WebEditorClient::handleKeyboardEvent(WebCore::KeyboardEvent* event) >+void WebEditorClient::handleKeyboardEvent(WebCore::KeyboardEvent& event) > { >- ASSERT(event->target()); >- auto* frame = downcast<Node>(event->target())->document().frame(); >+ ASSERT(event.target()); >+ auto* frame = downcast<Node>(event.target())->document().frame(); > ASSERT(frame); > > // FIXME: Reorder the checks in a more sensible way. > >- auto* platformEvent = event->underlyingPlatformEvent(); >+ auto* platformEvent = event.underlyingPlatformEvent(); > if (!platformEvent) > return; > >@@ -228,17 +228,17 @@ void WebEditorClient::handleKeyboardEvent(WebCore::KeyboardEvent* event) > // This is just a normal text insertion, so wait to execute the insertion > // until a keypress event happens. This will ensure that the insertion will not > // be reflected in the contents of the field until the keyup DOM event. >- if (event->type() == eventNames().keypressEvent) >- return handleKeyPress(*frame, *event, *platformEvent); >- if (event->type() == eventNames().keydownEvent) >- return handleKeyDown(*frame, *event, *platformEvent); >+ if (event.type() == eventNames().keypressEvent) >+ return handleKeyPress(*frame, event, *platformEvent); >+ if (event.type() == eventNames().keydownEvent) >+ return handleKeyDown(*frame, event, *platformEvent); > } > >-void WebEditorClient::handleInputMethodKeydown(WebCore::KeyboardEvent* event) >+void WebEditorClient::handleInputMethodKeydown(WebCore::KeyboardEvent& event) > { >- auto* platformEvent = event->underlyingPlatformEvent(); >+ auto* platformEvent = event.underlyingPlatformEvent(); > if (platformEvent && platformEvent->windowsVirtualKeyCode() == VK_PROCESSKEY) >- event->preventDefault(); >+ event.preventDefault(); > } > > } // namespace WebKit >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index cc4d7973d2446a657354ddb9bbef56a8ed9c8c5c..a719ae0a788c5a1f76969e3c1d5c6d79ba9cb208 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -344,7 +344,7 @@ public: > void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&); > > // -- Called from WebCore clients. >- bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*); >+ bool handleEditingKeyboardEvent(WebCore::KeyboardEvent&); > > void didStartPageTransition(); > void didCompletePageTransition(); >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index 83f3126ee5dfcd82ea50b25113b2545be981510d..535acbe50586a29c1aa3f1a05dcfb91563fda197 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -414,9 +414,9 @@ bool WebPage::allowsUserScaling() const > return m_viewportConfiguration.allowsUserScaling(); > } > >-bool WebPage::handleEditingKeyboardEvent(KeyboardEvent* event) >+bool WebPage::handleEditingKeyboardEvent(KeyboardEvent& event) > { >- auto* platformEvent = event->underlyingPlatformEvent(); >+ auto* platformEvent = event.underlyingPlatformEvent(); > if (!platformEvent) > return false; > >diff --git a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm >index da54f2e88b31642aa6dcd569228aef551b048ef4..a07ca45d337f0e02b254f1d2916798b153358617 100644 >--- a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm >+++ b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm >@@ -275,14 +275,14 @@ bool WebPage::executeKeypressCommandsInternal(const Vector<WebCore::KeypressComm > return eventWasHandled; > } > >-bool WebPage::handleEditingKeyboardEvent(KeyboardEvent* event) >+bool WebPage::handleEditingKeyboardEvent(KeyboardEvent& event) > { >- Frame* frame = frameForEvent(event); >+ auto* frame = frameForEvent(&event); > >- auto* platformEvent = event->underlyingPlatformEvent(); >+ auto* platformEvent = event.underlyingPlatformEvent(); > if (!platformEvent) > return false; >- auto& commands = event->keypressCommands(); >+ auto& commands = event.keypressCommands(); > > ASSERT(!platformEvent->macEvent()); // Cannot have a native event in WebProcess. > >@@ -304,7 +304,7 @@ bool WebPage::handleEditingKeyboardEvent(KeyboardEvent* event) > // If there are no text insertion commands, default keydown handler is the right time to execute the commands. > // Keypress (Char event) handler is the latest opportunity to execute. > if (!haveTextInsertionCommands || platformEvent->type() == PlatformEvent::Char) { >- eventWasHandled = executeKeypressCommandsInternal(commands, event); >+ eventWasHandled = executeKeypressCommandsInternal(commands, &event); > commands.clear(); > } > >diff --git a/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp b/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp >index 31df42d2408b638d046cb5db49dd29dd6ed59a7b..c94bd05c924557b9483e613dd99a88deb097144b 100644 >--- a/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp >+++ b/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp >@@ -238,16 +238,16 @@ const char* WebPage::interpretKeyEvent(const WebCore::KeyboardEvent* evt) > return mapKey ? keyPressCommandsMap->get(mapKey) : 0; > } > >-bool WebPage::handleEditingKeyboardEvent(WebCore::KeyboardEvent* event) >+bool WebPage::handleEditingKeyboardEvent(WebCore::KeyboardEvent& event) > { >- auto* frame = downcast<Node>(event->target())->document().frame(); >+ auto* frame = downcast<Node>(event.target())->document().frame(); > ASSERT(frame); > >- auto* keyEvent = event->underlyingPlatformEvent(); >+ 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)); >+ auto command = frame->editor().command(interpretKeyEvent(&event)); > > if (keyEvent->type() == PlatformEvent::RawKeyDown) { > // WebKit doesn't have enough information about mode to decide >@@ -256,17 +256,17 @@ bool WebPage::handleEditingKeyboardEvent(WebCore::KeyboardEvent* event) > // 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); >+ return !command.isTextInsertion() && command.execute(&event); > } > >- if (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() < ' ') >+ if (event.charCode() < ' ') > return false; > >- return frame->editor().insertText(keyEvent->text(), event); >+ return frame->editor().insertText(keyEvent->text(), &event); > } > > } // namespace WebKit >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h >index f56cf2c4f35557ee30c59b84074482245629fb7d..f1cf30fa7875730cf9defa6ae4101dad46585ce8 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h >@@ -127,8 +127,8 @@ private: > void undo() final; > void redo() final; > >- void handleKeyboardEvent(WebCore::KeyboardEvent*) final; >- void handleInputMethodKeydown(WebCore::KeyboardEvent*) final; >+ void handleKeyboardEvent(WebCore::KeyboardEvent&) final; >+ void handleInputMethodKeydown(WebCore::KeyboardEvent&) final; > > void textFieldDidBeginEditing(WebCore::Element*) final; > void textFieldDidEndEditing(WebCore::Element*) final; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >index 0fc814faca074d3bb568c5e627f01e11fd1b6b35..426595f42f434574730c8a5e28cd1c33a5f38c25 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >@@ -684,28 +684,28 @@ void WebEditorClient::redo() > [[m_webView undoManager] redo]; > } > >-void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event) >+void WebEditorClient::handleKeyboardEvent(KeyboardEvent& event) > { >- auto* frame = downcast<Node>(event->target())->document().frame(); >+ auto* frame = downcast<Node>(event.target())->document().frame(); > #if !PLATFORM(IOS_FAMILY) > WebHTMLView *webHTMLView = (WebHTMLView *)[[kit(frame) frameView] documentView]; >- if ([webHTMLView _interpretKeyEvent:event savingCommands:NO]) >- event->setDefaultHandled(); >+ if ([webHTMLView _interpretKeyEvent:&event savingCommands:NO]) >+ event.setDefaultHandled(); > #else > WebHTMLView *webHTMLView = (WebHTMLView *)[[kit(frame) frameView] documentView]; >- if ([webHTMLView _handleEditingKeyEvent:event]) >- event->setDefaultHandled(); >+ if ([webHTMLView _handleEditingKeyEvent:&event]) >+ event.setDefaultHandled(); > #endif > } > >-void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* event) >+void WebEditorClient::handleInputMethodKeydown(KeyboardEvent& event) > { > #if !PLATFORM(IOS_FAMILY) > // FIXME: Switch to WebKit2 model, interpreting the event before it's sent down to WebCore. >- auto* frame = downcast<Node>(event->target())->document().frame(); >+ auto* frame = downcast<Node>(event.target())->document().frame(); > WebHTMLView *webHTMLView = (WebHTMLView *)[[kit(frame) frameView] documentView]; >- if ([webHTMLView _interpretKeyEvent:event savingCommands:YES]) >- event->setDefaultHandled(); >+ if ([webHTMLView _interpretKeyEvent:&event savingCommands:YES]) >+ event.setDefaultHandled(); > #else > // iOS does not use input manager this way > #endif >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.cpp b/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.cpp >index f72b6b56055e00a1add59191ad6f3ff42ceaa646..8f9a29d779bc5030329c584993b0fc2b50acdc9e 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.cpp >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.cpp >@@ -715,13 +715,13 @@ void WebEditorClient::redo() > } > } > >-void WebEditorClient::handleKeyboardEvent(KeyboardEvent* evt) >+void WebEditorClient::handleKeyboardEvent(KeyboardEvent& event) > { >- if (m_webView->handleEditingKeyboardEvent(evt)) >- evt->setDefaultHandled(); >+ if (m_webView->handleEditingKeyboardEvent(event)) >+ event.setDefaultHandled(); > } > >-void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* ) >+void WebEditorClient::handleInputMethodKeydown(KeyboardEvent&) > { > } > >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.h b/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.h >index eea27354a6a4c9e432f79243ca6d1de207184a84..bb837255fa4ce67f135d27cdaab70daf32e04550 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.h >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.h >@@ -95,8 +95,8 @@ private: > void textDidChangeInTextArea(WebCore::Element*) final; > void overflowScrollPositionChanged() final { } > >- void handleKeyboardEvent(WebCore::KeyboardEvent*) final; >- void handleInputMethodKeydown(WebCore::KeyboardEvent*) final; >+ void handleKeyboardEvent(WebCore::KeyboardEvent&) final; >+ void handleInputMethodKeydown(WebCore::KeyboardEvent&) final; > > bool shouldEraseMarkersAfterChangeSelection(WebCore::TextCheckingType) const final; > void ignoreWordInSpellDocument(const WTF::String&) final; >diff --git a/Source/WebKitLegacy/win/WebView.cpp b/Source/WebKitLegacy/win/WebView.cpp >index 10fad7881c7e0ce5d92c5bbba0dee754c0f6338c..79fc46d0fb864179b9223deb35dcaf5fbca49971 100644 >--- a/Source/WebKitLegacy/win/WebView.cpp >+++ b/Source/WebKitLegacy/win/WebView.cpp >@@ -2356,32 +2356,32 @@ const char* WebView::interpretKeyEvent(const KeyboardEvent* evt) > return mapKey ? keyPressCommandsMap->get(mapKey) : 0; > } > >-bool WebView::handleEditingKeyboardEvent(KeyboardEvent* evt) >+bool WebView::handleEditingKeyboardEvent(KeyboardEvent& event) > { >- auto* frame = downcast<Node>(evt->target())->document().frame(); >+ auto* frame = downcast<Node>(event.target())->document().frame(); > ASSERT(frame); > >- auto* keyEvent = evt->underlyingPlatformEvent(); >+ 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(evt)); >+ 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(evt); >+ return !command.isTextInsertion() && command.execute(&event); > } > >- if (command.execute(evt)) >+ if (command.execute(&event)) > return true; > > // Don't insert null or control characters as they can result in unexpected behaviour >- if (evt->charCode() < ' ') >+ if (event.charCode() < ' ') > return false; > >- return frame->editor().insertText(keyEvent->text(), evt); >+ return frame->editor().insertText(keyEvent->text(), &event); > } > > bool WebView::keyDown(WPARAM virtualKeyCode, LPARAM keyData, bool systemKeyDown) >diff --git a/Source/WebKitLegacy/win/WebView.h b/Source/WebKitLegacy/win/WebView.h >index c3eb08c428892792cdb3a86d6df951e5a108ee6b..ad4e32d47e85bd824701eacaef45ef1fb4d5451e 100644 >--- a/Source/WebKitLegacy/win/WebView.h >+++ b/Source/WebKitLegacy/win/WebView.h >@@ -473,7 +473,7 @@ public: > bool isBeingDestroyed() const { return m_isBeingDestroyed; } > > const char* interpretKeyEvent(const WebCore::KeyboardEvent*); >- bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*); >+ bool handleEditingKeyboardEvent(WebCore::KeyboardEvent&); > > bool isPainting() const { return m_paintCount > 0; } >
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 197480
:
368720
|
368787
|
368816
| 369010