summaryrefslogtreecommitdiffstats
path: root/openembedded/packages/gtkhtml2/files/at-import_box-pos.patch
diff options
context:
space:
mode:
Diffstat (limited to 'openembedded/packages/gtkhtml2/files/at-import_box-pos.patch')
-rw-r--r--openembedded/packages/gtkhtml2/files/at-import_box-pos.patch686
1 files changed, 0 insertions, 686 deletions
diff --git a/openembedded/packages/gtkhtml2/files/at-import_box-pos.patch b/openembedded/packages/gtkhtml2/files/at-import_box-pos.patch
deleted file mode 100644
index fb31d057a4..0000000000
--- a/openembedded/packages/gtkhtml2/files/at-import_box-pos.patch
+++ /dev/null
@@ -1,686 +0,0 @@
1Index: libgtkhtml/css/cssmatcher.c
2===================================================================
3--- libgtkhtml/css/cssmatcher.c.orig 2006-02-04 20:10:47.000000000 +0000
4+++ libgtkhtml/css/cssmatcher.c 2006-02-05 18:19:15.000000000 +0000
5@@ -79,7 +79,7 @@ css_matcher_match_simple_selector (CssSi
6 element_name = html_atom_list_get_atom (html_atom_list, node->name);
7
8 /* Look at the element name */
9- if (!simple->is_star && simple->element_name != element_name)
10+ if ((!simple->is_star) && (simple->element_name != element_name))
11 return FALSE;
12
13 str = xmlGetProp (node, "id");
14@@ -2384,7 +2384,7 @@ css_matcher_sheet_stream_close (HtmlStre
15 CssStylesheet *ss;
16
17 if (html_stream_get_written (stream) != 0) {
18- ss = css_parser_parse_stylesheet (context->str->str, context->str->len);
19+ ss = css_parser_parse_stylesheet (context->str->str, context->str->len, NULL);
20
21 context->stat->s.import_rule.fetched = TRUE;
22
23@@ -2781,7 +2781,7 @@ css_matcher_get_style (HtmlDocument *doc
24 css_matcher_html_to_css (doc, style, node);
25
26 if (!default_stylesheet) {
27- default_stylesheet = css_parser_parse_stylesheet (html_css, strlen (html_css));
28+ default_stylesheet = css_parser_parse_stylesheet (html_css, strlen (html_css), NULL);
29 }
30
31 css_matcher_apply_stylesheet (doc, default_stylesheet, node, &declaration_list, CSS_STYLESHEET_DEFAULT, pseudo);
32@@ -2800,7 +2800,7 @@ css_matcher_get_style (HtmlDocument *doc
33 prop = xmlGetProp (node, "style");
34
35 if (prop) {
36- CssRuleset *rs = css_parser_parse_style_attr (prop, strlen (prop));
37+ CssRuleset *rs = css_parser_parse_style_attr (prop, strlen (prop), NULL);
38 gint i;
39
40 if (rs) {
41Index: libgtkhtml/css/cssparser.c
42===================================================================
43--- libgtkhtml/css/cssparser.c.orig 2006-02-04 20:10:47.000000000 +0000
44+++ libgtkhtml/css/cssparser.c 2006-02-05 18:19:15.000000000 +0000
45@@ -49,7 +49,7 @@ const gchar *css_dimensions[] = {
46
47 const gint css_n_dimensions = sizeof (css_dimensions) / sizeof (css_dimensions[0]);
48
49-static gint css_parser_parse_value (const gchar *buffer, gint start_pos, gint end_pos, CssValue **ret_val);
50+static gint css_parser_parse_value (const gchar *buffer, gint start_pos, gint end_pos, CssValue **ret_val, const gchar *base_url);
51
52 /* FIXME: Needs more whitespace types */
53 static gint
54@@ -443,7 +443,7 @@ css_parser_parse_number (const gchar *bu
55 }
56
57 static gint
58-css_parser_parse_term (const gchar *buffer, gint start_pos, gint end_pos, CssValue **ret_val)
59+css_parser_parse_term (const gchar *buffer, gint start_pos, gint end_pos, CssValue **ret_val, const gchar *base_url)
60 {
61 gint pos;
62 HtmlAtom atom;
63@@ -481,7 +481,7 @@ css_parser_parse_term (const gchar *buff
64 return -1;
65 }
66
67- pos = css_parser_parse_value (buffer, save_pos + 1, func_end, &val);
68+ pos = css_parser_parse_value (buffer, save_pos + 1, func_end, &val, base_url);
69
70 if (pos == -1) {
71 /*
72@@ -495,10 +495,48 @@ css_parser_parse_term (const gchar *buff
73 pos = func_end;
74 }
75 if (pos != -1) {
76- if (ret_val)
77+ if (ret_val) {
78 *ret_val = css_value_function_new (atom, val);
79- else
80+
81+ if ((*ret_val)->v.function->name == HTML_ATOM_URL &&
82+ (*ret_val)->v.function->args) {
83+ gchar *str = css_value_to_string ((*ret_val)->v.function->args);
84+
85+ if (base_url && str) {
86+ regex_t reg;
87+
88+ regcomp (&reg, "^[a-zA-Z][a-zA-Z0-9.+-]*:", REG_NOSUB);
89+ if (((*ret_val)->v.function->args->v.s[0] != '/') && (regexec (&reg, (*ret_val)->v.function->args->v.s, 0, NULL, 0))) {
90+ gchar *temp_base, *eptr;
91+
92+ temp_base = g_strdup(base_url);
93+ eptr = strrchr(temp_base, '?');
94+
95+ if (eptr != NULL)
96+ *eptr = '\0';
97+
98+ eptr = strrchr(temp_base, '/');
99+ if (eptr != NULL) {
100+ gchar *temp_arg = g_strdup((*ret_val)->v.function->args->v.s);
101+
102+ *eptr = '\0';
103+
104+ g_free((*ret_val)->v.function->args->v.s);
105+ (*ret_val)->v.function->args->v.s = g_strconcat(temp_base, "/", temp_arg, NULL);
106+ g_free(temp_arg);
107+ }
108+
109+ g_free(temp_base);
110+ }
111+ regfree (&reg);
112+ }
113+
114+ g_free (str);
115+ }
116+ }
117+ else {
118 css_value_unref (val);
119+ }
120 }
121
122 /* This is due to the ) */
123@@ -566,7 +604,7 @@ css_parser_parse_term (const gchar *buff
124 }
125
126 static gint
127-css_parser_parse_value (const gchar *buffer, gint start_pos, gint end_pos, CssValue **ret_val)
128+css_parser_parse_value (const gchar *buffer, gint start_pos, gint end_pos, CssValue **ret_val, const gchar *base_url)
129 {
130 gint pos = start_pos;
131 gint n = 0;
132@@ -589,7 +627,7 @@ css_parser_parse_value (const gchar *buf
133 css_value_list_append (list, term, list_sep);
134 }
135
136- pos = css_parser_parse_term (buffer, pos, end_pos, &term);
137+ pos = css_parser_parse_term (buffer, pos, end_pos, &term, base_url);
138
139 if (pos == -1) {
140 if (list)
141@@ -618,7 +656,7 @@ css_parser_parse_value (const gchar *buf
142 }
143 else {
144 /* Try and parse the term to see if it's valid */
145- if (css_parser_parse_term (buffer, pos, end_pos, NULL) == -1) {
146+ if (css_parser_parse_term (buffer, pos, end_pos, NULL, base_url) == -1) {
147 if (term)
148 css_value_unref (term);
149 if (list)
150@@ -1005,7 +1043,7 @@ css_parser_parse_selectors (const gchar
151 }
152
153 static gint
154-css_parser_parse_declaration (const gchar *buffer, gint start_pos, gint end_pos, CssDeclaration **ret_val)
155+css_parser_parse_declaration (const gchar *buffer, gint start_pos, gint end_pos, CssDeclaration **ret_val, const gchar *base_url)
156 {
157 CssValue *value;
158 CssDeclaration *result;
159@@ -1040,7 +1078,7 @@ css_parser_parse_declaration (const gcha
160
161 pos = css_parser_parse_whitespace (buffer, pos, prio_pos);
162
163- pos = css_parser_parse_value (buffer, pos, prio_pos, &value);
164+ pos = css_parser_parse_value (buffer, pos, prio_pos, &value, base_url);
165
166 if (pos == -1) {
167 return end_pos;
168@@ -1063,7 +1101,7 @@ css_parser_parse_declaration (const gcha
169 }
170
171 static CssDeclaration **
172-css_parser_parse_declarations (const gchar *buffer, gint start_pos, gint end_pos, gint *num_decl)
173+css_parser_parse_declarations (const gchar *buffer, gint start_pos, gint end_pos, gint *num_decl, const gchar *base_url)
174 {
175 gint pos = start_pos;
176 gint cur_pos = start_pos;
177@@ -1079,7 +1117,7 @@ css_parser_parse_declarations (const gch
178
179 pos = css_parser_parse_to_char (buffer, ';', pos, end_pos);
180
181- pos = css_parser_parse_declaration (buffer, cur_pos, pos, &declaration);
182+ pos = css_parser_parse_declaration (buffer, cur_pos, pos, &declaration, base_url);
183
184 if (declaration) {
185 if (n_decl == n_decl_max)
186@@ -1100,7 +1138,7 @@ css_parser_parse_declarations (const gch
187 }
188
189 static gint
190-css_parser_parse_ruleset (const gchar *buffer, gint start_pos, gint end_pos, CssRuleset **ret_val)
191+css_parser_parse_ruleset (const gchar *buffer, gint start_pos, gint end_pos, CssRuleset **ret_val, const gchar *base_url)
192 {
193 gint cur_pos;
194 gint pos;
195@@ -1143,7 +1181,7 @@ css_parser_parse_ruleset (const gchar *b
196 }
197 cur_pos = css_parser_parse_whitespace (buffer, cur_pos, end_pos);
198
199- decl = css_parser_parse_declarations (buffer, cur_pos, pos, &n_decl);
200+ decl = css_parser_parse_declarations (buffer, cur_pos, pos, &n_decl, base_url);
201
202 pos++;
203
204@@ -1186,7 +1224,8 @@ css_parser_prepare_stylesheet (const gch
205 }
206 else if (str[pos] == '/' &&
207 pos + 1 <= len &&
208- str[pos + 1] == '/') {
209+ str[pos + 1] == '/' &&
210+ (pos == 0 || str[pos-1] != ':')) {
211 while (pos < len &&
212 str[pos] != '\n')
213 pos++;
214@@ -1204,7 +1243,7 @@ css_parser_prepare_stylesheet (const gch
215 }
216
217 static gint
218-css_parser_parse_atkeyword (const gchar *buffer, gint start_pos, gint end_pos, CssStatement **ret_val)
219+css_parser_parse_atkeyword (const gchar *buffer, gint start_pos, gint end_pos, CssStatement **ret_val, const gchar *base_url)
220 {
221 gint pos = start_pos;
222 gint tmp_pos, cur_pos;
223@@ -1257,14 +1296,14 @@ css_parser_parse_atkeyword (const gchar
224 tmp_pos++;
225
226
227- rs = g_new (CssRuleset *, n_rs_max);
228+ rs = g_new0 (CssRuleset *, n_rs_max);
229
230 /* g_print ("wheee: \"%s\"\n", g_strndup (buffer + cur_pos, tmp_pos - cur_pos )); */
231 pos = cur_pos;
232 while (pos < tmp_pos) {
233 CssRuleset *ruleset;
234
235- pos = css_parser_parse_ruleset (buffer, pos, tmp_pos, &ruleset);
236+ pos = css_parser_parse_ruleset (buffer, pos, tmp_pos, &ruleset, base_url);
237
238 if (n_rs == n_rs_max)
239 rs = g_realloc (rs, sizeof (CssRuleset *) *
240@@ -1277,7 +1316,7 @@ css_parser_parse_atkeyword (const gchar
241
242 pos = css_parser_parse_whitespace (buffer, tmp_pos + 1, end_pos);
243
244- result = g_new (CssStatement, 1);
245+ result = g_new0 (CssStatement, 1);
246 result->type = CSS_MEDIA_RULE;
247 result->s.media_rule.rs = rs;
248 result->s.media_rule.n_rs = n_rs;
249@@ -1318,11 +1357,11 @@ css_parser_parse_atkeyword (const gchar
250
251 pos = css_parser_parse_whitespace (buffer, pos, cur_pos);
252
253- decl = css_parser_parse_declarations (buffer, pos, cur_pos, &n_decl);
254+ decl = css_parser_parse_declarations (buffer, pos, cur_pos, &n_decl, base_url);
255
256 g_print ("N_decl is: %d\n", n_decl);
257
258- result = g_new (CssStatement, 1);
259+ result = g_new0 (CssStatement, 1);
260 result->type = CSS_PAGE_RULE;
261 result->s.page_rule.name = name;
262 result->s.page_rule.pseudo = pseudo;
263@@ -1337,8 +1376,8 @@ css_parser_parse_atkeyword (const gchar
264 pos = css_parser_parse_whitespace (buffer, pos + 1, end_pos);
265 cur_pos = css_parser_parse_to_char (buffer, '}', pos, end_pos);
266
267- decl = css_parser_parse_declarations (buffer, pos, cur_pos, &n_decl);
268- result = g_new (CssStatement, 1);
269+ decl = css_parser_parse_declarations (buffer, pos, cur_pos, &n_decl, base_url);
270+ result = g_new0 (CssStatement, 1);
271 result->type = CSS_FONT_FACE_RULE;
272
273 result->s.font_face_rule.n_decl = n_decl;
274@@ -1349,8 +1388,61 @@ css_parser_parse_atkeyword (const gchar
275 return cur_pos + 1;
276
277 break;
278+ case HTML_ATOM_IMPORT: {
279+ gchar *import_url;
280+ const gchar *s_url, *e_url;
281+
282+ cur_pos = css_parser_parse_to_char (buffer, ';', pos, end_pos);
283+
284+ if (strchr (buffer + pos, '(')) {
285+ s_url = strchr (buffer + pos, '(');
286+ e_url = strchr (s_url, ')');
287+ } else if (strchr (buffer + pos, '\"')) {
288+ s_url = strchr (buffer + pos, '\"');
289+ e_url = strchr (s_url + 1, '\"');
290+ } else if (strchr (buffer + pos, '\'')) {
291+ s_url = strchr (buffer + pos, '\'');
292+ e_url = strchr (s_url + 1, '\'');
293+ }
294+
295+ if (!s_url || !e_url || ((e_url - s_url) < 1)) {
296+ g_warning ("Invalid @import line");
297+ *ret_val = NULL;
298+ return cur_pos + 1;
299+ }
300+
301+ s_url++;
302+ e_url--;
303+
304+ if ((*s_url == '\"') && (*e_url == '\"')) {
305+ s_url++;
306+ e_url--;
307+ } else if ((*s_url == '\'') && (*e_url == '\'')) {
308+ s_url++;
309+ e_url--;
310+ }
311+
312+ if (s_url > e_url) {
313+ g_warning ("Invalid @import line");
314+ *ret_val = NULL;
315+ return cur_pos + 1;
316+ }
317+
318+ import_url = g_strndup (s_url, strlen (s_url) - strlen (e_url) + 1);
319+
320+ result = g_new0 (CssStatement, 1);
321+ result->type = CSS_IMPORT_RULE;
322
323+ result->s.import_rule.url = css_value_string_new (import_url);
324+
325+ *ret_val = result;
326+
327+ return cur_pos + 1;
328+
329+ break;
330+ }
331 default:
332+ g_warning ("Unhandled keyword %d - %s", keyword, buffer);
333 /* Unknown keyword detected, skip to next block */
334 while (pos < end_pos) {
335 /* Handle a dangling semi-colon */
336@@ -1373,7 +1465,7 @@ css_parser_parse_atkeyword (const gchar
337 }
338
339 CssRuleset *
340-css_parser_parse_style_attr (const gchar *buffer, gint len)
341+css_parser_parse_style_attr (const gchar *buffer, gint len, const gchar *base_url)
342 {
343 CssRuleset *result;
344
345@@ -1382,7 +1474,7 @@ css_parser_parse_style_attr (const gchar
346
347 /* FIXME: Are comments allowed here? */
348
349- decl = css_parser_parse_declarations (buffer, 0, len, &n_decl);
350+ decl = css_parser_parse_declarations (buffer, 0, len, &n_decl, base_url);
351
352 if (!decl)
353 return NULL;
354@@ -1397,9 +1489,8 @@ css_parser_parse_style_attr (const gchar
355 }
356
357 CssStylesheet *
358-css_parser_parse_stylesheet (const gchar *str, gint len)
359+css_parser_parse_stylesheet (const gchar *str, gint len, const gchar *base_url)
360 {
361- CssStatement *statement;
362 CssStylesheet *result;
363 GSList *stat = NULL;
364 gchar *buffer;
365@@ -1413,26 +1504,23 @@ css_parser_parse_stylesheet (const gchar
366 end_pos = len;
367 while (pos < len) {
368 if (buffer[pos] == '@') {
369- pos = css_parser_parse_atkeyword (buffer, pos + 1, len, &statement);
370-#if 0
371- if (statement) {
372- if (n_stat == n_stat_max)
373- stat = g_realloc (stat, sizeof (CssStatement) *
374- (n_stat_max <<= 1));
375- stat[n_stat++] = statement;
376+ CssStatement *atstatement = NULL;
377+ pos = css_parser_parse_atkeyword (buffer, pos + 1, len, &atstatement, base_url);
378+ if (atstatement) {
379+ stat = g_slist_append (stat, atstatement);
380 }
381-#endif
382 }
383 else {
384 CssRuleset *ruleset;
385- pos = css_parser_parse_ruleset (buffer, pos, end_pos, &ruleset);
386+ pos = css_parser_parse_ruleset (buffer, pos, end_pos, &ruleset, base_url);
387
388 if (ruleset) {
389- statement = g_new (CssStatement, 1);
390- statement->type = CSS_RULESET;
391- statement->s.ruleset = ruleset;
392+ CssStatement *rulestatement;
393+ rulestatement = g_new0 (CssStatement, 1);
394+ rulestatement->type = CSS_RULESET;
395+ rulestatement->s.ruleset = ruleset;
396
397- stat = g_slist_append (stat, statement);
398+ stat = g_slist_append (stat, rulestatement);
399 }
400
401 if (pos == -1)
402@@ -1444,7 +1532,7 @@ css_parser_parse_stylesheet (const gchar
403
404 g_free (buffer);
405
406- result = g_new (CssStylesheet, 1);
407+ result = g_new0 (CssStylesheet, 1);
408 result->stat = stat;
409
410 return result;
411Index: libgtkhtml/css/cssparser.h
412===================================================================
413--- libgtkhtml/css/cssparser.h.orig 2006-02-04 20:10:47.000000000 +0000
414+++ libgtkhtml/css/cssparser.h 2006-02-05 18:19:15.000000000 +0000
415@@ -24,13 +24,14 @@
416 #define __CSSPARSER_H__
417
418 #include <glib.h>
419+#include <regex.h>
420
421 #include "cssstylesheet.h"
422
423 G_BEGIN_DECLS
424
425-CssStylesheet *css_parser_parse_stylesheet (const gchar *str, gint len);
426-CssRuleset *css_parser_parse_style_attr (const gchar *buffer, gint len);
427+CssStylesheet *css_parser_parse_stylesheet (const gchar *str, gint len, const gchar *base_url);
428+CssRuleset *css_parser_parse_style_attr (const gchar *buffer, gint len, const gchar *base_url);
429
430 G_END_DECLS
431
432Index: libgtkhtml/css/cssstylesheet.h
433===================================================================
434--- libgtkhtml/css/cssstylesheet.h.orig 2006-02-04 20:10:47.000000000 +0000
435+++ libgtkhtml/css/cssstylesheet.h 2006-02-05 18:19:15.000000000 +0000
436@@ -181,6 +181,7 @@ struct _CssTail {
437 };
438
439 struct _CssStylesheet {
440+ gchar *url;
441 gboolean disabled;
442 GSList *stat;
443 };
444Index: libgtkhtml/css/cssvalue.c
445===================================================================
446--- libgtkhtml/css/cssvalue.c.orig 2006-02-04 20:10:47.000000000 +0000
447+++ libgtkhtml/css/cssvalue.c 2006-02-04 20:13:33.000000000 +0000
448@@ -64,7 +64,7 @@ css_value_function_new (HtmlAtom name, C
449 function->name = name;
450 function->args = args;
451
452- result = g_new (CssValue, 1);
453+ result = g_new0 (CssValue, 1);
454 result->ref_count = 1;
455 result->value_type = CSS_FUNCTION;
456 result->v.function = function;
457Index: libgtkhtml/document/htmldocument.c
458===================================================================
459--- libgtkhtml/document/htmldocument.c.orig 2006-02-04 20:10:47.000000000 +0000
460+++ libgtkhtml/document/htmldocument.c 2006-02-05 18:19:17.000000000 +0000
461@@ -134,14 +134,42 @@ static void
462 html_document_stylesheet_stream_close (const gchar *buffer, gint len, gpointer data)
463 {
464 CssStylesheet *sheet;
465- HtmlDocument *document = HTML_DOCUMENT (data);
466+ HtmlDocumentStreamData *stream_data = (HtmlDocumentStreamData *) data;
467+ HtmlDocument *document = stream_data->document;
468 HtmlStyleChange style_change;
469-
470+ GSList *list;
471+
472 if (!buffer)
473 return;
474
475- sheet = css_parser_parse_stylesheet (buffer, len);
476+ sheet = css_parser_parse_stylesheet (buffer, len, (gchar *) stream_data->internal_data);
477+ g_free(stream_data->internal_data);
478+ stream_data->internal_data = NULL;
479+
480+ for (list = sheet->stat; list; list = list->next) {
481+ CssStatement *statement = list->data;
482+ HtmlStream *stream;
483+
484+ switch (statement->type) {
485+ case CSS_IMPORT_RULE: {
486+ HtmlDocumentStreamData *stream_data_import;
487+ gchar *url;
488+
489+ url = css_value_to_string (statement->s.import_rule.url);
490+ stream_data_import = g_new (HtmlDocumentStreamData, 1);
491+ stream_data_import->document = stream_data->document;
492+ stream_data_import->internal_data = g_strdup(url);
493+ stream = html_stream_buffer_new (html_document_stylesheet_stream_close, stream_data_import);
494+ g_signal_emit (G_OBJECT (document), document_signals [REQUEST_URL], 0, url, stream);
495+ g_free (url);
496+ break;
497+ }
498+ default:
499+ break;
500+ }
501+ }
502
503+ g_free (stream_data);
504 document->stylesheets = g_slist_append (document->stylesheets, sheet);
505
506 /* Restyle the document */
507@@ -179,9 +207,15 @@ html_document_node_inserted_traverser (H
508
509 if (str && (strcasecmp (str, "stylesheet") == 0)) {
510 gchar *url = xmlGetProp (node->xmlnode, "href");
511-
512 if (url) {
513- HtmlStream *stream = html_stream_buffer_new (html_document_stylesheet_stream_close, document);
514+ HtmlDocumentStreamData *stream_data;
515+ HtmlStream *stream;
516+
517+ stream_data = g_new (HtmlDocumentStreamData, 1);
518+ stream_data->document = document;
519+ stream_data->internal_data = g_strdup(url);
520+
521+ stream = html_stream_buffer_new (html_document_stylesheet_stream_close, stream_data);
522
523 g_signal_emit (G_OBJECT (document), document_signals [REQUEST_URL], 0, url, stream);
524 }
525@@ -242,12 +276,39 @@ html_document_node_inserted_traverser (H
526
527 CssStylesheet *ss;
528 HtmlStyleChange style_change;
529-
530- ss = css_parser_parse_stylesheet (node->xmlnode->content, strlen (node->xmlnode->content));
531- document->stylesheets = g_slist_append (document->stylesheets, ss);
532+ GSList *list;
533+
534+ ss = css_parser_parse_stylesheet (node->xmlnode->content, strlen (node->xmlnode->content), NULL);
535+
536+ for (list = ss->stat; list; list = list->next) {
537+ CssStatement *statement = list->data;
538+ HtmlStream *stream;
539+
540+ switch (statement->type) {
541+ case CSS_IMPORT_RULE: {
542+ gchar *cssurl;
543+ HtmlDocumentStreamData *stream_data;
544+
545+ cssurl = css_value_to_string (statement->s.import_rule.url);
546+
547+ stream_data = g_new (HtmlDocumentStreamData, 1);
548+ stream_data->document = document;
549+ stream_data->internal_data = g_strdup(cssurl);
550+
551+ stream = html_stream_buffer_new (html_document_stylesheet_stream_close, stream_data);
552+ g_signal_emit (G_OBJECT (document), document_signals [REQUEST_URL], 0, cssurl, stream);
553+ g_free (cssurl);
554+ break;
555+ }
556+ default:
557+ break;
558+ }
559+ }
560+
561+ document->stylesheets = g_slist_append ( document->stylesheets, ss);
562
563 /* Restyle the document */
564- style_change = html_document_restyle_node (document, DOM_NODE (dom_Document__get_documentElement (document->dom_document)), NULL, TRUE);
565+ style_change = html_document_restyle_node (document, DOM_NODE (dom_Document__get_documentElement ( document->dom_document)), NULL, TRUE);
566 g_signal_emit (G_OBJECT (document), document_signals [STYLE_UPDATED], 0, DOM_NODE (dom_Document__get_documentElement (document->dom_document)), style_change);
567 }
568 else if ((node->xmlnode->type == XML_TEXT_NODE || node->xmlnode->type == XML_COMMENT_NODE) && node->xmlnode->parent && strcasecmp (node->xmlnode->parent->name, "script") == 0) {
569Index: libgtkhtml/document/htmldocument.h
570===================================================================
571--- libgtkhtml/document/htmldocument.h.orig 2006-02-04 20:10:47.000000000 +0000
572+++ libgtkhtml/document/htmldocument.h 2006-02-05 18:19:17.000000000 +0000
573@@ -25,6 +25,7 @@
574
575 typedef struct _HtmlDocument HtmlDocument;
576 typedef struct _HtmlDocumentClass HtmlDocumentClass;
577+typedef struct _HtmlDocumentStreamData HtmlDocumentStreamData;
578
579 #include <gtk/gtk.h>
580
581@@ -93,6 +94,10 @@ struct _HtmlDocumentClass {
582 gboolean (*dom_mouse_out) (HtmlDocument *document, DomEvent *event);
583 };
584
585+struct _HtmlDocumentStreamData {
586+ HtmlDocument *document;
587+ gpointer internal_data;
588+};
589
590 GType html_document_get_type (void);
591
592Index: libgtkhtml/layout/htmlboxblock.c
593===================================================================
594--- libgtkhtml/layout/htmlboxblock.c.orig 2006-02-04 20:10:47.000000000 +0000
595+++ libgtkhtml/layout/htmlboxblock.c 2006-02-04 20:13:33.000000000 +0000
596@@ -100,17 +100,21 @@ html_real_box_block_update_geometry (Htm
597 HtmlBoxBlock *block = HTML_BOX_BLOCK (self);
598 gint full_width;
599
600+#if 0
601 if (relayout->get_min_width || relayout->get_max_width) {
602+#endif
603
604 /* Only expand the width of the block box if the width is of type "auto" */
605 if (HTML_BOX_GET_STYLE (self)->box->width.type == HTML_LENGTH_AUTO && line->width > *boxwidth) {
606-
607+
608 *boxwidth = line->width;
609 block->containing_width = line->width;
610 self->width = *boxwidth + html_box_horizontal_mbp_sum (self);
611 block->force_relayout = TRUE;
612 }
613+#if 0
614 }
615+#endif
616 full_width = MAX (line->width, line->full_width);
617
618 if (full_width > block->full_width)
619Index: libgtkhtml/view/htmlevent.c
620===================================================================
621--- libgtkhtml/view/htmlevent.c.orig 2006-02-04 20:10:47.000000000 +0000
622+++ libgtkhtml/view/htmlevent.c 2006-02-04 20:13:33.000000000 +0000
623@@ -46,14 +46,48 @@ html_event_find_parent_dom_node (HtmlBox
624 static gboolean
625 html_event_xy_in_box (HtmlBox *box, gint tx, gint ty, gint x, gint y)
626 {
627+ gint ox, oy;
628+ gboolean rv;
629+
630+ ox = box->x;
631+ oy = box->y;
632+
633+ rv = TRUE;
634+
635+ if ((HTML_BOX_GET_STYLE (box)->position == HTML_POSITION_RELATIVE ||
636+ HTML_BOX_GET_STYLE (box)->position == HTML_POSITION_ABSOLUTE)) {
637+ gint width = html_box_get_containing_block_width (box);
638+ gint height = html_box_get_containing_block_height (box);
639+
640+ if (HTML_BOX_GET_STYLE (box)->surround->position.left.type != HTML_LENGTH_AUTO)
641+ box->x += html_length_get_value (&HTML_BOX_GET_STYLE (box)->surround->position.left, width);
642+ else if (HTML_BOX_GET_STYLE (box)->surround->position.right.type != HTML_LENGTH_AUTO) {
643+ if (HTML_BOX_GET_STYLE (box)->display == HTML_DISPLAY_INLINE)
644+ box->x -= html_length_get_value (&HTML_BOX_GET_STYLE (box)->surround->position.right, width);
645+ else
646+ box->x += width - box->width - html_length_get_value (&HTML_BOX_GET_STYLE (box)->surround->position.right, width);
647+ }
648+ if (HTML_BOX_GET_STYLE (box)->surround->position.top.type != HTML_LENGTH_AUTO)
649+ box->y += html_length_get_value (&HTML_BOX_GET_STYLE (box)->surround->position.top, height);
650+
651+ else if (HTML_BOX_GET_STYLE (box)->surround->position.bottom.type != HTML_LENGTH_AUTO) {
652+ if (HTML_BOX_GET_STYLE (box)->display == HTML_DISPLAY_INLINE)
653+ box->y -= html_length_get_value (&HTML_BOX_GET_STYLE (box)->surround->position.bottom, height);
654+ else
655+ box->y += height - box->height - html_length_get_value (&HTML_BOX_GET_STYLE (box)->surround->position.bottom, height);
656+ }
657+ }
658
659 if (x < box->x + tx ||
660 x > box->x + tx + box->width ||
661 y < box->y + ty ||
662 y > box->y + ty + box->height)
663- return FALSE;
664+ rv = FALSE;
665+
666+ box->x = ox;
667+ box->y = oy;
668
669- return TRUE;
670+ return rv;
671 }
672
673 static void
674@@ -64,12 +98,6 @@ html_event_find_box_traverser (HtmlBox *
675 box = self->children;
676
677 while (box) {
678-
679- /* Ignore positioned boxes, because their ->x and->y positions is not their correct positions */
680- if (HTML_BOX_GET_STYLE (box)->position != HTML_POSITION_STATIC) {
681- box = box->next;
682- continue;
683- }
684 /* These boxes always has x = 0, y = 0, w = 0 and h = 0 so we have to do
685 * a special case for these */
686 if (HTML_IS_BOX_INLINE (box) || HTML_IS_BOX_TABLE_ROW_GROUP (box) || HTML_IS_BOX_FORM (box)) {