<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>178901</bug_id>
          
          <creation_ts>2017-10-26 17:08:11 -0700</creation_ts>
          <short_desc>[WPE] Make it introspectable</short_desc>
          <delta_ts>2022-04-04 06:16:31 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WPE WebKit</component>
          <version>Other</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>226662</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=226662</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=238734</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>222985</dependson>
    
    <dependson>226662</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aperez</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1365127</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-10-26 17:08:11 -0700</bug_when>
    <thetext>I&apos;d like the first release of WPE to be fully introspectable. To accomplish this, WPEBackends will need to become introspectable as well.

This should be a fairly small amount of work once we have documentation working, and we all agree that working documentation is a release blocker. The value of delaying the release until we have introspection working is to ensure our API is actually introspectable, and avoid needless breakage down the road. It&apos;s also a major marketing point, since it will be nice to be able to use WPE from languages other than C and C++ without going through the pain of writing and maintaining bindings manually.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1412414</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2018-04-06 11:26:07 -0700</bug_when>
    <thetext>This would be nice to have, but it&apos;s not going to be a release blocker.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1857794</commentid>
    <comment_count>2</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2022-04-04 02:45:46 -0700</bug_when>
    <thetext>After bug #226662 now it is possible to use WPEWebKit from other
languages via GObject-Introspection. As you can see in the transcript
of a Python session below, things work as expected, modulo the fact
that we do not currently have any WPE backend which would be itself
introspectable:

&gt;&gt;&gt; from gi.repository import WPEJavaScriptCore as JSC
&lt;stdin&gt;:1: PyGIWarning: WPEJavaScriptCore was imported without specifying a version first. Use gi.require_version(&apos;WPEJavaScriptCore&apos;, &apos;1.1&apos;) before import to ensure that the right version gets loaded.
&gt;&gt;&gt; JSC
&lt;IntrospectionModule &apos;WPEJavaScriptCore&apos; from &apos;/home/aperez/WebKit/_wpep/lib/girepository-1.0/WPEJavaScriptCore-1.1.typelib&apos;&gt;
&gt;&gt;&gt; ctx = JSC.Context.new()
&gt;&gt;&gt; v = ctx.evaluate(&quot;new Date();&quot;, -1)
&gt;&gt;&gt; v.to_string()
&apos;Mon Apr 04 2022 12:30:53 GMT+0300 (EEST)&apos;

&gt;&gt;&gt; from gi.repository import WPEWebKit as WK 
&lt;stdin&gt;:1: PyGIWarning: WPEWebKit was imported without specifying a version first. Use gi.require_version(&apos;WPEWebKit&apos;, &apos;1.1&apos;) before import to ensure that the right version gets loaded.
&gt;&gt;&gt; context = WK.WebContext.new_ephemeral()
&gt;&gt;&gt; context
&lt;WPEWebKit.WebContext object at 0x7fbc28475040 (WebKitWebContext at 0x55cad3a4b0f0)&gt;
&gt;&gt;&gt; backend = WK.WebViewBackend.new(None, None, None)
** (process:2742041): WARNING **: 12:32:35.580: (../pygobject/gi/pygi-basictype.c:78):marshal_from_py_void: runtime check failed: (arg_cache-&gt;transfer == GI_TRANSFER_NOTHING)

** (process:2742041): CRITICAL **: 12:32:35.580: WebKitWebViewBackend* webkit_web_view_backend_new(wpe_view_backend*, GDestroyNotify, gpointer): assertion &apos;backend&apos; failed
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
TypeError: constructor returned NULL</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1857795</commentid>
    <comment_count>3</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2022-04-04 02:50:19 -0700</bug_when>
    <thetext>I am going to close this, either:

 - WPE backends add support for GObject-Inrospection themselves, or

 - Some GI language bindings support working with non-GI libraries,
   for example one can register a “foreign module” in PyGObject to
   add support for allow passing C types to/from GI functions. This
   is done in the Cairo integration, see 
   https://pygobject.readthedocs.io/en/latest/guide/cairo_integration.html

At any rate, what&apos;s remaining for being able to instantiate a WebView
through GI does not need seem to belong inside WebKit.

*** This bug has been marked as a duplicate of bug 226662 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>