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);