Bug 228690 - REGRESSION (r280492): [Win] ASSERTION FAILED: evt->type() == eventNames().keydownEvent || evt->type() == eventNames().keypressEvent in WebView::interpretKeyEvent since r280492
Summary: REGRESSION (r280492): [Win] ASSERTION FAILED: evt->type() == eventNames().key...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-08-01 13:43 PDT by Fujii Hironori
Modified: 2021-08-02 15:38 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.22 KB, patch)
2021-08-01 14:21 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2021-08-01 13:43:08 PDT
[Win] ASSERTION FAILED: evt->type() == eventNames().keydownEvent || evt->type() == eventNames().keypressEvent in WebView::interpretKeyEvent since r280492

Since r280492 (240124@main, Bug 228009)

WinCairo-64-bit-WKL-Debug-Tests
https://build.webkit.org/#/builders/32/builds/769

ASSERTION FAILED: evt->type() == eventNames().keydownEvent || evt->type() == eventNames().keypressEvent
..\..\Source\WebKitLegacy\win\WebView.cpp(2320) : WebView::interpretKeyEvent
1   00007FF8FE421E8A WTFCrash
2   00007FF8DD011D01 WTFCrashWithInfo
3   00007FF8DD1A536F WebView::interpretKeyEvent
4   00007FF8DD1A5800 WebView::handleEditingKeyboardEvent
5   00007FF8DD1FBC80 WebEditorClient::handleKeyboardEvent
6   00007FF8DFD1EC1C WebCore::Editor::handleKeyboardEvent
7   00007FF8E07C6EB9 WebCore::EventHandler::defaultKeyboardEventHandler
8   00007FF8DFB7A9D0 WebCore::Node::defaultEventHandler
9   00007FF8DFF21C3B WebCore::HTMLInputElement::defaultEventHandler
10  00007FF8DFAFD5B4 WebCore::callDefaultEventHandlersInBubblingOrder
11  00007FF8DFAF640C WebCore::EventDispatcher::dispatchEvent
12  00007FF8DFB7A332 WebCore::Node::dispatchEvent
13  00007FF8DFAC57E0 WebCore::Element::dispatchKeyEvent
14  00007FF8E07CC767 WebCore::EventHandler::internalKeyEvent
15  00007FF8E07C6A9E WebCore::EventHandler::keyEvent
16  00007FF8DD1A28F8 WebView::keyUp
17  00007FF8DD1AE7A7 WebView::WebViewWndProc
18  00007FF911EF74D6 DispatchMessageW
19  00007FF911EF6DBB CallWindowProcW
20  00007FF904F1B8CA DefSubclassProc
21  00007FF904F1B5D8 CCSetScrollInfo
22  00007FF904F1B8CA DefSubclassProc
23  00007FF904F1B6E2 CCSetScrollInfo
24  00007FF911EF74D6 DispatchMessageW
25  00007FF911EF6FF2 DispatchMessageW
26  00007FF8F959C348 keyDownCallback
27  00007FF8F3F4E077 JSC::APICallbackFunction::callImpl<JSC::JSCallbackFunction>
28  00007FF8F3F41EA2 JSC::callJSCallbackFunction
29  000001DE2B0D102C
Comment 1 Fujii Hironori 2021-08-01 13:46:57 PDT
Apple-Win-10-Debug-Tests has been broken these days. And I didn't test with AppleWin, but I believe this is not a WinCairo port specific failure.
https://build.webkit.org/#/builders/16
Comment 2 Fujii Hironori 2021-08-01 14:11:16 PDT
WinCairo WK2 also have a similar code and is failing a similar assertion.

