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
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;
}
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;
}