Bug 250835
Summary: | [WPE][GTK] Remove most webkit_web_view_new_with_*() constructors | ||
---|---|---|---|
Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> |
Component: | WebKitGTK | Assignee: | Michael Catanzaro <mcatanzaro> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | bugs-noreply, mcatanzaro |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | |||
Bug Blocks: | 210100 |
Michael Catanzaro
Splitting this from bug #222366:
"""
I'm also considering to remove all (or most of) webkit_web_view_new_with constructors. With all the construct properties we currently have I think most people need to use g_object_new and pass properties. Maybe we can keep with_related_view and add optional parameters to new() for the properties that are expected to be passed (web context, network session and settings, for example)
"""
I agree.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Michael Catanzaro
Um, actually there is one downside to using optional parameters: it makes it difficult to add any new construct parameters in the future without dooming applications back to using g_object_new() directly again.
I have a slightly different proposal that uses variadic arguments instead and just passes them along to g_object_new_valist(), which gives us flexibility to add new construct properties in the future without having to give up on use of webkit_web_view_new(). The downside is using variadic arguments means it can't be introspectable, which previously would not matter since it's a new() function and those aren't used by language bindings anyway, but since we use gi-docgen now it means it can't appear in the API docs. Still, it's worth it IMO. Another downside is I couldn't find a way to make the WPE WebKitWebViewBackend a separate non-variadic parameter as I don't think there's any way to add it to the va_list that gets passed to g_object_new_valist(), so WPE port users have to not forget to pass that.
Michael Catanzaro
Pull request: https://github.com/WebKit/WebKit/pull/8926
Michael Catanzaro
(In reply to Michael Catanzaro from comment #1)
> I have a slightly different proposal that uses variadic arguments instead
> and just passes them along to g_object_new_valist(), which gives us
> flexibility to add new construct properties in the future without having to
> give up on use of webkit_web_view_new().
Carlos Garcia did not like this, so I will drop this part of the proposal.
EWS
Committed 259285@main (f2357aa30823): <https://commits.webkit.org/259285@main>
Reviewed commits have been landed. Closing PR #8926 and removing active labels.