diff options
Diffstat (limited to 'openembedded/packages/gtkhtml2/files/css-stylesheet-user.patch')
-rw-r--r-- | openembedded/packages/gtkhtml2/files/css-stylesheet-user.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/openembedded/packages/gtkhtml2/files/css-stylesheet-user.patch b/openembedded/packages/gtkhtml2/files/css-stylesheet-user.patch new file mode 100644 index 000000000..85fe53512 --- /dev/null +++ b/openembedded/packages/gtkhtml2/files/css-stylesheet-user.patch @@ -0,0 +1,54 @@ +Index: gtkhtml2/libgtkhtml/document/htmldocument.c +=================================================================== +--- gtkhtml2.orig/libgtkhtml/document/htmldocument.c 2006-01-21 02:24:09.000000000 +0000 ++++ gtkhtml2/libgtkhtml/document/htmldocument.c 2006-01-21 04:21:37.000000000 +0000 +@@ -1127,3 +1127,35 @@ + else + return NULL; + } ++ ++CssStylesheet * ++html_document_add_stylesheet (HtmlDocument *document, const gchar *buffer, gint len) ++{ ++ CssStylesheet *sheet; ++ HtmlStyleChange style_change; ++ ++ g_return_val_if_fail (buffer && (len > 0) && HTML_IS_DOCUMENT (document), NULL); ++ ++ /* Note: @import not supported for user stylesheets, due to ++ * complications it would cause with removal. ++ */ ++ ++ sheet = css_parser_parse_stylesheet (buffer, len, NULL); ++ 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); ++ ++ return sheet; ++} ++ ++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: gtkhtml2/libgtkhtml/document/htmldocument.h +=================================================================== +--- gtkhtml2.orig/libgtkhtml/document/htmldocument.h 2006-01-21 02:24:09.000000000 +0000 ++++ gtkhtml2/libgtkhtml/document/htmldocument.h 2006-01-21 03:48:55.000000000 +0000 +@@ -113,6 +113,9 @@ + void html_document_update_focus_element (HtmlDocument *document, DomElement *element); + DomNode *html_document_find_anchor (HtmlDocument *doc, const gchar *anchor); + ++CssStylesheet *html_document_add_stylesheet (HtmlDocument *document, const gchar *buffer, gint len); ++gboolean html_document_remove_stylesheet (HtmlDocument *document, CssStylesheet *stylesheet); ++ + G_END_DECLS + + #endif /* __HTMLDOCUMENT_H__ */ |