WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
83107
[X11][WebKit2][Plugins] wrong changing return-value for DefaultHandled
https://bugs.webkit.org/show_bug.cgi?id=83107
Summary
[X11][WebKit2][Plugins] wrong changing return-value for DefaultHandled
Kwangmin Bang
Reported
2012-04-03 19:45:46 PDT
Do not change return-value returned from Plugin by NPP_HandleEvent(). only x11 port is changing this value. If NPP_HandleEvent return 1, webkit should call setDefaultHandled(). it means plugin handled this event. If returned 0, webkit should NOT call setDefaulthandled(). it means plugin ignore the event or want to be called defaultHandler. please refer other platform codes or codes in Webcore/plugins. you can verify this bug on Youtube Video (Flash) through MouseWheelEvent.
Attachments
[WebKit2][Plugins] wrong changing return-value for DefaultHandled
(3.37 KB, patch)
2012-04-03 19:51 PDT
,
Kwangmin Bang
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Kwangmin Bang
Comment 1
2012-04-03 19:51:11 PDT
Created
attachment 135489
[details]
[WebKit2][Plugins] wrong changing return-value for DefaultHandled upload patch file.
Simon Hausmann
Comment 2
2012-04-16 02:38:46 PDT
Comment on
attachment 135489
[details]
[WebKit2][Plugins] wrong changing return-value for DefaultHandled View in context:
https://bugs.webkit.org/attachment.cgi?id=135489&action=review
> Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:-447 > - return !NPP_HandleEvent(&xEvent);
In WebKit1 the code (PluginViewQt.cpp at least) reads like this: bool dispatchNPEvent(...) { ... bool accepted = !m_plugin->pluginFuncs()->event(m_instance, &event); ... return accepted; } and then the caller uses if (dispatchNPEvent(...)) event->setDefaultHandled(); It appears the code in WebKit2 is similar, where WebProcess/Plugins/PluginView.cpp uses a pattern like this: bool didHandleEvent = false; ... didHandleEvent = m_plugin->handleMouseEvent(...); ... if (didHandleEvent) event->setDefaultHandled(); The return value of platformHandleMouseEvent seems to be passed through and with using !NPP_HandleEvent(...) I see the same transformation / interpretation of the return value from the plugin. Either I am missing something, the code in WebKit1 is wrong, or your patch is incorrect :). In order to get this logic correct I think it would be worthwhile to have a layout tests for this, especially since we have the infrastructure in place with a test netscape plugin.
Kwangmin Bang
Comment 3
2012-04-16 22:08:48 PDT
By your comment, i verified that return-value is changed by "!" operator in gtk/qt port. However, Mozilla NPAPI explains like below.
https://developer.mozilla.org/en/NPP_HandleEvent
If the plug-in handles the event, the function should return true. If the plug-in ignores the event, the function returns false. In other words, If plugin return true, webkit should call setDefaultHandled(); By NPAPI guide, I think my patch is right. And, mac port of webkit2 also does not change that. What's your opinion ?
Anders Carlsson
Comment 4
2014-02-05 10:52:39 PST
Comment on
attachment 135489
[details]
[WebKit2][Plugins] wrong changing return-value for DefaultHandled Clearing review flag on patches from before 2014. If this patch is still relevant, please reset the r? flag.
Alexey Proskuryakov
Comment 5
2022-07-01 11:36:01 PDT
Mass closing plug-in bugs, as plug-in support has been removed from WebKit. Please comment and/or reopen if this still affects WebKit in some way.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug