GNU bug report logs - #51712
29.0.50; [PATCH] New function `xwidget-webkit-load-html'

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Po Lu <luangruo@HIDDEN>; Keywords: patch; dated Tue, 9 Nov 2021 10:27:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 51712 <at> debbugs.gnu.org:


Received: (at 51712) by debbugs.gnu.org; 10 Nov 2021 12:50:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 10 07:50:42 2021
Received: from localhost ([127.0.0.1]:37239 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkn3q-0002rE-8E
	for submit <at> debbugs.gnu.org; Wed, 10 Nov 2021 07:50:42 -0500
Received: from eggs.gnu.org ([209.51.188.92]:47120)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mkn3n-0002r0-BN
 for 51712 <at> debbugs.gnu.org; Wed, 10 Nov 2021 07:50:41 -0500
Received: from [2001:470:142:3::e] (port=56356 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mkn3h-0003Rb-La; Wed, 10 Nov 2021 07:50:33 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=8tqy9u7KXbMOxefABUkvbuCM4fMf+6l0vdwXuC6qosg=; b=KZbDtrxONXSi
 /g7RitO4Si4LVCthTw9EZ9A/FASxGxwZbEvBnlp/+aF4eDUNQU77xeZKC6kdBjtTkI8XL219mOUOR
 fFmifmwwzQqCaQ+pcldJdMy4p7D+FLZeenXR7tus0LBKo9vnd3c/VlXDezBHKrFldoqt+jkgHQ2mP
 AmGUgHBcsQYyqTfE5zCTevfIyMG+b83+ooOwzQWxsv8NuNiqQh/tE6cEAnRcVfX7M983duJnCBaF4
 WUIXNZqStm/K5CNk7EqLTcEqRrjN6QyTa+OAkppA6jIQL42nEvHUd0G+9cMVtCkBgJKaFuESb2pLG
 2qUU8b8vHgIENZoKqCV2fA==;
Received: from [87.69.77.57] (port=4595 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mkn3g-0004ZO-VM; Wed, 10 Nov 2021 07:50:33 -0500
Date: Wed, 10 Nov 2021 14:50:28 +0200
Message-Id: <83bl2s41kb.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87zgqcczk4.fsf@HIDDEN> (message from Po Lu on Wed, 10 Nov
 2021 14:08:59 +0800)
Subject: Re: bug#51712: 29.0.50; [PATCH] New function
 `xwidget-webkit-load-html'
References: <878rxx8w1i.fsf.ref@HIDDEN> <878rxx8w1i.fsf@HIDDEN>
 <83h7cl5urs.fsf@HIDDEN> <87y25x5tu9.fsf@HIDDEN>
 <831r3p5sn4.fsf@HIDDEN> <87wnlgyjcd.fsf@HIDDEN>
 <87r1bolvx1.fsf@HIDDEN> <87czn8yii2.fsf@HIDDEN>
 <877ddgluzr.fsf@HIDDEN> <87fss4ohjv.fsf@HIDDEN>
 <87sfw4h7pt.fsf@HIDDEN> <87zgqcczk4.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51712
Cc: larsi@HIDDEN, 51712 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  51712 <at> debbugs.gnu.org
> Date: Wed, 10 Nov 2021 14:08:59 +0800
> 
> > That should be \"about:blank\" instead, since it's a string and not a
> > symbol.
> 
> Thanks, how's this?  Eli, does this look good to you?

Almost:

> +@defun xwidget-webkit-load-html xwidget text &optional base-uri
> +Load @var{text}, a string, into @var{xwidget}, which should be a
> +WebKit xwidget.  It treats @var{text} as HTML markup, which will be
> +rendered by @var{xwidget}.

Instead of the last sentence:

  Any HTML markup in @var{text} will be processed by @var{xwidget}
  while rendering the text.

> +Optional argument @var{base-uri}, which should be a string, specifies
> +the location of web resources specified through relative links, such
> +as the resource @samp{foo.png} in the HTML tag @samp{<img
> +src="foo.png">}.  It defaults to @samp{about:blank}.
> +@end defun

  Optional argument @var{base-uri}, which should be a string,
  specifies the absolute location of the web resources referenced by
  @var{text}, to be used for resolving relative links in @var{text}.

> +*** New function 'xwidget-webkit-load-html'.
> +This function is used to load HTML text into WebKit xwidgets, without
> +having to create a temporary file to store the markup.

Here' I'd like to say something like

  This is in contrast with loading HTML using ... which requires to
  create temporary files for storing the markup.

But I don't know what to write instead of "...".  What was the method
which existed earlier that you wanted to improve?

> +BASE_URI should be a string containing a URI that is used to locate
> +resources described by relative URLs, and if not specified, defaults
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"resources with relative URLs" sounds better to me.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.

Message received at 51712 <at> debbugs.gnu.org:


Received: (at 51712) by debbugs.gnu.org; 10 Nov 2021 06:09:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 10 01:09:17 2021
Received: from localhost ([127.0.0.1]:36733 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkgnN-0006FD-3p
	for submit <at> debbugs.gnu.org; Wed, 10 Nov 2021 01:09:17 -0500
Received: from sonic301-30.consmr.mail.ne1.yahoo.com ([66.163.184.199]:39593)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mkgnK-0006Ex-EP
 for 51712 <at> debbugs.gnu.org; Wed, 10 Nov 2021 01:09:16 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1636524548; bh=SzZF3ofo8CBkZ3CarJ67Ho2fk5tsXeIBdLnZkpG7jTg=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=ar6CpF4jq3aGMr3/FxiRYgFdeHQWXR+zlYi24aa8rcSVto3rMvXb1XEP6x1zDP865kQDg7MmNx/8HLPpV78uzS251RTGb0ua/Ik5ZtqeuovC3ZhdNeZt1yhL8mAu9IzYvcOd15eW4HP6cTN5tl4hw4t3rIBpoD/bFkbfsqaU2uif/jtiTh776q04jqsbRtmHwCrSBAaoa8ygMEmf8qq3bYpwdIX7B8W4hgy5K18bferiuWDipf2QR7bbxpt6tsXMCprGt/YuYlQN0JtT1PAYcseXm/zcx2Z5H9DM3yyGlRu3651PpGw3P8p7Mb8XHH/oEouQMNgnDnQCFZ7toZVH1g==
X-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0TOr_6c5.4h63IyVlNHBJWqHCNBwbUk5Cq1UjjmiwO_yE6PzHzYXW_0sInu5wPi1dA
 atV0lqksam7eHaLlvKXYDnTKeAoeA2AptsjWF93kX7NIQ.3Od95a9icD2HPwJXjiTTCyRq1qAotO
 uKvaMlM5KbvUJUumTnxNRxvCcASq7xIXAoKzukPDRUig2XQ8jVT5lsdJABnUaqT4.s9CDCVDp2x8
 cYNpJnH4FpR2Y06xd.FHontVGM43B9pQn1UzXvs.foe_iwuJvlK2l8hkri_SlqiKM6Z6ik7f3zWZ
 .R8P6CxbPJ1ZZGMtnxgDqHsHYMRZgTHNBB2oZC16U6Kb2AVa7gZ8VnQN7LRoQ8g_mKQcC3VZJkKC
 tLcvedtVYH9ML6JAP3RZe3Dnjb3Hptms23fcrFx5HyDLjkUVi8RvyoMqhBnKdqky0GQBJ65ql4Sw
 I41rIclx79BlY1w.Tczoln9gGfDInyWQIPrZiKu7C1S.HWpnh9pgVKD_AHdql8WC_NNJIDCUFO.K
 mEKut7qXsQ2CkAK5nerb4xgmBP0b4OAtzSADeyd8aFWO_FN105G.LaSQqtY0HR959n0YnIw9.mLc
 oHWuetMPTOpwCHroHGTmXWjHZXQcnXZNBAZyrbk9r5FZhgmC6zi0ek_48N5BE6o_MsCViSyzs26n
 Pkv_thFJ6qahIJKh.6cAVbKiZuJrZIGWOXYDdDabdHJ0pDF1O8bWh7W0ak73LxNo-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic301.consmr.mail.ne1.yahoo.com with HTTP; Wed, 10 Nov 2021 06:09:08 +0000
Received: by kubenode515.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID dad8584078955b3105c56876d20b773c; 
 Wed, 10 Nov 2021 06:09:02 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51712: 29.0.50; [PATCH] New function
 `xwidget-webkit-load-html'
References: <878rxx8w1i.fsf.ref@HIDDEN> <878rxx8w1i.fsf@HIDDEN>
 <83h7cl5urs.fsf@HIDDEN> <87y25x5tu9.fsf@HIDDEN>
 <831r3p5sn4.fsf@HIDDEN> <87wnlgyjcd.fsf@HIDDEN>
 <87r1bolvx1.fsf@HIDDEN> <87czn8yii2.fsf@HIDDEN>
 <877ddgluzr.fsf@HIDDEN> <87fss4ohjv.fsf@HIDDEN>
 <87sfw4h7pt.fsf@HIDDEN>
Date: Wed, 10 Nov 2021 14:08:59 +0800
In-Reply-To: <87sfw4h7pt.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 10 Nov 2021 06:59:10 +0100")
Message-ID: <87zgqcczk4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Mailer: WebService/1.1.19306
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 3938
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 51712
Cc: Eli Zaretskii <eliz@HIDDEN>, 51712 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> That should be \"about:blank\" instead, since it's a string and not a
> symbol.

Thanks, how's this?  Eli, does this look good to you?


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Add-xwidget-webkit-load-html.patch

From 1d701339df5ed91ed730fb134976137bcf1e0ce6 Mon Sep 17 00:00:00 2001
From: Po Lu <luangruo@HIDDEN>
Date: Tue, 9 Nov 2021 21:36:40 +0800
Subject: [PATCH] Add `xwidget-webkit-load-html'

* doc/lispref/display.texi (Xwidgets): Document new function.
* etc/NEWS: Announce new function.
* src/xwidget.c (Fxwidget_webkit_load_html): New function.
(syms_of_xwidget): Define new subr.
---
 doc/lispref/display.texi | 11 +++++++++++
 etc/NEWS                 |  5 +++++
 src/xwidget.c            | 40 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+)

diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index b6bd14f887..aa7d64493c 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -6943,6 +6943,17 @@ Xwidgets
 signals an error.
 @end defun
 
+@defun xwidget-webkit-load-html xwidget text &optional base-uri
+Load @var{text}, a string, into @var{xwidget}, which should be a
+WebKit xwidget.  It treats @var{text} as HTML markup, which will be
+rendered by @var{xwidget}.
+
+Optional argument @var{base-uri}, which should be a string, specifies
+the location of web resources specified through relative links, such
+as the resource @samp{foo.png} in the HTML tag @samp{<img
+src="foo.png">}.  It defaults to @samp{about:blank}.
+@end defun
+
 @node Buttons
 @section Buttons
 @cindex buttons in buffers
diff --git a/etc/NEWS b/etc/NEWS
index 3cad0995ac..ae318be1c0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -796,6 +796,11 @@ what the widget will actually receive.
 
 On GTK+, only key and function key events are implemented.
 
++++
+*** New function 'xwidget-webkit-load-html'.
+This function is used to load HTML text into WebKit xwidgets, without
+having to create a temporary file to store the markup.
+
 +++
 *** New functions for performing searches on WebKit xwidgets.
 Some new functions, such as 'xwidget-webkit-search', have been added
diff --git a/src/xwidget.c b/src/xwidget.c
index fc76ce307e..2587b658e7 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -2139,6 +2139,44 @@ DEFUN ("xwidget-webkit-finish-search", Fxwidget_webkit_finish_search,
   return Qnil;
 }
 
