Commit d72f6ed0 authored by Hajime Hoshi's avatar Hajime Hoshi Committed by Commit Bot

Revert "Fix emission of AtkValue property change signal"

This reverts commit 0bc500aa.

Reason for revert: test failures: crbug.com/1017548

Original change's description:
> Fix emission of AtkValue property change signal
> 
> The introduction of text-change signals for the omnibox included a
> regression that prevented the emission of AtkValue property change
> signals. Fix this error and also add an implementation of
> atk_value_set_value. The implementation is used in a test to verify the
> correct behavior.
> 
> The fix is that we correct the misuse of a logical operator and now
> always try to emit AtkValue property change events when receiving the
> kValueChanged event in AXPlatformNodeAuraLinux.
> 
> Bug: 1015387
> Change-Id: I18baa44a52190913ff70708bd5133bdcdea83b9e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1871692
> Auto-Submit: Martin Robinson <mrobinson@igalia.com>
> Reviewed-by: Joanmarie Diggs <jdiggs@igalia.com>
> Commit-Queue: Martin Robinson <mrobinson@igalia.com>
> Cr-Commit-Position: refs/heads/master@{#707820}

TBR=mrobinson@igalia.com,jdiggs@igalia.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1015387
Change-Id: I621fc94f48a55596ea9117b9a7106be946465b37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1875894Reviewed-by: default avatarHajime Hoshi <hajimehoshi@chromium.org>
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708903}
parent deaf4dd0
...@@ -764,31 +764,11 @@ void GetMinimumIncrement(AtkValue* atk_value, GValue* value) { ...@@ -764,31 +764,11 @@ void GetMinimumIncrement(AtkValue* atk_value, GValue* value) {
value); value);
} }
#if defined(ATK_212)
void SetValue(AtkValue* atk_value, const double new_value) {
g_return_if_fail(ATK_VALUE(atk_value));
AtkObject* atk_object = ATK_OBJECT(atk_value);
AXPlatformNodeAuraLinux* obj = AtkObjectToAXPlatformNodeAuraLinux(atk_object);
if (!obj)
return;
AXActionData data;
data.action = ax::mojom::Action::kSetValue;
data.value = base::NumberToString(new_value);
obj->GetDelegate()->AccessibilityPerformAction(data);
}
#endif // defined(ATK_212)
void Init(AtkValueIface* iface) { void Init(AtkValueIface* iface) {
iface->get_current_value = GetCurrentValue; iface->get_current_value = GetCurrentValue;
iface->get_maximum_value = GetMaximumValue; iface->get_maximum_value = GetMaximumValue;
iface->get_minimum_value = GetMinimumValue; iface->get_minimum_value = GetMinimumValue;
iface->get_minimum_increment = GetMinimumIncrement; iface->get_minimum_increment = GetMinimumIncrement;
#if defined(ATK_212)
iface->set_value = SetValue;
#endif // defined(ATK_212)
} }
const GInterfaceInfo Info = {reinterpret_cast<GInterfaceInitFunc>(Init), const GInterfaceInfo Info = {reinterpret_cast<GInterfaceInitFunc>(Init),
...@@ -3428,8 +3408,10 @@ void AXPlatformNodeAuraLinux::OnValueChanged() { ...@@ -3428,8 +3408,10 @@ void AXPlatformNodeAuraLinux::OnValueChanged() {
// If this is a non-web-content text entry, then we need to trigger text // If this is a non-web-content text entry, then we need to trigger text
// change signals when the value changes. This is handled by browser // change signals when the value changes. This is handled by browser
// accessibility for web content. // accessibility for web content.
if (IsPlainTextField() && !GetDelegate()->IsWebContent()) if (IsPlainTextField() || !GetDelegate()->IsWebContent()) {
UpdateHypertext(); UpdateHypertext();
return;
}
if (!IsRangeValueSupported(GetData())) if (!IsRangeValueSupported(GetData()))
return; return;
......
...@@ -973,53 +973,6 @@ TEST_F(AXPlatformNodeAuraLinuxTest, TestAtkValueGetMinimumIncrement) { ...@@ -973,53 +973,6 @@ TEST_F(AXPlatformNodeAuraLinuxTest, TestAtkValueGetMinimumIncrement) {
g_object_unref(root_obj); g_object_unref(root_obj);
} }
#if ATK_CHECK_VERSION(2, 12, 0)
TEST_F(AXPlatformNodeAuraLinuxTest, TestAtkValueChangedSignal) {
AXNodeData root;
root.id = 1;
root.role = ax::mojom::Role::kSlider;
root.AddFloatAttribute(ax::mojom::FloatAttribute::kMaxValueForRange, 5.0);
Init(root);
AtkObject* root_object(GetRootAtkObject());
ASSERT_TRUE(ATK_IS_OBJECT(root_object));
ASSERT_TRUE(ATK_IS_VALUE(root_object));
g_object_ref(root_object);
bool saw_value_change = false;
g_signal_connect(
root_object, "property-change::accessible-value",
G_CALLBACK(+[](AtkObject*, void* property, bool* saw_value_change) {
*saw_value_change = true;
}),
&saw_value_change);
atk_value_set_value(ATK_VALUE(root_object), 24.0);
GetRootPlatformNode()->NotifyAccessibilityEvent(
ax::mojom::Event::kValueChanged);
GValue current_value = G_VALUE_INIT;
atk_value_get_current_value(ATK_VALUE(root_object), &current_value);
EXPECT_EQ(G_TYPE_FLOAT, G_VALUE_TYPE(&current_value));
EXPECT_EQ(24.0, g_value_get_float(&current_value));
EXPECT_TRUE(saw_value_change);
saw_value_change = false;
atk_value_set_value(ATK_VALUE(root_object), 100.0);
GetRootPlatformNode()->NotifyAccessibilityEvent(
ax::mojom::Event::kValueChanged);
g_value_unset(&current_value);
atk_value_get_current_value(ATK_VALUE(root_object), &current_value);
EXPECT_EQ(G_TYPE_FLOAT, G_VALUE_TYPE(&current_value));
EXPECT_EQ(100.0, g_value_get_float(&current_value));
EXPECT_TRUE(saw_value_change);
g_value_unset(&current_value);
g_object_unref(root_object);
}
#endif // ATK_CHECK_VERSION(2, 12, 0)
// //
// AtkHyperlinkImpl interface // AtkHyperlinkImpl interface
// //
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment