Index: a11y/ChangeLog
===================================================================
--- a11y/ChangeLog	(revision 8954)
+++ a11y/ChangeLog	(working copy)
@@ -1,3 +1,15 @@
+2008-09-03  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #516680
+
+	* object.c: (gtk_html_a11y_grab_focus_cb):
+	Remember focus object same as in other functions.
+	* object.c: (gtk_html_a11y_cursor_changed_cb), (gtk_html_a11y_new),
+	(gtk_html_a11y_insert_object_cb), (gtk_html_a11y_delete_object_cb):
+	Do not touch gail's focus object data, rather keep all work
+	on atk_focus_tracker_notify. Also removed one forgotten printf
+	and added one atk_focus_tracker_notify.
+
 2007-07-03  Li Yuan  <li.yuan@sun.com>
 
 	* object.c: (gtk_html_a11y_delete_object_cb):
Index: a11y/object.c
===================================================================
--- a11y/object.c	(revision 8954)
+++ a11y/object.c	(working copy)
@@ -303,6 +303,8 @@ gtk_html_a11y_get_focus_object (GtkWidge
 	return obj;
 }
 
+static AtkObject * gtk_html_a11y_focus_object = NULL;
+
 static void
 gtk_html_a11y_grab_focus_cb(GtkWidget * widget)
 {
@@ -314,18 +316,14 @@ gtk_html_a11y_grab_focus_cb(GtkWidget * 
 		return;
 
 	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);
 
+	gtk_html_a11y_focus_object = focus_object;
 	atk_focus_tracker_notify (focus_object);
-
 }
 
-
-static AtkObject * gtk_html_a11y_focus_object = NULL;
-
 static void
 gtk_html_a11y_cursor_changed_cb (GtkWidget *widget)
 {
@@ -337,7 +335,6 @@ gtk_html_a11y_cursor_changed_cb (GtkWidg
 
 	if (gtk_html_a11y_focus_object != focus_object) {
 		gtk_html_a11y_focus_object = focus_object;
-        	g_object_set_data (G_OBJECT(obj), "gail-focus-object", focus_object);
         	atk_focus_tracker_notify (focus_object);
 	} else {
 		if (G_IS_HTML_A11Y_TEXT(focus_object)) {
@@ -364,7 +361,6 @@ gtk_html_a11y_insert_object_cb (GtkWidge
 
 	if (gtk_html_a11y_focus_object != a11y) {
 		gtk_html_a11y_focus_object = a11y;
-        	g_object_set_data (G_OBJECT(obj), "gail-focus-object", a11y);
         	atk_focus_tracker_notify (a11y);
 	}
 
@@ -378,7 +374,6 @@ static void
 gtk_html_a11y_delete_object_cb (GtkWidget * widget, int pos, int len)
 {
 	AtkObject * a11y, *obj;
-	HTMLCursor *cursor = GTK_HTML (widget)->engine->cursor;
 
         obj = gtk_widget_get_accessible (widget);
 	a11y = gtk_html_a11y_get_focus_object (widget);
@@ -386,13 +381,11 @@ gtk_html_a11y_delete_object_cb (GtkWidge
 
 	if (gtk_html_a11y_focus_object != a11y) {
 		gtk_html_a11y_focus_object = a11y;
-        	g_object_set_data (G_OBJECT(obj), "gail-focus-object", a11y);
         	atk_focus_tracker_notify (a11y);
 	}
 
 	if (G_IS_HTML_A11Y_TEXT(a11y)) {
 		g_signal_emit_by_name (a11y, "text_changed::delete", pos, len);
-		printf ("the cur is %d\n", cursor->offset);
 	}
 }
 
@@ -432,7 +425,7 @@ gtk_html_a11y_new (GtkWidget *widget)
 
 	if (focus_object && gtk_html_a11y_focus_object != focus_object) {
 		gtk_html_a11y_focus_object = focus_object;
-		g_object_set_data (G_OBJECT (accessible), "gail-focus-object", focus_object);
+		atk_focus_tracker_notify (focus_object);
 	}
 
 	return accessible;
