Re: [evolution-patches] Re: seek review for bug 47024: implement set/get_caret_offset method of AtkText interface



Hi York,

On Sun, 2003-08-03 at 11:14, yuedong du wrote:
> Hi Radek,
> 
> Attached is newer version of the patch. Please review.
> This patch trying to fix the html_a11y_get_gtkhtml_parent(). There are 2
> reasons that why the function not work:
> 
> 1. ClueV do not have corresponding accessible object. So the process of
> finding gtkhtml parent will terminate when it reach cluev object. So I
> just add in html_utils_get_accesible
> +       case HTML_TYPE_CLUEV:
> +               accessible = html_a11y_new (o, ATK_ROLE_INVALID);
> +               break;

This doesn't seem quite right, cluev should not have role INVALID
(why?). by default branch in switch statement it will get accessible
object with role UNKNOWN which should be OK. So I don't see reason for
this.

> 2. ClueV->parent will not point to the gtkhtml widget. The 'parent
> pointers' only work in HTML Object tree. gtkhtml is outside of this
> tree.  This can be resolved, however, because atk let us to set atk
> parent of the cluev to the gtkhtml.
> 
> This patch set atk parent relationship in 2 places:
> 
> a. When new the gtkhtml a11y object,
> 
>        g_signal_connect_after(widget, "cursor_move",
>                         G_CALLBACK(gtk_html_a11y_cursor_move_cb),
>                         NULL);
> +       html_utils_get_accessible(GTK_HTML(widget)->engine->clue,
> accessible);
>                                                                                 
>         /* printf ("created new gtkhtml accessible object\n"); */
> ... ...
> 
> 	html_utils_get_accessible() will set the parent relationship.
> 
> b. And when gtkhtml widget grab focus,
> +
> +       clue = html_utils_get_accessible(GTK_HTML(widget)->engine->clue,
> obj);
> +       atk_object_set_parent(clue, obj);
> +
> 
> Because when user read another mail, gtkhtml will reconstruct the html
> object tree. So clue will change, and we need to re-setup
> 'clue->gtkhtml' relationship.

This looks OK. I hope it's the only way it can happen.

> And finally, the patch assume each htmlobject tree start at cluev. Below
> is dump from testgtkhtml. Although the patch work fine in my
> environment, I think it need your confirmation.

Yeah, it starts always with engine->cluev. At least for now. Larry is
refactoring parser in trunk so it may change, but for 1.4.x you are
safe.

Also this change doesn't seem to be quite right:

@@ -160,7 +160,7 @@
 
                parent_obj = get_parent_html (accessible);
                if (parent_obj) {
-                       parent = HTML_OBJECT_ACCESSIBLE (parent_obj);
+                       parent = html_utils_get_accessible (parent_obj, NULL);
                }
        }

I think you have to create recursively accessible objects for all
parents of parent_obj here.

Cheers
Radek





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]