> WTF.dll!WTFCrash() Line 321	C++
> WebKit2.dll!WTFCrashWithInfo(int __formal, const char * __formal, const char * __formal, int __formal) Line 698	C++
> WebKit2.dll!WebKit::WebPage::interpretKeyEvent(const WebCore::KeyboardEvent * evt) Line 226	C++
> WebKit2.dll!WebKit::WebPage::handleEditingKeyboardEvent(WebCore::KeyboardEvent & event) Line 268	C++
> WebKit2.dll!WebKit::WebEditorClient::handleKeyboardEvent(WebCore::KeyboardEvent & event) Line 350	C++
> WebKit2.dll!WebCore::Editor::handleKeyboardEvent(WebCore::KeyboardEvent & event) Line 320	C++
> WebKit2.dll!WebCore::EventHandler::defaultKeyboardEventHandler(WebCore::KeyboardEvent & event) Line 3808	C++
> WebKit2.dll!WebCore::Node::defaultEventHandler(WebCore::Event & event) Line 2439	C++
> WebKit2.dll!WebCore::callDefaultEventHandlersInBubblingOrder(WebCore::Event & event, const WebCore::EventPath & path) Line 64	C++
> WebKit2.dll!WebCore::EventDispatcher::dispatchEvent(WebCore::Node & node, WebCore::Event & event) Line 205	C++
> WebKit2.dll!WebCore::Node::dispatchEvent(WebCore::Event & event) Line 2382	C++
> WebKit2.dll!WebCore::Element::dispatchKeyEvent(const WebCore::PlatformKeyboardEvent & platformEvent) Line 471	C++
> WebKit2.dll!WebCore::EventHandler::internalKeyEvent(const WebCore::PlatformKeyboardEvent & initialKeyEvent) Line 3560	C++
> WebKit2.dll!WebCore::EventHandler::keyEvent(const WebCore::PlatformKeyboardEvent & keyEvent) Line 3463	C++
> WebKit2.dll!WebCore::UserInputBridge::handleKeyEvent(const WebCore::PlatformKeyboardEvent & keyEvent, WebCore::InputSource __formal) Line 83	C++
> WebKit2.dll!WebKit::handleKeyEvent(const WebKit::WebKeyboardEvent & keyboardEvent, WebCore::Page * page) Line 3058	C++
> WebKit2.dll!WebKit::WebPage::keyEvent(const WebKit::WebKeyboardEvent & keyboardEvent) Line 3071	C++
> WebKit2.dll!IPC::callMemberFunctionImpl<WebKit::WebPage,void (__cdecl WebKit::WebPage::*)(WebKit::WebKeyboardEvent const &),std::tuple<WebKit::WebKeyboardEvent>,0>(WebKit::WebPage * object, void(WebKit::WebPage::*)(const WebKit::WebKeyboardEvent &) function, std::tuple<WebKit::WebKeyboardEvent> && args, std::integer_sequence<unsigned __int64,0> __formal) Line 44	C++
> WebKit2.dll!IPC::callMemberFunction<WebKit::WebPage,void (__cdecl WebKit::WebPage::*)(WebKit::WebKeyboardEvent const &),std::tuple<WebKit::WebKeyboardEvent>,std::integer_sequence<unsigned __int64,0>>(std::tuple<WebKit::WebKeyboardEvent> && args, WebKit::WebPage * object, void(WebKit::WebPage::*)(const WebKit::WebKeyboardEvent &) function) Line 50	C++
> WebKit2.dll!IPC::handleMessage<Messages::WebPage::KeyEvent,WebKit::WebPage,void (__cdecl WebKit::WebPage::*)(WebKit::WebKeyboardEvent const &)>(IPC::Decoder & decoder, WebKit::WebPage * object, void(WebKit::WebPage::*)(const WebKit::WebKeyboardEvent &) function) Line 120	C++
> WebKit2.dll!WebKit::WebPage::didReceiveWebPageMessage(IPC::Connection & connection, IPC::Decoder & decoder) Line 2875	C++
> WebKit2.dll!WebKit::WebPage::didReceiveMessage(IPC::Connection & connection, IPC::Decoder & decoder) Line 5009	C++
> WebKit2.dll!IPC::MessageReceiverMap::dispatchMessage(IPC::Connection & connection, IPC::Decoder & decoder) Line 130	C++
> WebKit2.dll!WebKit::WebProcess::didReceiveMessage(IPC::Connection & connection, IPC::Decoder & decoder) Line 857	C++
> WebKit2.dll!IPC::Connection::dispatchMessage(IPC::Decoder & decoder) Line 1059	C++
> WebKit2.dll!IPC::Connection::dispatchMessage(std::unique_ptr<IPC::Decoder,std::default_delete<IPC::Decoder>> message) Line 1105	C++
> WebKit2.dll!IPC::Connection::dispatchOneIncomingMessage() Line 1173	C++
> WebKit2.dll!IPC::Connection::enqueueIncomingMessage::__l2::<lambda>() Line 1028	C++
> WebKit2.dll!WTF::Detail::CallableWrapper<void <lambda>(void),void>::call() Line 53	C++
> WTF.dll!WTF::Function<void __cdecl(void)>::operator()() Line 83	C++
> WTF.dll!WTF::RunLoop::performWork() Line 134	C++
> WTF.dll!WTF::RunLoop::wndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 57	C++
> WTF.dll!WTF::RunLoop::RunLoopWndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 39	C++
> user32.dll!00007ffd46a7e858()	Unknown
> user32.dll!00007ffd46a7e299()	Unknown
> WTF.dll!WTF::RunLoop::run() Line 74	C++
> WebKit2.dll!WebKit::AuxiliaryProcessMainBase<WebKit::WebProcess,1>::run(int argc, char * * argv) Line 71	C++
> WebKit2.dll!WebKit::AuxiliaryProcessMain<WebKit::WebProcessMainWin>(int argc, char * * argv) Line 97	C++
> WebKit2.dll!WebKit::WebProcessMain(int argc, char * * argv) Line 58	C++
> WebKitWebProcess.exe!main(int argc, char * * argv) Line 35	C++
> [Inline Frame] WebKitWebProcess.exe!invoke_main() Line 78	C++
> WebKitWebProcess.exe!__scrt_common_main_seh() Line 288	C++
> kernel32.dll!00007ffd45127034()	Unknown
> ntdll.dll!00007ffd46f42651()	Unknown
Comment 3 Fujii Hironori 2021-08-01 14:21:02 PDT
Created attachment 434726 [details]
Patch
Comment 4 Brent Fulgham 2021-08-02 14:13:28 PDT
Comment on attachment 434726 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434726&action=review

