summaryrefslogtreecommitdiffstats
path: root/openembedded/packages/gtkhtml2/files/fix-recreation2.patch
blob: 92a8c8fd212d9de361935e6b430534151d6a2904 (plain)
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
Index: libgtkhtml/view/htmlview.c
===================================================================
--- libgtkhtml/view/htmlview.c.orig	2006-02-11 05:06:22.000000000 +0000
+++ libgtkhtml/view/htmlview.c	2006-02-11 05:07:01.000000000 +0000
@@ -2135,38 +2135,31 @@ html_view_style_updated (HtmlDocument *d
 		HtmlBox *new_box = NULL;
 
 		/* Don't replace boxes where display: none has been set */
-		if (style->display == HTML_DISPLAY_NONE) {
-			html_view_removed (document, node, view);
+		if (!style || style->display == HTML_DISPLAY_NONE)
 			break;
-		}
 
 		new_box = html_box_factory_new_box (view, node, TRUE);
 		g_assert (new_box);
 	
 		new_box->dom_node = node;
 		g_object_add_weak_pointer (G_OBJECT (node), (gpointer *)&(new_box->dom_node));
+		html_box_handle_html_properties (new_box, node->xmlnode);				
 		new_box->next = box->next;
 		new_box->prev = box->prev;
 		new_box->parent = box->parent;
-		new_box->children = box->children;
 		
-		if (box->next) box->next->prev = new_box;
-		if (box->prev) box->prev->next = new_box;
-		if (box->parent)
+		if (box->parent) {
 			if (box->parent->children == box)
 				box->parent->children = new_box;
+		}
+		if (box->next) box->next->prev = new_box;
+		if (box->prev) box->prev->next = new_box;
 		if (box->children) {
 			HtmlBox *child = box->children;
 			while (child) {
-				if (child->parent == box)
-					child->parent = new_box;
-				child = child->prev;
-			}
-			child = box->children->next;
-			while (child) {
-				if (child->parent == box)
-					child->parent = new_box;
-				child = child->next;
+				HtmlBox *temp = child->next;
+				html_box_append_child (new_box, child);
+				child = temp;
 			}
 		}
 		
@@ -2176,7 +2169,6 @@ html_view_style_updated (HtmlDocument *d
 		html_view_remove_layout_box (view, node);
 		g_object_unref (box);
 		
-		html_box_handle_html_properties (new_box, node->xmlnode);				
 		html_view_add_layout_box (view, node, new_box);
 		html_view_relayout_callback (document, node, view);
 		break;
Index: libgtkhtml/graphics/htmlimage.c
===================================================================
--- libgtkhtml/graphics/htmlimage.c.orig	2006-02-11 05:06:22.000000000 +0000
+++ libgtkhtml/graphics/htmlimage.c	2006-02-11 05:06:34.000000000 +0000
@@ -142,6 +142,7 @@ static void
 html_image_init (HtmlImage *image)
 {
 	image->pixbuf = NULL;
+	image->stream = NULL;
 	image->broken = FALSE;
 	image->loading = FALSE;
 	image->loader = gdk_pixbuf_loader_new ();
Index: libgtkhtml/graphics/htmlimagefactory.c
===================================================================
--- libgtkhtml/graphics/htmlimagefactory.c.orig	2006-02-11 05:06:22.000000000 +0000
+++ libgtkhtml/graphics/htmlimagefactory.c	2006-02-11 05:07:43.000000000 +0000
@@ -146,7 +146,7 @@ html_image_factory_get_image (HtmlImageF
 		
 		image = HTML_IMAGE (g_object_new (HTML_IMAGE_TYPE, NULL));
 
-		g_object_weak_ref (G_OBJECT (image), (GWeakNotify)html_image_shutdown, image_factory);
+		g_signal_connect_swapped (G_OBJECT (image), "last_unref", G_CALLBACK (html_image_shutdown), image_factory);
 		
 		image->loading = TRUE;
 		
@@ -154,6 +154,7 @@ html_image_factory_get_image (HtmlImageF
 					  image);
 
 		image->stream = stream;
+		g_object_add_weak_pointer (G_OBJECT (stream), (gpointer *) &(image->stream));
 		g_object_add_weak_pointer (G_OBJECT (image), (gpointer *) &(stream->user_data));
 
 		g_signal_emit (G_OBJECT (image_factory), image_factory_signals [REQUEST_IMAGE], 0, uri, stream);