-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathyelp-xulrunner-fix.patch
More file actions
116 lines (107 loc) · 4.65 KB
/
yelp-xulrunner-fix.patch
File metadata and controls
116 lines (107 loc) · 4.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
diff -up yelp-2.28.1/src/yelp-html.cpp.xulrunner-fix yelp-2.28.1/src/yelp-html.cpp
--- yelp-2.28.1/src/yelp-html.cpp.xulrunner-fix 2009-11-19 18:09:56.000000000 +0100
+++ yelp-2.28.1/src/yelp-html.cpp 2010-04-16 10:45:50.000000000 +0200
@@ -24,6 +24,8 @@
#include <mozilla-config.h>
#include <config.h>
+#include <string.h>
+
#include "yelp-gecko-services.h"
#include "yelp-gecko-utils.h"
#include "yelp-marshal.h"
@@ -90,13 +92,20 @@ static gint
html_open_uri (GtkMozEmbed *embed, const gchar *uri)
{
YelpHtml *html = YELP_HTML (embed);
- gboolean block_load;
+ gboolean block_load = FALSE;
g_return_val_if_fail (uri != NULL, FALSE);
debug_print (DB_FUNCTION, "entering\n");
debug_print (DB_ARG, " uri = \"%s\"\n", uri);
+ if (g_str_equal (html->priv->base_uri, uri)) {
+ /* As of xulrunner 1.6.2, open_uri is called in response
+ to the base URI we pass in.
+ */
+ return FALSE;
+ }
+
if (!html->priv->frames_enabled) {
g_signal_emit (html, signals[URI_SELECTED], 0, uri, FALSE);
block_load = TRUE;
diff -up yelp-2.28.1/src/yelp-window.c.xulrunner-fix yelp-2.28.1/src/yelp-window.c
--- yelp-2.28.1/src/yelp-window.c.xulrunner-fix 2009-11-19 18:09:56.000000000 +0100
+++ yelp-2.28.1/src/yelp-window.c 2010-04-16 10:47:47.000000000 +0200
@@ -1854,14 +1854,21 @@ html_uri_selected_cb (YelpHtml *html,
gboolean handled,
gpointer user_data)
{
+ gchar *new_uri = uri;
YelpWindow *window = YELP_WINDOW (user_data);
debug_print (DB_FUNCTION, "entering\n");
debug_print (DB_ARG, " uri = \"%s\"\n", uri);
+ if (g_str_has_prefix (uri, "xref:"))
+ new_uri = g_strconcat (window->priv->base_uri, "#", uri + 5, NULL);
+
if (!handled) {
- yelp_window_load (window, uri);
+ yelp_window_load (window, new_uri);
}
+
+ if (new_uri != uri)
+ g_free (new_uri);
}
static gboolean
diff -up yelp-2.28.1/stylesheets/db2html.xsl.in.xulrunner-fix yelp-2.28.1/stylesheets/db2html.xsl.in
--- yelp-2.28.1/stylesheets/db2html.xsl.in.xulrunner-fix 2009-11-19 18:09:56.000000000 +0100
+++ yelp-2.28.1/stylesheets/db2html.xsl.in 2010-04-16 10:45:50.000000000 +0200
@@ -68,7 +68,7 @@ FIXME: yelp:cache no longer works
<!-- == db.xref.target == -->
<xsl:template name="db.xref.target">
<xsl:param name="linkend"/>
- <xsl:value-of select="concat('#', $linkend)"/>
+ <xsl:value-of select="concat('xref:', $linkend)"/>
</xsl:template>
<!-- == db2html.css.custom == -->
diff -up yelp-2.28.1/stylesheets/db2html.xsl.xulrunner-fix yelp-2.28.1/stylesheets/db2html.xsl
--- yelp-2.28.1/stylesheets/db2html.xsl.xulrunner-fix 2009-11-19 18:54:57.000000000 +0100
+++ yelp-2.28.1/stylesheets/db2html.xsl 2010-04-16 10:45:50.000000000 +0200
@@ -68,7 +68,7 @@ FIXME: yelp:cache no longer works
<!-- == db.xref.target == -->
<xsl:template name="db.xref.target">
<xsl:param name="linkend"/>
- <xsl:value-of select="concat('#', $linkend)"/>
+ <xsl:value-of select="concat('xref:', $linkend)"/>
</xsl:template>
<!-- == db2html.css.custom == -->
diff -up yelp-2.28.1/stylesheets/mal2html.xsl.in.xulrunner-fix yelp-2.28.1/stylesheets/mal2html.xsl.in
--- yelp-2.28.1/stylesheets/mal2html.xsl.in.xulrunner-fix 2009-11-19 18:09:56.000000000 +0100
+++ yelp-2.28.1/stylesheets/mal2html.xsl.in 2010-04-16 10:45:50.000000000 +0200
@@ -44,10 +44,10 @@
<xsl:when test="contains($xref, '#')">
<xsl:variable name="pageid" select="substring-before($xref, '#')"/>
<xsl:variable name="sectionid" select="substring-after($xref, '#')"/>
- <xsl:value-of select="concat('#', $pageid, '/', $sectionid)"/>
+ <xsl:value-of select="concat('xref:', $pageid, '/', $sectionid)"/>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="concat('#', $xref)"/>
+ <xsl:value-of select="concat('xref:', $xref)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
diff -up yelp-2.28.1/stylesheets/mal2html.xsl.xulrunner-fix yelp-2.28.1/stylesheets/mal2html.xsl
--- yelp-2.28.1/stylesheets/mal2html.xsl.xulrunner-fix 2009-11-19 18:54:57.000000000 +0100
+++ yelp-2.28.1/stylesheets/mal2html.xsl 2010-04-16 10:45:50.000000000 +0200
@@ -44,10 +44,10 @@
<xsl:when test="contains($xref, '#')">
<xsl:variable name="pageid" select="substring-before($xref, '#')"/>
<xsl:variable name="sectionid" select="substring-after($xref, '#')"/>
- <xsl:value-of select="concat('#', $pageid, '/', $sectionid)"/>
+ <xsl:value-of select="concat('xref:', $pageid, '/', $sectionid)"/>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="concat('#', $xref)"/>
+ <xsl:value-of select="concat('xref:', $xref)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>