RESOLVED WONTFIX 70339
NPN_ConvertPoint does not work the first time inside NPP_SetWindow
https://bugs.webkit.org/show_bug.cgi?id=70339
Summary NPN_ConvertPoint does not work the first time inside NPP_SetWindow
Rudi Sherry
Reported 2011-10-18 10:37:07 PDT
When I get the first NPP_SetWindow call that has non-zero clipping in the npwindow, I want to get the screen coords of the plug-in. They are wrong: 0,0 in plug-in coords gives me 0,-<pluginheight>. I debugged it and the reason appears to be that the plug-in process is getting a geometryChanged message *first*, before ever getting the real view/window frames, and *then* getting the view frame-changed notification. When it gets the geometryChanged, it calls NPP_SetWindow but the conversion depends on things that don't get set until the view frame-changed notification. Here is the stack the first time our plug-in get NPP_SetWindow with non-zero clipping... during this time, WebKit::NetscapePlugin::m_windowFrameInScreenCoordinates and m_viewFrameInWindowCoordinates are all [0,0][0,0]: #4 0x101020195 in WebKit::NetscapePlugin::NPP_SetWindow at NetscapePlugin.cpp:426 #5 0x10102029c in WebKit::NetscapePlugin::callSetWindow at NetscapePlugin.cpp:497 #6 0x101021ab2 in WebKit::NetscapePlugin::geometryDidChange at NetscapePlugin.cpp:676 #7 0x10116c9ee in WebKit::PluginControllerProxy::geometryDidChange at PluginControllerProxy.cpp:439 #8 0x1011726fb in CoreIPC::callMemberFunction<WebKit::PluginControllerProxy, void (WebKit::PluginControllerProxy::*)(WebCore::IntRect const&, WebCore::IntRect const&, WebKit::ShareableBitmap::Handle const&), WebCore::IntRect, WebCore::IntRect, WebKit::ShareableBitmap::Handle> at HandleMessage.h:31 #9 0x101173b4c in CoreIPC::handleMessage<Messages::PluginControllerProxy::GeometryDidChange, WebKit::PluginControllerProxy, void (WebKit::PluginControllerProxy::*)(WebCore::IntRect const&, WebCore::IntRect const&, WebKit::ShareableBitmap::Handle const&)> at HandleMessage.h:277 #10 0x101172122 in WebKit::PluginControllerProxy::didReceivePluginControllerProxyMessage at PluginControllerProxyMessageReceiver.cpp:76 #11 0x10115f6d7 in WebKit::WebProcessConnection::didReceiveMessage at WebProcessConnection.cpp:172 #12 0x101005cc4 in CoreIPC::Connection::dispatchMessage at Connection.cpp:689 #13 0x101005f0b in CoreIPC::Connection::SyncMessageState::dispatchMessages at Connection.cpp:169 #14 0x1010064af in CoreIPC::Connection::SyncMessageState::dispatchMessageAndResetDidScheduleDispatchMessagesWork at Connection.cpp:181 #15 0x101008855 in MemberFunctionWorkItem0<CoreIPC::Connection::SyncMessageState>::execute at WorkItem.h:79 This is because it hasn't yet gotten the ViewFrameDidChange notification through the proxy. It does that sometime later, in this stack: #0 0x10102c565 in WebKit::NetscapePlugin::windowAndViewFramesChanged at NetscapePluginMac.mm:897 #1 0x1011a77c8 in WebKit::PluginControllerProxy::windowAndViewFramesChanged at PluginControllerProxyMac.mm:105 #2 0x101172bd9 in CoreIPC::callMemberFunction<WebKit::PluginControllerProxy, void (WebKit::PluginControllerProxy::*)(WebCore::IntRect const&, WebCore::IntRect const&), WebCore::IntRect, WebCore::IntRect> at HandleMessage.h:25 #3 0x101173a70 in CoreIPC::handleMessage<Messages::PluginControllerProxy::WindowAndViewFramesChanged, WebKit::PluginControllerProxy, void (WebKit::PluginControllerProxy::*)(WebCore::IntRect const&, WebCore::IntRect const&)> at HandleMessage.h:277 #4 0x1011724be in WebKit::PluginControllerProxy::didReceivePluginControllerProxyMessage at PluginControllerProxyMessageReceiver.cpp:129 #5 0x10115f6d7 in WebKit::WebProcessConnection::didReceiveMessage at WebProcessConnection.cpp:172 #6 0x101005cc4 in CoreIPC::Connection::dispatchMessage at Connection.cpp:689 #7 0x101005e38 in CoreIPC::Connection::dispatchMessages at Connection.cpp:716 #8 0x10100876d in MemberFunctionWorkItem0<CoreIPC::Connection>::execute at WorkItem.h:79 #9 0x101047c81 in RunLoop::performWork at RunLoop.cpp:63 #10 0x101048dd9 in RunLoop::performWork at RunLoopMac.mm:37 ...but this doesn't result in any calls to NPP_SetWindow, so I don't know when I can call NPN_ConvertPoint() and get the real screen coords. Full disclosure: my webkit sources are about two weeks old, not the most current.
Attachments
Alexey Proskuryakov
Comment 1 2022-07-01 11:35:34 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.