diff options
Diffstat (limited to 'openembedded/packages/gtkhtml2/files/css-media.patch')
-rw-r--r-- | openembedded/packages/gtkhtml2/files/css-media.patch | 113 |
1 files changed, 46 insertions, 67 deletions
diff --git a/openembedded/packages/gtkhtml2/files/css-media.patch b/openembedded/packages/gtkhtml2/files/css-media.patch index 999ce196dc..a2d4d2b68c 100644 --- a/openembedded/packages/gtkhtml2/files/css-media.patch +++ b/openembedded/packages/gtkhtml2/files/css-media.patch | |||
@@ -1,8 +1,8 @@ | |||
1 | Index: gtkhtml2/libgtkhtml/css/cssmatcher.c | 1 | Index: libgtkhtml/css/cssmatcher.c |
2 | =================================================================== | 2 | =================================================================== |
3 | --- gtkhtml2.orig/libgtkhtml/css/cssmatcher.c 2006-01-25 02:07:44.000000000 +0000 | 3 | --- libgtkhtml/css/cssmatcher.c.orig 2006-02-05 18:19:15.000000000 +0000 |
4 | +++ gtkhtml2/libgtkhtml/css/cssmatcher.c 2006-02-01 02:19:13.000000000 +0000 | 4 | +++ libgtkhtml/css/cssmatcher.c 2006-02-05 18:20:15.000000000 +0000 |
5 | @@ -2411,7 +2411,8 @@ | 5 | @@ -2411,7 +2411,8 @@ css_matcher_apply_stylesheet (HtmlDocume |
6 | CssStatement *stat = list->data; | 6 | CssStatement *stat = list->data; |
7 | gint j; | 7 | gint j; |
8 | 8 | ||
@@ -12,7 +12,7 @@ Index: gtkhtml2/libgtkhtml/css/cssmatcher.c | |||
12 | if (stat->s.import_rule.fetched) { | 12 | if (stat->s.import_rule.fetched) { |
13 | if (stat->s.import_rule.sheet) { | 13 | if (stat->s.import_rule.sheet) { |
14 | css_matcher_apply_stylesheet (doc, stat->s.import_rule.sheet, node, declaration_list, type, pseudo); | 14 | css_matcher_apply_stylesheet (doc, stat->s.import_rule.sheet, node, declaration_list, type, pseudo); |
15 | @@ -2440,31 +2441,65 @@ | 15 | @@ -2440,31 +2441,65 @@ css_matcher_apply_stylesheet (HtmlDocume |
16 | g_free (str); | 16 | g_free (str); |
17 | #endif | 17 | #endif |
18 | } | 18 | } |
@@ -97,7 +97,7 @@ Index: gtkhtml2/libgtkhtml/css/cssmatcher.c | |||
97 | } | 97 | } |
98 | } | 98 | } |
99 | } | 99 | } |
100 | @@ -2781,7 +2816,7 @@ | 100 | @@ -2781,7 +2816,7 @@ css_matcher_get_style (HtmlDocument *doc |
101 | css_matcher_html_to_css (doc, style, node); | 101 | css_matcher_html_to_css (doc, style, node); |
102 | 102 | ||
103 | if (!default_stylesheet) { | 103 | if (!default_stylesheet) { |
@@ -106,7 +106,7 @@ Index: gtkhtml2/libgtkhtml/css/cssmatcher.c | |||
106 | } | 106 | } |
107 | 107 | ||
108 | css_matcher_apply_stylesheet (doc, default_stylesheet, node, &declaration_list, CSS_STYLESHEET_DEFAULT, pseudo); | 108 | css_matcher_apply_stylesheet (doc, default_stylesheet, node, &declaration_list, CSS_STYLESHEET_DEFAULT, pseudo); |
109 | @@ -2800,25 +2835,31 @@ | 109 | @@ -2800,25 +2835,31 @@ css_matcher_get_style (HtmlDocument *doc |
110 | prop = xmlGetProp (node, "style"); | 110 | prop = xmlGetProp (node, "style"); |
111 | 111 | ||
112 | if (prop) { | 112 | if (prop) { |
@@ -153,11 +153,11 @@ Index: gtkhtml2/libgtkhtml/css/cssmatcher.c | |||
153 | xmlFree (prop); | 153 | xmlFree (prop); |
154 | } | 154 | } |
155 | 155 | ||
156 | Index: gtkhtml2/libgtkhtml/document/htmldocument.c | 156 | Index: libgtkhtml/document/htmldocument.c |
157 | =================================================================== | 157 | =================================================================== |
158 | --- gtkhtml2.orig/libgtkhtml/document/htmldocument.c 2006-01-25 02:07:49.000000000 +0000 | 158 | --- libgtkhtml/document/htmldocument.c.orig 2006-02-05 18:20:06.000000000 +0000 |
159 | +++ gtkhtml2/libgtkhtml/document/htmldocument.c 2006-02-01 02:19:13.000000000 +0000 | 159 | +++ libgtkhtml/document/htmldocument.c 2006-02-05 18:20:15.000000000 +0000 |
160 | @@ -147,9 +147,7 @@ | 160 | @@ -142,9 +142,7 @@ html_document_stylesheet_stream_close (c |
161 | if (!buffer) | 161 | if (!buffer) |
162 | return; | 162 | return; |
163 | 163 | ||
@@ -168,7 +168,7 @@ Index: gtkhtml2/libgtkhtml/document/htmldocument.c | |||
168 | 168 | ||
169 | for (list = sheet->stat; list; list = list->next) { | 169 | for (list = sheet->stat; list; list = list->next) { |
170 | CssStatement *statement = list->data; | 170 | CssStatement *statement = list->data; |
171 | @@ -158,15 +156,13 @@ | 171 | @@ -153,15 +151,13 @@ html_document_stylesheet_stream_close (c |
172 | switch (statement->type) { | 172 | switch (statement->type) { |
173 | case CSS_IMPORT_RULE: { | 173 | case CSS_IMPORT_RULE: { |
174 | HtmlDocumentStreamData *stream_data_import; | 174 | HtmlDocumentStreamData *stream_data_import; |
@@ -187,7 +187,7 @@ Index: gtkhtml2/libgtkhtml/document/htmldocument.c | |||
187 | break; | 187 | break; |
188 | } | 188 | } |
189 | default: | 189 | default: |
190 | @@ -174,8 +170,11 @@ | 190 | @@ -169,8 +165,11 @@ html_document_stylesheet_stream_close (c |
191 | } | 191 | } |
192 | } | 192 | } |
193 | 193 | ||
@@ -200,7 +200,7 @@ Index: gtkhtml2/libgtkhtml/document/htmldocument.c | |||
200 | 200 | ||
201 | /* Restyle the document */ | 201 | /* Restyle the document */ |
202 | style_change = html_document_restyle_node (document, DOM_NODE (dom_Document__get_documentElement (document->dom_document)), NULL, TRUE); | 202 | style_change = html_document_restyle_node (document, DOM_NODE (dom_Document__get_documentElement (document->dom_document)), NULL, TRUE); |
203 | @@ -216,21 +215,22 @@ | 203 | @@ -211,21 +210,22 @@ html_document_node_inserted_traverser (H |
204 | HtmlDocumentStreamData *stream_data; | 204 | HtmlDocumentStreamData *stream_data; |
205 | HtmlStream *stream; | 205 | HtmlStream *stream; |
206 | 206 | ||
@@ -226,7 +226,7 @@ Index: gtkhtml2/libgtkhtml/document/htmldocument.c | |||
226 | } | 226 | } |
227 | g_free (str); | 227 | g_free (str); |
228 | } | 228 | } |
229 | @@ -282,8 +282,10 @@ | 229 | @@ -277,8 +277,10 @@ html_document_node_inserted_traverser (H |
230 | CssStylesheet *ss; | 230 | CssStylesheet *ss; |
231 | HtmlStyleChange style_change; | 231 | HtmlStyleChange style_change; |
232 | GSList *list; | 232 | GSList *list; |
@@ -238,7 +238,7 @@ Index: gtkhtml2/libgtkhtml/document/htmldocument.c | |||
238 | 238 | ||
239 | for (list = ss->stat; list; list = list->next) { | 239 | for (list = ss->stat; list; list = list->next) { |
240 | CssStatement *statement = list->data; | 240 | CssStatement *statement = list->data; |
241 | @@ -296,9 +298,10 @@ | 241 | @@ -291,9 +293,10 @@ html_document_node_inserted_traverser (H |
242 | 242 | ||
243 | cssurl = css_value_to_string (statement->s.import_rule.url); | 243 | cssurl = css_value_to_string (statement->s.import_rule.url); |
244 | 244 | ||
@@ -250,7 +250,7 @@ Index: gtkhtml2/libgtkhtml/document/htmldocument.c | |||
250 | 250 | ||
251 | stream = html_stream_buffer_new (html_document_stylesheet_stream_close, stream_data); | 251 | stream = html_stream_buffer_new (html_document_stylesheet_stream_close, stream_data); |
252 | g_signal_emit (G_OBJECT (document), document_signals [REQUEST_URL], 0, cssurl, stream); | 252 | g_signal_emit (G_OBJECT (document), document_signals [REQUEST_URL], 0, cssurl, stream); |
253 | @@ -546,6 +549,9 @@ | 253 | @@ -541,6 +544,9 @@ html_document_finalize (GObject *object) |
254 | 254 | ||
255 | if (document->parser) | 255 | if (document->parser) |
256 | g_object_unref (G_OBJECT (document->parser)); | 256 | g_object_unref (G_OBJECT (document->parser)); |
@@ -260,7 +260,7 @@ Index: gtkhtml2/libgtkhtml/document/htmldocument.c | |||
260 | 260 | ||
261 | parent_class->finalize (object); | 261 | parent_class->finalize (object); |
262 | } | 262 | } |
263 | @@ -753,6 +759,7 @@ | 263 | @@ -748,6 +754,7 @@ html_document_init (HtmlDocument *docume |
264 | { | 264 | { |
265 | document->stylesheets = NULL; | 265 | document->stylesheets = NULL; |
266 | document->image_factory = html_image_factory_new (); | 266 | document->image_factory = html_image_factory_new (); |
@@ -268,25 +268,7 @@ Index: gtkhtml2/libgtkhtml/document/htmldocument.c | |||
268 | 268 | ||
269 | g_signal_connect (G_OBJECT (document->image_factory), "request_image", | 269 | g_signal_connect (G_OBJECT (document->image_factory), "request_image", |
270 | G_CALLBACK (html_document_request_image), document); | 270 | G_CALLBACK (html_document_request_image), document); |
271 | @@ -1129,7 +1136,7 @@ | 271 | @@ -1150,3 +1157,24 @@ html_document_remove_stylesheet (HtmlDoc |
272 | } | ||
273 | |||
274 | CssStylesheet * | ||
275 | -html_document_add_stylesheet (HtmlDocument *document, const gchar *buffer, gint len) | ||
276 | +html_document_add_stylesheet (HtmlDocument *document, const gchar *buffer, gint len, const gchar *media) | ||
277 | { | ||
278 | CssStylesheet *sheet; | ||
279 | HtmlStyleChange style_change; | ||
280 | @@ -1140,7 +1147,7 @@ | ||
281 | * complications it would cause with removal. | ||
282 | */ | ||
283 | |||
284 | - sheet = css_parser_parse_stylesheet (buffer, len, NULL); | ||
285 | + sheet = css_parser_parse_stylesheet (buffer, len, NULL, media); | ||
286 | document->stylesheets = g_slist_append (document->stylesheets, sheet); | ||
287 | |||
288 | style_change = html_document_restyle_node (document, DOM_NODE (dom_Document__get_documentElement (document->dom_document)), NULL, TRUE); | ||
289 | @@ -1159,3 +1166,24 @@ | ||
290 | return TRUE; | 272 | return TRUE; |
291 | } | 273 | } |
292 | 274 | ||
@@ -311,11 +293,11 @@ Index: gtkhtml2/libgtkhtml/document/htmldocument.c | |||
311 | +{ | 293 | +{ |
312 | + return document->media_type; | 294 | + return document->media_type; |
313 | +} | 295 | +} |
314 | Index: gtkhtml2/libgtkhtml/document/htmldocument.h | 296 | Index: libgtkhtml/document/htmldocument.h |
315 | =================================================================== | 297 | =================================================================== |
316 | --- gtkhtml2.orig/libgtkhtml/document/htmldocument.h 2006-01-25 02:07:49.000000000 +0000 | 298 | --- libgtkhtml/document/htmldocument.h.orig 2006-02-05 18:20:06.000000000 +0000 |
317 | +++ gtkhtml2/libgtkhtml/document/htmldocument.h 2006-01-25 02:07:50.000000000 +0000 | 299 | +++ libgtkhtml/document/htmldocument.h 2006-02-05 18:20:15.000000000 +0000 |
318 | @@ -64,6 +64,8 @@ | 300 | @@ -64,6 +64,8 @@ struct _HtmlDocument { |
319 | DomNode *hover_node; | 301 | DomNode *hover_node; |
320 | DomNode *active_node; | 302 | DomNode *active_node; |
321 | DomElement *focus_element; | 303 | DomElement *focus_element; |
@@ -324,7 +306,7 @@ Index: gtkhtml2/libgtkhtml/document/htmldocument.h | |||
324 | }; | 306 | }; |
325 | 307 | ||
326 | struct _HtmlDocumentClass { | 308 | struct _HtmlDocumentClass { |
327 | @@ -97,6 +99,7 @@ | 309 | @@ -97,6 +99,7 @@ struct _HtmlDocumentClass { |
328 | struct _HtmlDocumentStreamData { | 310 | struct _HtmlDocumentStreamData { |
329 | HtmlDocument *document; | 311 | HtmlDocument *document; |
330 | gpointer internal_data; | 312 | gpointer internal_data; |
@@ -332,25 +314,22 @@ Index: gtkhtml2/libgtkhtml/document/htmldocument.h | |||
332 | }; | 314 | }; |
333 | 315 | ||
334 | GType html_document_get_type (void); | 316 | GType html_document_get_type (void); |
335 | @@ -113,9 +116,12 @@ | 317 | @@ -116,6 +119,10 @@ DomNode *html_document_find_anchor |
336 | void html_document_update_focus_element (HtmlDocument *document, DomElement *element); | 318 | void html_document_add_stylesheet (HtmlDocument *document, CssStylesheet *stylesheet); |
337 | DomNode *html_document_find_anchor (HtmlDocument *doc, const gchar *anchor); | ||
338 | |||
339 | -CssStylesheet *html_document_add_stylesheet (HtmlDocument *document, const gchar *buffer, gint len); | ||
340 | +CssStylesheet *html_document_add_stylesheet (HtmlDocument *document, const gchar *buffer, gint len, const gchar *media); | ||
341 | gboolean html_document_remove_stylesheet (HtmlDocument *document, CssStylesheet *stylesheet); | 319 | gboolean html_document_remove_stylesheet (HtmlDocument *document, CssStylesheet *stylesheet); |
342 | 320 | ||
343 | +void html_document_set_media_type (HtmlDocument *document, const gchar *type); | 321 | +void html_document_set_media_type (HtmlDocument *document, const gchar *type); |
344 | +const gchar *html_document_get_media_type (HtmlDocument *document); | 322 | +const gchar *html_document_get_media_type (HtmlDocument *document); |
323 | + | ||
345 | + | 324 | + |
346 | G_END_DECLS | 325 | G_END_DECLS |
347 | 326 | ||
348 | #endif /* __HTMLDOCUMENT_H__ */ | 327 | #endif /* __HTMLDOCUMENT_H__ */ |
349 | Index: gtkhtml2/libgtkhtml/css/cssparser.c | 328 | Index: libgtkhtml/css/cssparser.c |
350 | =================================================================== | 329 | =================================================================== |
351 | --- gtkhtml2.orig/libgtkhtml/css/cssparser.c 2006-01-25 02:05:54.000000000 +0000 | 330 | --- libgtkhtml/css/cssparser.c.orig 2006-02-05 18:19:15.000000000 +0000 |
352 | +++ gtkhtml2/libgtkhtml/css/cssparser.c 2006-01-25 02:07:50.000000000 +0000 | 331 | +++ libgtkhtml/css/cssparser.c 2006-02-05 18:20:15.000000000 +0000 |
353 | @@ -688,6 +688,32 @@ | 332 | @@ -688,6 +688,32 @@ css_parser_parse_value (const gchar *buf |
354 | return pos; | 333 | return pos; |
355 | } | 334 | } |
356 | 335 | ||
@@ -383,7 +362,7 @@ Index: gtkhtml2/libgtkhtml/css/cssparser.c | |||
383 | 362 | ||
384 | static gint | 363 | static gint |
385 | css_parser_parse_attr_selector (const gchar *buffer, gint start_pos, gint end_pos, CssTail *tail) | 364 | css_parser_parse_attr_selector (const gchar *buffer, gint start_pos, gint end_pos, CssTail *tail) |
386 | @@ -1329,7 +1355,7 @@ | 365 | @@ -1329,7 +1355,7 @@ css_parser_parse_atkeyword (const gchar |
387 | 366 | ||
388 | /* g_print ("Going to return: %d\n", pos); */ | 367 | /* g_print ("Going to return: %d\n", pos); */ |
389 | 368 | ||
@@ -392,7 +371,7 @@ Index: gtkhtml2/libgtkhtml/css/cssparser.c | |||
392 | 371 | ||
393 | break; | 372 | break; |
394 | case HTML_ATOM_PAGE: | 373 | case HTML_ATOM_PAGE: |
395 | @@ -1390,7 +1416,8 @@ | 374 | @@ -1390,7 +1416,8 @@ css_parser_parse_atkeyword (const gchar |
396 | break; | 375 | break; |
397 | case HTML_ATOM_IMPORT: { | 376 | case HTML_ATOM_IMPORT: { |
398 | gchar *import_url; | 377 | gchar *import_url; |
@@ -402,7 +381,7 @@ Index: gtkhtml2/libgtkhtml/css/cssparser.c | |||
402 | 381 | ||
403 | cur_pos = css_parser_parse_to_char (buffer, ';', pos, end_pos); | 382 | cur_pos = css_parser_parse_to_char (buffer, ';', pos, end_pos); |
404 | 383 | ||
405 | @@ -1411,6 +1438,7 @@ | 384 | @@ -1411,6 +1438,7 @@ css_parser_parse_atkeyword (const gchar |
406 | return cur_pos + 1; | 385 | return cur_pos + 1; |
407 | } | 386 | } |
408 | 387 | ||
@@ -410,7 +389,7 @@ Index: gtkhtml2/libgtkhtml/css/cssparser.c | |||
410 | s_url++; | 389 | s_url++; |
411 | e_url--; | 390 | e_url--; |
412 | 391 | ||
413 | @@ -1434,6 +1462,11 @@ | 392 | @@ -1434,6 +1462,11 @@ css_parser_parse_atkeyword (const gchar |
414 | result->type = CSS_IMPORT_RULE; | 393 | result->type = CSS_IMPORT_RULE; |
415 | 394 | ||
416 | result->s.import_rule.url = css_value_string_new (import_url); | 395 | result->s.import_rule.url = css_value_string_new (import_url); |
@@ -422,7 +401,7 @@ Index: gtkhtml2/libgtkhtml/css/cssparser.c | |||
422 | 401 | ||
423 | *ret_val = result; | 402 | *ret_val = result; |
424 | 403 | ||
425 | @@ -1489,7 +1522,7 @@ | 404 | @@ -1489,7 +1522,7 @@ css_parser_parse_style_attr (const gchar |
426 | } | 405 | } |
427 | 406 | ||
428 | CssStylesheet * | 407 | CssStylesheet * |
@@ -431,7 +410,7 @@ Index: gtkhtml2/libgtkhtml/css/cssparser.c | |||
431 | { | 410 | { |
432 | CssStylesheet *result; | 411 | CssStylesheet *result; |
433 | GSList *stat = NULL; | 412 | GSList *stat = NULL; |
434 | @@ -1515,12 +1548,23 @@ | 413 | @@ -1515,12 +1548,23 @@ css_parser_parse_stylesheet (const gchar |
435 | pos = css_parser_parse_ruleset (buffer, pos, end_pos, &ruleset, base_url); | 414 | pos = css_parser_parse_ruleset (buffer, pos, end_pos, &ruleset, base_url); |
436 | 415 | ||
437 | if (ruleset) { | 416 | if (ruleset) { |
@@ -460,10 +439,10 @@ Index: gtkhtml2/libgtkhtml/css/cssparser.c | |||
460 | } | 439 | } |
461 | 440 | ||
462 | if (pos == -1) | 441 | if (pos == -1) |
463 | Index: gtkhtml2/libgtkhtml/css/cssparser.h | 442 | Index: libgtkhtml/css/cssparser.h |
464 | =================================================================== | 443 | =================================================================== |
465 | --- gtkhtml2.orig/libgtkhtml/css/cssparser.h 2006-01-25 02:05:54.000000000 +0000 | 444 | --- libgtkhtml/css/cssparser.h.orig 2006-02-05 18:19:15.000000000 +0000 |
466 | +++ gtkhtml2/libgtkhtml/css/cssparser.h 2006-01-25 02:07:50.000000000 +0000 | 445 | +++ libgtkhtml/css/cssparser.h 2006-02-05 18:20:15.000000000 +0000 |
467 | @@ -30,7 +30,7 @@ | 446 | @@ -30,7 +30,7 @@ |
468 | 447 | ||
469 | G_BEGIN_DECLS | 448 | G_BEGIN_DECLS |
@@ -473,11 +452,11 @@ Index: gtkhtml2/libgtkhtml/css/cssparser.h | |||
473 | CssRuleset *css_parser_parse_style_attr (const gchar *buffer, gint len, const gchar *base_url); | 452 | CssRuleset *css_parser_parse_style_attr (const gchar *buffer, gint len, const gchar *base_url); |
474 | 453 | ||
475 | G_END_DECLS | 454 | G_END_DECLS |
476 | Index: gtkhtml2/libgtkhtml/css/cssstylesheet.h | 455 | Index: libgtkhtml/css/cssstylesheet.h |
477 | =================================================================== | 456 | =================================================================== |
478 | --- gtkhtml2.orig/libgtkhtml/css/cssstylesheet.h 2006-02-01 02:19:56.000000000 +0000 | 457 | --- libgtkhtml/css/cssstylesheet.h.orig 2006-02-05 18:19:15.000000000 +0000 |
479 | +++ gtkhtml2/libgtkhtml/css/cssstylesheet.h 2006-02-01 02:20:08.000000000 +0000 | 458 | +++ libgtkhtml/css/cssstylesheet.h 2006-02-05 18:20:15.000000000 +0000 |
480 | @@ -99,6 +99,7 @@ | 459 | @@ -99,6 +99,7 @@ struct _CssStatement { |
481 | CssValue *url; | 460 | CssValue *url; |
482 | gboolean fetched; | 461 | gboolean fetched; |
483 | gboolean fetching; | 462 | gboolean fetching; |