Bug 269358 - VAPI for register_script_message_handler of webkitgtk-6.0 is wrong
Summary: VAPI for register_script_message_handler of webkitgtk-6.0 is wrong
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: Other
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-14 05:28 PST by Zhi
Modified: 2024-02-15 14:26 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zhi 2024-02-14 05:28:53 PST
According to doc, `world_name` in `register_script_message_handler` and `register_script_message_handler_with_reply` is nullable but the VAPI is not. If world_name is not set to null, we cannot use this messaging merchanism in common browser script.
Comment 1 Michael Catanzaro 2024-02-14 07:22:48 PST
I see the world_name parameter of webkit_user_content_manager_register_script_message_handler_with_reply() is not properly annotated as nullable. We can fix that.

I don't see anything wrong with register_script_message_handler() though.
Comment 2 Michael Catanzaro 2024-02-14 08:44:44 PST
Pull request: https://github.com/WebKit/WebKit/pull/24417
Comment 3 Zhi 2024-02-14 09:00:51 PST
Thanks for the fix. Maybe I use an old version of the lib(from fedora repo). I saw the wrong parameter defined for both functions.
Comment 4 Michael Catanzaro 2024-02-14 10:45:23 PST
If you're getting it from Fedora, then it's not old. I maintain the Fedora package.

If you can point to evidence showing what is wrong, that would be great. It would be better to look at the gir file than the vapi file, though, because we don't distribute a vapi. That is provided by vala, not by us. Although unlikely, it's possible that a bug could have been introduced at that level.
Comment 5 Michael Catanzaro 2024-02-14 10:49:14 PST
Looks like the vapi was fixed in https://gitlab.gnome.org/GNOME/vala/-/commit/c5dfcd3065116b94d12ddda54f8feefb944ca51a and Fedora has that change already. Maybe your vala package is old?
Comment 6 Michael Catanzaro 2024-02-14 10:51:50 PST
Anyway, you can work around this by declaring the function in your own vapi for now.

Note that the WebKit change here only directly fixes languages that use introspection directly. It won't directly affect vala until the next time vala updates its WebKitGTK bindings. That doesn't usually take very long, but it means the eventual fix will arrive in a vala update, not a WebKit update. Just something to be aware of.
Comment 7 EWS 2024-02-14 13:10:56 PST
Committed 274653@main (5d528e1cafca): <https://commits.webkit.org/274653@main>

Reviewed commits have been landed. Closing PR #24417 and removing active labels.
Comment 8 Zhi 2024-02-15 05:10:01 PST
Thanks. I am new to Vala and don't know much details. I'll check it later after vala update.