2009-06-08 Xan Lopez <xlopez@igalia.com>
authorxan@webkit.org <xan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Jun 2009 13:10:46 +0000 (13:10 +0000)
committerxan@webkit.org <xan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Jun 2009 13:10:46 +0000 (13:10 +0000)
        Reviewed by Jan Alonzo.

        https://bugs.webkit.org/show_bug.cgi?id=25415
        [GTK][ATK] Please implement support for get_text_at_offset

        Reduce duplicated code to access the text of a AtkText
        object. doAXStringForRange calls text() internally, so we are
        doing exactly the same after the change.

        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
        (getGailTextUtilForAtk):
        (getPangoLayoutForAtk):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@44559 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp

index 18dcb9dcc11e4f0f450c96093ab809ee561deaed..1cc18a3bf3de4ddaeadebbc632edfef8f1e8f694 100644 (file)
@@ -5,14 +5,13 @@
         https://bugs.webkit.org/show_bug.cgi?id=25415
         [GTK][ATK] Please implement support for get_text_at_offset
 
-        Use GailUtilText instead of my crappy partial reimplementation of
-        it. This should add support for LINE boundaries too, although it's
-        mostly untested for now.
+        Reduce duplicated code to access the text of a AtkText
+        object. doAXStringForRange calls text() internally, so we are
+        doing exactly the same after the change.
 
         * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
         (getGailTextUtilForAtk):
-        (webkit_accessible_text_get_text_after_offset):
-        (webkit_accessible_text_get_text_at_offset):
+        (getPangoLayoutForAtk):
 
 2009-06-10  Xan Lopez  <xlopez@igalia.com>
 
         (webkit_accessible_text_get_text_after_offset):
         (webkit_accessible_text_get_text_at_offset):
 
+2009-06-10  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Jan Alonzo.
+
+        https://bugs.webkit.org/show_bug.cgi?id=25415
+        [GTK][ATK] Please implement support for get_text_at_offset
+
+        Use GailUtilText instead of my crappy partial reimplementation of
+        it. This should add support for LINE boundaries too, although it's
+        mostly untested for now.
+
+        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+        (getGailTextUtilForAtk):
+        (webkit_accessible_text_get_text_after_offset):
+        (webkit_accessible_text_get_text_at_offset):
+
 2009-06-10  Jan Michael Alonzo  <jmalonzo@webkit.org>
 
         Gtk build fix: include <stdio.h> as it is required in jpeglib.h
index 25e090df1cbd2395959b098b246ac5f40850f656..7ca65d2ae3edd93042821e11595258d595c45225 100644 (file)
@@ -490,16 +490,8 @@ static GailTextUtil* getGailTextUtilForAtk(AtkText* textObject)
     if (data)
         return static_cast<GailTextUtil*>(data);
 
-    String text;
-    AccessibilityObject* coreObject = core(textObject);
-
-    if (coreObject->isTextControl())
-        text = coreObject->text();
-    else
-        text = coreObject->textUnderElement();
-
     GailTextUtil* gailTextUtil = gail_text_util_new();
-    gail_text_util_text_setup(gailTextUtil, text.utf8().data());
+    gail_text_util_text_setup(gailTextUtil, webkit_accessible_text_get_text(textObject, 0, -1));
     g_object_set_data_full(G_OBJECT(textObject), "webkit-accessible-gail-text-util", gailTextUtil, g_object_unref);
     return gailTextUtil;
 }
@@ -522,23 +514,18 @@ static PangoLayout* getPangoLayoutForAtk(AtkText* textObject)
     if (data)
         return static_cast<PangoLayout*>(data);
 
-    String text;
     AccessibilityObject* coreObject = core(textObject);
 
-    if (coreObject->isTextControl())
-        text = coreObject->text();
-    else
-        text = coreObject->textUnderElement();
-
     HostWindow* hostWindow = coreObject->document()->view()->hostWindow();
     if (!hostWindow)
         return 0;
     PlatformWidget webView = hostWindow->platformWindow();
     if (!webView)
         return 0;
+
     g_signal_connect(webView, "style-set", G_CALLBACK(updateLayout), textObject);
     g_signal_connect(webView, "direction-changed", G_CALLBACK(updateLayout), textObject);
-    PangoLayout* layout = gtk_widget_create_pango_layout(static_cast<GtkWidget*>(webView), text.utf8().data());
+    PangoLayout* layout = gtk_widget_create_pango_layout(static_cast<GtkWidget*>(webView), webkit_accessible_text_get_text(textObject, 0, -1));
     g_object_set_data_full(G_OBJECT(textObject), "webkit-accessible-pango-layout", layout, g_object_unref);
     return layout;
 }