1 |
mrpouet 10/01/27 17:18:24 |
2 |
|
3 |
Added: yelp-2.28.1-xul192-compat.patch |
4 |
Log: |
5 |
Fix issues introduced by xulrunner 1.9.2, per bug #301831 |
6 |
(Portage version: 2.2_rc61/cvs/Linux x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 gnome-extra/yelp/files/yelp-2.28.1-xul192-compat.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-extra/yelp/files/yelp-2.28.1-xul192-compat.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-extra/yelp/files/yelp-2.28.1-xul192-compat.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: yelp-2.28.1-xul192-compat.patch |
15 |
=================================================================== |
16 |
From a5588114ed94d00ca64913aa5b248e09a5e13edc Mon Sep 17 00:00:00 2001 |
17 |
From: Shaun McCance <shaunm@×××××.org> |
18 |
Date: Mon, 25 Jan 2010 20:21:10 +0000 |
19 |
Subject: Fixing issues introduced by xulrunner 1.9.2 |
20 |
|
21 |
API changes in a stable release are not fun. With 1.9.2, setting the base |
22 |
URI when opening a stream causes a uri_selected callback. So we compare |
23 |
the URI to what we know we're loading to prevent an infinite loop. |
24 |
|
25 |
Also, #fragment links no longer trigger a uri_selected callback. So I've |
26 |
halfway backported the xref: method used in the yelp-3-0 branch. It's not |
27 |
pervasive. We rewrite it pretty much immediately. So we still use the |
28 |
slash hack, instead of the nicer method in yelp-3-0. This should be enough |
29 |
to keep 2.x alive. |
30 |
--- |
31 |
diff --git a/src/yelp-html.cpp b/src/yelp-html.cpp |
32 |
index edd8788..aa9371d 100644 |
33 |
--- a/src/yelp-html.cpp |
34 |
+++ b/src/yelp-html.cpp |
35 |
@@ -24,6 +24,8 @@ |
36 |
#include <mozilla-config.h> |
37 |
#include <config.h> |
38 |
|
39 |
+#include <string.h> |
40 |
+ |
41 |
#include "yelp-gecko-services.h" |
42 |
#include "yelp-gecko-utils.h" |
43 |
#include "yelp-marshal.h" |
44 |
@@ -90,13 +92,20 @@ static gint |
45 |
html_open_uri (GtkMozEmbed *embed, const gchar *uri) |
46 |
{ |
47 |
YelpHtml *html = YELP_HTML (embed); |
48 |
- gboolean block_load; |
49 |
+ gboolean block_load = FALSE; |
50 |
|
51 |
g_return_val_if_fail (uri != NULL, FALSE); |
52 |
|
53 |
debug_print (DB_FUNCTION, "entering\n"); |
54 |
debug_print (DB_ARG, " uri = \"%s\"\n", uri); |
55 |
|
56 |
+ if (g_str_equal (html->priv->base_uri, uri)) { |
57 |
+ /* As of xulrunner 1.6.2, open_uri is called in response |
58 |
+ to the base URI we pass in. |
59 |
+ */ |
60 |
+ return FALSE; |
61 |
+ } |
62 |
+ |
63 |
if (!html->priv->frames_enabled) { |
64 |
g_signal_emit (html, signals[URI_SELECTED], 0, uri, FALSE); |
65 |
block_load = TRUE; |
66 |
diff --git a/src/yelp-window.c b/src/yelp-window.c |
67 |
index d436f24..401e059 100644 |
68 |
--- a/src/yelp-window.c |
69 |
+++ b/src/yelp-window.c |
70 |
@@ -1849,14 +1849,21 @@ html_uri_selected_cb (YelpHtml *html, |
71 |
gboolean handled, |
72 |
gpointer user_data) |
73 |
{ |
74 |
+ gchar *new_uri = uri; |
75 |
YelpWindow *window = YELP_WINDOW (user_data); |
76 |
|
77 |
debug_print (DB_FUNCTION, "entering\n"); |
78 |
debug_print (DB_ARG, " uri = \"%s\"\n", uri); |
79 |
|
80 |
+ if (g_str_has_prefix (uri, "xref:")) |
81 |
+ new_uri = g_strconcat (window->priv->base_uri, "#", uri + 5, NULL); |
82 |
+ |
83 |
if (!handled) { |
84 |
- yelp_window_load (window, uri); |
85 |
+ yelp_window_load (window, new_uri); |
86 |
} |
87 |
+ |
88 |
+ if (new_uri != uri) |
89 |
+ g_free (new_uri); |
90 |
} |
91 |
|
92 |
static gboolean |
93 |
diff --git a/stylesheets/db2html.xsl.in b/stylesheets/db2html.xsl.in |
94 |
index 1ebf44e..b68f153 100644 |
95 |
--- a/stylesheets/db2html.xsl.in |
96 |
+++ b/stylesheets/db2html.xsl.in |
97 |
@@ -68,7 +68,7 @@ FIXME: yelp:cache no longer works |
98 |
<!-- == db.xref.target == --> |
99 |
<xsl:template name="db.xref.target"> |
100 |
<xsl:param name="linkend"/> |
101 |
- <xsl:value-of select="concat('#', $linkend)"/> |
102 |
+ <xsl:value-of select="concat('xref:', $linkend)"/> |
103 |
</xsl:template> |
104 |
|
105 |
<!-- == db2html.css.custom == --> |
106 |
diff --git a/stylesheets/mal2html.xsl.in b/stylesheets/mal2html.xsl.in |
107 |
index 37560a7..9a55fcc 100644 |
108 |
--- a/stylesheets/mal2html.xsl.in |
109 |
+++ b/stylesheets/mal2html.xsl.in |
110 |
@@ -44,10 +44,10 @@ |
111 |
<xsl:when test="contains($xref, '#')"> |
112 |
<xsl:variable name="pageid" select="substring-before($xref, '#')"/> |
113 |
<xsl:variable name="sectionid" select="substring-after($xref, '#')"/> |
114 |
- <xsl:value-of select="concat('#', $pageid, '/', $sectionid)"/> |
115 |
+ <xsl:value-of select="concat('xref:', $pageid, '/', $sectionid)"/> |
116 |
</xsl:when> |
117 |
<xsl:otherwise> |
118 |
- <xsl:value-of select="concat('#', $xref)"/> |
119 |
+ <xsl:value-of select="concat('xref:', $xref)"/> |
120 |
</xsl:otherwise> |
121 |
</xsl:choose> |
122 |
</xsl:template> |
123 |
-- |
124 |
cgit v0.8.3.1 |