| Summary: | Unregistering and re-registering a user message handler does not work | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Adrian Perez <aperez> | ||||
| Component: | WebCore JavaScript | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | cgarcia, jberlin, mcatanzaro | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
This has probably been fixed in r184846, the #ifdefed test cases passes now in current trunk Created attachment 257258 [details]
Patch
Committed r187218: <http://trac.webkit.org/changeset/187218> |
User script messages sent with “window.webkit.messageHandlers.<name>.postMessage()” will not work (i.e. “WebScriptMessageHandler::Client::didPostMessage()” is not called) after performing the following sequence of operations: 1. Register a handler with “WebUserContentControllerProxy::addUserScriptMessageHandler()” 2. Unregister the handler with “WebUserContentControllerProxy::removeUserMessageHandlerForName()” 3. Register again a handler with the same name as in step (1) using “WebUserContentControllerProxy::addUserScriptMessageHandler()” This probably means that either removing the handler does not do all the cleanup it should and the logic for installing a handler fails when trying to add one with a name used previously. I have found this issue while writing the unit tests for the API of the GTK+ port, being worked in bug #133730