Skip to content
Permalink
Browse files
WebCore:
2009-10-28  Xan Lopez  <xlopez@igalia.com>

        Reviewed by Jan Alonzo.

        [Gtk] Extraneous object of ROLE_PANEL in hierarchy for entries
        https://bugs.webkit.org/show_bug.cgi?id=25897

        Make text controls always implement the text interface, and the
        editable text interface when they are not read only. This is what
        ATK-users expect.

        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
        (getInterfaceMaskFromObject):

WebKit/gtk:

2009-10-28  Xan Lopez  <xlopez@igalia.com>

        Reviewed by Jan Alonzo.

        [Gtk] Extraneous object of ROLE_PANEL in hierarchy for entries
        https://bugs.webkit.org/show_bug.cgi?id=25897

        Update test to also check that entries implement the AtkText
        interface.

        * tests/testatk.c:
        (run_get_text_tests):
        (test_webkit_atk_get_text_at_offset_forms):
        (test_webkit_atk_get_text_at_offset):
        (main):

Canonical link: https://commits.webkit.org/41650@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Xan Lopez committed Oct 28, 2009
1 parent e2e7de9 commit 52235bd6e794207b05993e7ff784c182fb65df88
Showing with 100 additions and 34 deletions.
  1. +14 −0 WebCore/ChangeLog
  2. +3 −5 WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
  3. +16 −0 WebKit/gtk/ChangeLog
  4. +67 −29 WebKit/gtk/tests/testatk.c
@@ -1,3 +1,17 @@
2009-10-28 Xan Lopez <xlopez@igalia.com>

Reviewed by Jan Alonzo.

[Gtk] Extraneous object of ROLE_PANEL in hierarchy for entries
https://bugs.webkit.org/show_bug.cgi?id=25897

Make text controls always implement the text interface, and the
editable text interface when they are not read only. This is what
ATK-users expect.

* accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
(getInterfaceMaskFromObject):

2009-10-27 Holger Hans Peter Freyther <zecke@selfish.org>

Reviewed by Simon Fraser.
@@ -1230,11 +1230,9 @@ static guint16 getInterfaceMaskFromObject(AccessibilityObject* coreObject)

if (role == StaticTextRole)
interfaceMask |= 1 << WAI_TEXT;

if (coreObject->isAccessibilityRenderObject() && coreObject->isTextControl()) {
if (coreObject->isReadOnly())
interfaceMask |= 1 << WAI_TEXT;
else
else if (coreObject->isAccessibilityRenderObject() && coreObject->isTextControl()) {
interfaceMask |= 1 << WAI_TEXT;
if (!coreObject->isReadOnly())
interfaceMask |= 1 << WAI_EDITABLE_TEXT;
}

@@ -1,3 +1,19 @@
2009-10-28 Xan Lopez <xlopez@igalia.com>

Reviewed by Jan Alonzo.

[Gtk] Extraneous object of ROLE_PANEL in hierarchy for entries
https://bugs.webkit.org/show_bug.cgi?id=25897

Update test to also check that entries implement the AtkText
interface.

* tests/testatk.c:
(run_get_text_tests):
(test_webkit_atk_get_text_at_offset_forms):
(test_webkit_atk_get_text_at_offset):
(main):

2009-10-26 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>

Unreviewed. Update documentation control files for 1.1.16.
@@ -50,36 +50,9 @@ static void test_get_text_function(AtkText* text_obj, AtkGetTextFunction fn, Atk
g_free(text);
}

static void test_webkit_atk_get_text_at_offset(void)
static void run_get_text_tests(AtkText* text_obj)
{
WebKitWebView* webView;
AtkObject *obj;
GMainLoop* loop;
AtkText* text_obj;
char* text;

webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
g_object_ref_sink(webView);
GtkAllocation alloc = { 0, 0, 800, 600 };
gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc);
webkit_web_view_load_string(webView, contents, NULL, NULL, NULL);
loop = g_main_loop_new(NULL, TRUE);

g_timeout_add(100, (GSourceFunc)bail_out, loop);
g_main_loop_run(loop);

/* Get to the inner AtkText object */
obj = gtk_widget_get_accessible(GTK_WIDGET(webView));
g_assert(obj);
obj = atk_object_ref_accessible_child(obj, 0);
g_assert(obj);
obj = atk_object_ref_accessible_child(obj, 0);
g_assert(obj);

text_obj = ATK_TEXT(obj);
g_assert(ATK_IS_TEXT(text_obj));

text = atk_text_get_text(text_obj, 0, -1);
char* text = atk_text_get_text(text_obj, 0, -1);
g_assert_cmpstr(text, ==, "This is a test. This is the second sentence. And this the third.");
g_free(text);

@@ -218,6 +191,70 @@ static void test_webkit_atk_get_text_at_offset(void)
/* ATK_TEXT_BOUNDARY_LINE_END */
test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_END,
0, "This is a test. This is the second sentence. And this the third.", 0, 64);
}

static void test_webkit_atk_get_text_at_offset_forms(void)
{
WebKitWebView* webView;
AtkObject* obj;
GMainLoop* loop;
AtkText* text_obj;

webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
g_object_ref_sink(webView);
GtkAllocation alloc = { 0, 0, 800, 600 };
gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc);
webkit_web_view_load_string(webView, contents, NULL, NULL, NULL);
loop = g_main_loop_new(NULL, TRUE);

g_timeout_add(100, (GSourceFunc)bail_out, loop);
g_main_loop_run(loop);

/* Get to the inner AtkText object */
obj = gtk_widget_get_accessible(GTK_WIDGET(webView));
g_assert(obj);
obj = atk_object_ref_accessible_child(obj, 0);
g_assert(obj);
obj = atk_object_ref_accessible_child(obj, 0);
g_assert(obj);

text_obj = ATK_TEXT(obj);
g_assert(ATK_IS_TEXT(text_obj));

run_get_text_tests(text_obj);

g_object_unref(webView);
}

static void test_webkit_atk_get_text_at_offset(void)
{
WebKitWebView* webView;
AtkObject* obj;
GMainLoop* loop;
AtkText* text_obj;

webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
g_object_ref_sink(webView);
GtkAllocation alloc = { 0, 0, 800, 600 };
gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc);
webkit_web_view_load_string(webView, contents, NULL, NULL, NULL);
loop = g_main_loop_new(NULL, TRUE);

g_timeout_add(100, (GSourceFunc)bail_out, loop);
g_main_loop_run(loop);

/* Get to the inner AtkText object */
obj = gtk_widget_get_accessible(GTK_WIDGET(webView));
g_assert(obj);
obj = atk_object_ref_accessible_child(obj, 0);
g_assert(obj);
obj = atk_object_ref_accessible_child(obj, 0);
g_assert(obj);

text_obj = ATK_TEXT(obj);
g_assert(ATK_IS_TEXT(text_obj));

run_get_text_tests(text_obj);

g_object_unref(webView);
}
@@ -229,6 +266,7 @@ int main(int argc, char** argv)

g_test_bug_base("https://bugs.webkit.org/");
g_test_add_func("/webkit/atk/get_text_at_offset", test_webkit_atk_get_text_at_offset);
g_test_add_func("/webkit/atk/get_text_at_offset_forms", test_webkit_atk_get_text_at_offset_forms);
return g_test_run ();
}

0 comments on commit 52235bd

Please sign in to comment.