[Linux] remove AtkText stub implementation (flutter/engine#34839)

When Orca has "Speak object under mouse" enabled, it tries to get the
text range extents for any object that implements the AtkText interface
and gets a bit confused by our AtkText stub implementation that merely
returns null for `get_text`.

Removing the stub implementation helps to avoid the issue that Orca
would try to call `atk_text_get_range_extents()` with `start_offset=0`
and `end_offset=0`:

> Atk-CRITICAL **: atk_text_get_range_extents: assertion 'start_offset >= 0 && start_offset < end_offset' failed
This commit is contained in:
J-P Nurmi 2022-08-04 21:33:55 +03:00 committed by GitHub
parent 6e0f658ba9
commit bacc6eb5cc

View File

@ -89,7 +89,6 @@ enum { kProp0, kPropEngine, kPropId, kPropLast };
static void fl_accessible_node_component_interface_init(
AtkComponentIface* iface);
static void fl_accessible_node_action_interface_init(AtkActionIface* iface);
static void fl_accessible_node_text_interface_init(AtkTextIface* iface);
G_DEFINE_TYPE_WITH_CODE(
FlAccessibleNode,
@ -99,9 +98,7 @@ G_DEFINE_TYPE_WITH_CODE(
G_IMPLEMENT_INTERFACE(ATK_TYPE_COMPONENT,
fl_accessible_node_component_interface_init)
G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION,
fl_accessible_node_action_interface_init)
G_IMPLEMENT_INTERFACE(ATK_TYPE_TEXT,
fl_accessible_node_text_interface_init))
fl_accessible_node_action_interface_init))
// Returns TRUE if [flag] has changed between [old_flags] and [flags].
static gboolean flag_is_changed(FlutterSemanticsFlag old_flags,
@ -338,13 +335,6 @@ static const gchar* fl_accessible_node_get_name(AtkAction* action, gint i) {
return data->name;
}
// Implements AtkText::get_text.
static gchar* fl_accessible_node_get_text(AtkText* text,
gint start_offset,
gint end_offset) {
return nullptr;
}
// Implements FlAccessibleNode::set_name.
static void fl_accessible_node_set_name_impl(FlAccessibleNode* self,
const gchar* name) {
@ -475,10 +465,6 @@ static void fl_accessible_node_action_interface_init(AtkActionIface* iface) {
iface->get_name = fl_accessible_node_get_name;
}
static void fl_accessible_node_text_interface_init(AtkTextIface* iface) {
iface->get_text = fl_accessible_node_get_text;
}
static void fl_accessible_node_init(FlAccessibleNode* self) {
FlAccessibleNodePrivate* priv = FL_ACCESSIBLE_NODE_GET_PRIVATE(self);
priv->actions = g_ptr_array_new();