> Source/WebKit/ChangeLog:3
> +        [Win] ASSERTION FAILED: evt->type() == eventNames().keydownEvent || evt->type() == eventNames().keypressEvent in WebView::interpretKeyEvent since r280492

Why doesn't Windows want the ability to handle KeyUp events?
Comment 5 Fujii Hironori 2021-08-02 14:33:02 PDT
Comment on attachment 434726 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434726&action=review

>> Source/WebKit/ChangeLog:3
>> +        [Win] ASSERTION FAILED: evt->type() == eventNames().keydownEvent || evt->type() == eventNames().keypressEvent in WebView::interpretKeyEvent since r280492
> 
> Why doesn't Windows want the ability to handle KeyUp events?

r280492 changed to pass keyup event to EditorClient::handleKeyboardEvent for smooth scrolling. But, WebView::handleEditingKeyboardEvent of Windows port doesn't need it.
Comment 6 Brent Fulgham 2021-08-02 14:55:38 PDT
Comment on attachment 434726 [details]
Patch

r=me
Comment 7 Fujii Hironori 2021-08-02 15:02:17 PDT
Comment on attachment 434726 [details]
Patch

Thank you for the review.
Comment 8 EWS 2021-08-02 15:37:11 PDT
Committed r280565 (240189@main): <https://commits.webkit.org/240189@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434726 [details].
Comment 9 Radar WebKit Bug Importer 2021-08-02 15:38:18 PDT
<rdar://problem/81432660>