+2009-06-10 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ https://bugs.webkit.org/show_bug.cgi?id=25609
+ [GTK] Implement support for get_selection and get_n_selections
+
+ Implement atk_text_get_selection.
+
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (webkit_accessible_text_get_selection):
+
2009-06-10 Xan Lopez <xlopez@igalia.com>
Reviewed by Gustavo Noronha.
static gchar* webkit_accessible_text_get_selection(AtkText* text, gint selection_num, gint* start_offset, gint* end_offset)
{
- notImplemented();
- return NULL;
+ if (selection_num != 0) {
+ // WebCore does not support multiple selection, so anything but 0 does not make sense for now.
+ *start_offset = *end_offset = 0;
+ return NULL;
+ }
+
+ AccessibilityObject* coreObject = core(text);
+ VisibleSelection selection = coreObject->selection();
+ *start_offset = selection.start().offsetInContainerNode();
+ *end_offset = selection.end().offsetInContainerNode();
+
+ return webkit_accessible_text_get_text(text, *start_offset, *end_offset);
}
static gboolean webkit_accessible_text_add_selection(AtkText* text, gint start_offset, gint end_offset)