Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2112
diff -u -p -r1.2112 ChangeLog
--- ChangeLog	31 Mar 2005 12:44:42 -0000	1.2112
+++ ChangeLog	4 Apr 2005 14:33:09 -0000
@@ -1,3 +1,10 @@
+2005-04-04  Yu Mengjie  <meng-jie.yu@sun.com>
+
+	* gtkhtml.c: (idle_handler), (gtk_html_adjust_cursor_position):
+	Check whether we have iframe_parent.
+
+	Fixes #74055
+
 2005-03-29  Radek Doulik  <rodo@novell.com>
 
 	* test-suite.c (test_cursor_around_anchors): added test for cursor
Index: gtkhtml.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml.c,v
retrieving revision 1.595
diff -u -p -r1.595 gtkhtml.c
--- gtkhtml.c	26 Mar 2005 11:14:52 -0000	1.595
+++ gtkhtml.c	4 Apr 2005 14:33:23 -0000
@@ -145,7 +145,6 @@ enum {
 
 static void     gtk_html_get_property  (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
 static void     gtk_html_set_property  (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-
 #endif
 
 static guint signals [LAST_SIGNAL] = { 0 };
@@ -163,6 +162,7 @@ static gboolean command                (
 static gint     mouse_change_pos       (GtkWidget *widget, GdkWindow *window, gint x, gint y, gint state);
 static void     add_bindings           (GtkHTMLClass *klass);
 static gchar *  get_value_nick         (GtkHTMLCommandType com_type);					
+static void	gtk_html_adjust_cursor_position (GtkHTML *html);
 
 
 /* Values for selection information.  FIXME: what about COMPOUND_STRING and
@@ -362,22 +362,40 @@ idle_handler (gpointer data)
 	html = GTK_HTML (data);
 	engine = html->engine;
 
-	if (html->priv->scroll_timeout_id == 0  &&
-	    html->engine->thaw_idle_id == 0  &&
-	    !html_engine_frozen (html->engine))
-		html_engine_make_cursor_visible (engine);
-
 	if (html->engine->thaw_idle_id == 0 && !html_engine_frozen (html->engine))
 		html_engine_flush_draw_queue (engine);
 
-	gtk_adjustment_set_value (GTK_LAYOUT (html)->hadjustment, (gfloat) engine->x_offset);
-	gtk_adjustment_set_value (GTK_LAYOUT (html)->vadjustment, (gfloat) engine->y_offset);
+	gtk_html_adjust_cursor_position (html);
 
-	gtk_html_private_calc_scrollbars (html, NULL, NULL);
 	
  	html->priv->idle_handler_id = 0;
+
+	while (html->iframe_parent) {
+		html = GTK_HTML (html->iframe_parent);
+		gtk_html_adjust_cursor_position (html);
+		
+	}
 	return FALSE;
 }
+
+
+static void
+gtk_html_adjust_cursor_position (GtkHTML *html)
+{
+	HTMLEngine *e;
+	e = html->engine;
+
+	if (html->priv->scroll_timeout_id == 0  &&
+	    html->engine->thaw_idle_id == 0  &&
+	    !html_engine_frozen (html->engine))
+		html_engine_make_cursor_visible (e);
+
+	gtk_adjustment_set_value (GTK_LAYOUT (html)->hadjustment, (gfloat) e->x_offset);
+	gtk_adjustment_set_value (GTK_LAYOUT (html)->vadjustment, (gfloat) e->y_offset);
+	gtk_html_private_calc_scrollbars (html, NULL, NULL);
+
+}
+
 
 static void
 queue_draw (GtkHTML *html)
