Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/a11y/ChangeLog,v
retrieving revision 1.19
diff -u -p -r1.19 ChangeLog
--- ChangeLog	31 Jan 2005 10:46:33 -0000	1.19
+++ ChangeLog	23 Feb 2005 07:03:55 -0000
@@ -1,3 +1,13 @@
+2005-02-22  Mengjie Yu  <meng-jie.yu@sun.com>
+
+	* object.c: (gtk_html_a11y_get_focus_object),
+	(gtk_html_a11y_grab_focus_cb), (gtk_html_a11y_cursor_changed_cb),
+	(gtk_html_a11y_insert_object_cb), (gtk_html_a11y_delete_object_cb):
+	use html_engine_get_focus_object to get the focus_object while 
+	cared_mode is off and gtkhtml widget is not editable.
+
+        Fixes #72842
+
 2005-01-02  Mengjie Yu  <meng-jie.yu@sun.com>
 
 	Fix for 70130 and 70683.        
Index: object.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/a11y/object.c,v
retrieving revision 1.9
diff -u -p -r1.9 object.c
--- object.c	26 Jan 2005 07:51:49 -0000	1.9
+++ object.c	23 Feb 2005 07:03:56 -0000
@@ -283,10 +283,17 @@ gtk_html_a11y_get_focus_object (GtkWidge
 	GtkHTML * html;
 	HTMLObject * htmlobj = NULL;
         AtkObject *obj = NULL;
+	gint offset;
 
 	html = GTK_HTML(widget);
-	if (html->engine && html->engine->cursor)
+
+	g_return_val_if_fail (html && html->engine, NULL);
+
+	if (!html->engine->caret_mode && !gtk_html_get_editable (html))
+		htmlobj = html_engine_get_focus_object (html->engine, &offset);
+	else if (html->engine && html->engine->cursor)
 		htmlobj = html->engine->cursor->object;
+
 	if (htmlobj)
 		obj = html_utils_get_accessible (htmlobj, NULL);
 
@@ -299,14 +306,15 @@ gtk_html_a11y_grab_focus_cb(GtkWidget * 
         AtkObject *focus_object, *obj, *clue;
 
 
-	 focus_object = gtk_html_a11y_get_focus_object (widget);
-        obj = gtk_widget_get_accessible (widget);
-        g_object_set_data (G_OBJECT(obj), "gail-focus-object", focus_object);
+	focus_object = gtk_html_a11y_get_focus_object (widget);
+	g_return_if_fail (focus_object != NULL);
+	obj = gtk_widget_get_accessible (widget);
+	g_object_set_data (G_OBJECT(obj), "gail-focus-object", focus_object);
 
 	clue = html_utils_get_accessible(GTK_HTML(widget)->engine->clue, obj);
 	atk_object_set_parent(clue, obj);
 
-        atk_focus_tracker_notify (focus_object);
+	atk_focus_tracker_notify (focus_object);
 
 }
 
@@ -318,8 +326,9 @@ gtk_html_a11y_cursor_changed_cb (GtkWidg
 {
         AtkObject *focus_object, *obj;
 
-	focus_object = gtk_html_a11y_get_focus_object (widget);
-       obj = gtk_widget_get_accessible (widget);
+	focus_object = gtk_html_a11y_get_focus_object (widget);  
+	g_return_if_fail (focus_object != NULL);
+	obj = gtk_widget_get_accessible (widget);
 	
 	if (gtk_html_a11y_focus_object != focus_object) {
 		gtk_html_a11y_focus_object = focus_object;
@@ -342,6 +351,7 @@ gtk_html_a11y_insert_object_cb (GtkWidge
 
         obj = gtk_widget_get_accessible (widget);
 	a11y = gtk_html_a11y_get_focus_object (widget);
+	g_return_if_fail (a11y != NULL);
 
 	if (gtk_html_a11y_focus_object != a11y) {
 		gtk_html_a11y_focus_object = a11y;
@@ -362,6 +372,7 @@ gtk_html_a11y_delete_object_cb (GtkWidge
 
         obj = gtk_widget_get_accessible (widget);
 	a11y = gtk_html_a11y_get_focus_object (widget);
+	g_return_if_fail (a11y != NULL);
 
 	if (gtk_html_a11y_focus_object != a11y) {
 		gtk_html_a11y_focus_object = a11y;
