[Xfce4-commits] <midori:master> Rework rendering of raw XML as source

Christian Dywan noreply at xfce.org
Fri May 7 20:36:02 CEST 2010


Updating branch refs/heads/master
         to 743b264a72b2f507687404ad6357fefeff0b189c (commit)
       from fb72bcfeaecd4d6e40fd01f1b291579a6d6dbcfa (commit)

commit 743b264a72b2f507687404ad6357fefeff0b189c
Author: Christian Dywan <christian at twotoasts.de>
Date:   Fri May 7 20:31:41 2010 +0200

    Rework rendering of raw XML as source
    
    We need to be stricter with what counts as raw XML, for instance
    not SVG images. And we shouldn't break explicit source view.

 midori/midori-view.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index e8a9f9d..b843229 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -2594,15 +2594,12 @@ webkit_web_view_mime_type_decision_cb (GtkWidget*               web_view,
     if (webkit_web_view_can_show_mime_type (WEBKIT_WEB_VIEW (web_view), mime_type))
     {
         #if WEBKIT_CHECK_VERSION (1, 1, 14)
-        gboolean view_source = FALSE;
+        gboolean view_source = webkit_web_view_get_view_source_mode (WEBKIT_WEB_VIEW (web_view));
 
-        if (strcmp (mime_type, "application/xhtml+xml"))
-        {
-            content_type = g_content_type_from_mime_type (mime_type);
-            if (g_content_type_is_a (content_type, "application/xml"))
-                view_source = TRUE;
-            g_free (content_type);
-        }
+        /* Render raw XML, including news feeds, as source */
+        if (!view_source && (!strcmp (mime_type, "application/xml")
+                          || !strcmp (mime_type, "text/xml")))
+            view_source = TRUE;
         webkit_web_view_set_view_source_mode (WEBKIT_WEB_VIEW (web_view), view_source);
         #endif
 



More information about the Xfce4-commits mailing list