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
|
Index: libgtkhtml/document/htmldocument.c
===================================================================
--- libgtkhtml/document/htmldocument.c.orig 2006-02-05 18:19:17.000000000 +0000
+++ libgtkhtml/document/htmldocument.c 2006-02-05 18:20:06.000000000 +0000
@@ -1122,3 +1122,31 @@ html_document_find_anchor (HtmlDocument
else
return NULL;
}
+
+void
+html_document_add_stylesheet (HtmlDocument *document, CssStylesheet *sheet)
+{
+ HtmlStyleChange style_change;
+
+ g_return_val_if_fail (HTML_IS_DOCUMENT (document), NULL);
+
+ /* Note: @import not supported for user stylesheets, due to
+ * complications it would cause with removal.
+ */
+
+ document->stylesheets = g_slist_append (document->stylesheets, sheet);
+
+ style_change = html_document_restyle_node (document, DOM_NODE (dom_Document__get_documentElement (document->dom_document)), NULL, TRUE);
+ g_signal_emit (G_OBJECT (document), document_signals [STYLE_UPDATED], 0, DOM_NODE (dom_Document__get_documentElement (document->dom_document)), style_change);
+}
+
+gboolean
+html_document_remove_stylesheet (HtmlDocument *document, CssStylesheet *stylesheet)
+{
+ g_return_val_if_fail (stylesheet && HTML_IS_DOCUMENT (document), FALSE);
+
+ document->stylesheets = g_slist_remove (document->stylesheets, stylesheet);
+
+ return TRUE;
+}
+
Index: libgtkhtml/document/htmldocument.h
===================================================================
--- libgtkhtml/document/htmldocument.h.orig 2006-02-05 18:19:17.000000000 +0000
+++ libgtkhtml/document/htmldocument.h 2006-02-05 18:20:06.000000000 +0000
@@ -113,6 +113,9 @@ void html_document_update_active_nod
void html_document_update_focus_element (HtmlDocument *document, DomElement *element);
DomNode *html_document_find_anchor (HtmlDocument *doc, const gchar *anchor);
+void html_document_add_stylesheet (HtmlDocument *document, CssStylesheet *stylesheet);
+gboolean html_document_remove_stylesheet (HtmlDocument *document, CssStylesheet *stylesheet);
+
G_END_DECLS
#endif /* __HTMLDOCUMENT_H__ */
|