+#ifdef USE_GTK
+DEFUN ("xwidget-webkit-load-html", Fxwidget_webkit_load_html,
+       Sxwidget_webkit_load_html, 2, 3, 0,
+       doc: /* Make XWIDGET's WebKit widget render TEXT.
+XWIDGET should be a WebKit xwidget, that will receive TEXT.  TEXT
+should be a string that will be displayed by XWIDGET as HTML markup.
+BASE_URI should be a string containing a URI that is used to locate
+resources described by relative URLs, and if not specified, defaults
+to "about:blank".  */)
+  (Lisp_Object xwidget, Lisp_Object text, Lisp_Object base_uri)
+{
+  struct xwidget *xw;
+  WebKitWebView *webview;
+  char *data, *uri;
+
+  CHECK_XWIDGET (xwidget);
+  CHECK_STRING (text);
+  if (NILP (base_uri))
+    base_uri = build_string ("about:blank");
+  else
+    CHECK_STRING (base_uri);
+
+  base_uri = ENCODE_UTF_8 (base_uri);
+  text = ENCODE_UTF_8 (text);
+  xw = XXWIDGET (xwidget);
+
+  data = SSDATA (text);
+  uri = SSDATA (base_uri);
+  webview = WEBKIT_WEB_VIEW (xw->widget_osr);
+
+  block_input ();
+  webkit_web_view_load_html (webview, data, uri);
+  unblock_input ();
+
+  return Qnil;
+}
+#endif
+
 void
 syms_of_xwidget (void)
 {
@@ -2177,6 +2214,9 @@ syms_of_xwidget (void)
   defsubr (&Sxwidget_webkit_next_result);
   defsubr (&Sxwidget_webkit_previous_result);
   defsubr (&Sset_xwidget_buffer);
+#ifdef USE_GTK
+  defsubr (&Sxwidget_webkit_load_html);
+#endif
 
   DEFSYM (QCxwidget, ":xwidget");
   DEFSYM (QCtitle, ":title");
-- 
2.31.1


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.

Message received at 51712 <at> debbugs.gnu.org:


Received: (at 51712) by debbugs.gnu.org; 10 Nov 2021 05:59:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 10 00:59:24 2021
Received: from localhost ([127.0.0.1]:36696 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkgdo-0005s9-04
	for submit <at> debbugs.gnu.org; Wed, 10 Nov 2021 00:59:24 -0500
Received: from quimby.gnus.org ([95.216.78.240]:39334)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mkgdn-0005rx-2j
 for 51712 <at> debbugs.gnu.org; Wed, 10 Nov 2021 00:59:23 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=5I4HNXCUPWzfRW7OmG7T9BIR4+gtrWC+eowro6pP8KI=; b=nryIHLk0Sn1hNLAO0m0LS8vBsE
 UZr7A8t/WEwhRtzkcl8vzBnBQvIU9b8JSS291k3h749xamUCRVNVrcqEgXdMtWAROEJDKx2muscSx
 3rKSn3t6SjCNQ3fcUs0PSJ1/xc7H+5gdqEfJM/Eb8BjbdzDYkliAfcqYXdSHKbtAY9Lo=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mkgda-0001pe-U8; Wed, 10 Nov 2021 06:59:14 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
Subject: Re: bug#51712: 29.0.50; [PATCH] New function
 `xwidget-webkit-load-html'
References: <878rxx8w1i.fsf.ref@HIDDEN> <878rxx8w1i.fsf@HIDDEN>
 <83h7cl5urs.fsf@HIDDEN> <87y25x5tu9.fsf@HIDDEN>
 <831r3p5sn4.fsf@HIDDEN> <87wnlgyjcd.fsf@HIDDEN>
 <87r1bolvx1.fsf@HIDDEN> <87czn8yii2.fsf@HIDDEN>
 <877ddgluzr.fsf@HIDDEN> <87fss4ohjv.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEVcQTJ9f4KRbVGx
 jmzCoH3KqoXbvqH////XHG2cAAAAAWJLR0QHFmGI6wAAAAd0SU1FB+ULCgU6BlgxSEMAAAFySURB
 VDjLvdNdjoMgEABgVrvvu+kFzGDfG356AIU+b6h4AFHuf4QdwFZINdmnJWrCfBn+HAhZ28d30WKs
 AsBP6J45T/HzF6mFtqEN+GhtUwcbqZXC/hZ4QaXeYk9Q+1AfQXUMOMeglOKvJreMiXLcCgkvfk7b
 HAgNhqDBzTakXUHngIdwomko3LJ1OBRKFVG2GfA+QDi2W/e4ZCAUg3SgM3U5SNsnuDBegF76OBR5
 AJ9XsAlYhE8DfJFbxvwEDSAKkDML8dPUlODkwNIMpBwqQjVcDHkHTq13uGSg+QYnOdz94k2FBcML
 EIP31jPAODcZGKq8H3dBLt4unGNcTNnOf+jN3fTCKRdcu3YDI+9OqgC6L6CTo6H4T6gace3Zj+ra
 MUwMVI/ePrIMJjwkwFLq6AbX1iUQWvUsh4uJxQCh3kqAFwiWlc+VxiIpMwI0a4kARYA6g/WGVnEJ
 R9AcQEP+kpEujMDrs13nCLtX7T9gP25/ATmpDLLFOmk3AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIx
 LTExLTEwVDA1OjU4OjA2KzAwOjAwMugY8AAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0xMS0xMFQw
 NTo1ODowNiswMDowMEO1oEwAAAAASUVORK5CYII=
X-Now-Playing: Kate Bush's _Remastered (16): The Other Sides (2): The Other
 Side 1_: "Running Up That Hill (A Deal With God) 2012 Remix"
Date: Wed, 10 Nov 2021 06:59:10 +0100
In-Reply-To: <87fss4ohjv.fsf@HIDDEN> (Po Lu's message of "Wed, 10 Nov 2021
 10:44:52 +0800")
Message-ID: <87sfw4h7pt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Po Lu <luangruo@HIDDEN> writes: > Hmm, OK, how's this?
 Looks good to me. One tiny thing: 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51712
Cc: Eli Zaretskii <eliz@HIDDEN>, 51712 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Po Lu <luangruo@HIDDEN> writes:

> Hmm, OK, how's this?

Looks good to me.  One tiny thing:

> +BASE_URI should be a string containing a URI that is used to locate
> +resources described by relative URLs, and if not specified, defaults
> +to `about:blank'.  */)

That should be \"about:blank\" instead, since it's a string and not a
symbol.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.

Message received at 51712 <at> debbugs.gnu.org:


Received: (at 51712) by debbugs.gnu.org; 10 Nov 2021 04:47:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 23:47:58 2021
Received: from localhost ([127.0.0.1]:36638 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkfWg-000432-J0
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 23:47:58 -0500
Received: from sonic317-33.consmr.mail.ne1.yahoo.com ([66.163.184.44]:38521)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mkfWf-0003zT-CR
 for 51712 <at> debbugs.gnu.org; Tue, 09 Nov 2021 23:47:57 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1636519671; bh=R6hvwaSh4ZZFYGqzO6/PmAkYWveoUjJelHd58LEBVPs=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=EJpaRmhAWAuF9PgLLLHWhZoKf0avbQh5z+QyeAl3bmVOjl4K95XxKa4k7Hfgo7AejHG69eyynqZ0QFhT1OxmQ12UVgJ/M4GzdZBopL1fmmkSYN8qCpX/a8EcRRPlEWkHRCych6MpYFrOu2y8szmQfu9P7+qFI57ikbRj2uShLTWT6QAXemtwdht/U+GzAZ3H2YdNWULzMUg1DpPpHYLn4bpR6Uce9erq/BJfj46qHHoF1I7aYYYfkXQqa4IlLzaBP8vazCF1M2BYKJrmOS50uoPAu2twZiiAf/AmVBzyzo4O52IsRnFXtCv9Dae6aUCUW5UIcuTQTOuOg46NOb76iQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1636519671; bh=0YX+fYUezK/3xQ2Uxkb1i4kFAnkC1R4cuxz/IhNmZfF=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=jmt8L0yxqoa8hXFdkkMzbcoOogYcHhyI7mox682QGDYIfah601aS+ULcaepzRuJsJarUPm0uPHM23tGzBoRa8avjw3Ks+4Xek9x2L3z5nt5DA2qgc8yKbMrkufYxAU0ypdpX1akrLtmMx5peFGaE2XsIp146/HskZeQG2uCKvhz215uoIE5NvhK+Ve+kbRBEdksX5MDpkHHnxFH3ZSeqfIh18XxyCCKlxlB4um8tl9CeXSPLCYoeufW2znD+TWIIMOw3okaiRR99omKX8NLfsqQYj3woHkfJx6+zhnBToo5sOLvTqL/s3rLlyKFQIB6MkHuzS77oZWSXCKGBdYCFbw==
X-YMail-OSG: Uzs.CLcVM1kdpJQI.ZoddJ7fYQm8Re11Mu68TpZkzBEj0svPslPieewtxaTInb7
 NVx2W1Dfa1p.jQ907NhG_dbVRqlw1XnKJgPjIFQe6_SZMr8hHfx938PxZO._i_qQnQfnXkvQHKf_
 sdKNvO92ZR552B4xdnFmaDtcSIBiUlEuyWYk4tVRZFM4nVN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ijDM8_5g1GPv9cDFI2YMmHBtYqRZzCbNbOKRdqiSA.krMC.H3GVQsBM-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic317.consmr.mail.ne1.yahoo.com with HTTP; Wed, 10 Nov 2021 04:47:51 +0000
Received: by kubenode509.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID dda141478e2938820e05a27dbf71fb6a; 
 Wed, 10 Nov 2021 04:47:45 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Richard Stallman <rms@HIDDEN>
Subject: Re: bug#51712: 29.0.50; [PATCH] New function
 `xwidget-webkit-load-html'
References: <878rxx8w1i.fsf.ref@HIDDEN> <878rxx8w1i.fsf@HIDDEN>
 <E1mkfK7-0006Mh-Cl@HIDDEN>
Date: Wed, 10 Nov 2021 12:47:40 +0800
In-Reply-To: <E1mkfK7-0006Mh-Cl@HIDDEN> (Richard Stallman's message
 of "Tue, 09 Nov 2021 23:34:59 -0500")
Message-ID: <87bl2sfwgj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19306
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 361
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 51712
Cc: 51712 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Richard Stallman <rms@HIDDEN> writes:

> Would you please explain the role of JavaScript code in use of xwidget?
> In particular, will this JavaScript code be written specifically for
> use with Emacs?  Or will it be found on the net?

It will be JavaScript code written specifically for use with Emacs, used
to manipulate the DOM tree of the widget.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.

Message received at 51712 <at> debbugs.gnu.org:


Received: (at 51712) by debbugs.gnu.org; 10 Nov 2021 04:37:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 23:37:58 2021
Received: from localhost ([127.0.0.1]:36601 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkfN0-0001aw-N2
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 23:37:58 -0500
Received: from quimby.gnus.org ([95.216.78.240]:38834)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mkfMy-0001af-9q
 for 51712 <at> debbugs.gnu.org; Tue, 09 Nov 2021 23:37:57 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=BBFyTJwNRdh4Qx/ASRq5Zhyh1nWroA+Q7XMWKC3HF4s=; b=BYaROJN8o7wHKKWnd7+71K3CH6
 jTQTWrTmzeBiCxeW01M21emyeS8s697AjtStNpHaoYysuEs4DpSJpj3Gkfb5yBNYnLyI/0HK8BKMF
 9WFjdS1HovxRV6HOMWMCo7qH5F8QAo8Bz2rG4nTTnDes1yTujUmlwmryxXIIQUoUqF2I=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mkfMm-0001Iq-0q; Wed, 10 Nov 2021 05:37:47 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Richard Stallman <rms@HIDDEN>
Subject: Re: bug#51712: 29.0.50; [PATCH] New function
 `xwidget-webkit-load-html'
References: <878rxx8w1i.fsf.ref@HIDDEN> <878rxx8w1i.fsf@HIDDEN>
 <E1mkfK7-0006Mh-Cl@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEWVc1BONCu5mGfl
 06fDs51waYn///94bPVFAAAAAWJLR0QGYWa4fQAAAAd0SU1FB+ULCgQlDQN79WIAAAGRSURBVDjL
 bdRBdsQgCABQYtO9thdgGLufpzlASrxC73+VAmqiaV1N8gdFxMACMshRzgneso1SeAkQAhg9cwoN
 mMggeJU1v8Knvd/A69+DhhCCk4gKWR4swgORCD1qqL71FgFOgDR0HApUNORfkDxwuYOXmSQEYwof
 JFuIzGDpeheJiffnmVX+asBOp7pgaxGEmhUe1z5cWtoaM8DHq0bIiBP4EzASXSXZoUPByAPkCmDb
 oPcBaG8g2+CfAVwDWYAm0PpAcBQZKcYx4oRSjnwdbV5BQCoSpbo5jxHuIWA53UEjdCaKMwBYhIwZ
 FltDzo/5Bl7XcLHQDR4eFXT1Cj3dHRRAjo/voFPBM3O5ATXIB5cJtCTemn+L81QGa1E4/oKeVKEb
 +ArSQSNgA+uf80YxFwQwAO242CDVNoMTiHaFLVn3YYXWi1qrje3vUMGurT47/dFedHCSMtZofVw6
 0Jo3m69N1AFh3QzsArtaRLC515KoD2glsQW1h/pAd60Bci0ROtCQVSnf9pFo34YwwHzRfwH0qIi9
 RUb9HQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0xMS0xMFQwNDozNzoxMyswMDowMGhSf4IAAAAl
 dEVYdGRhdGU6bW9kaWZ5ADIwMjEtMTEtMTBUMDQ6Mzc6MTMrMDA6MDAZD8c+AAAAAElFTkSuQmCC
X-Now-Playing: Kate Bush's _Remastered (9): Aerial: A Sky of Honey_: "Nocturn"
Date: Wed, 10 Nov 2021 05:37:39 +0100
In-Reply-To: <E1mkfK7-0006Mh-Cl@HIDDEN> (Richard Stallman's message
 of "Tue, 09 Nov 2021 23:34:59 -0500")
Message-ID: <87ilx0iq24.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Richard Stallman <rms@HIDDEN> writes: > Would you please
 explain the role of JavaScript code in use of xwidget? > In particular, will
 this JavaScript code be written specifically for > use with Emacs? Or will
 it be found on the net? 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51712
Cc: Po Lu <luangruo@HIDDEN>, 51712 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Richard Stallman <rms@HIDDEN> writes:

> Would you please explain the role of JavaScript code in use of xwidget?
> In particular, will this JavaScript code be written specifically for
> use with Emacs?  Or will it be found on the net?

It's JS written by me included in Emacs.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.

Message received at 51712 <at> debbugs.gnu.org:


Received: (at 51712) by debbugs.gnu.org; 10 Nov 2021 04:35:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 23:35:07 2021
Received: from localhost ([127.0.0.1]:36594 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkfKE-0001WH-Sb
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 23:35:07 -0500
Received: from eggs.gnu.org ([209.51.188.92]:37272)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rms@HIDDEN>) id 1mkfKD-0001Vc-19
 for 51712 <at> debbugs.gnu.org; Tue, 09 Nov 2021 23:35:05 -0500
Received: from [2001:470:142:3::e] (port=43670 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rms@HIDDEN>)
 id 1mkfK7-0003ql-LV; Tue, 09 Nov 2021 23:34:59 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From:
 mime-version; bh=var8CDmroVLc7AmT1yWUc/5L9c3z3MMsGsV051d60qU=; b=DCeoTmnGnD3D
 Gu8gfsL1BPLhGZKVRrA0tnvoUT6TlO913fTTObQHtoizcJy1nsh63rO9yWRpDNRPdPS4pn27MQNyK
 /ZzCLKGAuBv6/LczWPpQo4nmOhG+N7vtZdFtMKlUQYGEhx6ofm9IOgmNE8e8qAt8pG8v3owOINum3
 grkfrbcs4yNAEPWDzhM/y4PmnBk75ggY3tkiaVS+hkagW+/5olicZj34k/IAAOz4jrEUAkgSeSBA9
 CaQOOMcUu0SsC/SBU1U84I778lprRtYfZYWVEdrXxfmXoOVkOXGXy/HOzmVX1u8FOXrZJvKVOpSRI
 Z+Q82UXvZzzD+4yDAnTOFQ==;
Received: from rms by fencepost.gnu.org with local (Exim 4.90_1)
 (envelope-from <rms@HIDDEN>)
 id 1mkfK7-0006Mh-Cl; Tue, 09 Nov 2021 23:34:59 -0500
Content-Type: text/plain; charset=Utf-8
From: Richard Stallman <rms@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <878rxx8w1i.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#51712: 29.0.50;
 [PATCH] New function `xwidget-webkit-load-html'
References: <878rxx8w1i.fsf.ref@HIDDEN> <878rxx8w1i.fsf@HIDDEN>
Message-Id: <E1mkfK7-0006Mh-Cl@HIDDEN>
Date: Tue, 09 Nov 2021 23:34:59 -0500
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51712
Cc: 51712 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rms@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Hopefully this allows to reduce the amount of JavaScript hacks needed to
  > load HTML into a widget.

Would you please explain the role of JavaScript code in use of xwidget?
In particular, will this JavaScript code be written specifically for
use with Emacs?  Or will it be found on the net?

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.

Message received at 51712 <at> debbugs.gnu.org:


Received: (at 51712) by debbugs.gnu.org; 10 Nov 2021 02:45:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 21:45:08 2021
Received: from localhost ([127.0.0.1]:36484 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkdbn-0004rQ-UD
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 21:45:08 -0500
Received: from sonic310-25.consmr.mail.ne1.yahoo.com ([66.163.186.206]:38885)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mkdbk-0004qZ-A8
 for 51712 <at> debbugs.gnu.org; Tue, 09 Nov 2021 21:45:06 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1636512298; bh=W5i6Q/X3V5x9PkMedktclghhPiQqVcs3dWGkzdyol9w=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=iQmdiNPmPUU0Fe3mI7vzDik2aNRci0WEOK+QKu+LBLnI4/F04+E9vjpf7/FtsC24TiemSN+rQJ3lgiKUvd4x2XOrONVYLlSw5Wecajk1fUNrtauSAWAo+TJqNDySfycdok7XbpU6t1TH8THh9L0KkTHHo7cqBqjKUc/rBl77VopnHyOAOHSdO5fbAcFdgMljbjxnUCArXgT6AWVpjwGJgbsRt7yndb2679a7jksrVGTT6b031aY5WsgzZEgagDpYktp9CveLqxM5Uam9ilmtGluQKhaSz3YMO047zmXBFIZ028Sn76hsl7peWfEFV9BSb0sPrTok8jvxhN0a4gYPUQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1636512298; bh=AHUfWHOFvPUyAyLeDjBs288Mn/bU7yY6SE97Pcm9jUD=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=mb8xo9MQ8LuHxCrS3ClmOajtQfWmwGXE/kJ9qxN2OzHRTdR2aJGkBEo3mdcxlHXKAgrlROKT9eivKnXbHrb/S1RhBTOTLdHT6kvOXWfUnrE7Z2THpYGnJ84cOJvnbWS6chrTD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ek.x2l5IFZoA0vsH5bKj7Pr6kkZwpo6_CejQkmnXRByVUfqjefBQ6zuJRjtGB6VJeN45
 skV2K0J.5mxkhU2fjkD75e1UZaGu5Hqmn.27lo_qUQZVKUCeEqylxufuKeDBQC7ivg2Emwd_YWAU
 N3cGh_8Ym9rD3frlQJAHxKWt0yo15vk7cf9kS6jbOR8SFJGvBnAtSBtwk4b13Apgxp0P3FsEpMDN
 0vttKUnZLQK93AvfZ51y0Mgcz5NSkimmq6dt.AuHZcMLC3xTvnCuihJyaAIA5uxbCT_.rHJYxbUc
 JO29RzN1dEr0myk4idvIMwkdL9k4dJ6vTtaPAhKoNZNkYS1VD99dh1L0w15_DWEWTmBXGk51gk84
 uF1tOsx4rnE5MCT3cT9B_tfhzGU5FZBiGjUWFVqQKabrXOYBbpLmWhos-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic310.consmr.mail.ne1.yahoo.com with HTTP; Wed, 10 Nov 2021 02:44:58 +0000
Received: by kubenode503.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 6ca6bd34e8964ea7162fe0898d2bb791; 
 Wed, 10 Nov 2021 02:44:55 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51712: 29.0.50; [PATCH] New function
 `xwidget-webkit-load-html'
References: <878rxx8w1i.fsf.ref@HIDDEN> <878rxx8w1i.fsf@HIDDEN>
 <83h7cl5urs.fsf@HIDDEN> <87y25x5tu9.fsf@HIDDEN>
 <831r3p5sn4.fsf@HIDDEN> <87wnlgyjcd.fsf@HIDDEN>
 <87r1bolvx1.fsf@HIDDEN> <87czn8yii2.fsf@HIDDEN>
 <877ddgluzr.fsf@HIDDEN>
Date: Wed, 10 Nov 2021 10:44:52 +0800
In-Reply-To: <877ddgluzr.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 10 Nov 2021 01:22:48 +0100")
Message-ID: <87fss4ohjv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Mailer: WebService/1.1.19306
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 4791
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 51712
Cc: Eli Zaretskii <eliz@HIDDEN>, 51712 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Po Lu <luangruo@HIDDEN> writes:
>
>> Thanks, does this look OK to you?  And I'm afraid I'm not terribly good
>> at phrasing this into words, so I would really appreciate it if you
>> could help write that section of the manual.
>
> [...]
>
>> +Optional argument @var{base-uri}, which should be a string, specifies
>> +the location of web resources specified through relative links, such
>> +as the resource @samp{foo.png} in the HTML tag @samp{<img
>> +src="foo.png">}.  It defaults to @samp{about:blank}.
>
> Looks good to me.
>
>> +XWIDGET should be a WebKit xwidget, that will receive TEXT.  TEXT
>> +should be a string that will be displayed by XWIDGET as HTML markup.
>> +BASE_URI should be a string containing a URI that is used to fetch
>> +resources, and if not specified, defaults to `about:blank'.  */)
>
> Should probably be "relative resources (i.e., URLs that aren't
> absolute)" or something of the kind.

Hmm, OK, how's this?


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Add-xwidget-webkit-load-html.patch

From 1d701339df5ed91ed730fb134976137bcf1e0ce6 Mon Sep 17 00:00:00 2001
From: Po Lu <luangruo@HIDDEN>
Date: Tue, 9 Nov 2021 21:36:40 +0800
Subject: [PATCH] Add `xwidget-webkit-load-html'

* doc/lispref/display.texi (Xwidgets): Document new function.
* etc/NEWS: Announce new function.
* src/xwidget.c (Fxwidget_webkit_load_html): New function.
(syms_of_xwidget): Define new subr.
---
 doc/lispref/display.texi | 11 +++++++++++
 etc/NEWS                 |  5 +++++
 src/xwidget.c            | 40 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+)

diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index b6bd14f887..aa7d64493c 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -6943,6 +6943,17 @@ Xwidgets
 signals an error.
 @end defun
 
+@defun xwidget-webkit-load-html xwidget text &optional base-uri
+Load @var{text}, a string, into @var{xwidget}, which should be a
+WebKit xwidget.  It treats @var{text} as HTML markup, which will be
+rendered by @var{xwidget}.
+
+Optional argument @var{base-uri}, which should be a string, specifies
+the location of web resources specified through relative links, such
+as the resource @samp{foo.png} in the HTML tag @samp{<img
+src="foo.png">}.  It defaults to @samp{about:blank}.
+@end defun
+
 @node Buttons
 @section Buttons
 @cindex buttons in buffers
diff --git a/etc/NEWS b/etc/NEWS
index 3cad0995ac..ae318be1c0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -796,6 +796,11 @@ what the widget will actually receive.
 
 On GTK+, only key and function key events are implemented.
 
++++
+*** New function 'xwidget-webkit-load-html'.
+This function is used to load HTML text into WebKit xwidgets, without
+having to create a temporary file to store the markup.
+
 +++
 *** New functions for performing searches on WebKit xwidgets.
 Some new functions, such as 'xwidget-webkit-search', have been added
diff --git a/src/xwidget.c b/src/xwidget.c
index fc76ce307e..2587b658e7 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -2139,6 +2139,44 @@ DEFUN ("xwidget-webkit-finish-search", Fxwidget_webkit_finish_search,
   return Qnil;
 }
 
+#ifdef USE_GTK
+DEFUN ("xwidget-webkit-load-html", Fxwidget_webkit_load_html,
+       Sxwidget_webkit_load_html, 2, 3, 0,
+       doc: /* Make XWIDGET's WebKit widget render TEXT.
+XWIDGET should be a WebKit xwidget, that will receive TEXT.  TEXT
+should be a string that will be displayed by XWIDGET as HTML markup.
+BASE_URI should be a string containing a URI that is used to locate
+resources described by relative URLs, and if not specified, defaults
+to `about:blank'.  */)
+  (Lisp_Object xwidget, Lisp_Object text, Lisp_Object base_uri)
+{
+  struct xwidget *xw;
+  WebKitWebView *webview;
+  char *data, *uri;
+
+  CHECK_XWIDGET (xwidget);
+  CHECK_STRING (text);
+  if (NILP (base_uri))
+    base_uri = build_string ("about:blank");
+  else
+    CHECK_STRING (base_uri);
+
+  base_uri = ENCODE_UTF_8 (base_uri);
+  text = ENCODE_UTF_8 (text);
+  xw = XXWIDGET (xwidget);
+
+  data = SSDATA (text);
+  uri = SSDATA (base_uri);
+  webview = WEBKIT_WEB_VIEW (xw->widget_osr);
+
+  block_input ();
+  webkit_web_view_load_html (webview, data, uri);
+  unblock_input ();
+
+  return Qnil;
+}
+#endif
+
 void
 syms_of_xwidget (void)
 {
@@ -2177,6 +2214,9 @@ syms_of_xwidget (void)
   defsubr (&Sxwidget_webkit_next_result);
   defsubr (&Sxwidget_webkit_previous_result);
   defsubr (&Sset_xwidget_buffer);
+#ifdef USE_GTK
+  defsubr (&Sxwidget_webkit_load_html);
+#endif
 
   DEFSYM (QCxwidget, ":xwidget");
   DEFSYM (QCtitle, ":title");
-- 
2.31.1


--=-=-=
Content-Type: text/plain


Thanks.

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 51712 <at> debbugs.gnu.org:


Received: (at 51712) by debbugs.gnu.org; 10 Nov 2021 00:23:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 19:23:00 2021
Received: from localhost ([127.0.0.1]:36307 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkbOG-0005FT-68
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 19:23:00 -0500
Received: from quimby.gnus.org ([95.216.78.240]:36492)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mkbOE-0005FH-IA
 for 51712 <at> debbugs.gnu.org; Tue, 09 Nov 2021 19:22:59 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=0ioPmlOiC69vrHWQolSpDbAcaFtyhfG6wWNpmrsr8lM=; b=pzVnr9oMvZ7yC/x1Vs6hmEx1DR
 QuhdkreiKr6iSZAkwIyOdVMzsMah5dzAvWagflm6MS78zipS2AthJ7kQ+lxh/rSLFbsHU/V2rJfID
 tWbwIuTzYFZNJZ4DAgnBRQxeGlAd45oK5ZRh7GVvfuMf1Ce1xKIw7Po94X9zq7y/QA7c=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mkbO5-0007zI-Bn; Wed, 10 Nov 2021 01:22:51 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
Subject: Re: bug#51712: 29.0.50; [PATCH] New function
 `xwidget-webkit-load-html'
References: <878rxx8w1i.fsf.ref@HIDDEN> <878rxx8w1i.fsf@HIDDEN>
 <83h7cl5urs.fsf@HIDDEN> <87y25x5tu9.fsf@HIDDEN>
 <831r3p5sn4.fsf@HIDDEN> <87wnlgyjcd.fsf@HIDDEN>
 <87r1bolvx1.fsf@HIDDEN> <87czn8yii2.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEVBOC2umGywn33/
 ///6R8N8AAAAAWJLR0QDEQxM8gAAAAd0SU1FB+ULCRcvDfVBry8AAAGPSURBVCjPbZKxbtswEIaP
 gmggmShAChJvBTKkfgoqiAw0E1WIhqUpKZJBfAplaIdO8SAB1WQXVmDeU5Z3KjxFEO746X7dHY8E
 +OzRs3sgI3e8zu/JRj1byMldvekgvGC1eOVI+mJIC30Zx5D0L5REeGGuAYYtxcHn5ikkpYgBK3QX
 Fjb8H94cCL5wOWPYrbQKtpIMGx0+iq2Y+/HvAW7mVjfYMViC3Uj9tG3GkW8UQf9IuvZKg4oa37xR
 0ZDUijU2PwPE16ClrRwnkLdCy1y5PwRuD9YmdfP7GOBvJ31VNuOwD9DB0pdrHPDAE1thv8BhCtMS
 Haz8k/A/djnD0h/ydninwQXA3nqkHRH474f6pDKWZbWO67tkgioKsz3K1n61H6AjDdIssHC+JJkS
 OsLBYUlFFYgIR4d8HKDifJwcnk/RTa+neVjCpO6Yqoghhmzc38Hiv8rWH77gfUNiqks8LQxfgEw/
 SDwny0A4FMWc4FmDc2nJkA6FefRqViW/pJGVrBhkoStromkGab0t7vt/qotsNRY1pfcAAAAldEVY
 dGRhdGU6Y3JlYXRlADIwMjEtMTEtMDlUMjM6NDc6MTIrMDA6MDAh3mbdAAAAJXRFWHRkYXRlOm1v
 ZGlmeQAyMDIxLTExLTA5VDIzOjQ3OjEyKzAwOjAwUIPeYQAAAABJRU5ErkJggg==
X-Now-Playing: Kate Bush's _Remastered (3): Never For Ever_: "Breathing"
Date: Wed, 10 Nov 2021 01:22:48 +0100
In-Reply-To: <87czn8yii2.fsf@HIDDEN> (Po Lu's message of "Wed, 10 Nov 2021
 08:14:13 +0800")
Message-ID: <877ddgluzr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Po Lu <luangruo@HIDDEN> writes: > Thanks, does this look
 OK to you? And I'm afraid I'm not terribly good > at phrasing this into words, 
 so I would really appreciate it if you > could help write that section of
 the manual. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51712
Cc: Eli Zaretskii <eliz@HIDDEN>, 51712 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Po Lu <luangruo@HIDDEN> writes:

> Thanks, does this look OK to you?  And I'm afraid I'm not terribly good
> at phrasing this into words, so I would really appreciate it if you
> could help write that section of the manual.

[...]

> +Optional argument @var{base-uri}, which should be a string, specifies
> +the location of web resources specified through relative links, such
> +as the resource @samp{foo.png} in the HTML tag @samp{<img
> +src="foo.png">}.  It defaults to @samp{about:blank}.

Looks good to me.

> +XWIDGET should be a WebKit xwidget, that will receive TEXT.  TEXT
> +should be a string that will be displayed by XWIDGET as HTML markup.
> +BASE_URI should be a string containing a URI that is used to fetch
> +resources, and if not specified, defaults to `about:blank'.  */)

Should probably be "relative resources (i.e., URLs that aren't
absolute)" or something of the kind.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.

Message received at 51712 <at> debbugs.gnu.org:


Received: (at 51712) by debbugs.gnu.org; 10 Nov 2021 00:14:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 19:14:30 2021
Received: from localhost ([127.0.0.1]:36288 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkbG1-0002r1-Pl
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 19:14:30 -0500
Received: from sonic308-10.consmr.mail.ne1.yahoo.com ([66.163.187.33]:42460)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mkbFy-0002qn-DP
 for 51712 <at> debbugs.gnu.org; Tue, 09 Nov 2021 19:14:28 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1636503258; bh=1yPT3667B9lqn4n0NrEtZYXaPt/LRSn0zJ3nSC1kV58=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=sGFZJRmSVMMcOxeTue+s3irmHCCYnIbPdH2jz+M9xJenEmt4Xfb2ChPHBMBEraepV3tP8SD5oL/hfpdTMiIM8mnJ3uATo4aKBbieRvOPBJk/MiZFCtTP8HZbLWqWJV6CkDnFHdoO55Ia0WGiDtPr9zLpmeIRfCc7ZbW2zThf44XN8Yi9U3klcj57bt/tpBzP4V3ZOhahVmYHXvUkRfhVHc+vR9LUti3tIUtnLPoCobdcC3PsNSbAxj+zDSlcliLnx17WYk4fAuNbMENo+YUYTFu8wES087J9KjbxZdLsKTbIB+zrUwjvQyrg4MRSzN9teh9rFoYa2nptv83EgRwk3A==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1636503258; bh=qc2nEqUUkAJNfqxhRaYOCo2R+gMp+BaNlpVpq6sqJCl=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=bckMcKnEwX+raAxOc8qBDNWgxdoZZBLyljIsx52CkHfBUtT0nnoqijR6mHT6T62Pvfjdgx+oSCxDL4kBfa7pGGvXqzFmMKZpRD5kESP1NBexjZB9/hbsqMn0fMuPKwjbiRNa3kOjpfIWPiNXnINFPTEfhGC3MkmLUrxCb3ZSqw07eEBPjUQq741r2ugEHw+N8mN9TyIfNgoHXbRcHzseds29X3TIS9OMx16ohVVvXCFf/4K3GwuxAw71+L8U+9d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PhAzY5J3A7k5RpQzfNIDAgKfPRaupc5EwFpFmyg4Zc5tq6vB2fopofUBpOOkmwn2zSPxJhS
 Tn7.DpvTIPGTJrNUU5UdlzFJuZKanA8KfNHxiiaXkiE0Xp2ylqDanI4Yicghx5Go960ysgK9gF4F
 yXLzQd2GLYavEBu_sjpjAHe6eZ8gLUbm3T2Eu8VTsQJ6skCHqFfw6XdyPSQ7TqvWB4J4k1WylLAN
 k1xliHKB5jjt8txhEigmlmtmYzbLAdIfe5RiZQwRfd3Eb0I44axiW.f6V_mQXtsqtI_OatSk.KsG
 Xseujj6nFLJ2svwh70z0GQLYhjAghMYSRtHeK8Z.5WT8LwkczDi3qNUghD7jSyGc-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic308.consmr.mail.ne1.yahoo.com with HTTP; Wed, 10 Nov 2021 00:14:18 +0000
Received: by kubenode511.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID cb1e5a73f26b952405e7f13c26154eaa; 
 Wed, 10 Nov 2021 00:14:16 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51712: 29.0.50; [PATCH] New function
 `xwidget-webkit-load-html'
References: <878rxx8w1i.fsf.ref@HIDDEN> <878rxx8w1i.fsf@HIDDEN>
 <83h7cl5urs.fsf@HIDDEN> <87y25x5tu9.fsf@HIDDEN>
 <831r3p5sn4.fsf@HIDDEN> <87wnlgyjcd.fsf@HIDDEN>
 <87r1bolvx1.fsf@HIDDEN>
Date: Wed, 10 Nov 2021 08:14:13 +0800
In-Reply-To: <87r1bolvx1.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 10 Nov 2021 01:02:50 +0100")
Message-ID: <87czn8yii2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Mailer: WebService/1.1.19306
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 4816
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 51712
Cc: Eli Zaretskii <eliz@HIDDEN>, 51712 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Po Lu <luangruo@HIDDEN> writes:
>
>>> Hmm... this is better, but at least I am still in the dark regarding
>>> the need for this optional argument.  E.g., what would happen if you
>>> use that tag, but don't specify the URI?
>>
>> I'm in the dark too.  I am not a web developer, and browser engines are
>> remarkably lax about these things, but hopefully Lars can explain better
>> (after all, shr must deal with these things too), so I added him to the
>> Ccs.
>
> The base URI is used when expanding relative links.  So if you have HTML
> that looks like
>
> <a href="foo.html"><img src="img.png"></a>
>
> then the browser can't resolve those two URLs without having the base
> URI.  So you'd pass in a base URI of https://example.com/foo/bar/zot if
> that's where the HTML snippet is from.
>
> When the URLs are absolute, the base URI is irrelevant.

Thanks, does this look OK to you?  And I'm afraid I'm not terribly good
at phrasing this into words, so I would really appreciate it if you
could help write that section of the manual.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Add-xwidget-webkit-load-html.patch

From 1d701339df5ed91ed730fb134976137bcf1e0ce6 Mon Sep 17 00:00:00 2001
From: Po Lu <luangruo@HIDDEN>
Date: Tue, 9 Nov 2021 21:36:40 +0800
Subject: [PATCH] Add `xwidget-webkit-load-html'

* doc/lispref/display.texi (Xwidgets): Document new function.
* etc/NEWS: Announce new function.
* src/xwidget.c (Fxwidget_webkit_load_html): New function.
(syms_of_xwidget): Define new subr.
---
 doc/lispref/display.texi | 11 +++++++++++
 etc/NEWS                 |  5 +++++
 src/xwidget.c            | 40 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+)

diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index b6bd14f887..aa7d64493c 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -6943,6 +6943,17 @@ Xwidgets
 signals an error.
 @end defun
 
+@defun xwidget-webkit-load-html xwidget text &optional base-uri
+Load @var{text}, a string, into @var{xwidget}, which should be a
+WebKit xwidget.  It treats @var{text} as HTML markup, which will be
+rendered by @var{xwidget}.
+
+Optional argument @var{base-uri}, which should be a string, specifies
+the location of web resources specified through relative links, such
+as the resource @samp{foo.png} in the HTML tag @samp{<img
+src="foo.png">}.  It defaults to @samp{about:blank}.
+@end defun
+
 @node Buttons
 @section Buttons
 @cindex buttons in buffers
diff --git a/etc/NEWS b/etc/NEWS
index 3cad0995ac..ae318be1c0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -796,6 +796,11 @@ what the widget will actually receive.
 
 On GTK+, only key and function key events are implemented.
 
++++
+*** New function 'xwidget-webkit-load-html'.
+This function is used to load HTML text into WebKit xwidgets, without
+having to create a temporary file to store the markup.
+
 +++
 *** New functions for performing searches on WebKit xwidgets.
 Some new functions, such as 'xwidget-webkit-search', have been added
diff --git a/src/xwidget.c b/src/xwidget.c
index fc76ce307e..2587b658e7 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -2139,6 +2139,43 @@ DEFUN ("xwidget-webkit-finish-search", Fxwidget_webkit_finish_search,
   return Qnil;
 }
 
+#ifdef USE_GTK
+DEFUN ("xwidget-webkit-load-html", Fxwidget_webkit_load_html,
+       Sxwidget_webkit_load_html, 2, 3, 0,
+       doc: /* Make XWIDGET's WebKit widget render TEXT.
+XWIDGET should be a WebKit xwidget, that will receive TEXT.  TEXT
+should be a string that will be displayed by XWIDGET as HTML markup.
+BASE_URI should be a string containing a URI that is used to fetch
+resources, and if not specified, defaults to `about:blank'.  */)
+  (Lisp_Object xwidget, Lisp_Object text, Lisp_Object base_uri)
+{
+  struct xwidget *xw;
+  WebKitWebView *webview;
+  char *data, *uri;
+
+  CHECK_XWIDGET (xwidget);
+  CHECK_STRING (text);
+  if (NILP (base_uri))
+    base_uri = build_string ("about:blank");
+  else
+    CHECK_STRING (base_uri);
+
+  base_uri = ENCODE_UTF_8 (base_uri);
+  text = ENCODE_UTF_8 (text);
+  xw = XXWIDGET (xwidget);
+
+  data = SSDATA (text);
+  uri = SSDATA (base_uri);
+  webview = WEBKIT_WEB_VIEW (xw->widget_osr);
+
+  block_input ();
+  webkit_web_view_load_html (webview, data, uri);
+  unblock_input ();
+
+  return Qnil;
+}
+#endif
+
 void
 syms_of_xwidget (void)
 {
@@ -2177,6 +2214,9 @@ syms_of_xwidget (void)
   defsubr (&Sxwidget_webkit_next_result);
   defsubr (&Sxwidget_webkit_previous_result);
   defsubr (&Sset_xwidget_buffer);
+#ifdef USE_GTK
+  defsubr (&Sxwidget_webkit_load_html);
+#endif
 
   DEFSYM (QCxwidget, ":xwidget");
   DEFSYM (QCtitle, ":title");
-- 
2.31.1


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.

Message received at 51712 <at> debbugs.gnu.org:


Received: (at 51712) by debbugs.gnu.org; 10 Nov 2021 00:03:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 19:03:01 2021
Received: from localhost ([127.0.0.1]:36269 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkb4v-0002YM-0j
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 19:03:01 -0500
Received: from quimby.gnus.org ([95.216.78.240]:36198)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mkb4t-0002Y7-VM
 for 51712 <at> debbugs.gnu.org; Tue, 09 Nov 2021 19:03:00 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=lkScS7CVxf006p4rD5hEpnmeKF3cxkAtYI2nVbeQ89k=; b=RcAr9IgoT5SsSvQ6ehOBQvYeaQ
 XAJdtN4rhEaJBP1QjE6yfEGX9qLBpqwWUnlHFNbduqW6aXdy/CkokEiSkC8EXiyA4iwwtpMr3OCwW
 1XhqNiZX0V8Lx9W3qjwhdTs/NKwkd4Es1iTR+2G7QvvwSlI6uo18s81yXe4haCTnwsIk=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mkb4k-0007q7-Hf; Wed, 10 Nov 2021 01:02:53 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
Subject: Re: bug#51712: 29.0.50; [PATCH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g==
X-Now-Playing: Kate Bush's _Remastered (3): Never For Ever_: "Egypt"
Date: Wed, 10 Nov 2021 01:02:50 +0100
In-Reply-To: <87wnlgyjcd.fsf@HIDDEN> (Po Lu's message of "Wed, 10 Nov 2021
 07:56:02 +0800")
Message-ID: <87r1bolvx1.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Po Lu <luangruo@HIDDEN> writes: >> Hmm... this is better, 
 but at least I am still in the dark regarding >> the need for this optional
 argument. E.g., what would happen if you >> use that tag, but don't specify
 the URI? > > I'm in th [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51712
Cc: Eli Zaretskii <eliz@HIDDEN>, 51712 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Po Lu <luangruo@HIDDEN> writes:

>> Hmm... this is better, but at least I am still in the dark regarding
>> the need for this optional argument.  E.g., what would happen if you
>> use that tag, but don't specify the URI?
>
> I'm in the dark too.  I am not a web developer, and browser engines are
> remarkably lax about these things, but hopefully Lars can explain better
> (after all, shr must deal with these things too), so I added him to the
> Ccs.

The base URI is used when expanding relative links.  So if you have HTML
that looks like

<a href="foo.html"><img src="img.png"></a>

then the browser can't resolve those two URLs without having the base
URI.  So you'd pass in a base URI of https://example.com/foo/bar/zot if
that's where the HTML snippet is from.

When the URLs are absolute, the base URI is irrelevant.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.

Message received at 51712 <at> debbugs.gnu.org:


Received: (at 51712) by debbugs.gnu.org; 9 Nov 2021 23:56:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 18:56:18 2021
Received: from localhost ([127.0.0.1]:36255 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkayQ-0000Co-Dn
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 18:56:18 -0500
Received: from sonic313-9.consmr.mail.ne1.yahoo.com ([66.163.185.32]:36762)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mkayO-0000Cb-PH
 for 51712 <at> debbugs.gnu.org; Tue, 09 Nov 2021 18:56:18 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1636502170; bh=2cGumqjwPfUqXkGKQeHj2N6wTQOruOPYYtL2z7oBK6E=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=MI4oGVw/UwQAHQfRicopLBiPFQa89xZzeQG+owu4XoiAPCtDXUblEyXfZtC/bRdeH+OWV5ZLhTuGfEr1wOGjg+7vBbi/H01lnE93vBe5S1f2roj13yv86n6/mvQsj/JOSXJxu8REAbP7JYZHd7oC0ikF2S/+/n/BpIW1nvGLkpzqBnsjTWt0RPlPxT5JeTl/VCX9+Vg6wAPnPVKm/SbGlZABGJPCBn3o4zKiIE5/HM+rsppGv8HIFnDsw33TRM0jWyMdqY+IZRnXYt2+dID+4L5oKYfmXmTbbXlMZTpIjwrif7FXjc6jEGGRe4Cr/p/QzuUEbGfIDj0TSM6uenY4Jw==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1636502170; bh=u6LqmkXqlycKBJVUYkO2ZbEfHOo5syDsiG7s5q49uQl=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=ZrqGWOp3l5o1bae2U5yfo42gD4WyxoKw3yLHCkmdM/dWIWLoOHdamAMElSsDCG8LY0cq77TJ6vBoD9qrc4GrtR2gzpMKtdRCGmZ4cq8BRe9aaJTXZ2B1bsGnt9dsdvTn+q7nfgOBjpriMF+jURkGU8r1t1beHcLlqxkDyai811Q0LYPpSwY4pMO51I13/u9cTL0wR9vlB+WGlewZ0hLQWo2mJmKpobXXwAYY/nTdU0V2zAShqcqNMoYGM1IL5An16YnA15qDzoIjqxeBPTNQJhwBqJqbxiROGLeeEYW1XlwxIJkqqRgaBTMJ/1k3+e0mOCu1mRQbfs+ImItITTEwGQ==
X-YMail-OSG: wK79CSkVM1meMzC82z_JDY0W5UyTtBu9lxpiRMToRSjSQMM3uYJCxIng7_Wnl6a
 OHY.VUdU1oZjqkCtUstg1jd22pnwkK8iTyTmrw3juMtpgvS9ZXNjFrWPAeF_aXRxpVPeBRf29F_Y
 RMr_ayjqjoqFDOYkMP3v5PNs7IeFH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Y
 VU36Kx4eef5OHT8CdUOCNc.avKER.z7SwbqVzum2ZAW8_K4jyKxCTg55lXepCFJA-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic313.consmr.mail.ne1.yahoo.com with HTTP; Tue, 9 Nov 2021 23:56:10 +0000
Received: by kubenode502.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 2eb3350e3b406d760b277791ff090563; 
 Tue, 09 Nov 2021 23:56:05 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#51712: 29.0.50; [PATCH] New function
 `xwidget-webkit-load-html'
References: <878rxx8w1i.fsf.ref@HIDDEN> <878rxx8w1i.fsf@HIDDEN>
 <83h7cl5urs.fsf@HIDDEN> <87y25x5tu9.fsf@HIDDEN>
 <831r3p5sn4.fsf@HIDDEN>
Date: Wed, 10 Nov 2021 07:56:02 +0800
In-Reply-To: <831r3p5sn4.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 09 Nov
 2021 16:07:59 +0200")
Message-ID: <87wnlgyjcd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Mailer: WebService/1.1.19306
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 5130
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 51712
Cc: larsi@HIDDEN, 51712 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:

> Then I'd suggest not to have it defined on non-GTK builds for now.  It
> is confusing to have a function that silently does nothing (after
> wasting some cycles).

Thanks, I'll keep that in mind.

> I'd say that TEXT should be a string.  The name itself doesn't
> necessarily say so.

Fixed, thanks.
>> +Optional argument @var{base-uri}, which should be a string, specifies
>> +the location of web resources, such as the resource @samp{foo.png} in
>> +the HTML tag @samp{<img src="foo.png">}.  It defaults to
>> +@samp{about:blank}.

> Hmm... this is better, but at least I am still in the dark regarding
> the need for this optional argument.  E.g., what would happen if you
> use that tag, but don't specify the URI?

I'm in the dark too.  I am not a web developer, and browser engines are
remarkably lax about these things, but hopefully Lars can explain better
(after all, shr must deal with these things too), so I added him to the
Ccs.

> This still leaves me wondering why the entry talks about temporary
> files.

Previously, loading custom markup into a widget required using a
temporary file to store the markup.

>> +DEFUN ("xwidget-webkit-load-html", Fxwidget_webkit_load_html,
>> +       Sxwidget_webkit_load_html, 2, 3, 0,
>> +       doc: /* Make XWIDGET's WebKit widget render text.
>                                                       ^^^^
> "text" should be in CAPS.

Thanks.

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Add-xwidget-webkit-load-html.patch

From 8877c57a09dce06f6b1b64294ce8a632f862cc6e Mon Sep 17 00:00:00 2001
From: Po Lu <luangruo@HIDDEN>
Date: Tue, 9 Nov 2021 21:36:40 +0800
Subject: [PATCH] Add `xwidget-webkit-load-html'

* doc/lispref/display.texi (Xwidgets): Document new function.
* etc/NEWS: Announce new function.
* src/xwidget.c (Fxwidget_webkit_load_html): New function.
(syms_of_xwidget): Define new subr.
---
 doc/lispref/display.texi | 11 +++++++++++
 etc/NEWS                 |  5 +++++
 src/xwidget.c            | 40 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+)

diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index b6bd14f887..0b6dc05267 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -6943,6 +6943,17 @@ Xwidgets
 signals an error.
 @end defun
 
+@defun xwidget-webkit-load-html xwidget text &optional base-uri
+Load @var{text}, a string, into @var{xwidget}, which should be a
+WebKit xwidget.  It treats @var{text} as HTML markup, which will be
+rendered by @var{xwidget}.
+
+Optional argument @var{base-uri}, which should be a string, specifies
+the location of web resources, such as the resource @samp{foo.png} in
+the HTML tag @samp{<img src="foo.png">}.  It defaults to
+@samp{about:blank}.
+@end defun
+
 @node Buttons
 @section Buttons
 @cindex buttons in buffers
diff --git a/etc/NEWS b/etc/NEWS
index 807f31fa33..b55630336e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -792,6 +792,11 @@ what the widget will actually receive.
 
 On GTK+, only key and function key events are implemented.
 
++++
+*** New function 'xwidget-webkit-load-html'.
+This function is used to load HTML text into WebKit xwidgets, without
+having to create a temporary file to store the markup.
+
 +++
 *** New functions for performing searches on WebKit xwidgets.
 Some new functions, such as 'xwidget-webkit-search', have been added
diff --git a/src/xwidget.c b/src/xwidget.c
index fc76ce307e..2587b658e7 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -2139,6 +2139,43 @@ DEFUN ("xwidget-webkit-finish-search", Fxwidget_webkit_finish_search,
   return Qnil;
 }
 
+#ifdef USE_GTK
+DEFUN ("xwidget-webkit-load-html", Fxwidget_webkit_load_html,
+       Sxwidget_webkit_load_html, 2, 3, 0,
+       doc: /* Make XWIDGET's WebKit widget render TEXT.
+XWIDGET should be a WebKit xwidget, that will receive TEXT.  TEXT
+should be a string that will be displayed by XWIDGET as HTML markup.
+BASE_URI should be a string containing a URI that is used to fetch
+resources, and if not specified, defaults to `about:blank'.  */)
+  (Lisp_Object xwidget, Lisp_Object text, Lisp_Object base_uri)
+{
+  struct xwidget *xw;
+  WebKitWebView *webview;
+  char *data, *uri;
+
+  CHECK_XWIDGET (xwidget);
+  CHECK_STRING (text);
+  if (NILP (base_uri))
+    base_uri = build_string ("about:blank");
+  else
+    CHECK_STRING (base_uri);
+
+  base_uri = ENCODE_UTF_8 (base_uri);
+  text = ENCODE_UTF_8 (text);
+  xw = XXWIDGET (xwidget);
+
+  data = SSDATA (text);
+  uri = SSDATA (base_uri);
+  webview = WEBKIT_WEB_VIEW (xw->widget_osr);
+
+  block_input ();
+  webkit_web_view_load_html (webview, data, uri);
+  unblock_input ();
+
+  return Qnil;
+}
+#endif
+
 void
 syms_of_xwidget (void)
 {
@@ -2177,6 +2214,9 @@ syms_of_xwidget (void)
   defsubr (&Sxwidget_webkit_next_result);
   defsubr (&Sxwidget_webkit_previous_result);
   defsubr (&Sset_xwidget_buffer);
+#ifdef USE_GTK
+  defsubr (&Sxwidget_webkit_load_html);
+#endif
 
   DEFSYM (QCxwidget, ":xwidget");
   DEFSYM (QCtitle, ":title");
-- 
2.31.1


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.

Message received at 51712 <at> debbugs.gnu.org:


Received: (at 51712) by debbugs.gnu.org; 9 Nov 2021 14:08:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 09:08:17 2021
Received: from localhost ([127.0.0.1]:33093 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkRnN-0000tv-Ir
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 09:08:17 -0500
Received: from eggs.gnu.org ([209.51.188.92]:52470)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mkRnL-0000tj-Qi
 for 51712 <at> debbugs.gnu.org; Tue, 09 Nov 2021 09:08:16 -0500
Received: from [2001:470:142:3::e] (port=40828 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mkRnD-0006yL-Qw; Tue, 09 Nov 2021 09:08:10 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=HVeG6SvhVItOgG8g1yadRicOYCuCZ9rUb5+1Ln4TBFM=; b=Cww0BPIgaFeP
 QEC60qDg2njxPWV3f9fBvF2cKJ26LCj0LBjKsLQjZ2uxS14FuvF1FPpXN05DtPie+it6yHJ7BmNVV
 Z7StBbjmSXNVskxV2vF/iNKAgchbUWAGN2eFoYK0w7eoD1rqZyfc2RLLmZyy0W6P8IVEVLIFEexje
 xdBl/Px8Dkhr3aw85kGGLRmTSs/RXa2wWrHCFoQunhc/A4vHMNR5/p9yz+AnovL08iTz9oTes1Chb
 mNvU6ngmUV1+eod04y79wjDYqFoRLYnUtV0zOKCkYV/4skYCWLFMPT52eakBIuee8Qkurvhc0iJaP
 lkqVwV/bhG6Z/t88pyfD5w==;
Received: from [87.69.77.57] (port=4246 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mkRnC-00018G-P2; Tue, 09 Nov 2021 09:08:07 -0500
Date: Tue, 09 Nov 2021 16:07:59 +0200
Message-Id: <831r3p5sn4.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <87y25x5tu9.fsf@HIDDEN> (message from Po Lu on Tue, 09 Nov
 2021 21:42:06 +0800)
Subject: Re: bug#51712: 29.0.50; [PATCH] New function
 `xwidget-webkit-load-html'
References: <878rxx8w1i.fsf.ref@HIDDEN> <878rxx8w1i.fsf@HIDDEN>
 <83h7cl5urs.fsf@HIDDEN> <87y25x5tu9.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51712
Cc: 51712 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Po Lu <luangruo@HIDDEN>
> Cc: 51712 <at> debbugs.gnu.org
> Date: Tue, 09 Nov 2021 21:42:06 +0800
> 
> >> +  text = ENCODE_UTF_8 (text);
> >> +  xw = XXWIDGET (xwidget);
> >> +
> >> +#ifdef USE_GTK
> >> +  data = SSDATA (text);
> >> +  uri = SSDATA (base_uri);
> >> +  webview = WEBKIT_WEB_VIEW (xw->widget_osr);
> >> +
> >> +  block_input ();
> >> +  webkit_web_view_load_html (webview, data, uri);
> >> +  unblock_input ();
> >> +#endif
> 
> > Hmm... if we only use TEXT and BASE-URI in the GTK build, why do we
> > encode them in the other builds?  Isn't that a waste of cycles?  IOW,
> > what does this function do if USE_GTK is not defined?
> 
> This feature isn't supported on macOS, but it's my hope that someone
> will port it to macOS in short order.

Then I'd suggest not to have it defined on non-GTK builds for now.  It
is confusing to have a function that silently does nothing (after
wasting some cycles).

> +@defun xwidget-webkit-load-html xwidget text &optional base-uri
> +Load @var{text} into @var{xwidget}, which should be a WebKit xwidget.
> +It treats @var{text} as HTML markup, which will be rendered by
> +@var{xwidget}.

I'd say that TEXT should be a string.  The name itself doesn't
necessarily say so.

> +Optional argument @var{base-uri}, which should be a string, specifies
> +the location of web resources, such as the resource @samp{foo.png} in
> +the HTML tag @samp{<img src="foo.png">}.  It defaults to
> +@samp{about:blank}.

Hmm... this is better, but at least I am still in the dark regarding
the need for this optional argument.  E.g., what would happen if you
use that tag, but don't specify the URI?

> +*** New function 'xwidget-webkit-load-html'.
> +This function is used to load HTML text into WebKit xwidgets, without
> +having to create a temporary file to store the markup.

This still leaves me wondering why the entry talks about temporary
files.
> +DEFUN ("xwidget-webkit-load-html", Fxwidget_webkit_load_html,
> +       Sxwidget_webkit_load_html, 2, 3, 0,
> +       doc: /* Make XWIDGET's WebKit widget render text.
                                                      ^^^^
"text" should be in CAPS.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.

Message received at 51712 <at> debbugs.gnu.org:


Received: (at 51712) by debbugs.gnu.org; 9 Nov 2021 13:42:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 08:42:29 2021
Received: from localhost ([127.0.0.1]:32998 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkROO-00007l-I5
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 08:42:28 -0500
Received: from sonic301-31.consmr.mail.ne1.yahoo.com ([66.163.184.200]:37322)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mkROK-00007T-Vg
 for 51712 <at> debbugs.gnu.org; Tue, 09 Nov 2021 08:42:26 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1636465339; bh=JhENjCz8OfkRNzIbtZb3s56eURRodywRH5F0l+zDHe4=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=SUZSs4yJKzqjSI25zcDmBLX9/GIwdz5OU3vRvSP6N7OxDVNrH6YVg1YABukpBi6lTMFA1CPYBmDSvEJ9W9mk89eEANmkBjqDNM1MyihN38EwQ2KCPpqTDud6zRazjy6hd7643ErDWqwAPFoAPNpf17mqrGgx6CTw4VbKr/aBGzJBcAPLytSbLjtN1qg5sfdthpJ+Sx61zSJLZeHPamhXp9CMv2Oo/HQ5RNnPv/4IZAI8KGEHMCoB7iOseWsRRu8wkgMbn4zOpFPSeGbeZED4Mv9gzjQ0YXDSma6QezHANok3Nh/lgKIg/k1QmHIin12k+zRTbKFL8fPGx/V61xERCA==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1636465339; bh=kI4g8Gqm4/MH9mqii259XdKVfGglwd+zf08TpFt7CbP=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=DZfZtzspdG1wtwgi5dcyNzFY2l911xo3bxJEZAImIJEqJd3D7Hqd2pP96B+wv+do69RiGyg9KUUSGzGbVAFOxWVNd0dAK6Uu7e6klmv1PVGn7wF0XNL5g3B8ksWC46vAz3W0fsk+bcMg650/eUNQT8samQsPGHGexmcRm4xxL2a5k9twkjbI1HjYra3ipETF712hzxbmzuTea/10wk3SITGwRJUWZVWqfYIIxaREehbfWVNbazIRWcf38T5HaNsP3ZCpEKWWXwzLuhrkPZfOYgziDDNrsoi+q3aLh9Hfgl2jauvV3V43uq92FYed5Pyku5zBrUei8KSKV3tbEcNDDw==
X-YMail-OSG: inlt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JJ2cKuewMzAFZGkXGjW25Fsz.kQ3rzKMAOTFP0mAZlHW4fRk_TFbMPpbBlyDLdy17iMBQQ30
 s9DVf9mDAuxG108frDyaAr90lBGs9KzUa4UZ38B0ktgwgrkwg7FkKhsA2RNqU346pTpG57AmqE4j
 D1vHbhtOz.70Da9LgbiAhBkq6vtL2sMJaCnHklskyWhK5t8IPhxGhjrW3jttz
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic301.consmr.mail.ne1.yahoo.com with HTTP; Tue, 9 Nov 2021 13:42:19 +0000
Received: by kubenode501.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID d432b1c7e9ece9ef4d367970d501bed4; 
 Tue, 09 Nov 2021 13:42:12 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#51712: 29.0.50; [PATCH] New function
 `xwidget-webkit-load-html'
References: <878rxx8w1i.fsf.ref@HIDDEN> <878rxx8w1i.fsf@HIDDEN>
 <83h7cl5urs.fsf@HIDDEN>
Date: Tue, 09 Nov 2021 21:42:06 +0800
In-Reply-To: <83h7cl5urs.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 09 Nov
 2021 15:21:59 +0200")
Message-ID: <87y25x5tu9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Mailer: WebService/1.1.19266
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 6274
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 51712
Cc: 51712 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:

>
> can you rephrase the last sentence not to use passive tense, please?
>
> But BASE-URI is not an &optional argument above.
>
> And also, this sentence is unnecessarily complex because you state the
> reason before the goal.  It is much better to do it the other way
> around, and while at that, make 2 simple sentences out of one complex
> one:
>
>   Optional argument @var{base-uri}, which should be a string,
>   specifies the location of the web resource.  It defaults to
>   @samp{about:blank}.
>
> (Of course, now this begs the question: what does it mean "web
> resource" for HTML text?  How about answering that in the text?)
>
> The second part is either unnecessary or too terse.  if it is
> important to explain that, please elaborate how temporary files are
> relevant here.
>
> The "plain text" part seems to contradict the text in the manual,
> which says it will be rendered as HTML markup?
>
> "will be" is confusing: why the future tense?
>
> Also, what kind of Lisp type is that?

It should be a string, thanks, I've resolved the concerns you listed
above.

> And I think explaining the importance of "fetching resources" would be
> beneficiary here.

I documented it in the manual the best I could.  I'm no web developer,
and the WebKitGTK documentation is vague on this subject, so I can't
think of anything better.

> And finally, "is treated as equivalent" is better reworded as "and
> defaults to ...", which is our style in these cases.

Thanks, done.

>> +  if (NILP (base_uri))
>> +    base_uri = build_string ("about:blank");
>> +  CHECK_STRING (base_uri);
>
> That last line should better be under 'else', right?

Done, thanks.

>> +  base_uri = ENCODE_UTF_8 (base_uri);

> Is it a good idea to produce non-ASCII URIs?

I personally think it's not, but the uuencoding of the URI is done by
WebKitGTK, which expects strings passed as the `uri' parameter to be
encoded as UTF-8 as opposed to uuencoded.

>> +  text = ENCODE_UTF_8 (text);
>> +  xw = XXWIDGET (xwidget);
>> +
>> +#ifdef USE_GTK
>> +  data = SSDATA (text);
>> +  uri = SSDATA (base_uri);
>> +  webview = WEBKIT_WEB_VIEW (xw->widget_osr);
>> +
>> +  block_input ();
>> +  webkit_web_view_load_html (webview, data, uri);
>> +  unblock_input ();
>> +#endif

> Hmm... if we only use TEXT and BASE-URI in the GTK build, why do we
> encode them in the other builds?  Isn't that a waste of cycles?  IOW,
> what does this function do if USE_GTK is not defined?

This feature isn't supported on macOS, but it's my hope that someone
will port it to macOS in short order.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Add-xwidget-webkit-load-html.patch

From 4d4b1013813bebf9d473cc04f73cf784fb759091 Mon Sep 17 00:00:00 2001
From: Po Lu <luangruo@HIDDEN>
Date: Tue, 9 Nov 2021 21:36:40 +0800
Subject: [PATCH] Add `xwidget-webkit-load-html'

* doc/lispref/display.texi (Xwidgets): Document new function.
* etc/NEWS: Announce new function.
* src/xwidget.c (Fxwidget_webkit_load_html): New function.
(syms_of_xwidget): Define new subr.
---
 doc/lispref/display.texi | 11 +++++++++++
 etc/NEWS                 |  5 +++++
 src/xwidget.c            | 40 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+)

diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index b6bd14f887..07b9f1a743 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -6943,6 +6943,17 @@ Xwidgets
 signals an error.
 @end defun
 
+@defun xwidget-webkit-load-html xwidget text &optional base-uri
+Load @var{text} into @var{xwidget}, which should be a WebKit xwidget.
+It treats @var{text} as HTML markup, which will be rendered by
+@var{xwidget}.
+
+Optional argument @var{base-uri}, which should be a string, specifies
+the location of web resources, such as the resource @samp{foo.png} in
+the HTML tag @samp{<img src="foo.png">}.  It defaults to
+@samp{about:blank}.
+@end defun
+
 @node Buttons
 @section Buttons
 @cindex buttons in buffers
diff --git a/etc/NEWS b/etc/NEWS
index 807f31fa33..b55630336e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -792,6 +792,11 @@ what the widget will actually receive.
 
 On GTK+, only key and function key events are implemented.
 
++++
+*** New function 'xwidget-webkit-load-html'.
+This function is used to load HTML text into WebKit xwidgets, without
+having to create a temporary file to store the markup.
+
 +++
 *** New functions for performing searches on WebKit xwidgets.
 Some new functions, such as 'xwidget-webkit-search', have been added
diff --git a/src/xwidget.c b/src/xwidget.c
index fc76ce307e..37e4fd94c1 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -2139,6 +2139,45 @@ DEFUN ("xwidget-webkit-finish-search", Fxwidget_webkit_finish_search,
   return Qnil;
 }
 
+DEFUN ("xwidget-webkit-load-html", Fxwidget_webkit_load_html,
+       Sxwidget_webkit_load_html, 2, 3, 0,
+       doc: /* Make XWIDGET's WebKit widget render text.
+XWIDGET should be a WebKit xwidget, that will receive TEXT.  TEXT
+should be a string that will be displayed by XWIDGET as HTML markup.
+BASE_URI should be a string containing a URI that is used to fetch
+resources, and if not specified, defaults to `about:blank'.  */)
+  (Lisp_Object xwidget, Lisp_Object text, Lisp_Object base_uri)
+{
+  struct xwidget *xw;
+#ifdef USE_GTK
+  WebKitWebView *webview;
+  char *data, *uri;
+#endif
+
+  CHECK_XWIDGET (xwidget);
+  CHECK_STRING (text);
+  if (NILP (base_uri))
+    base_uri = build_string ("about:blank");
+  else
+    CHECK_STRING (base_uri);
+
+#ifdef USE_GTK
+  base_uri = ENCODE_UTF_8 (base_uri);
+  text = ENCODE_UTF_8 (text);
+  xw = XXWIDGET (xwidget);
+
+  data = SSDATA (text);
+  uri = SSDATA (base_uri);
+  webview = WEBKIT_WEB_VIEW (xw->widget_osr);
+
+  block_input ();
+  webkit_web_view_load_html (webview, data, uri);
+  unblock_input ();
+#endif
+
+  return Qnil;
+}
+
 void
 syms_of_xwidget (void)
 {
@@ -2177,6 +2216,7 @@ syms_of_xwidget (void)
   defsubr (&Sxwidget_webkit_next_result);
   defsubr (&Sxwidget_webkit_previous_result);
   defsubr (&Sset_xwidget_buffer);
+  defsubr (&Sxwidget_webkit_load_html);
 
   DEFSYM (QCxwidget, ":xwidget");
   DEFSYM (QCtitle, ":title");
-- 
2.31.1


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.

Message received at 51712 <at> debbugs.gnu.org:


Received: (at 51712) by debbugs.gnu.org; 9 Nov 2021 13:22:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 08:22:14 2021
Received: from localhost ([127.0.0.1]:32951 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkR4o-000819-K7
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 08:22:14 -0500
Received: from eggs.gnu.org ([209.51.188.92]:56170)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mkR4m-00080x-VD
 for 51712 <at> debbugs.gnu.org; Tue, 09 Nov 2021 08:22:13 -0500
Received: from [2001:470:142:3::e] (port=38066 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mkR4h-0000H5-PC; Tue, 09 Nov 2021 08:22:07 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=7G0v7nsBp+/vbKNEPlKkIMYI5vchyadoveCepwnpTeM=; b=IUq6kD7/2STr
 kWosN1wGEfnkgNpcVmFuTWQulLSS9L4+q2LiFuZDS2wJMzJWbKGG6Gl5R1Z+hOEQWUSiDXzYtHtFl
 E+MGwrdLd++uy1UMjSc6v4yiVMUQvyUqBJcfch0d+L8DlNzDUtiL5bnVIgARtToo2GIwAhy7kcuu7
 UqV9JPURPa84HzElK6/S9htnowkR1cUsCj34f44sMLAguvYKrjJ0pOy2vft3XGDZwQLars34ZUDnu
 Bfy0OJJ3GVWI2juoJj1w1S3S7LOgkXx0u1InCeNN5Dlzff7nrxK1M1qSGV+sAqKNTSc/fESHoRk+X
 c4brIUysw+vMi8zfXT6EbQ==;
Received: from [87.69.77.57] (port=1409 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mkR4h-0003kx-1G; Tue, 09 Nov 2021 08:22:07 -0500
Date: Tue, 09 Nov 2021 15:21:59 +0200
Message-Id: <83h7cl5urs.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
In-Reply-To: <878rxx8w1i.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#51712: 29.0.50;
 [PATCH] New function `xwidget-webkit-load-html'
References: <878rxx8w1i.fsf.ref@HIDDEN> <878rxx8w1i.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51712
Cc: 51712 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Tue, 09 Nov 2021 18:26:17 +0800
> From:  Po Lu via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> +@defun xwidget-webkit-load-html xwidget text base-uri
> +Load @var{text} into @var{xwidget}, which should be a WebKit xwidget.
> +@var{text} will be treated as HTML markup, and rendered by
> +@var{xwidget}.

can you rephrase the last sentence not to use passive tense, please?

> +For the purpose of controlling the location where web resources will
> +be found, you can optionally specify a base URI as a string in
> +@var{base-uri}, which defaults to @samp{about:blank}.

But BASE-URI is not an &optional argument above.

And also, this sentence is unnecessarily complex because you state the
reason before the goal.  It is much better to do it the other way
around, and while at that, make 2 simple sentences out of one complex
one:

  Optional argument @var{base-uri}, which should be a string,
  specifies the location of the web resource.  It defaults to
  @samp{about:blank}.

(Of course, now this begs the question: what does it mean "web
resource" for HTML text?  How about answering that in the text?)

> ++++
> +*** New function 'xwidget-webkit-load-html'.
> +This function is used to load HTML text into WebKit xwidgets, without
> +having to create a temporary file or URL.

The second part is either unnecessary or too terse.  if it is
important to explain that, please elaborate how temporary files are
relevant here.

> +DEFUN ("xwidget-webkit-load-html", Fxwidget_webkit_load_html,
> +       Sxwidget_webkit_load_html, 2, 3, 0,
> +       doc: /* Make XWIDGET's WebKit widget render text.
> +XWIDGET should be a WebKit xwidget, that will receive TEXT.  TEXT
> +should be a string that will be displayed by XWIDGET as plain text.

The "plain text" part seems to contradict the text in the manual,
which says it will be rendered as HTML markup?

> +BASE_URI will be a URI that is used to fetch resources, and if not
> +specified, is treated as equivalent to `about:blank'.  */)

"will be" is confusing: why the future tense?

Also, what kind of Lisp type is that?

And I think explaining the importance of "fetching resources" would be
beneficiary here.

And finally, "is treated as equivalent" is better reworded as "and
defaults to ...", which is our style in these cases.

> +  if (NILP (base_uri))
> +    base_uri = build_string ("about:blank");
> +  CHECK_STRING (base_uri);

That last line should better be under 'else', right?

> +  base_uri = ENCODE_UTF_8 (base_uri);

Is it a good idea to produce non-ASCII URIs?

> +  text = ENCODE_UTF_8 (text);
> +  xw = XXWIDGET (xwidget);
> +
> +#ifdef USE_GTK
> +  data = SSDATA (text);
> +  uri = SSDATA (base_uri);
> +  webview = WEBKIT_WEB_VIEW (xw->widget_osr);
> +
> +  block_input ();
> +  webkit_web_view_load_html (webview, data, uri);
> +  unblock_input ();
> +#endif

Hmm... if we only use TEXT and BASE-URI in the GTK build, why do we
encode them in the other builds?  Isn't that a waste of cycles?  IOW,
what does this function do if USE_GTK is not defined?

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 9 Nov 2021 10:26:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 05:26:36 2021
Received: from localhost ([127.0.0.1]:60946 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkOKq-0000yq-FY
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 05:26:36 -0500
Received: from lists.gnu.org ([209.51.188.17]:56268)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1mkOKl-0000ye-1t
 for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 05:26:35 -0500
Received: from eggs.gnu.org ([209.51.188.92]:60554)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <luangruo@HIDDEN>)
 id 1mkOKk-0006PH-U3
 for bug-gnu-emacs@HIDDEN; Tue, 09 Nov 2021 05:26:30 -0500
Received: from sonic308-56.consmr.mail.ne1.yahoo.com ([66.163.187.31]:41310)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <luangruo@HIDDEN>)
 id 1mkOKh-0000ZI-Rh
 for bug-gnu-emacs@HIDDEN; Tue, 09 Nov 2021 05:26:30 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1636453584; bh=t81I97hmPfYiB0cDKpmPbWbXdkRprhWDPyeIuBz9c1g=;
 h=From:To:Subject:Date:References:From:Subject:Reply-To;
 b=gx0vAMRbJemDZzRzxLAuA0P1gOV0XQBTbLzaV+oc4moIu5scq6lTWclUmhQHFo3mCGShb79tLKzHjDz7LmYJcdi5mdKd4buECUFvBoyQtWEo5ydW60b1WPr3pshdxBj2B30eU0JZyBOzGUNXshnUKDgOHjUL0R6ThiwLA+ZKea3ztIff6rL7Ui8feOjyZv7dWn9Bfs8bGHI6hbEHgfMUJ/t2XdhRGjkm4ktQg3ley1OrSkrJzX+RlYEqOexFVG3gCxLLTY/HqVQJkM/hLCSR5itUMVSr2JtwCL+IUWG45hO9rVTUhc2gEo6mFLQr3uDDD8EMjZqKPoj50685GDC4Fg==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1636453584; bh=fRMCVXLi9tPufqEtF4/5Csbw/SEXUuuMzJINtiVE6BC=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=EIjVdjYeiY/ToUKFNQzcgjzFyJuCRyGCZEK8GfgpY2gxGYxmBCycNhDWMhhJzZfn2Lja7KJvSQwI3/5SVF6z3XaHXz5vEpTPB4GG7CEwGedh//cntgeaQP2hepW6JTOCjhSqlutObTdrVkoQ94bXN0pzZ6XRM4F9gHl+jf5geLGcKkKEpWDpITbWGD9S1r9+6xGmM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yOQ3XAihIoA_WR
 7So7BQhXqJSBI8tur7zSGcC1BCOk5cfsjasCIf0lknkOjJZ9Mt.5WyI3CKhT3ek17XQRF19p5HVU
 TaEIShjVGwF.ullmzLEpaDnG.PgaN8Fu5hEhbq.3o5IkxHRo2P7_F2bI39qHR2QXlEkGc1J9M2pp
 dvFUU0r9DUqYyjzW_rxkNrQG4w2avd2bEYk2dwodrnD8OBXopkqppIGsHOwOiPeC6Cf4S_lTpy65
 tyOUwMmDCEJJd5JtxIox6jnOGogckwyVXQ1HYM5ol676LK8NbGgiPLBg9Pfn0CMVCsQ6.1ybTMzk
 XsPbsgX5.SYeqTF0igs0EjQX7WVrnmbavZg--
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic308.consmr.mail.ne1.yahoo.com with HTTP; Tue, 9 Nov 2021 10:26:24 +0000
Received: by kubenode504.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 98241121cd4db3e1cdf3cfa7e3a0da97; 
 Tue, 09 Nov 2021 10:26:22 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.50; [PATCH] New function `xwidget-webkit-load-html'
Date: Tue, 09 Nov 2021 18:26:17 +0800
Message-ID: <878rxx8w1i.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
References: <878rxx8w1i.fsf.ref@HIDDEN>
X-Mailer: WebService/1.1.19266
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 3821
Received-SPF: pass client-ip=66.163.187.31; envelope-from=luangruo@HIDDEN;
 helo=sonic308-56.consmr.mail.ne1.yahoo.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.6 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.6 (-)

--=-=-=
Content-Type: text/plain

Hopefully this allows to reduce the amount of JavaScript hacks needed to
load HTML into a widget.  It also lets you customize the base URI WebKit
uses to find web resources, which you can't do from JavaScript.

Thanks.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Add-xwidget-webkit-load-html.patch

From f368cd47dd5a2d232024ef1fb0f95f4b0c15e566 Mon Sep 17 00:00:00 2001
From: Po Lu <luangruo@HIDDEN>
Date: Tue, 9 Nov 2021 18:24:03 +0800
Subject: [PATCH] Add `xwidget-webkit-load-html'

* doc/lispref/display.texi (Xwidgets): Document new function.
* etc/NEWS: Announce new function.
* src/xwidget.c (Fxwidget_webkit_load_html): New function.
(syms_of_xwidget): Define new subr.
---
 doc/lispref/display.texi | 10 ++++++++++
 etc/NEWS                 |  5 +++++
 src/xwidget.c            | 38 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 53 insertions(+)

diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index b6bd14f887..3ccc755391 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -6943,6 +6943,16 @@ Xwidgets
 signals an error.
 @end defun
 
+@defun xwidget-webkit-load-html xwidget text base-uri
+Load @var{text} into @var{xwidget}, which should be a WebKit xwidget.
+@var{text} will be treated as HTML markup, and rendered by
+@var{xwidget}.
+
+For the purpose of controlling the location where web resources will
+be found, you can optionally specify a base URI as a string in
+@var{base-uri}, which defaults to @samp{about:blank}.
+@end defun
+
 @node Buttons
 @section Buttons
 @cindex buttons in buffers
diff --git a/etc/NEWS b/etc/NEWS
index 807f31fa33..93c161025b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -792,6 +792,11 @@ what the widget will actually receive.
 
 On GTK+, only key and function key events are implemented.
 
++++
+*** New function 'xwidget-webkit-load-html'.
+This function is used to load HTML text into WebKit xwidgets, without
+having to create a temporary file or URL.
+
 +++
 *** New functions for performing searches on WebKit xwidgets.
 Some new functions, such as 'xwidget-webkit-search', have been added
diff --git a/src/xwidget.c b/src/xwidget.c
index fc76ce307e..22893bfe2e 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -2139,6 +2139,43 @@ DEFUN ("xwidget-webkit-finish-search", Fxwidget_webkit_finish_search,
   return Qnil;
 }
 
+DEFUN ("xwidget-webkit-load-html", Fxwidget_webkit_load_html,
+       Sxwidget_webkit_load_html, 2, 3, 0,
+       doc: /* Make XWIDGET's WebKit widget render text.
+XWIDGET should be a WebKit xwidget, that will receive TEXT.  TEXT
+should be a string that will be displayed by XWIDGET as plain text.
+BASE_URI will be a URI that is used to fetch resources, and if not
+specified, is treated as equivalent to `about:blank'.  */)
+  (Lisp_Object xwidget, Lisp_Object text, Lisp_Object base_uri)
+{
+  struct xwidget *xw;
+#ifdef USE_GTK
+  WebKitWebView *webview;
+  char *data, *uri;
+#endif
+
+  CHECK_XWIDGET (xwidget);
+  CHECK_STRING (text);
+  if (NILP (base_uri))
+    base_uri = build_string ("about:blank");
+  CHECK_STRING (base_uri);
+  base_uri = ENCODE_UTF_8 (base_uri);
+  text = ENCODE_UTF_8 (text);
+  xw = XXWIDGET (xwidget);
+
+#ifdef USE_GTK
+  data = SSDATA (text);
+  uri = SSDATA (base_uri);
+  webview = WEBKIT_WEB_VIEW (xw->widget_osr);
+
+  block_input ();
+  webkit_web_view_load_html (webview, data, uri);
+  unblock_input ();
+#endif
+
+  return Qnil;
+}
+
 void
 syms_of_xwidget (void)
 {
@@ -2177,6 +2214,7 @@ syms_of_xwidget (void)
   defsubr (&Sxwidget_webkit_next_result);
   defsubr (&Sxwidget_webkit_previous_result);
   defsubr (&Sset_xwidget_buffer);
+  defsubr (&Sxwidget_webkit_load_html);
 
   DEFSYM (QCxwidget, ":xwidget");
   DEFSYM (QCtitle, ":title");
-- 
2.31.1


--=-=-=--




Acknowledgement sent to Po Lu <luangruo@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#51712; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 10 Nov 2021 13:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.