changeset 32561:be0162cb27c4

Implement webview formatting clearing.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 27 Feb 2012 03:15:42 +0000
parents c1daad7121f8
children 4547ab591cfc
files pidgin/gtkwebview.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkwebview.c	Sun Feb 26 05:49:17 2012 +0000
+++ b/pidgin/gtkwebview.c	Mon Feb 27 03:15:42 2012 +0000
@@ -314,6 +314,7 @@
 webview_clear_formatting(GtkWebView *webview)
 {
 	GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview);
+	WebKitDOMDocument *dom;
 
 	if (!webkit_web_view_get_editable(WEBKIT_WEB_VIEW(webview)))
 		return;
@@ -335,6 +336,9 @@
 
 	g_free(priv->edit.background);
 	priv->edit.background = NULL;
+
+	dom = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(webview));
+	webkit_dom_document_exec_command(dom, "removeFormat", FALSE, "");
 }
 
 static void